field_theory.fixedMathlib.FieldTheory.Fixed

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)

(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)

(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)

(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)

(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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -246,7 +246,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
-  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.definition, MulAction.ofQuotientStabilizer_mk,
+  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← Subfield.toSubring_subtype_eq_subtype, ←
     IsInvariantSubring.coe_subtypeHom' G (FixedPoints.subfield G F).toSubring, ←
     MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
Diff
@@ -246,7 +246,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
-  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
+  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.definition, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← Subfield.toSubring_subtype_eq_subtype, ←
     IsInvariantSubring.coe_subtypeHom' G (FixedPoints.subfield G F).toSubring, ←
     MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
Diff
@@ -149,14 +149,14 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
   haveI : IsEmpty ((∅ : Finset F) : Set F) := ⟨Subtype.prop⟩
   refine' Finset.induction_on s (fun _ => linearIndependent_empty_type) fun a s has ih hs => _
   rw [coe_insert] at hs ⊢
-  rw [linearIndependent_insert (mt mem_coe.1 has)] at hs 
+  rw [linearIndependent_insert (mt mem_coe.1 has)] at hs
   rw [linearIndependent_insert' (mt mem_coe.1 has)]; refine' ⟨ih hs.1, fun ha => _⟩
-  rw [Finsupp.mem_span_image_iff_total] at ha ; rcases ha with ⟨l, hl, hla⟩
-  rw [Finsupp.total_apply_of_mem_supported F hl] at hla 
+  rw [Finsupp.mem_span_image_iff_total] at ha; rcases ha with ⟨l, hl, hla⟩
+  rw [Finsupp.total_apply_of_mem_supported F hl] at hla
   suffices ∀ i ∈ s, l i ∈ FixedPoints.subfield G F
     by
     replace hla := (sum_apply _ _ fun i => l i • to_fun G F i).symm.trans (congr_fun hla 1)
-    simp_rw [Pi.smul_apply, to_fun_apply, one_smul] at hla 
+    simp_rw [Pi.smul_apply, to_fun_apply, one_smul] at hla
     refine' hs.2 (hla ▸ Submodule.sum_mem _ fun c hcs => _)
     change (⟨l c, this c hcs⟩ : FixedPoints.subfield G F) • c ∈ _
     exact Submodule.smul_mem _ _ (Submodule.subset_span <| mem_coe.2 hcs)
@@ -231,7 +231,7 @@ theorem eval₂' :
 #print FixedPoints.minpoly.ne_one /-
 theorem ne_one : minpoly G F x ≠ (1 : Polynomial (FixedPoints.subfield G F)) := fun H =>
   have := eval₂ G F x
-  (one_ne_zero : (1 : F) ≠ 0) <| by rwa [H, Polynomial.eval₂_one] at this 
+  (one_ne_zero : (1 : F) ≠ 0) <| by rwa [H, Polynomial.eval₂_one] at this
 #align fixed_points.minpoly.ne_one FixedPoints.minpoly.ne_one
 -/
 
@@ -263,18 +263,18 @@ theorem irreducible_aux (f g : Polynomial (FixedPoints.subfield G F)) (hf : f.Mo
   have hf2 : f ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_right _ _
   have hg2 : g ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_left _ _
   have := eval₂ G F x
-  rw [← hfg, Polynomial.eval₂_mul, mul_eq_zero] at this 
+  rw [← hfg, Polynomial.eval₂_mul, mul_eq_zero] at this
   cases this
   · right
     have hf3 : f = minpoly G F x :=
       Polynomial.eq_of_monic_of_associated hf (monic G F x)
         (associated_of_dvd_dvd hf2 <| @of_eval₂ G _ F _ _ _ x f this)
-    rwa [← mul_one (minpoly G F x), hf3, mul_right_inj' (monic G F x).NeZero] at hfg 
+    rwa [← mul_one (minpoly G F x), hf3, mul_right_inj' (monic G F x).NeZero] at hfg
   · left
     have hg3 : g = minpoly G F x :=
       Polynomial.eq_of_monic_of_associated hg (monic G F x)
         (associated_of_dvd_dvd hg2 <| @of_eval₂ G _ F _ _ _ x g this)
-    rwa [← one_mul (minpoly G F x), hg3, mul_left_inj' (monic G F x).NeZero] at hfg 
+    rwa [← one_mul (minpoly G F x), hg3, mul_left_inj' (monic G F x).NeZero] at hfg
 #align fixed_points.minpoly.irreducible_aux FixedPoints.minpoly.irreducible_aux
 -/
 
Diff
@@ -310,8 +310,7 @@ theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card
   rank_le fun s hs => by
     simpa only [rank_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
       Cardinal.natCast_le] using
-      cardinal_lift_le_rank_of_linearIndependent'
-        (linear_independent_smul_of_linear_independent G F hs)
+      LinearIndependent.cardinal_lift_le_rank (linear_independent_smul_of_linear_independent G F hs)
 #align fixed_points.rank_le_card FixedPoints.rank_le_card
 -/
 
@@ -377,7 +376,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
 theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] [Field W] [Algebra K W] [FiniteDimensional K W] :
     Cardinal.mk (V →ₐ[K] W) ≤ finrank W (V →ₗ[K] W) :=
-  cardinal_mk_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V W
+  cardinal_mk_le_finrank <| linearIndependent_toLinearMap K V W
 #align cardinal_mk_alg_hom cardinal_mk_algHom
 -/
 
@@ -391,7 +390,7 @@ noncomputable instance AlgEquiv.fintype (K : Type u) (V : Type v) [Field K] [Fie
 #print finrank_algHom /-
 theorem finrank_algHom (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] : Fintype.card (V →ₐ[K] V) ≤ finrank V (V →ₗ[K] V) :=
-  fintype_card_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V V
+  fintype_card_le_finrank <| linearIndependent_toLinearMap K V V
 #align finrank_alg_hom finrank_algHom
 -/
 
Diff
@@ -197,9 +197,9 @@ variable [Fintype G] (x : F)
 #print FixedPoints.minpoly /-
 /-- `minpoly G F x` is the minimal polynomial of `(x : F)` over `fixed_points G F`. -/
 def minpoly : Polynomial (FixedPoints.subfield G F) :=
-  (prodXSubSmul G F x).toSubring (FixedPoints.subfield G F).toSubring fun c hc g =>
+  (prodXSubSMul G F x).toSubring (FixedPoints.subfield G F).toSubring fun c hc g =>
     let ⟨n, hc0, hn⟩ := Polynomial.mem_frange_iff.1 hc
-    hn.symm ▸ prodXSubSmul.coeff G F x g n
+    hn.symm ▸ prodXSubSMul.coeff G F x g n
 #align fixed_points.minpoly FixedPoints.minpoly
 -/
 
@@ -207,7 +207,7 @@ namespace minpoly
 
 #print FixedPoints.minpoly.monic /-
 theorem monic : (minpoly G F x).Monic := by simp only [minpoly, Polynomial.monic_toSubring];
-  exact prodXSubSmul.monic G F x
+  exact prodXSubSMul.monic G F x
 #align fixed_points.minpoly.monic FixedPoints.minpoly.monic
 -/
 
@@ -216,7 +216,7 @@ theorem eval₂ :
     Polynomial.eval₂ (Subring.subtype <| (FixedPoints.subfield G F).toSubring) x (minpoly G F x) =
       0 :=
   by
-  rw [← prodXSubSmul.eval G F x, Polynomial.eval₂_eq_eval_map]
+  rw [← prodXSubSMul.eval G F x, Polynomial.eval₂_eq_eval_map]
   simp only [minpoly, Polynomial.map_toSubring]
 #align fixed_points.minpoly.eval₂ FixedPoints.minpoly.eval₂
 -/
@@ -241,7 +241,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     minpoly G F x ∣ f :=
   by
   erw [← Polynomial.map_dvd_map' (Subfield.subtype <| FixedPoints.subfield G F), minpoly,
-    Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
+    Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSMul]
   refine'
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
@@ -328,7 +328,7 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
       by
       cases nonempty_fintype G
       rw [← minpoly_eq_minpoly, minpoly, coe_algebra_map, ← Subfield.toSubring_subtype_eq_subtype,
-        Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
+        Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSMul]
       exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_X_sub_C _⟩
 #align fixed_points.normal FixedPoints.normal
 -/
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2020 Kenny Lau. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kenny Lau
 -/
-import Mathbin.Algebra.GroupRingAction.Invariant
-import Mathbin.Algebra.Polynomial.GroupRingAction
-import Mathbin.FieldTheory.Normal
-import Mathbin.FieldTheory.Separable
-import Mathbin.FieldTheory.Tower
+import Algebra.GroupRingAction.Invariant
+import Algebra.Polynomial.GroupRingAction
+import FieldTheory.Normal
+import FieldTheory.Separable
+import FieldTheory.Tower
 
 #align_import field_theory.fixed from "leanprover-community/mathlib"@"fd4551cfe4b7484b81c2c9ba3405edae27659676"
 
Diff
@@ -54,7 +54,7 @@ def FixedBy.subfield : Subfield F where
   add_mem' x y hx hy := (smul_add m x y).trans <| congr_arg₂ _ hx hy
   neg_mem' x hx := (smul_neg m x).trans <| congr_arg _ hx
   one_mem' := smul_one m
-  mul_mem' x y hx hy := (smul_mul' m x y).trans <| congr_arg₂ _ hx hy
+  hMul_mem' x y hx hy := (smul_mul' m x y).trans <| congr_arg₂ _ hx hy
   inv_mem' x hx := (smul_inv'' m x).trans <| congr_arg _ hx
 #align fixed_by.subfield FixedBy.subfield
 -/
@@ -77,11 +77,11 @@ instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] : Mul
     where
   smul m x := ⟨m • x, IsInvariantSubfield.smul_mem m x.2⟩
   one_smul s := Subtype.eq <| one_smul M s
-  mul_smul m₁ m₂ s := Subtype.eq <| mul_smul m₁ m₂ s
+  hMul_smul m₁ m₂ s := Subtype.eq <| hMul_smul m₁ m₂ s
   smul_add m s₁ s₂ := Subtype.eq <| smul_add m s₁ s₂
   smul_zero m := Subtype.eq <| smul_zero m
   smul_one m := Subtype.eq <| smul_one m
-  smul_mul m s₁ s₂ := Subtype.eq <| smul_mul' m s₁ s₂
+  smul_hMul m s₁ s₂ := Subtype.eq <| smul_mul' m s₁ s₂
 #align is_invariant_subfield.to_mul_semiring_action IsInvariantSubfield.toMulSemiringAction
 -/
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2020 Kenny Lau. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kenny Lau
-
-! This file was ported from Lean 3 source module field_theory.fixed
-! leanprover-community/mathlib commit fd4551cfe4b7484b81c2c9ba3405edae27659676
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.GroupRingAction.Invariant
 import Mathbin.Algebra.Polynomial.GroupRingAction
@@ -14,6 +9,8 @@ import Mathbin.FieldTheory.Normal
 import Mathbin.FieldTheory.Separable
 import Mathbin.FieldTheory.Tower
 
+#align_import field_theory.fixed from "leanprover-community/mathlib"@"fd4551cfe4b7484b81c2c9ba3405edae27659676"
+
 /-!
 # Fixed field under a group action.
 
Diff
@@ -112,10 +112,10 @@ instance : IsInvariantSubfield M (FixedPoints.subfield M F)
 instance : SMulCommClass M (FixedPoints.subfield M F) F
     where smul_comm m f f' := show m • (↑f * f') = f * m • f' by rw [smul_mul', f.prop m]
 
-#print FixedPoints.smul_comm_class' /-
-instance smul_comm_class' : SMulCommClass (FixedPoints.subfield M F) M F :=
+#print FixedPoints.smulCommClass' /-
+instance smulCommClass' : SMulCommClass (FixedPoints.subfield M F) M F :=
   SMulCommClass.symm _ _ _
-#align fixed_points.smul_comm_class' FixedPoints.smul_comm_class'
+#align fixed_points.smul_comm_class' FixedPoints.smulCommClass'
 -/
 
 #print FixedPoints.smul /-
Diff
@@ -75,6 +75,7 @@ class IsInvariantSubfield (S : Subfield F) : Prop where
 
 variable (S : Subfield F)
 
+#print IsInvariantSubfield.toMulSemiringAction /-
 instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] : MulSemiringAction M S
     where
   smul m x := ⟨m • x, IsInvariantSubfield.smul_mem m x.2⟩
@@ -85,6 +86,7 @@ instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] : Mul
   smul_one m := Subtype.eq <| smul_one m
   smul_mul m s₁ s₂ := Subtype.eq <| smul_mul' m s₁ s₂
 #align is_invariant_subfield.to_mul_semiring_action IsInvariantSubfield.toMulSemiringAction
