number_theory.cyclotomic.galMathlib.NumberTheory.Cyclotomic.Gal

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -140,7 +140,7 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units,
         hζ.coe_to_roots_of_unity_coe, ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at
         key
-      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
+      simp only [ZMod.natCast_val, ZMod.cast_id', id.def] at key
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 -/
Diff
@@ -60,18 +60,18 @@ field extension. -/
 theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   by
   intro f g hfg
-  apply_fun Units.val at hfg 
-  simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg 
-  generalize_proofs hf' hg' at hfg 
+  apply_fun Units.val at hfg
+  simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg
+  generalize_proofs hf' hg' at hfg
   have hf := hf'.some_spec
   have hg := hg'.some_spec
-  generalize_proofs hζ at hf hg 
+  generalize_proofs hζ at hf hg
   suffices f hμ.to_roots_of_unity = g hμ.to_roots_of_unity
     by
     apply AlgEquiv.coe_algHom_injective
     apply (hμ.power_basis K).algHom_ext
     exact this
-  rw [ZMod.eq_iff_modEq_nat] at hfg 
+  rw [ZMod.eq_iff_modEq_nat] at hfg
   refine' (hf.trans _).trans hg.symm
   rw [← rootsOfUnity.coe_pow _ hf'.some, ← rootsOfUnity.coe_pow _ hg'.some]
   congr 1
@@ -132,15 +132,15 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       generalize_proofs _ h
       have key := hζ.aut_to_pow_spec K ((hζ.power_basis K).equivOfMinpoly ((hμ x).PowerBasis K) h)
       have := (hζ.power_basis K).equivOfMinpoly_gen ((hμ x).PowerBasis K) h
-      rw [hζ.power_basis_gen K] at this 
-      rw [this, IsPrimitiveRoot.powerBasis_gen] at key 
-      rw [← hζ.coe_to_roots_of_unity_coe] at key 
-      simp only [← coe_coe, ← rootsOfUnity.coe_pow] at key 
+      rw [hζ.power_basis_gen K] at this
+      rw [this, IsPrimitiveRoot.powerBasis_gen] at key
+      rw [← hζ.coe_to_roots_of_unity_coe] at key
+      simp only [← coe_coe, ← rootsOfUnity.coe_pow] at key
       replace key := rootsOfUnity.coe_injective key
       rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units,
         hζ.coe_to_roots_of_unity_coe, ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at
-        key 
-      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key 
+        key
+      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 -/
Diff
@@ -79,7 +79,7 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   convert hfg
   rw [hμ.eq_order_of]
   rw [← hμ.coe_to_roots_of_unity_coe]
-  rw [orderOf_units, orderOf_subgroup]
+  rw [orderOf_units, Subgroup.orderOf_coe]
 #align is_primitive_root.aut_to_pow_injective IsPrimitiveRoot.autToPow_injective
 -/
 
@@ -137,8 +137,9 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       rw [← hζ.coe_to_roots_of_unity_coe] at key 
       simp only [← coe_coe, ← rootsOfUnity.coe_pow] at key 
       replace key := rootsOfUnity.coe_injective key
-      rw [pow_eq_pow_iff_modEq, ← orderOf_subgroup, ← orderOf_units, hζ.coe_to_roots_of_unity_coe, ←
-        (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key 
+      rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units,
+        hζ.coe_to_roots_of_unity_coe, ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at
+        key 
       simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key 
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 -/
-import Mathbin.NumberTheory.Cyclotomic.PrimitiveRoots
-import Mathbin.FieldTheory.PolynomialGaloisGroup
+import NumberTheory.Cyclotomic.PrimitiveRoots
+import FieldTheory.PolynomialGaloisGroup
 
 #align_import number_theory.cyclotomic.gal from "leanprover-community/mathlib"@"30faa0c3618ce1472bf6305ae0e3fa56affa3f95"
 
@@ -53,7 +53,7 @@ namespace IsPrimitiveRoot
 variable [CommRing L] [IsDomain L] (hμ : IsPrimitiveRoot μ n) [Algebra K L]
   [IsCyclotomicExtension {n} K L]
 
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2]) } -/
 #print IsPrimitiveRoot.autToPow_injective /-
 /-- `is_primitive_root.aut_to_pow` is injective in the case that it's considered over a cyclotomic
 field extension. -/