+-/
 
 instance [IsInvariantSubfield M S] : IsInvariantSubring M S.toSubring
     where smul_mem := IsInvariantSubfield.smul_mem
@@ -110,15 +112,20 @@ instance : IsInvariantSubfield M (FixedPoints.subfield M F)
 instance : SMulCommClass M (FixedPoints.subfield M F) F
     where smul_comm m f f' := show m • (↑f * f') = f * m • f' by rw [smul_mul', f.prop m]
 
+#print FixedPoints.smul_comm_class' /-
 instance smul_comm_class' : SMulCommClass (FixedPoints.subfield M F) M F :=
   SMulCommClass.symm _ _ _
 #align fixed_points.smul_comm_class' FixedPoints.smul_comm_class'
+-/
 
+#print FixedPoints.smul /-
 @[simp]
 theorem smul (m : M) (x : FixedPoints.subfield M F) : m • x = x :=
   Subtype.eq <| x.2 m
 #align fixed_points.smul FixedPoints.smul
+-/
 
+#print FixedPoints.smul_polynomial /-
 -- Why is this so slow?
 @[simp]
 theorem smul_polynomial (m : M) (p : Polynomial (FixedPoints.subfield M F)) : m • p = p :=
@@ -126,14 +133,18 @@ theorem smul_polynomial (m : M) (p : Polynomial (FixedPoints.subfield M F)) : m
     (fun p q ihp ihq => by rw [smul_add, ihp, ihq]) fun n x ih => by
     rw [smul_mul', Polynomial.smul_C, smul, smul_pow', Polynomial.smul_X]
 #align fixed_points.smul_polynomial FixedPoints.smul_polynomial
+-/
 
 instance : Algebra (FixedPoints.subfield M F) F := by infer_instance
 
+#print FixedPoints.coe_algebraMap /-
 theorem coe_algebraMap :
     algebraMap (FixedPoints.subfield M F) F = Subfield.subtype (FixedPoints.subfield M F) :=
   rfl
 #align fixed_points.coe_algebra_map FixedPoints.coe_algebraMap
+-/
 
+#print FixedPoints.linearIndependent_smul_of_linearIndependent /-
 theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
     (LinearIndependent (FixedPoints.subfield G F) fun i : (s : Set F) => (i : F)) →
       LinearIndependent F fun i : (s : Set F) => MulAction.toFun G F i :=
@@ -180,24 +191,30 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
   dsimp only
   rw [hla, to_fun_apply, to_fun_apply, smul_smul, mul_inv_cancel_left]
 #align fixed_points.linear_independent_smul_of_linear_independent FixedPoints.linearIndependent_smul_of_linearIndependent
+-/
 
 section Fintype
 
 variable [Fintype G] (x : F)
 
+#print FixedPoints.minpoly /-
 /-- `minpoly G F x` is the minimal polynomial of `(x : F)` over `fixed_points G F`. -/
 def minpoly : Polynomial (FixedPoints.subfield G F) :=
   (prodXSubSmul G F x).toSubring (FixedPoints.subfield G F).toSubring fun c hc g =>
     let ⟨n, hc0, hn⟩ := Polynomial.mem_frange_iff.1 hc
     hn.symm ▸ prodXSubSmul.coeff G F x g n
 #align fixed_points.minpoly FixedPoints.minpoly
+-/
 
 namespace minpoly
 
+#print FixedPoints.minpoly.monic /-
 theorem monic : (minpoly G F x).Monic := by simp only [minpoly, Polynomial.monic_toSubring];
   exact prodXSubSmul.monic G F x
 #align fixed_points.minpoly.monic FixedPoints.minpoly.monic
+-/
 
+#print FixedPoints.minpoly.eval₂ /-
 theorem eval₂ :
     Polynomial.eval₂ (Subring.subtype <| (FixedPoints.subfield G F).toSubring) x (minpoly G F x) =
       0 :=
@@ -205,17 +222,23 @@ theorem eval₂ :
   rw [← prodXSubSmul.eval G F x, Polynomial.eval₂_eq_eval_map]
   simp only [minpoly, Polynomial.map_toSubring]
 #align fixed_points.minpoly.eval₂ FixedPoints.minpoly.eval₂
+-/
 
+#print FixedPoints.minpoly.eval₂' /-
 theorem eval₂' :
     Polynomial.eval₂ (Subfield.subtype <| FixedPoints.subfield G F) x (minpoly G F x) = 0 :=
   eval₂ G F x
 #align fixed_points.minpoly.eval₂' FixedPoints.minpoly.eval₂'
+-/
 
+#print FixedPoints.minpoly.ne_one /-
 theorem ne_one : minpoly G F x ≠ (1 : Polynomial (FixedPoints.subfield G F)) := fun H =>
   have := eval₂ G F x
   (one_ne_zero : (1 : F) ≠ 0) <| by rwa [H, Polynomial.eval₂_one] at this 
 #align fixed_points.minpoly.ne_one FixedPoints.minpoly.ne_one
+-/
 
+#print FixedPoints.minpoly.of_eval₂ /-
 theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     (hf : Polynomial.eval₂ (Subfield.subtype <| FixedPoints.subfield G F) x f = 0) :
     minpoly G F x ∣ f :=
@@ -233,7 +256,9 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     MulSemiringActionHom.coe_polynomial, IsInvariantSubring.coe_subtypeHom', Polynomial.eval_map,
     Subfield.toSubring_subtype_eq_subtype, hf, smul_zero]
 #align fixed_points.minpoly.of_eval₂ FixedPoints.minpoly.of_eval₂