@@ -100,7 +100,7 @@ noncomputable def Aut.commGroup : CommGroup (L ≃ₐ[K] L) :=
 
 variable (h : Irreducible (cyclotomic n K)) {K} (L)
 
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1, 5]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1, 5]) } -/
 #print IsCyclotomicExtension.autEquivPow /-
 /-- The `mul_equiv` that takes an automorphism `f` to the element `k : (zmod n)ˣ` such that
   `f μ = μ ^ k` for any root of unity `μ`. A  strengthening of `is_primitive_root.aut_to_pow`. -/
@@ -156,7 +156,7 @@ noncomputable def fromZetaAut : L ≃ₐ[K] L :=
 #align is_cyclotomic_extension.from_zeta_aut IsCyclotomicExtension.fromZetaAut
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([4]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([4]) } -/
 #print IsCyclotomicExtension.fromZetaAut_spec /-
 theorem fromZetaAut_spec : fromZetaAut hμ h (zeta n K L) = μ :=
   by
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Rodriguez. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module number_theory.cyclotomic.gal
-! leanprover-community/mathlib commit 30faa0c3618ce1472bf6305ae0e3fa56affa3f95
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.NumberTheory.Cyclotomic.PrimitiveRoots
 import Mathbin.FieldTheory.PolynomialGaloisGroup
 
+#align_import number_theory.cyclotomic.gal from "leanprover-community/mathlib"@"30faa0c3618ce1472bf6305ae0e3fa56affa3f95"
+
 /-!
 # Galois group of cyclotomic extensions
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 
 ! This file was ported from Lean 3 source module number_theory.cyclotomic.gal
-! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
+! leanprover-community/mathlib commit 30faa0c3618ce1472bf6305ae0e3fa56affa3f95
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.FieldTheory.PolynomialGaloisGroup
 /-!
 # Galois group of cyclotomic extensions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file, we show the relationship between the Galois group of `K(ζₙ)` and `(zmod n)ˣ`;
 it is always a subgroup, and if the `n`th cyclotomic polynomial is irreducible, they are isomorphic.
 
Diff
@@ -54,6 +54,7 @@ variable [CommRing L] [IsDomain L] (hμ : IsPrimitiveRoot μ n) [Algebra K L]
   [IsCyclotomicExtension {n} K L]
 
 /- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2]) } -/
+#print IsPrimitiveRoot.autToPow_injective /-
 /-- `is_primitive_root.aut_to_pow` is injective in the case that it's considered over a cyclotomic
 field extension. -/
 theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
@@ -80,6 +81,7 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   rw [← hμ.coe_to_roots_of_unity_coe]
   rw [orderOf_units, orderOf_subgroup]
 #align is_primitive_root.aut_to_pow_injective IsPrimitiveRoot.autToPow_injective
+-/
 
 end IsPrimitiveRoot
 
@@ -88,15 +90,18 @@ namespace IsCyclotomicExtension
 variable [CommRing L] [IsDomain L] (hμ : IsPrimitiveRoot μ n) [Algebra K L]
   [IsCyclotomicExtension {n} K L]
 
+#print IsCyclotomicExtension.Aut.commGroup /-
 /-- Cyclotomic extensions are abelian. -/
 noncomputable def Aut.commGroup : CommGroup (L ≃ₐ[K] L) :=
   ((zeta_spec n K L).autToPow_injective K).CommGroup _ (map_one _) (map_mul _) (map_inv _)
     (map_div _) (map_pow _) (map_zpow _)
 #align is_cyclotomic_extension.aut.comm_group IsCyclotomicExtension.Aut.commGroup
+-/
 
 variable (h : Irreducible (cyclotomic n K)) {K} (L)
 
 /- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1, 5]) } -/
+#print IsCyclotomicExtension.autEquivPow /-
 /-- The `mul_equiv` that takes an automorphism `f` to the element `k : (zmod n)ˣ` such that
   `f μ = μ ^ k` for any root of unity `μ`. A  strengthening of `is_primitive_root.aut_to_pow`. -/
 @[simps]
@@ -137,9 +142,11 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key 
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
+-/
 
 variable {L}
 
+#print IsCyclotomicExtension.fromZetaAut /-
 /-- Maps `μ` to the `alg_equiv` that sends `is_cyclotomic_extension.zeta` to `μ`. -/
 noncomputable def fromZetaAut : L ≃ₐ[K] L :=
   let hζ := (zeta_spec n K L).eq_pow_of_pow_eq_one hμ.pow_eq_one n.Pos
@@ -147,8 +154,10 @@ noncomputable def fromZetaAut : L ≃ₐ[K] L :=
     ZMod.unitOfCoprime hζ.some <|
       ((zeta_spec n K L).pow_iff_coprime n.Pos hζ.some).mp <| hζ.choose_spec.choose_spec.symm ▸ hμ
 #align is_cyclotomic_extension.from_zeta_aut IsCyclotomicExtension.fromZetaAut
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([4]) } -/
+#print IsCyclotomicExtension.fromZetaAut_spec /-
 theorem fromZetaAut_spec : fromZetaAut hμ h (zeta n K L) = μ :=
   by
   simp_rw [from_zeta_aut, aut_equiv_pow_symm_apply]
@@ -158,6 +167,7 @@ theorem fromZetaAut_spec : fromZetaAut hμ h (zeta n K L) = μ :=
   convert h.some_spec.some_spec
   exact ZMod.val_cast_of_lt h.some_spec.some
 #align is_cyclotomic_extension.from_zeta_aut_spec IsCyclotomicExtension.fromZetaAut_spec
+-/
 
 end IsCyclotomicExtension
 
@@ -166,23 +176,27 @@ section Gal
 variable [Field L] (hμ : IsPrimitiveRoot μ n) [Algebra K L] [IsCyclotomicExtension {n} K L]
   (h : Irreducible (cyclotomic n K)) {K}
 