+-/
 
+#print FixedPoints.minpoly.irreducible_aux /-
 -- Why is this so slow?
 theorem irreducible_aux (f g : Polynomial (FixedPoints.subfield G F)) (hf : f.Monic) (hg : g.Monic)
     (hfg : f * g = minpoly G F x) : f = 1 ∨ g = 1 :=
@@ -254,28 +279,36 @@ theorem irreducible_aux (f g : Polynomial (FixedPoints.subfield G F)) (hf : f.Mo
         (associated_of_dvd_dvd hg2 <| @of_eval₂ G _ F _ _ _ x g this)
     rwa [← one_mul (minpoly G F x), hg3, mul_left_inj' (monic G F x).NeZero] at hfg 
 #align fixed_points.minpoly.irreducible_aux FixedPoints.minpoly.irreducible_aux
+-/
 
+#print FixedPoints.minpoly.irreducible /-
 theorem irreducible : Irreducible (minpoly G F x) :=
   (Polynomial.irreducible_of_monic (monic G F x) (ne_one G F x)).2 (irreducible_aux G F x)
 #align fixed_points.minpoly.irreducible FixedPoints.minpoly.irreducible
+-/
 
 end minpoly
 
 end Fintype
 
+#print FixedPoints.isIntegral /-
 theorem isIntegral [Finite G] (x : F) : IsIntegral (FixedPoints.subfield G F) x := by
   cases nonempty_fintype G; exact ⟨minpoly G F x, minpoly.monic G F x, minpoly.eval₂ G F x⟩
 #align fixed_points.is_integral FixedPoints.isIntegral
+-/
 
 section Fintype
 
 variable [Fintype G] (x : F)
 
+#print FixedPoints.minpoly_eq_minpoly /-
 theorem minpoly_eq_minpoly : minpoly G F x = minpoly (FixedPoints.subfield G F) x :=
   minpoly.eq_of_irreducible_of_monic (minpoly.irreducible G F x) (minpoly.eval₂ G F x)
     (minpoly.monic G F x)
 #align fixed_points.minpoly_eq_minpoly FixedPoints.minpoly_eq_minpoly
+-/
 
+#print FixedPoints.rank_le_card /-
 theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card G :=
   rank_le fun s hs => by
     simpa only [rank_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
@@ -283,6 +316,7 @@ theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card
       cardinal_lift_le_rank_of_linearIndependent'
         (linear_independent_smul_of_linear_independent G F hs)
 #align fixed_points.rank_le_card FixedPoints.rank_le_card
+-/
 
 end Fintype
 
@@ -290,6 +324,7 @@ section Finite
 
 variable [Finite G]
 
+#print FixedPoints.normal /-
 instance normal : Normal (FixedPoints.subfield G F) F :=
   ⟨fun x => (isIntegral G F x).IsAlgebraic _, fun x =>
     (Polynomial.splits_id_iff_splits _).1 <|
@@ -299,7 +334,9 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
         Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
       exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_X_sub_C _⟩
 #align fixed_points.normal FixedPoints.normal
+-/
 
+#print FixedPoints.separable /-
 instance separable : IsSeparable (FixedPoints.subfield G F) F :=
   ⟨isIntegral G F, fun x => by
     cases nonempty_fintype G
@@ -308,6 +345,7 @@ instance separable : IsSeparable (FixedPoints.subfield G F) F :=
       minpoly, Polynomial.map_toSubring _ (Subfield G F).toSubring]
     exact Polynomial.separable_prod_X_sub_C_iff.2 (injective_of_quotient_stabilizer G x)⟩
 #align fixed_points.separable FixedPoints.separable
+-/
 
 instance : FiniteDimensional (subfield G F) F := by cases nonempty_fintype G;
   exact
@@ -316,11 +354,13 @@ instance : FiniteDimensional (subfield G F) F := by cases nonempty_fintype G;
 
 end Finite
 
+#print FixedPoints.finrank_le_card /-
 theorem finrank_le_card [Fintype G] : finrank (subfield G F) F ≤ Fintype.card G :=
   by
   rw [← Cardinal.natCast_le, finrank_eq_rank]
   apply rank_le_card
 #align fixed_points.finrank_le_card FixedPoints.finrank_le_card
+-/
 
 end FixedPoints
 
@@ -336,11 +376,13 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
 #align linear_independent_to_linear_map linearIndependent_toLinearMap
 -/
 
+#print cardinal_mk_algHom /-
 theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] [Field W] [Algebra K W] [FiniteDimensional K W] :
     Cardinal.mk (V →ₐ[K] W) ≤ finrank W (V →ₗ[K] W) :=
   cardinal_mk_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V W
 #align cardinal_mk_alg_hom cardinal_mk_algHom
+-/
 
 #print AlgEquiv.fintype /-
 noncomputable instance AlgEquiv.fintype (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
@@ -358,6 +400,7 @@ theorem finrank_algHom (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K
 
 namespace FixedPoints
 
+#print FixedPoints.finrank_eq_card /-
 theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G]
     [MulSemiringAction G F] [FaithfulSMul G F] :
     finrank (FixedPoints.subfield G F) F = Fintype.card G :=
@@ -368,7 +411,9 @@ theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G
       _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := (finrank_algHom (fixedPoints G F) F)
       _ = finrank (FixedPoints.subfield G F) F := finrank_linear_map' _ _ _
 #align fixed_points.finrank_eq_card FixedPoints.finrank_eq_card
+-/
 
+#print FixedPoints.toAlgHom_bijective /-
 /-- `mul_semiring_action.to_alg_hom` is bijective. -/
 theorem toAlgHom_bijective (G : Type u) (F : Type v) [Group G] [Field F] [Finite G]
     [MulSemiringAction G F] [FaithfulSMul G F] :
@@ -383,12 +428,15 @@ theorem toAlgHom_bijective (G : Type u) (F : Type v) [Group G] [Field F] [Finite
     · rw [← finrank_eq_card G F]
       exact LE.le.trans_eq (finrank_algHom _ F) (finrank_linear_map' _ _ _)
 #align fixed_points.to_alg_hom_bijective FixedPoints.toAlgHom_bijective
+-/
 
+#print FixedPoints.toAlgHomEquiv /-
 /-- Bijection between G and algebra homomorphisms that fix the fixed points -/
 def toAlgHomEquiv (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G] [MulSemiringAction G F]
     [FaithfulSMul G F] : G ≃ (F →ₐ[FixedPoints.subfield G F] F) :=
   Equiv.ofBijective _ (toAlgHom_bijective G F)
 #align fixed_points.to_alg_hom_equiv FixedPoints.toAlgHomEquiv
+-/
 
 end FixedPoints
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kenny Lau
 
 ! This file was ported from Lean 3 source module field_theory.fixed
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
+! leanprover-community/mathlib commit fd4551cfe4b7484b81c2c9ba3405edae27659676
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.FieldTheory.Tower
 /-!
 # Fixed field under a group action.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This is the basis of the Fundamental Theorem of Galois Theory.
 Given a (finite) group `G` that acts on a field `F`, we define `fixed_points G F`,
 the subfield consisting of elements of `F` fixed_points by every element of `G`.
Diff
@@ -170,7 +170,7 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
     ext
     rw [to_fun_apply, ← mul_inv_cancel_left g g', mul_smul, ← smul_mul', ← to_fun_apply _ x]
   show
-    (∑ x in s, g • (fun y => l y • MulAction.toFun G F y) x (g⁻¹ * g')) =
+    ∑ x in s, g • (fun y => l y • MulAction.toFun G F y) x (g⁻¹ * g') =
       ∑ x in s, (fun y => l y • MulAction.toFun G F y) x g'
   rw [← smul_sum, ← sum_apply _ _ fun y => l y • to_fun G F y, ←
     sum_apply _ _ fun y => l y • to_fun G F y]
Diff
@@ -46,6 +46,7 @@ variable (G : Type u) [Group G]
 
 variable (F : Type v) [Field F] [MulSemiringAction M F] [MulSemiringAction G F] (m : M)
 
+#print FixedBy.subfield /-
 /-- The subfield of F fixed by the field endomorphism `m`. -/
 def FixedBy.subfield : Subfield F where
   carrier := fixedBy M F m
@@ -56,15 +57,18 @@ def FixedBy.subfield : Subfield F where
   mul_mem' x y hx hy := (smul_mul' m x y).trans <| congr_arg₂ _ hx hy
   inv_mem' x hx := (smul_inv'' m x).trans <| congr_arg _ hx
 #align fixed_by.subfield FixedBy.subfield
+-/
 
 section InvariantSubfields
 
 variable (M) {F}
 
+#print IsInvariantSubfield /-
 /-- A typeclass for subrings invariant under a `mul_semiring_action`. -/
 class IsInvariantSubfield (S : Subfield F) : Prop where
   smul_mem : ∀ (m : M) {x : F}, x ∈ S → m • x ∈ S
 #align is_invariant_subfield IsInvariantSubfield
+-/
 
 variable (S : Subfield F)
 
@@ -88,12 +92,14 @@ namespace FixedPoints
 
 variable (M)
 
+#print FixedPoints.subfield /-
 -- we use `subfield.copy` so that the underlying set is `fixed_points M F`
 /-- The subfield of fixed points by a monoid action. -/
 def subfield : Subfield F :=
   Subfield.copy (⨅ m : M, FixedBy.subfield F m) (fixedPoints M F)
     (by ext z; simp [fixed_points, FixedBy.subfield, iInf, Subfield.mem_sInf])
 #align fixed_points.subfield FixedPoints.subfield
+-/
 
 instance : IsInvariantSubfield M (FixedPoints.subfield M F)
     where smul_mem g x hx g' := by rw [hx, hx]
@@ -315,6 +321,7 @@ theorem finrank_le_card [Fintype G] : finrank (subfield G F) F ≤ Fintype.card
 
 end FixedPoints
 
+#print linearIndependent_toLinearMap /-
 theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [CommSemiring R]
     [Ring A] [Algebra R A] [CommRing B] [IsDomain B] [Algebra R B] :
     LinearIndependent B (AlgHom.toLinearMap : (A →ₐ[R] B) → A →ₗ[R] B) :=
@@ -324,6 +331,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
       _)
   this.of_comp _
 #align linear_independent_to_linear_map linearIndependent_toLinearMap
+-/
 
 theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] [Field W] [Algebra K W] [FiniteDimensional K W] :
@@ -331,15 +339,19 @@ theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Fie
   cardinal_mk_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V W
 #align cardinal_mk_alg_hom cardinal_mk_algHom
 
+#print AlgEquiv.fintype /-
 noncomputable instance AlgEquiv.fintype (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] : Fintype (V ≃ₐ[K] V) :=
   Fintype.ofEquiv (V →ₐ[K] V) (algEquivEquivAlgHom K V).symm
 #align alg_equiv.fintype AlgEquiv.fintype
+-/
 
+#print finrank_algHom /-
 theorem finrank_algHom (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] : Fintype.card (V →ₐ[K] V) ≤ finrank V (V →ₗ[K] V) :=
   fintype_card_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V V
 #align finrank_alg_hom finrank_algHom
+-/
 
 namespace FixedPoints
 
Diff
@@ -352,7 +352,6 @@ theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G
         Fintype.card_le_of_injective _ (MulSemiringAction.toAlgHom_injective _ F)
       _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := (finrank_algHom (fixedPoints G F) F)
       _ = finrank (FixedPoints.subfield G F) F := finrank_linear_map' _ _ _
-      
 #align fixed_points.finrank_eq_card FixedPoints.finrank_eq_card
 
 /-- `mul_semiring_action.to_alg_hom` is bijective. -/
Diff
@@ -131,15 +131,15 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
   by
   haveI : IsEmpty ((∅ : Finset F) : Set F) := ⟨Subtype.prop⟩
   refine' Finset.induction_on s (fun _ => linearIndependent_empty_type) fun a s has ih hs => _
-  rw [coe_insert] at hs⊢
-  rw [linearIndependent_insert (mt mem_coe.1 has)] at hs
+  rw [coe_insert] at hs ⊢
+  rw [linearIndependent_insert (mt mem_coe.1 has)] at hs 
   rw [linearIndependent_insert' (mt mem_coe.1 has)]; refine' ⟨ih hs.1, fun ha => _⟩
-  rw [Finsupp.mem_span_image_iff_total] at ha; rcases ha with ⟨l, hl, hla⟩
-  rw [Finsupp.total_apply_of_mem_supported F hl] at hla
+  rw [Finsupp.mem_span_image_iff_total] at ha ; rcases ha with ⟨l, hl, hla⟩
+  rw [Finsupp.total_apply_of_mem_supported F hl] at hla 
   suffices ∀ i ∈ s, l i ∈ FixedPoints.subfield G F
     by
     replace hla := (sum_apply _ _ fun i => l i • to_fun G F i).symm.trans (congr_fun hla 1)
-    simp_rw [Pi.smul_apply, to_fun_apply, one_smul] at hla
+    simp_rw [Pi.smul_apply, to_fun_apply, one_smul] at hla 
     refine' hs.2 (hla ▸ Submodule.sum_mem _ fun c hcs => _)
     change (⟨l c, this c hcs⟩ : FixedPoints.subfield G F) • c ∈ _
     exact Submodule.smul_mem _ _ (Submodule.subset_span <| mem_coe.2 hcs)
@@ -204,7 +204,7 @@ theorem eval₂' :
 
 theorem ne_one : minpoly G F x ≠ (1 : Polynomial (FixedPoints.subfield G F)) := fun H =>
   have := eval₂ G F x
-  (one_ne_zero : (1 : F) ≠ 0) <| by rwa [H, Polynomial.eval₂_one] at this
+  (one_ne_zero : (1 : F) ≠ 0) <| by rwa [H, Polynomial.eval₂_one] at this 
 #align fixed_points.minpoly.ne_one FixedPoints.minpoly.ne_one
 
 theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
@@ -232,18 +232,18 @@ theorem irreducible_aux (f g : Polynomial (FixedPoints.subfield G F)) (hf : f.Mo
   have hf2 : f ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_right _ _
   have hg2 : g ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_left _ _
   have := eval₂ G F x
-  rw [← hfg, Polynomial.eval₂_mul, mul_eq_zero] at this
+  rw [← hfg, Polynomial.eval₂_mul, mul_eq_zero] at this 
   cases this
   · right
     have hf3 : f = minpoly G F x :=
       Polynomial.eq_of_monic_of_associated hf (monic G F x)
         (associated_of_dvd_dvd hf2 <| @of_eval₂ G _ F _ _ _ x f this)
-    rwa [← mul_one (minpoly G F x), hf3, mul_right_inj' (monic G F x).NeZero] at hfg
+    rwa [← mul_one (minpoly G F x), hf3, mul_right_inj' (monic G F x).NeZero] at hfg 
   · left
     have hg3 : g = minpoly G F x :=
       Polynomial.eq_of_monic_of_associated hg (monic G F x)
         (associated_of_dvd_dvd hg2 <| @of_eval₂ G _ F _ _ _ x g this)
-    rwa [← one_mul (minpoly G F x), hg3, mul_left_inj' (monic G F x).NeZero] at hfg
+    rwa [← one_mul (minpoly G F x), hg3, mul_left_inj' (monic G F x).NeZero] at hfg 
 #align fixed_points.minpoly.irreducible_aux FixedPoints.minpoly.irreducible_aux
 
 theorem irreducible : Irreducible (minpoly G F x) :=
Diff
@@ -34,7 +34,7 @@ then `finrank (fixed_points G F) F = fintype.card G`.
 
 noncomputable section
 
-open Classical BigOperators
+open scoped Classical BigOperators
 
 open MulAction Finset FiniteDimensional
 
Diff
@@ -92,9 +92,7 @@ variable (M)
 /-- The subfield of fixed points by a monoid action. -/
 def subfield : Subfield F :=
   Subfield.copy (⨅ m : M, FixedBy.subfield F m) (fixedPoints M F)
-    (by
-      ext z
-      simp [fixed_points, FixedBy.subfield, iInf, Subfield.mem_sInf])
+    (by ext z; simp [fixed_points, FixedBy.subfield, iInf, Subfield.mem_sInf])
 #align fixed_points.subfield FixedPoints.subfield
 
 instance : IsInvariantSubfield M (FixedPoints.subfield M F)
@@ -135,10 +133,8 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
   refine' Finset.induction_on s (fun _ => linearIndependent_empty_type) fun a s has ih hs => _
   rw [coe_insert] at hs⊢
   rw [linearIndependent_insert (mt mem_coe.1 has)] at hs
-  rw [linearIndependent_insert' (mt mem_coe.1 has)]
-  refine' ⟨ih hs.1, fun ha => _⟩
-  rw [Finsupp.mem_span_image_iff_total] at ha
-  rcases ha with ⟨l, hl, hla⟩
+  rw [linearIndependent_insert' (mt mem_coe.1 has)]; refine' ⟨ih hs.1, fun ha => _⟩
+  rw [Finsupp.mem_span_image_iff_total] at ha; rcases ha with ⟨l, hl, hla⟩
   rw [Finsupp.total_apply_of_mem_supported F hl] at hla
   suffices ∀ i ∈ s, l i ∈ FixedPoints.subfield G F
     by
@@ -154,8 +150,7 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
           (mem_attach _ _) :
         _)
   refine' (@sum_attach _ _ s _ fun i => (g • l i - l i) • MulAction.toFun G F i).trans _
-  ext g'
-  dsimp only
+  ext g'; dsimp only
   conv_lhs =>
     rw [sum_apply]
     congr
@@ -190,9 +185,7 @@ def minpoly : Polynomial (FixedPoints.subfield G F) :=
 
 namespace minpoly
 
-theorem monic : (minpoly G F x).Monic :=
-  by
-  simp only [minpoly, Polynomial.monic_toSubring]
+theorem monic : (minpoly G F x).Monic := by simp only [minpoly, Polynomial.monic_toSubring];
   exact prodXSubSmul.monic G F x
 #align fixed_points.minpoly.monic FixedPoints.minpoly.monic
 
@@ -236,12 +229,8 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
 theorem irreducible_aux (f g : Polynomial (FixedPoints.subfield G F)) (hf : f.Monic) (hg : g.Monic)
     (hfg : f * g = minpoly G F x) : f = 1 ∨ g = 1 :=
   by
-  have hf2 : f ∣ minpoly G F x := by
-    rw [← hfg]
-    exact dvd_mul_right _ _
-  have hg2 : g ∣ minpoly G F x := by
-    rw [← hfg]
-    exact dvd_mul_left _ _
+  have hf2 : f ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_right _ _
+  have hg2 : g ∣ minpoly G F x := by rw [← hfg]; exact dvd_mul_left _ _
   have := eval₂ G F x
   rw [← hfg, Polynomial.eval₂_mul, mul_eq_zero] at this
   cases this
@@ -265,10 +254,8 @@ end minpoly
 
 end Fintype
 
-theorem isIntegral [Finite G] (x : F) : IsIntegral (FixedPoints.subfield G F) x :=
-  by
-  cases nonempty_fintype G
-  exact ⟨minpoly G F x, minpoly.monic G F x, minpoly.eval₂ G F x⟩
+theorem isIntegral [Finite G] (x : F) : IsIntegral (FixedPoints.subfield G F) x := by
+  cases nonempty_fintype G; exact ⟨minpoly G F x, minpoly.monic G F x, minpoly.eval₂ G F x⟩
 #align fixed_points.is_integral FixedPoints.isIntegral
 
 section Fintype
@@ -313,9 +300,7 @@ instance separable : IsSeparable (FixedPoints.subfield G F) F :=
     exact Polynomial.separable_prod_X_sub_C_iff.2 (injective_of_quotient_stabilizer G x)⟩
 #align fixed_points.separable FixedPoints.separable
 
-instance : FiniteDimensional (subfield G F) F :=
-  by
-  cases nonempty_fintype G
+instance : FiniteDimensional (subfield G F) F := by cases nonempty_fintype G;
   exact
     IsNoetherian.iff_fg.1
       (IsNoetherian.iff_rank_lt_aleph0.2 <| (rank_le_card G F).trans_lt <| Cardinal.nat_lt_aleph0 _)
Diff
@@ -310,7 +310,7 @@ instance separable : IsSeparable (FixedPoints.subfield G F) F :=
     -- this was a plain rw when we were using unbundled subrings
     erw [← minpoly_eq_minpoly, ← Polynomial.separable_map (FixedPoints.subfield G F).Subtype,
       minpoly, Polynomial.map_toSubring _ (Subfield G F).toSubring]
-    exact Polynomial.separable_prod_x_sub_c_iff.2 (injective_of_quotient_stabilizer G x)⟩
+    exact Polynomial.separable_prod_X_sub_C_iff.2 (injective_of_quotient_stabilizer G x)⟩
 #align fixed_points.separable FixedPoints.separable
 
 instance : FiniteDimensional (subfield G F) F :=
Diff
@@ -94,7 +94,7 @@ def subfield : Subfield F :=
   Subfield.copy (⨅ m : M, FixedBy.subfield F m) (fixedPoints M F)
     (by
       ext z
-      simp [fixed_points, FixedBy.subfield, infᵢ, Subfield.mem_infₛ])
+      simp [fixed_points, FixedBy.subfield, iInf, Subfield.mem_sInf])
 #align fixed_points.subfield FixedPoints.subfield
 
 instance : IsInvariantSubfield M (FixedPoints.subfield M F)
Diff
@@ -284,7 +284,7 @@ theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card
   rank_le fun s hs => by
     simpa only [rank_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
       Cardinal.natCast_le] using
-      cardinal_lift_le_rank_of_linear_independent'
+      cardinal_lift_le_rank_of_linearIndependent'
         (linear_independent_smul_of_linear_independent G F hs)
 #align fixed_points.rank_le_card FixedPoints.rank_le_card
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kenny Lau
 
 ! This file was ported from Lean 3 source module field_theory.fixed
-! leanprover-community/mathlib commit e7bab9a85e92cf46c02cb4725a7be2f04691e3a7
+! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -280,13 +280,13 @@ theorem minpoly_eq_minpoly : minpoly G F x = minpoly (FixedPoints.subfield G F)
     (minpoly.monic G F x)
 #align fixed_points.minpoly_eq_minpoly FixedPoints.minpoly_eq_minpoly
 
-theorem dim_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card G :=
-  dim_le fun s hs => by
-    simpa only [dim_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
+theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card G :=
+  rank_le fun s hs => by
+    simpa only [rank_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
       Cardinal.natCast_le] using
-      cardinal_lift_le_dim_of_linear_independent'
+      cardinal_lift_le_rank_of_linear_independent'
         (linear_independent_smul_of_linear_independent G F hs)
-#align fixed_points.dim_le_card FixedPoints.dim_le_card
+#align fixed_points.rank_le_card FixedPoints.rank_le_card
 
 end Fintype
 
@@ -318,14 +318,14 @@ instance : FiniteDimensional (subfield G F) F :=
   cases nonempty_fintype G
   exact
     IsNoetherian.iff_fg.1
-      (IsNoetherian.iff_dim_lt_aleph0.2 <| (dim_le_card G F).trans_lt <| Cardinal.nat_lt_aleph0 _)
+      (IsNoetherian.iff_rank_lt_aleph0.2 <| (rank_le_card G F).trans_lt <| Cardinal.nat_lt_aleph0 _)
 
 end Finite
 
 theorem finrank_le_card [Fintype G] : finrank (subfield G F) F ≤ Fintype.card G :=
   by
-  rw [← Cardinal.natCast_le, finrank_eq_dim]
-  apply dim_le_card
+  rw [← Cardinal.natCast_le, finrank_eq_rank]
+  apply rank_le_card
 #align fixed_points.finrank_le_card FixedPoints.finrank_le_card
 
 end FixedPoints
Diff
@@ -301,7 +301,7 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
       cases nonempty_fintype G
       rw [← minpoly_eq_minpoly, minpoly, coe_algebra_map, ← Subfield.toSubring_subtype_eq_subtype,
         Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
-      exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_x_sub_c _⟩
+      exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_X_sub_C _⟩
 #align fixed_points.normal FixedPoints.normal
 
 instance separable : IsSeparable (FixedPoints.subfield G F) F :=
Diff
@@ -222,7 +222,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
   refine'
     Fintype.prod_dvd_of_coprime
-      (Polynomial.pairwise_coprime_x_sub_c <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
+      (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
   rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← Subfield.toSubring_subtype_eq_subtype, ←
Diff
@@ -226,9 +226,9 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
       QuotientGroup.induction_on y fun g => _
   rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← Subfield.toSubring_subtype_eq_subtype, ←
-    IsInvariantSubring.coe_subtype_hom' G (FixedPoints.subfield G F).toSubring, ←
+    IsInvariantSubring.coe_subtypeHom' G (FixedPoints.subfield G F).toSubring, ←
     MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
-    MulSemiringActionHom.coe_polynomial, IsInvariantSubring.coe_subtype_hom', Polynomial.eval_map,
+    MulSemiringActionHom.coe_polynomial, IsInvariantSubring.coe_subtypeHom', Polynomial.eval_map,
     Subfield.toSubring_subtype_eq_subtype, hf, smul_zero]
 #align fixed_points.minpoly.of_eval₂ FixedPoints.minpoly.of_eval₂
 
Diff
@@ -117,7 +117,7 @@ theorem smul (m : M) (x : FixedPoints.subfield M F) : m • x = x :=
 theorem smul_polynomial (m : M) (p : Polynomial (FixedPoints.subfield M F)) : m • p = p :=
   Polynomial.induction_on p (fun x => by rw [Polynomial.smul_C, smul])
     (fun p q ihp ihq => by rw [smul_add, ihp, ihq]) fun n x ih => by
-    rw [smul_mul', Polynomial.smul_C, smul, smul_pow', Polynomial.smul_x]
+    rw [smul_mul', Polynomial.smul_C, smul, smul_pow', Polynomial.smul_X]
 #align fixed_points.smul_polynomial FixedPoints.smul_polynomial
 
 instance : Algebra (FixedPoints.subfield M F) F := by infer_instance
Diff
@@ -225,11 +225,11 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
       (Polynomial.pairwise_coprime_x_sub_c <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
   rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
-    Polynomial.eval_smul', ← Subfield.toSubring.subtype_eq_subtype, ←
+    Polynomial.eval_smul', ← Subfield.toSubring_subtype_eq_subtype, ←
     IsInvariantSubring.coe_subtype_hom' G (FixedPoints.subfield G F).toSubring, ←
     MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
     MulSemiringActionHom.coe_polynomial, IsInvariantSubring.coe_subtype_hom', Polynomial.eval_map,
-    Subfield.toSubring.subtype_eq_subtype, hf, smul_zero]
+    Subfield.toSubring_subtype_eq_subtype, hf, smul_zero]
 #align fixed_points.minpoly.of_eval₂ FixedPoints.minpoly.of_eval₂
 
 -- Why is this so slow?
@@ -299,7 +299,7 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
     (Polynomial.splits_id_iff_splits _).1 <|
       by
       cases nonempty_fintype G
-      rw [← minpoly_eq_minpoly, minpoly, coe_algebra_map, ← Subfield.toSubring.subtype_eq_subtype,
+      rw [← minpoly_eq_minpoly, minpoly, coe_algebra_map, ← Subfield.toSubring_subtype_eq_subtype,
         Polynomial.map_toSubring _ (Subfield G F).toSubring, prodXSubSmul]
       exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_x_sub_c _⟩
 #align fixed_points.normal FixedPoints.normal
Diff
@@ -115,9 +115,9 @@ theorem smul (m : M) (x : FixedPoints.subfield M F) : m • x = x :=
 -- Why is this so slow?
 @[simp]
 theorem smul_polynomial (m : M) (p : Polynomial (FixedPoints.subfield M F)) : m • p = p :=
-  Polynomial.induction_on p (fun x => by rw [Polynomial.smul_c, smul])
+  Polynomial.induction_on p (fun x => by rw [Polynomial.smul_C, smul])
     (fun p q ihp ihq => by rw [smul_add, ihp, ihq]) fun n x ih => by
-    rw [smul_mul', Polynomial.smul_c, smul, smul_pow', Polynomial.smul_x]
+    rw [smul_mul', Polynomial.smul_C, smul, smul_pow', Polynomial.smul_x]
 #align fixed_points.smul_polynomial FixedPoints.smul_polynomial
 
 instance : Algebra (FixedPoints.subfield M F) F := by infer_instance
Diff
@@ -365,7 +365,7 @@ theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G
     calc
       Fintype.card G ≤ Fintype.card (F →ₐ[FixedPoints.subfield G F] F) :=
         Fintype.card_le_of_injective _ (MulSemiringAction.toAlgHom_injective _ F)
-      _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := finrank_algHom (fixedPoints G F) F
+      _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := (finrank_algHom (fixedPoints G F) F)
       _ = finrank (FixedPoints.subfield G F) F := finrank_linear_map' _ _ _
       
 #align fixed_points.finrank_eq_card FixedPoints.finrank_eq_card

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

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

Diff
@@ -342,7 +342,7 @@ theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G
     calc
       Fintype.card G ≤ Fintype.card (F →ₐ[FixedPoints.subfield G F] F) :=
         Fintype.card_le_of_injective _ (MulSemiringAction.toAlgHom_injective _ F)
-      _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := (finrank_algHom (subfield G F) F)
+      _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := finrank_algHom (subfield G F) F
       _ = finrank (FixedPoints.subfield G F) F := finrank_linearMap_self _ _ _
 #align fixed_points.finrank_eq_card FixedPoints.finrank_eq_card
 
chore: rename IsRoot.definition back to IsRoot.def (#11999)

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

Diff
@@ -213,7 +213,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
-  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.definition, MulAction.ofQuotientStabilizer_mk,
+  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← this, ← Subfield.toSubring_subtype_eq_subtype, ←
     IsInvariantSubring.coe_subtypeHom' G (FixedPoints.subfield G F).toSubring, h,
     ← MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
chore: rename away from 'def' (#11548)

This will become an error in 2024-03-16 nightly, possibly not permanently.

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -213,7 +213,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
       QuotientGroup.induction_on y fun g => _
-  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.def, MulAction.ofQuotientStabilizer_mk,
+  rw [Polynomial.dvd_iff_isRoot, Polynomial.IsRoot.definition, MulAction.ofQuotientStabilizer_mk,
     Polynomial.eval_smul', ← this, ← Subfield.toSubring_subtype_eq_subtype, ←
     IsInvariantSubring.coe_subtypeHom' G (FixedPoints.subfield G F).toSubring, h,
     ← MulSemiringActionHom.coe_polynomial, ← MulSemiringActionHom.map_smul, smul_polynomial,
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -38,9 +38,7 @@ open MulAction Finset FiniteDimensional
 universe u v w
 
 variable {M : Type u} [Monoid M]
-
 variable (G : Type u) [Group G]
-
 variable (F : Type v) [Field F] [MulSemiringAction M F] [MulSemiringAction G F] (m : M)
 
 /-- The subfield of F fixed by the field endomorphism `m`. -/
chore(FieldTheory/Fixed): Fintype -> Finite (#10310)
Diff
@@ -363,7 +363,7 @@ theorem toAlgHom_bijective (G : Type u) (F : Type v) [Group G] [Field F] [Finite
 #align fixed_points.to_alg_hom_bijective FixedPoints.toAlgHom_bijective
 
 /-- Bijection between G and algebra homomorphisms that fix the fixed points -/
-def toAlgHomEquiv (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G] [MulSemiringAction G F]
+def toAlgHomEquiv (G : Type u) (F : Type v) [Group G] [Field F] [Finite G] [MulSemiringAction G F]
     [FaithfulSMul G F] : G ≃ (F →ₐ[FixedPoints.subfield G F] F) :=
   Equiv.ofBijective _ (toAlgHom_bijective G F)
 #align fixed_points.to_alg_hom_equiv FixedPoints.toAlgHomEquiv
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -314,7 +314,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
     LinearIndependent B (AlgHom.toLinearMap : (A →ₐ[R] B) → A →ₗ[R] B) :=
   have : LinearIndependent B (LinearMap.ltoFun R A B ∘ AlgHom.toLinearMap) :=
     ((linearIndependent_monoidHom A B).comp ((↑) : (A →ₐ[R] B) → A →* B) fun _ _ hfg =>
-        AlgHom.ext fun _ => FunLike.ext_iff.1 hfg _ :
+        AlgHom.ext fun _ => DFunLike.ext_iff.1 hfg _ :
       _)
   this.of_comp _
 #align linear_independent_to_linear_map linearIndependent_toLinearMap
feat(LinearAlgebra): generalize results about Module.rank of LinearMap. (#9677)

LinearAlgebra/LinearIndependent: generalize linearIndependent_algHom_toLinearMap(') to allow different domain and codomain of the AlgHom.

LinearAlgebra/Basic: add LinearEquiv.congrLeft that works for two rings with commuting actions on the codomain.

LinearAlgebra/FreeModule/Finite/Matrix: generalize Module.Free.linearMap, Module.Finite.linearMap, and FiniteDimensional.finrank_linearMap to work with two different rings that may be noncommutative. Add FiniteDimensional.rank_linearMap, FiniteDimensional.(fin)rank_linearMap_self, and card/cardinal_mk_algHom_le_rank.

FieldTheory/Tower: remove the instance LinearMap.finite_dimensional'' which becomes redundant; mark finrank_linear_map' as deprecated (superseded by finrank_linearMap_self.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -320,7 +320,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
 #align linear_independent_to_linear_map linearIndependent_toLinearMap
 
 theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
-    [FiniteDimensional K V] [Field W] [Algebra K W] [FiniteDimensional K W] :
+    [FiniteDimensional K V] [Field W] [Algebra K W] :
     Cardinal.mk (V →ₐ[K] W) ≤ finrank W (V →ₗ[K] W) :=
   (linearIndependent_toLinearMap K V W).cardinal_mk_le_finrank
 #align cardinal_mk_alg_hom cardinal_mk_algHom
@@ -345,7 +345,7 @@ theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G
       Fintype.card G ≤ Fintype.card (F →ₐ[FixedPoints.subfield G F] F) :=
         Fintype.card_le_of_injective _ (MulSemiringAction.toAlgHom_injective _ F)
       _ ≤ finrank F (F →ₗ[FixedPoints.subfield G F] F) := (finrank_algHom (subfield G F) F)
-      _ = finrank (FixedPoints.subfield G F) F := finrank_linear_map' _ _ _
+      _ = finrank (FixedPoints.subfield G F) F := finrank_linearMap_self _ _ _
 #align fixed_points.finrank_eq_card FixedPoints.finrank_eq_card
 
 /-- `MulSemiringAction.toAlgHom` is bijective. -/
@@ -359,7 +359,7 @@ theorem toAlgHom_bijective (G : Type u) (F : Type v) [Group G] [Field F] [Finite
   · apply le_antisymm
     · exact Fintype.card_le_of_injective _ (MulSemiringAction.toAlgHom_injective _ F)
     · rw [← finrank_eq_card G F]
-      exact LE.le.trans_eq (finrank_algHom _ F) (finrank_linear_map' _ _ _)
+      exact LE.le.trans_eq (finrank_algHom _ F) (finrank_linearMap_self _ _ _)
 #align fixed_points.to_alg_hom_bijective FixedPoints.toAlgHom_bijective
 
 /-- Bijection between G and algebra homomorphisms that fix the fixed points -/
chore(*): drop $/<| before fun (#9361)

Subset of #9319

Diff
@@ -314,7 +314,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
     LinearIndependent B (AlgHom.toLinearMap : (A →ₐ[R] B) → A →ₗ[R] B) :=
   have : LinearIndependent B (LinearMap.ltoFun R A B ∘ AlgHom.toLinearMap) :=
     ((linearIndependent_monoidHom A B).comp ((↑) : (A →ₐ[R] B) → A →* B) fun _ _ hfg =>
-        AlgHom.ext <| fun _ => FunLike.ext_iff.1 hfg _ :
+        AlgHom.ext fun _ => FunLike.ext_iff.1 hfg _ :
       _)
   this.of_comp _
 #align linear_independent_to_linear_map linearIndependent_toLinearMap
feat: Better lemmas for transferring finite sums along equivalences (#9237)

Lemmas around this were a mess, throth in terms of names, statement and location. This PR standardises everything to be in Algebra.BigOperators.Basic and changes the lemmas to take in InjOn and SurjOn assumptions where possible (and where impossible make sure the hypotheses are taken in the correct order) and moves the equality of functions hypothesis last.

Also add a few lemmas that help fix downstream uses by golfing.

From LeanAPAP and LeanCamCombi

Diff
@@ -144,7 +144,7 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
       (linearIndependent_iff'.1 (ih hs.1) s.attach (fun i => g • l i - l i) _ ⟨i, his⟩
           (mem_attach _ _) :
         _)
-  refine' (@sum_attach _ _ s _ fun i => (g • l i - l i) • MulAction.toFun G F i).trans _
+  refine' (sum_attach s fun i ↦ (g • l i - l i) • MulAction.toFun G F i).trans _
   ext g'; dsimp only
   conv_lhs =>
     rw [sum_apply]
chore(LinearAlgebra): rename to enable LinearIndependent dot notation (#9144)
  • Rename cardinal_lift_le_rank_of_linearIndependent, cardinal_le_rank_of_linearIndependent('), cardinal_mk/fintype_card/finset_card_le_finrank_of_linearIndependent, fintype_card_le_finrank_of_linearIndependent, finset_card_le_finrank_of_linearIndependent by removing trailing _of_linearIndependent in favor of namespace LinearIndependent.

  • Remove cardinal_lift_le_rank_of_linearIndependent', exact duplicate of the version without the prime

  • Rename FiniteDimensional/Module.Finite.lt_aleph0_of_linearIndependent to LinearIndependent.lt_aleph0_of_finiteDimensional/finite

  • Add one lemma LinearIndependent.aleph0_le_rank in LinearAlgebra/Dimension and two lemmas LinearIndependent.finrank_eq_zero_of_infinite and finrank_eq_nat_card_basis in LinearAlgebra/Finrank

  • Remove StrongRankCondition from finrank_eq_zero_of_basis_imp_not_finite and four subsequent lemmas

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>

Diff
@@ -268,8 +268,7 @@ theorem rank_le_card : Module.rank (FixedPoints.subfield G F) F ≤ Fintype.card
   rank_le fun s hs => by
     simpa only [rank_fun', Cardinal.mk_coe_finset, Finset.coe_sort_coe, Cardinal.lift_natCast,
       Cardinal.natCast_le] using
-      cardinal_lift_le_rank_of_linearIndependent'
-        (linearIndependent_smul_of_linearIndependent G F hs)
+      (linearIndependent_smul_of_linearIndependent G F hs).cardinal_lift_le_rank
 #align fixed_points.rank_le_card FixedPoints.rank_le_card
 
 end Fintype
@@ -323,7 +322,7 @@ theorem linearIndependent_toLinearMap (R : Type u) (A : Type v) (B : Type w) [Co
 theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] [Field W] [Algebra K W] [FiniteDimensional K W] :
     Cardinal.mk (V →ₐ[K] W) ≤ finrank W (V →ₗ[K] W) :=
-  cardinal_mk_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V W
+  (linearIndependent_toLinearMap K V W).cardinal_mk_le_finrank
 #align cardinal_mk_alg_hom cardinal_mk_algHom
 
 noncomputable instance AlgEquiv.fintype (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
@@ -333,7 +332,7 @@ noncomputable instance AlgEquiv.fintype (K : Type u) (V : Type v) [Field K] [Fie
 
 theorem finrank_algHom (K : Type u) (V : Type v) [Field K] [Field V] [Algebra K V]
     [FiniteDimensional K V] : Fintype.card (V →ₐ[K] V) ≤ finrank V (V →ₗ[K] V) :=
-  fintype_card_le_finrank_of_linearIndependent <| linearIndependent_toLinearMap K V V
+  (linearIndependent_toLinearMap K V V).fintype_card_le_finrank
 #align finrank_alg_hom finrank_algHom
 
 namespace FixedPoints
chore: Nsmul -> NSMul, Zpow -> ZPow, etc (#9067)

Normalising to naming convention rule number 6.

Diff
@@ -172,22 +172,22 @@ variable [Fintype G] (x : F)
 
 /-- `minpoly G F x` is the minimal polynomial of `(x : F)` over `FixedPoints.subfield G F`. -/
 def minpoly : Polynomial (FixedPoints.subfield G F) :=
-  (prodXSubSmul G F x).toSubring (FixedPoints.subfield G F).toSubring fun _ hc g =>
+  (prodXSubSMul G F x).toSubring (FixedPoints.subfield G F).toSubring fun _ hc g =>
     let ⟨n, _, hn⟩ := Polynomial.mem_frange_iff.1 hc
-    hn.symm ▸ prodXSubSmul.coeff G F x g n
+    hn.symm ▸ prodXSubSMul.coeff G F x g n
 #align fixed_points.minpoly FixedPoints.minpoly
 
 namespace minpoly
 
 theorem monic : (minpoly G F x).Monic := by
   simp only [minpoly, Polynomial.monic_toSubring];
-  exact prodXSubSmul.monic G F x
+  exact prodXSubSMul.monic G F x
 #align fixed_points.minpoly.monic FixedPoints.minpoly.monic
 
 theorem eval₂ :
     Polynomial.eval₂ (Subring.subtype <| (FixedPoints.subfield G F).toSubring) x (minpoly G F x) =
       0 := by
-  rw [← prodXSubSmul.eval G F x, Polynomial.eval₂_eq_eval_map]
+  rw [← prodXSubSMul.eval G F x, Polynomial.eval₂_eq_eval_map]
   simp only [minpoly, Polynomial.map_toSubring]
 #align fixed_points.minpoly.eval₂ FixedPoints.minpoly.eval₂
 
@@ -210,7 +210,7 @@ theorem of_eval₂ (f : Polynomial (FixedPoints.subfield G F))
     (subfield G F).toSubring)) f = Polynomial.map
     ((IsInvariantSubring.subtypeHom G (subfield G F).toSubring)) f := rfl
   erw [← Polynomial.map_dvd_map' (Subfield.subtype <| FixedPoints.subfield G F), minpoly, this,
-    Polynomial.map_toSubring _ _, prodXSubSmul]
+    Polynomial.map_toSubring _ _, prodXSubSMul]
   refine'
     Fintype.prod_dvd_of_coprime
       (Polynomial.pairwise_coprime_X_sub_C <| MulAction.injective_ofQuotientStabilizer G x) fun y =>
@@ -283,7 +283,7 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
     (Polynomial.splits_id_iff_splits _).1 <| by
       cases nonempty_fintype G
       rw [← minpoly_eq_minpoly, minpoly, coe_algebraMap, ← Subfield.toSubring_subtype_eq_subtype,
-        Polynomial.map_toSubring _ (subfield G F).toSubring, prodXSubSmul]
+        Polynomial.map_toSubring _ (subfield G F).toSubring, prodXSubSMul]
       exact Polynomial.splits_prod _ fun _ _ => Polynomial.splits_X_sub_C _⟩
 #align fixed_points.normal FixedPoints.normal
 
chore: remove redundant integrality condition in IsSeparable (#8862)

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -288,7 +288,7 @@ instance normal : Normal (FixedPoints.subfield G F) F :=
 #align fixed_points.normal FixedPoints.normal
 
 instance separable : IsSeparable (FixedPoints.subfield G F) F :=
-  ⟨isIntegral G F, fun x => by
+  ⟨fun x => by
     cases nonempty_fintype G
     -- this was a plain rw when we were using unbundled subrings
     erw [← minpoly_eq_minpoly, ← Polynomial.separable_map (FixedPoints.subfield G F).subtype,
chore(IntegralClosure): noncommutative generalizations and golfs (#8406)

Zulip

Initially I just wanted to add more dot notations for IsIntegral and IsAlgebraic (done in #8437); then I noticed near-duplicates Algebra.isIntegral_of_finite [Field R] [Ring A] and RingHom.IsIntegral.of_finite [CommRing R] [CommRing A] so I went on to generalize the latter to cover the former, and generalized everything in the IntegralClosure file to the noncommutative case whenever possible.

In the process I noticed more golfs, which result in this PR. Most notably, isIntegral_of_mem_of_FG is now proven using Cayley-Hamilton and doesn't depend on the Noetherian case isIntegral_of_noetherian; the latter is now proven using the former. In total the golfs makes mathlib 227 lines leaner (+487 -714).

The main changes are in the single file RingTheory/IntegralClosure:

  • Change the definition of Algebra.IsIntegral which makes it unfold to IsIntegral rather than RingHom.IsIntegralElem because the former has much more APIs.

  • Fix lemma names involving is_integral which are actually about IsIntegralElem: RingHom.is_integral_mapRingHom.isIntegralElem_map RingHom.is_integral_of_mem_closureRingHom.IsIntegralElem.of_mem_closure RingHom.is_integral_zero/oneRingHom.isIntegralElem_zero/one RingHom.is_integral_add/neg/sub/mul/of_mul_unitRingHom.IsIntegralElem.add/neg/sub/mul/of_mul_unit

  • Add a lemma Algebra.IsIntegral.of_injective.

  • Move isIntegral_of_(submodule_)noetherian down and golf them.

  • Remove (Algebra.)isIntegral_of_finite that work only over fields, in favor of the more general (Algebra.)isIntegral.of_finite.

  • Merge duplicate lemmas isIntegral_of_isScalarTower and isIntegral_tower_top_of_isIntegral into IsIntegral.tower_top.

  • Golf IsIntegral.of_mem_of_fg by first proving IsIntegral.of_finite using Cayley-Hamilton.

  • Add a docstring mentioning the Kurosh problem at Algebra.IsIntegral.finite. The negative solution to the problem means the theorem doesn't generalize to noncommutative algebras.

  • Golf IsIntegral.tmul and isField_of_isIntegral_of_isField(').

  • Combine isIntegral_trans_aux into isIntegral_trans and golf.

  • Add Algebra namespace to isIntegral_sup.

  • rename lemmas for dot notation: RingHom.isIntegral_transRingHom.IsIntegral.trans RingHom.isIntegral_quotient/tower_bot/top_of_isIntegralRingHom.IsIntegral.quotient/tower_bot/top isIntegral_of_mem_closure'IsIntegral.of_mem_closure' (and the '' version) isIntegral_of_surjectiveAlgebra.isIntegral_of_surjective

The next changed file is RingTheory/Algebraic:

  • Rename: of_larger_basetower_top (for consistency with IsIntegral) Algebra.isAlgebraic_of_finiteAlgebra.IsAlgebraic.of_finite Algebra.isAlgebraic_transAlgebra.IsAlgebraic.trans

  • Add new lemmasAlgebra.IsIntegral.isAlgebraic, isAlgebraic_algHom_iff, and Algebra.IsAlgebraic.of_injective to streamline some proofs.

The generalization from CommRing to Ring requires an additional lemma scaleRoots_eval₂_mul_of_commute in Polynomial/ScaleRoots.

A lemma Algebra.lmul_injective is added to Algebra/Bilinear (in order to golf the proof of IsIntegral.of_mem_of_fg).

In all other files, I merely fix the changed names, or use newly available dot notations.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -279,7 +279,7 @@ section Finite
 variable [Finite G]
 
 instance normal : Normal (FixedPoints.subfield G F) F :=
-  ⟨fun x => (isIntegral G F x).isAlgebraic _, fun x =>
+  ⟨fun x => (isIntegral G F x).isAlgebraic, fun x =>
     (Polynomial.splits_id_iff_splits _).1 <| by
       cases nonempty_fintype G
       rw [← minpoly_eq_minpoly, minpoly, coe_algebraMap, ← Subfield.toSubring_subtype_eq_subtype,
perf(FunLike.Basic): beta reduce CoeFun.coe (#7905)

This eliminates (fun a ↦ β) α in the type when applying a FunLike.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -163,7 +163,6 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
       ∑ x in s, (fun y => l y • MulAction.toFun G F y) x g'
   rw [← smul_sum, ← sum_apply _ _ fun y => l y • toFun G F y, ←
     sum_apply _ _ fun y => l y • toFun G F y]
-  dsimp only
   rw [hla, toFun_apply, toFun_apply, smul_smul, mul_inv_cancel_left]
 #align fixed_points.linear_independent_smul_of_linear_independent FixedPoints.linearIndependent_smul_of_linearIndependent
 
refactor(GroupTheory/GroupAction/Basic): re-organise, rename, and make some variables implicit (#7786)
  • Re-organise the namespace and section structure of GroupTheory/GroupAction/Basic.lean.
  • Remove the namespaces MulAction.Stabilizer and AddAction.Stabilizer, renaming MulAction.Stabilizer.submonoid to MulAction.stabilizerSubmonoid.
  • Make variables for the monoid/group/set implicit when an element or subset is used in the statement.
Diff
@@ -45,7 +45,7 @@ variable (F : Type v) [Field F] [MulSemiringAction M F] [MulSemiringAction G F]
 
 /-- The subfield of F fixed by the field endomorphism `m`. -/
 def FixedBy.subfield : Subfield F where
-  carrier := fixedBy M F m
+  carrier := fixedBy F m
   zero_mem' := smul_zero m
   add_mem' hx hy := (smul_add m _ _).trans <| congr_arg₂ _ hx hy
   neg_mem' hx := (smul_neg m _).trans <| congr_arg _ hx
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,11 +2,6 @@
 Copyright (c) 2020 Kenny Lau. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kenny Lau
-
-! This file was ported from Lean 3 source module field_theory.fixed
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.GroupRingAction.Invariant
 import Mathlib.Algebra.Polynomial.GroupRingAction
@@ -14,6 +9,8 @@ import Mathlib.FieldTheory.Normal
 import Mathlib.FieldTheory.Separable
 import Mathlib.FieldTheory.Tower
 
+#align_import field_theory.fixed from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
+
 /-!
 # Fixed field under a group action.
 
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -133,7 +133,7 @@ theorem linearIndependent_smul_of_linearIndependent {s : Finset F} :
   rw [coe_insert] at hs ⊢
   rw [linearIndependent_insert (mt mem_coe.1 has)] at hs
   rw [linearIndependent_insert' (mt mem_coe.1 has)]; refine' ⟨ih hs.1, fun ha => _⟩
-  rw [Finsupp.mem_span_image_iff_total] at ha ; rcases ha with ⟨l, hl, hla⟩
+  rw [Finsupp.mem_span_image_iff_total] at ha; rcases ha with ⟨l, hl, hla⟩
   rw [Finsupp.total_apply_of_mem_supported F hl] at hla
   suffices ∀ i ∈ s, l i ∈ FixedPoints.subfield G F by
     replace hla := (sum_apply _ _ fun i => l i • toFun G F i).symm.trans (congr_fun hla 1)
chore: tidy various files (#5233)
Diff
@@ -68,10 +68,8 @@ class IsInvariantSubfield (S : Subfield F) : Prop where
 
 variable (S : Subfield F)
 
---instance : MulSemiringAction M S := Submonoid.mulSemiringAction S.toSubmonoid
-
-instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] : MulSemiringAction M S
-    where
+instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] :
+    MulSemiringAction M S where
   smul m x := ⟨m • x.1, IsInvariantSubfield.smul_mem m x.2⟩
   one_smul s := Subtype.eq <| one_smul M s.1
   mul_smul m₁ m₂ s := Subtype.eq <| mul_smul m₁ m₂ s.1
@@ -81,8 +79,8 @@ instance IsInvariantSubfield.toMulSemiringAction [IsInvariantSubfield M S] : Mul
   smul_mul m s₁ s₂ := Subtype.eq <| smul_mul' m s₁.1 s₂.1
 #align is_invariant_subfield.to_mul_semiring_action IsInvariantSubfield.toMulSemiringAction
 
-instance [IsInvariantSubfield M S] : IsInvariantSubring M S.toSubring
-    where smul_mem := IsInvariantSubfield.smul_mem
+instance [IsInvariantSubfield M S] : IsInvariantSubring M S.toSubring where
+  smul_mem := IsInvariantSubfield.smul_mem
 
 end InvariantSubfields
 
@@ -97,15 +95,15 @@ def subfield : Subfield F :=
     (by ext z; simp [fixedPoints, FixedBy.subfield, iInf, Subfield.mem_sInf]; rfl)
 #align fixed_points.subfield FixedPoints.subfield
 
-instance : IsInvariantSubfield M (FixedPoints.subfield M F)
-    where smul_mem g x hx g' := by rw [hx, hx]
+instance : IsInvariantSubfield M (FixedPoints.subfield M F) where
+  smul_mem g x hx g' := by rw [hx, hx]
 
-instance : SMulCommClass M (FixedPoints.subfield M F) F
-    where smul_comm m f f' := show m • (↑f * f') = f * m • f' by rw [smul_mul', f.prop m]
+instance : SMulCommClass M (FixedPoints.subfield M F) F where
+  smul_comm m f f' := show m • (↑f * f') = f * m • f' by rw [smul_mul', f.prop m]
 
-instance smul_comm_class' : SMulCommClass (FixedPoints.subfield M F) M F :=
+instance smulCommClass' : SMulCommClass (FixedPoints.subfield M F) M F :=
   SMulCommClass.symm _ _ _
-#align fixed_points.smul_comm_class' FixedPoints.smul_comm_class'
+#align fixed_points.smul_comm_class' FixedPoints.smulCommClass'
 
 @[simp]
 theorem smul (m : M) (x : FixedPoints.subfield M F) : m • x = x :=
feat: port FieldTheory.Fixed (#4890)

Co-authored-by: Chris Hughes <chrishughes24@gmail.com>

Dependencies 10 + 659

660 files ported (98.5%)
273491 lines ported (98.8%)
Show graph

The unported dependencies are