+#print galCyclotomicEquivUnitsZMod /-
 /-- `is_cyclotomic_extension.aut_equiv_pow` repackaged in terms of `gal`.
 Asserts that the Galois group of `cyclotomic n K` is equivalent to `(zmod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
-noncomputable def galCyclotomicEquivUnitsZmod : (cyclotomic n K).Gal ≃* (ZMod n)ˣ :=
+noncomputable def galCyclotomicEquivUnitsZMod : (cyclotomic n K).Gal ≃* (ZMod n)ˣ :=
   (AlgEquiv.autCongr
           (IsSplittingField.algEquiv L _ : L ≃ₐ[K] (cyclotomic n K).SplittingField)).symm.trans
     (IsCyclotomicExtension.autEquivPow L h)
-#align gal_cyclotomic_equiv_units_zmod galCyclotomicEquivUnitsZmod
+#align gal_cyclotomic_equiv_units_zmod galCyclotomicEquivUnitsZMod
+-/
 
+#print galXPowEquivUnitsZMod /-
 /-- `is_cyclotomic_extension.aut_equiv_pow` repackaged in terms of `gal`.
 Asserts that the Galois group of `X ^ n - 1` is equivalent to `(zmod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
-noncomputable def galXPowEquivUnitsZmod : (X ^ (n : ℕ) - 1).Gal ≃* (ZMod n)ˣ :=
+noncomputable def galXPowEquivUnitsZMod : (X ^ (n : ℕ) - 1).Gal ≃* (ZMod n)ˣ :=
   (AlgEquiv.autCongr
           (IsSplittingField.algEquiv L _ : L ≃ₐ[K] (X ^ (n : ℕ) - 1).SplittingField)).symm.trans
     (IsCyclotomicExtension.autEquivPow L h)
-#align gal_X_pow_equiv_units_zmod galXPowEquivUnitsZmod
+#align gal_X_pow_equiv_units_zmod galXPowEquivUnitsZMod
+-/
 
 end Gal
 
Diff
@@ -109,7 +109,7 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
     invFun := fun t =>
       (hζ.PowerBasis K).equivOfMinpoly ((hμ t).PowerBasis K)
         (by
-          haveI := IsCyclotomicExtension.ne_zero' n K L
+          haveI := IsCyclotomicExtension.neZero' n K L
           simp only [IsPrimitiveRoot.powerBasis_gen]
           have hr :=
             IsPrimitiveRoot.minpoly_eq_cyclotomic_of_irreducible
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 
 ! This file was ported from Lean 3 source module number_theory.cyclotomic.gal
-! leanprover-community/mathlib commit 861a26926586cd46ff80264d121cdb6fa0e35cc1
+! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -170,7 +170,8 @@ variable [Field L] (hμ : IsPrimitiveRoot μ n) [Algebra K L] [IsCyclotomicExten
 Asserts that the Galois group of `cyclotomic n K` is equivalent to `(zmod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
 noncomputable def galCyclotomicEquivUnitsZmod : (cyclotomic n K).Gal ≃* (ZMod n)ˣ :=
-  (AlgEquiv.autCongr (IsSplittingField.algEquiv _ _)).symm.trans
+  (AlgEquiv.autCongr
+          (IsSplittingField.algEquiv L _ : L ≃ₐ[K] (cyclotomic n K).SplittingField)).symm.trans
     (IsCyclotomicExtension.autEquivPow L h)
 #align gal_cyclotomic_equiv_units_zmod galCyclotomicEquivUnitsZmod
 
@@ -178,7 +179,8 @@ noncomputable def galCyclotomicEquivUnitsZmod : (cyclotomic n K).Gal ≃* (ZMod
 Asserts that the Galois group of `X ^ n - 1` is equivalent to `(zmod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
 noncomputable def galXPowEquivUnitsZmod : (X ^ (n : ℕ) - 1).Gal ≃* (ZMod n)ˣ :=
-  (AlgEquiv.autCongr (IsSplittingField.algEquiv _ _)).symm.trans
+  (AlgEquiv.autCongr
+          (IsSplittingField.algEquiv L _ : L ≃ₐ[K] (X ^ (n : ℕ) - 1).SplittingField)).symm.trans
     (IsCyclotomicExtension.autEquivPow L h)
 #align gal_X_pow_equiv_units_zmod galXPowEquivUnitsZmod
 
Diff
@@ -96,8 +96,6 @@ noncomputable def Aut.commGroup : CommGroup (L ≃ₐ[K] L) :=
 
 variable (h : Irreducible (cyclotomic n K)) {K} (L)
 
-include h
-
 /- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1, 5]) } -/
 /-- The `mul_equiv` that takes an automorphism `f` to the element `k : (zmod n)ˣ` such that
   `f μ = μ ^ k` for any root of unity `μ`. A  strengthening of `is_primitive_root.aut_to_pow`. -/
@@ -140,8 +138,6 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 
-include hμ
-
 variable {L}
 
 /-- Maps `μ` to the `alg_equiv` that sends `is_cyclotomic_extension.zeta` to `μ`. -/
Diff
@@ -59,12 +59,12 @@ field extension. -/
 theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   by
   intro f g hfg
-  apply_fun Units.val  at hfg 
+  apply_fun Units.val at hfg 
   simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg 
-  generalize_proofs hf' hg'  at hfg 
+  generalize_proofs hf' hg' at hfg 
   have hf := hf'.some_spec
   have hg := hg'.some_spec
-  generalize_proofs hζ  at hf hg 
+  generalize_proofs hζ at hf hg 
   suffices f hμ.to_roots_of_unity = g hμ.to_roots_of_unity
     by
     apply AlgEquiv.coe_algHom_injective
Diff
@@ -59,18 +59,18 @@ field extension. -/
 theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   by
   intro f g hfg
-  apply_fun Units.val  at hfg
-  simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg
-  generalize_proofs hf' hg'  at hfg
+  apply_fun Units.val  at hfg 
+  simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg 
+  generalize_proofs hf' hg'  at hfg 
   have hf := hf'.some_spec
   have hg := hg'.some_spec
-  generalize_proofs hζ  at hf hg
+  generalize_proofs hζ  at hf hg 
   suffices f hμ.to_roots_of_unity = g hμ.to_roots_of_unity
     by
     apply AlgEquiv.coe_algHom_injective
     apply (hμ.power_basis K).algHom_ext
     exact this
-  rw [ZMod.eq_iff_modEq_nat] at hfg
+  rw [ZMod.eq_iff_modEq_nat] at hfg 
   refine' (hf.trans _).trans hg.symm
   rw [← rootsOfUnity.coe_pow _ hf'.some, ← rootsOfUnity.coe_pow _ hg'.some]
   congr 1
@@ -129,14 +129,14 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       generalize_proofs _ h
       have key := hζ.aut_to_pow_spec K ((hζ.power_basis K).equivOfMinpoly ((hμ x).PowerBasis K) h)
       have := (hζ.power_basis K).equivOfMinpoly_gen ((hμ x).PowerBasis K) h
-      rw [hζ.power_basis_gen K] at this
-      rw [this, IsPrimitiveRoot.powerBasis_gen] at key
-      rw [← hζ.coe_to_roots_of_unity_coe] at key
-      simp only [← coe_coe, ← rootsOfUnity.coe_pow] at key
+      rw [hζ.power_basis_gen K] at this 
+      rw [this, IsPrimitiveRoot.powerBasis_gen] at key 
+      rw [← hζ.coe_to_roots_of_unity_coe] at key 
+      simp only [← coe_coe, ← rootsOfUnity.coe_pow] at key 
       replace key := rootsOfUnity.coe_injective key
       rw [pow_eq_pow_iff_modEq, ← orderOf_subgroup, ← orderOf_units, hζ.coe_to_roots_of_unity_coe, ←
-        (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
-      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
+        (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key 
+      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key 
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 
Diff
@@ -60,7 +60,7 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K :=
   by
   intro f g hfg
   apply_fun Units.val  at hfg
-  simp only [IsPrimitiveRoot.coe_autToPow_apply, [anonymous]] at hfg
+  simp only [IsPrimitiveRoot.coe_autToPow_apply, Units.val_eq_coe] at hfg
   generalize_proofs hf' hg'  at hfg
   have hf := hf'.some_spec
   have hg := hg'.some_spec
Diff
@@ -46,7 +46,7 @@ variable {n : ℕ+} (K : Type _) [Field K] {L : Type _} {μ : L}
 
 open Polynomial IsCyclotomicExtension
 
-open Cyclotomic
+open scoped Cyclotomic
 
 namespace IsPrimitiveRoot
 
Diff
@@ -181,7 +181,7 @@ noncomputable def galCyclotomicEquivUnitsZmod : (cyclotomic n K).Gal ≃* (ZMod
 /-- `is_cyclotomic_extension.aut_equiv_pow` repackaged in terms of `gal`.
 Asserts that the Galois group of `X ^ n - 1` is equivalent to `(zmod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
-noncomputable def galXPowEquivUnitsZmod : (x ^ (n : ℕ) - 1).Gal ≃* (ZMod n)ˣ :=
+noncomputable def galXPowEquivUnitsZmod : (X ^ (n : ℕ) - 1).Gal ≃* (ZMod n)ˣ :=
   (AlgEquiv.autCongr (IsSplittingField.algEquiv _ _)).symm.trans
     (IsCyclotomicExtension.autEquivPow L h)
 #align gal_X_pow_equiv_units_zmod galXPowEquivUnitsZmod

Changes in mathlib4

mathlib3
mathlib4
feat: make generalize_proofs handle proofs under binders (#12472)

The generalize_proofs tactic had a bug where it would not generalize proofs that appeared under binders correctly, creating terms with fvars from the wrong context. The tactic has been refactored, and it now abstracts the proofs (universally quantifying all the bound variables that appear in the proof) before lifting them to the local context.

This feature can be controlled with the abstract option. Using generalize_proofs (config := { abstract := false }) turns off proof abstraction and leaves alone those proofs that refer to bound variables.

Other new features:

  • generalize_proofs at h for a let-bound local hypothesis h will clear its value.
  • generalize_proofs at h for a duplicate proposition will eliminate h from the local context.
  • Proofs are recursively generalized for each new local hypothesis. This can be turned off with generalize_proofs (config := { maxDepth := 0 }).
  • generalize_proofs at h will no longer generalize proofs from the goal.
  • The type of the generalized proof is carefully computed by propagating expected types, rather than by using inferType. This gives local hypotheses in more useful forms.

(This PR serves as a followup to this comment.)

Diff
@@ -56,16 +56,10 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K := by
   intro f g hfg
   apply_fun Units.val at hfg
   simp only [IsPrimitiveRoot.coe_autToPow_apply] at hfg
-  -- Porting note: was `generalize_proofs hf' hg' at hfg`
-  revert hfg
-  generalize_proofs hf' hg'
-  intro hfg
+  generalize_proofs hf' hg' at hfg
   have hf := hf'.choose_spec
   have hg := hg'.choose_spec
-  -- Porting note: was `generalize_proofs hζ at hf hg`
-  revert hf hg
-  generalize_proofs hζ
-  intro hf hg
+  generalize_proofs hζ at hf hg
   suffices f (hμ.toRootsOfUnity : Lˣ) = g (hμ.toRootsOfUnity : Lˣ) by
     apply AlgEquiv.coe_algHom_injective
     apply (hμ.powerBasis K).algHom_ext
@@ -154,13 +148,11 @@ noncomputable def fromZetaAut : L ≃ₐ[K] L :=
 
 theorem fromZetaAut_spec : fromZetaAut hμ h (zeta n K L) = μ := by
   simp_rw [fromZetaAut, autEquivPow_symm_apply]
--- Porting note: `generalize_proofs` did not generalize the same proofs, making the proof different.
-  generalize_proofs h1 h2
-  nth_rewrite 4 [← (zeta_spec n K L).powerBasis_gen K]
-  have := Exists.choose_spec ((zeta_spec n K L).eq_pow_of_pow_eq_one hμ.pow_eq_one n.pos)
-  rw [PowerBasis.equivOfMinpoly_gen, h1.powerBasis_gen K, ZMod.coe_unitOfCoprime,
-    ZMod.val_cast_of_lt this.1]
-  exact this.2
+  generalize_proofs hζ h _ hμ _
+  nth_rewrite 4 [← hζ.powerBasis_gen K]
+  rw [PowerBasis.equivOfMinpoly_gen, hμ.powerBasis_gen K]
+  convert h.choose_spec.2
+  exact ZMod.val_cast_of_lt h.choose_spec.1
 #align is_cyclotomic_extension.from_zeta_aut_spec IsCyclotomicExtension.fromZetaAut_spec
 
 end IsCyclotomicExtension
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -138,7 +138,7 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       replace key := rootsOfUnity.coe_injective key
       rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units, hζ.val_toRootsOfUnity_coe,
         ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
-      simp only [ZMod.nat_cast_val, ZMod.cast_id', id] at key
+      simp only [ZMod.natCast_val, ZMod.cast_id', id] at key
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 
chore: avoid id.def (adaptation for nightly-2024-03-27) (#11829)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -138,7 +138,7 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
       replace key := rootsOfUnity.coe_injective key
       rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units, hζ.val_toRootsOfUnity_coe,
         ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
-      simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
+      simp only [ZMod.nat_cast_val, ZMod.cast_id', id] at key
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
 
doc: fix many more mathlib3 names in doc comments (#11987)

A mix of various changes; generated with a script and manually tweaked.

Diff
@@ -170,7 +170,7 @@ section Gal
 variable [Field L] (hμ : IsPrimitiveRoot μ n) [Algebra K L] [IsCyclotomicExtension {n} K L]
   (h : Irreducible (cyclotomic n K)) {K}
 
-/-- `IsCyclotomicExtension.autEquivPow` repackaged in terms of `gal`.
+/-- `IsCyclotomicExtension.autEquivPow` repackaged in terms of `Gal`.
 Asserts that the Galois group of `cyclotomic n K` is equivalent to `(ZMod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
 noncomputable def galCyclotomicEquivUnitsZMod : (cyclotomic n K).Gal ≃* (ZMod n)ˣ :=
@@ -179,7 +179,7 @@ noncomputable def galCyclotomicEquivUnitsZMod : (cyclotomic n K).Gal ≃* (ZMod
     (IsCyclotomicExtension.autEquivPow L h)
 #align gal_cyclotomic_equiv_units_zmod galCyclotomicEquivUnitsZMod
 
-/-- `IsCyclotomicExtension.autEquivPow` repackaged in terms of `gal`.
+/-- `IsCyclotomicExtension.autEquivPow` repackaged in terms of `Gal`.
 Asserts that the Galois group of `X ^ n - 1` is equivalent to `(ZMod n)ˣ`
 if `cyclotomic n K` is irreducible in the base field. -/
 noncomputable def galXPowEquivUnitsZMod : (X ^ (n : ℕ) - 1 : K[X]).Gal ≃* (ZMod n)ˣ :=
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -136,8 +136,8 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
         rw [← hζ.val_toRootsOfUnity_coe]
       simp only [← rootsOfUnity.coe_pow] at key
       replace key := rootsOfUnity.coe_injective key
-      rw [pow_eq_pow_iff_modEq, ←Subgroup.orderOf_coe, ← orderOf_units, hζ.val_toRootsOfUnity_coe, ←
-        (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
+      rw [pow_eq_pow_iff_modEq, ← Subgroup.orderOf_coe, ← orderOf_units, hζ.val_toRootsOfUnity_coe,
+        ← (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
       simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
       exact Units.ext key }
 #align is_cyclotomic_extension.aut_equiv_pow IsCyclotomicExtension.autEquivPow
feat: Order of elements of a subgroup (#8385)

The cardinality of a subgroup is greater than the order of any of its elements.

Rename

  • order_eq_card_zpowersFintype.card_zpowers
  • order_eq_card_zpowers'Nat.card_zpowers (and turn it around to match Nat.card_subgroupPowers)
  • Submonoid.powers_subsetSubmonoid.powers_le
  • orderOf_dvd_card_univorderOf_dvd_card
  • orderOf_subgroupSubgroup.orderOf
  • Subgroup.nonemptySubgroup.coe_nonempty
Diff
@@ -79,7 +79,7 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K := by
   rw [hμ.eq_orderOf]
   -- Porting note: was `{occs := occurrences.pos [2]}`
   conv_rhs => rw [← hμ.val_toRootsOfUnity_coe]
-  rw [orderOf_units, orderOf_subgroup]
+  rw [orderOf_units, Subgroup.orderOf_coe]
 #align is_primitive_root.aut_to_pow_injective IsPrimitiveRoot.autToPow_injective
 
 end IsPrimitiveRoot
@@ -136,7 +136,7 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
         rw [← hζ.val_toRootsOfUnity_coe]
       simp only [← rootsOfUnity.coe_pow] at key
       replace key := rootsOfUnity.coe_injective key
-      rw [pow_eq_pow_iff_modEq, ← orderOf_subgroup, ← orderOf_units, hζ.val_toRootsOfUnity_coe, ←
+      rw [pow_eq_pow_iff_modEq, ←Subgroup.orderOf_coe, ← orderOf_units, hζ.val_toRootsOfUnity_coe, ←
         (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
       simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
       exact Units.ext key }
fix: simps config for Units (#6514)
Diff
@@ -78,7 +78,7 @@ theorem autToPow_injective : Function.Injective <| hμ.autToPow K := by
   convert hfg
   rw [hμ.eq_orderOf]
   -- Porting note: was `{occs := occurrences.pos [2]}`
-  conv_rhs => rw [← hμ.toRootsOfUnity_coe_val]
+  conv_rhs => rw [← hμ.val_toRootsOfUnity_coe]
   rw [orderOf_units, orderOf_subgroup]
 #align is_primitive_root.aut_to_pow_injective IsPrimitiveRoot.autToPow_injective
 
@@ -131,12 +131,12 @@ noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
 -- Porting note: was `rw ← hζ.coe_to_roots_of_unity_coe at key {occs := occurrences.pos [1, 5]}`.
       conv at key =>
         congr; congr
-        rw [← hζ.toRootsOfUnity_coe_val]
+        rw [← hζ.val_toRootsOfUnity_coe]
         rfl; rfl
-        rw [← hζ.toRootsOfUnity_coe_val]
+        rw [← hζ.val_toRootsOfUnity_coe]
       simp only [← rootsOfUnity.coe_pow] at key
       replace key := rootsOfUnity.coe_injective key
-      rw [pow_eq_pow_iff_modEq, ← orderOf_subgroup, ← orderOf_units, hζ.toRootsOfUnity_coe_val, ←
+      rw [pow_eq_pow_iff_modEq, ← orderOf_subgroup, ← orderOf_units, hζ.val_toRootsOfUnity_coe, ←
         (zeta_spec n K L).eq_orderOf, ← ZMod.eq_iff_modEq_nat] at key
       simp only [ZMod.nat_cast_val, ZMod.cast_id', id.def] at key
       exact Units.ext key }
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -39,7 +39,7 @@ it is always a subgroup, and if the `n`th cyclotomic polynomial is irreducible,
 -/
 
 
-variable {n : ℕ+} (K : Type _) [Field K] {L : Type _} {μ : L}
+variable {n : ℕ+} (K : Type*) [Field K] {L : Type*} {μ : L}
 
 open Polynomial IsCyclotomicExtension
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Rodriguez. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module number_theory.cyclotomic.gal
-! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots
 import Mathlib.FieldTheory.PolynomialGaloisGroup
 
+#align_import number_theory.cyclotomic.gal from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
+
 /-!
 # Galois group of cyclotomic extensions
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -101,7 +101,7 @@ noncomputable def Aut.commGroup : CommGroup (L ≃ₐ[K] L) :=
 variable (h : Irreducible (cyclotomic n K)) {K} (L)
 
 /-- The `MulEquiv` that takes an automorphism `f` to the element `k : (ZMod n)ˣ` such that
-  `f μ = μ ^ k` for any root of unity `μ`. A  strengthening of `IsPrimitiveRoot.autToPow`. -/
+  `f μ = μ ^ k` for any root of unity `μ`. A strengthening of `IsPrimitiveRoot.autToPow`. -/
 @[simps]
 noncomputable def autEquivPow : (L ≃ₐ[K] L) ≃* (ZMod n)ˣ :=
   let hζ := zeta_spec n K L
chore: tidy various files (#5482)
Diff
@@ -35,7 +35,7 @@ it is always a subgroup, and if the `n`th cyclotomic polynomial is irreducible,
 
 * We currently can get away with the fact that the power of a primitive root is a primitive root,
   but the correct long-term solution for computing other explicit Galois groups is creating
-  `power_basis.map_conjugate`; but figuring out the exact correct assumptions + proof for this is
+  `PowerBasis.map_conjugate`; but figuring out the exact correct assumptions + proof for this is
   mathematically nontrivial. (Current thoughts: the correct condition is that the annihilating
   ideal of both elements is equal. This may not hold in an ID, and definitely holds in an ICD.)
 
feat: port NumberTheory.Cyclotomic.Gal (#5447)

Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>

Dependencies 12 + 1208

1209 files ported (99.0%)
530244 lines ported (99.0%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file