ring_theory.polynomial.eisenstein.is_integral ⟷ Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -101,7 +101,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       rw [zero_add, pow_one] at hi ⊒
       exact (cyclotomic_comp_X_add_one_isEisensteinAt p).Mem hi
     Β· intro i hi
-      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd, ←
+      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.intCast_zmod_eq_zero_iff_dvd, ←
         Int.coe_castRingHom, ← coeff_map, map_comp, map_cyclotomic, Polynomial.map_add, map_X,
         Polynomial.map_one, pow_add, pow_one, cyclotomic_mul_prime_dvd_eq_pow, pow_comp, ←
         ZMod.expand_card, coeff_expand hp.out.pos]
@@ -113,7 +113,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rw [hk, pow_succ', mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
-        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
+        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.intCast_zmod_eq_zero_iff_dvd,
           ← Int.coe_castRingHom, ← coeff_map] at hn
         simpa [map_comp] using hn
       · exact ⟨p ^ n, by rw [pow_succ']⟩
Diff
@@ -68,13 +68,13 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
       nat_degree_cyclotomic, Nat.totient_prime hp.out] at hi
     simp only [hi.trans_le (Nat.sub_le _ _), sum_ite_eq', mem_range, if_true,
-      Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.coe_nat_dvd]
+      Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.natCast_dvd_natCast]
     exact hp.out.dvd_choose_self i.succ_ne_zero (lt_tsub_iff_right.1 hi)
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime, eval_add, eval_X, eval_one, zero_add,
       eval_geom_sum, one_geom_sum, Ideal.submodule_span_eq, Ideal.span_singleton_pow,
       Ideal.mem_span_singleton]
     intro h
-    obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
+    obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h
     rw [← mul_assoc, mul_one, mul_assoc] at hk
     nth_rw 1 [← Nat.mul_one p] at hk
     rw [mul_right_inj' hp.out.ne_zero] at hk
@@ -110,20 +110,20 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
           nat_degree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _),
           Nat.add_one_sub_one] at hn hi
-        rw [hk, pow_succ, mul_assoc] at hi
+        rw [hk, pow_succ', mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
         rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
           ← Int.coe_castRingHom, ← coeff_map] at hn
         simpa [map_comp] using hn
-      · exact ⟨p ^ n, by rw [pow_succ]⟩
+      · exact ⟨p ^ n, by rw [pow_succ']⟩
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime_pow_eq_geom_sum hp.out, eval_add,
       eval_X, eval_one, zero_add, eval_finset_sum]
     simp only [eval_pow, eval_X, one_pow, sum_const, card_range, Nat.smul_one_eq_coe,
       submodule_span_eq, Ideal.submodule_span_eq, Ideal.span_singleton_pow,
       Ideal.mem_span_singleton]
     intro h
-    obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
+    obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h
     rw [← mul_assoc, mul_one, mul_assoc] at hk
     nth_rw 1 [← Nat.mul_one p] at hk
     rw [mul_right_inj' hp.out.ne_zero] at hk
@@ -424,7 +424,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
     z ∈ adjoin R ({B.gen} : Set L) := by
   induction' n with n hn
   Β· simpa using hz
-  Β· rw [pow_succ, mul_smul] at hz
+  Β· rw [pow_succ', mul_smul] at hz
     exact
       hn
         (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (IsIntegral.smul _ hzint)
Diff
@@ -56,7 +56,7 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
       (fun i hi => _) _
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine' (cyclotomic.monic p β„€).comp (monic_X_add_C 1) fun h => _
-    rw [nat_degree_X_add_C] at h 
+    rw [nat_degree_X_add_C] at h
     exact zero_ne_one h.symm
   Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, map_sum]
     conv =>
@@ -66,7 +66,7 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
       ext
       rw [lcoeff_apply, ← C_eq_nat_cast, C_mul_X_pow_eq_monomial, coeff_monomial]
     rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
-      nat_degree_cyclotomic, Nat.totient_prime hp.out] at hi 
+      nat_degree_cyclotomic, Nat.totient_prime hp.out] at hi
     simp only [hi.trans_le (Nat.sub_le _ _), sum_ite_eq', mem_range, if_true,
       Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.coe_nat_dvd]
     exact hp.out.dvd_choose_self i.succ_ne_zero (lt_tsub_iff_right.1 hi)
@@ -75,9 +75,9 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
       Ideal.mem_span_singleton]
     intro h
     obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
-    rw [← mul_assoc, mul_one, mul_assoc] at hk 
-    nth_rw 1 [← Nat.mul_one p] at hk 
-    rw [mul_right_inj' hp.out.ne_zero] at hk 
+    rw [← mul_assoc, mul_one, mul_assoc] at hk
+    nth_rw 1 [← Nat.mul_one p] at hk
+    rw [mul_right_inj' hp.out.ne_zero] at hk
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_X_add_one_isEisensteinAt
 -/
@@ -94,7 +94,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       _ _
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine' (cyclotomic.monic _ β„€).comp (monic_X_add_C 1) fun h => _
-    rw [nat_degree_X_add_C] at h 
+    rw [nat_degree_X_add_C] at h
     exact zero_ne_one h.symm
   Β· induction' n with n hn
     Β· intro i hi
@@ -109,12 +109,12 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rintro ⟨k, hk⟩
         rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
           nat_degree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _),
-          Nat.add_one_sub_one] at hn hi 
-        rw [hk, pow_succ, mul_assoc] at hi 
+          Nat.add_one_sub_one] at hn hi
+        rw [hk, pow_succ, mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
         rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
-          ← Int.coe_castRingHom, ← coeff_map] at hn 
+          ← Int.coe_castRingHom, ← coeff_map] at hn
         simpa [map_comp] using hn
       · exact ⟨p ^ n, by rw [pow_succ]⟩
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime_pow_eq_geom_sum hp.out, eval_add,
@@ -124,9 +124,9 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       Ideal.mem_span_singleton]
     intro h
     obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
-    rw [← mul_assoc, mul_one, mul_assoc] at hk 
-    nth_rw 1 [← Nat.mul_one p] at hk 
-    rw [mul_right_inj' hp.out.ne_zero] at hk 
+    rw [← mul_assoc, mul_one, mul_assoc] at hk
+    nth_rw 1 [← Nat.mul_one p] at hk
+    rw [mul_right_inj' hp.out.ne_zero] at hk
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt
 -/
@@ -166,7 +166,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
   choose! f hf using
     hei.is_weakly_eisenstein_at.exists_mem_adjoin_mul_eq_pow_nat_degree_le (minpoly.aeval R B.gen)
       (minpoly.monic hBint)
-  simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf 
+  simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf
   -- The Eisenstein condition shows that `p` divides `Q.coeff 0`
   -- if `p^n.succ` divides the following multiple of `Q.coeff 0^n.succ`:
   suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).coeff 0 ^ n)
@@ -181,7 +181,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
   have aux : βˆ€ i ∈ (range (Q.nat_degree + 1)).eraseβ‚“ 0, B.dim ≀ i + n :=
     by
     intro i hi
-    simp only [mem_range, mem_erase] at hi 
+    simp only [mem_range, mem_erase] at hi
     rw [hn]
     exact le_add_pred_of_pos _ hi.1
   have hintsum :
@@ -245,13 +245,13 @@ theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [Co
     (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.coeff i) (hz : aeval x Q = p β€’ z) :
     z ∈ adjoin A ({x} : Set B) := by
   choose! f hf using hQ
-  rw [aeval_eq_sum_range, sum_range] at hz 
+  rw [aeval_eq_sum_range, sum_range] at hz
   conv_lhs at hz =>
     congr
     skip
     ext
     rw [hf i (mem_range.2 (Fin.is_lt i)), ← smul_smul]
-  rw [← smul_sum] at hz 
+  rw [← smul_sum] at hz
   rw [← smul_right_injective _ hp hz]
   exact
     Subalgebra.sum_mem _ fun _ _ =>
@@ -279,14 +279,14 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
   let P₁ := P.map (algebraMap R L)
   -- There is a polynomial `Q` such that `p β€’ z = aeval B.gen Q`. We can assume that
   -- `Q.degree < P.degree` and `Q β‰  0`.
-  rw [adjoin_singleton_eq_range_aeval] at hz 
+  rw [adjoin_singleton_eq_range_aeval] at hz
   obtain ⟨Q₁, hQ⟩ := hz
   set Q := Q₁ %β‚˜ P with hQ₁
   replace hQ : aeval B.gen Q = p β€’ z
-  Β· rw [← mod_by_monic_add_div Q₁ (minpoly.monic hBint)] at hQ 
+  Β· rw [← mod_by_monic_add_div Q₁ (minpoly.monic hBint)] at hQ
     simpa using hQ
   by_cases hQzero : Q = 0
-  Β· simp only [hQzero, Algebra.smul_def, zero_eq_mul, aeval_zero] at hQ 
+  Β· simp only [hQzero, Algebra.smul_def, zero_eq_mul, aeval_zero] at hQ
     cases' hQ with H H₁
     Β· have : Function.Injective (algebraMap R L) :=
         by
@@ -307,14 +307,14 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
     exact n
     -- Two technical results we will need about `P.nat_degree` and `Q.nat_degree`.
     have H := degree_mod_by_monic_lt Q₁ (minpoly.monic hBint)
-    rw [← hQ₁, ← hP] at H 
+    rw [← hQ₁, ← hP] at H
     replace H :=
       Nat.lt_iff_add_one_le.1
         (lt_of_lt_of_le
           (lt_of_le_of_lt (Nat.lt_iff_add_one_le.1 (Nat.lt_of_succ_lt_succ (mem_range.1 hj)))
             (lt_succ_self _))
           (Nat.lt_iff_add_one_le.1 ((nat_degree_lt_nat_degree_iff hQzero).2 H)))
-    rw [add_assoc] at H 
+    rw [add_assoc] at H
     have Hj : Q.nat_degree + 1 = j + 1 + (Q.nat_degree - j) := by
       rw [← add_comm 1, ← add_comm 1, add_assoc, add_right_inj, ←
         Nat.add_sub_assoc (Nat.lt_of_succ_lt_succ (mem_range.1 hj)).le, add_comm,
@@ -347,7 +347,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
       rw [(minpoly.monic hBint).natDegree_map, add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
       Β· exact Nat.zero_le _
       Β· refine' one_le_iff_ne_zero.2 fun h => _
-        rw [h] at hk 
+        rw [h] at hk
         simpa using hk
       Β· infer_instance
     -- The Eisenstein condition shows that `p` divides `Q.coeff j`
@@ -366,15 +366,15 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
     -- Using `hQ : aeval B.gen Q = p β€’ z`, we write `p β€’ z` as a sum of terms of degree less than
     -- `j+1`, that are multiples of `p` by induction, and terms of degree at least `j+1`.
     rw [aeval_eq_sum_range, Hj, range_add, sum_union (disjoint_range_add_left_embedding _ _),
-      sum_congr rfl hg, add_comm] at hQ 
+      sum_congr rfl hg, add_comm] at hQ
     -- We multiply this equality by `B.gen ^ (P.nat_degree-(j+2))`, so we can use `hf₁` on the terms
     -- we didn't know were multiples of `p`, and we take the norm on both sides.
     replace hQ := congr_arg (fun x => x * B.gen ^ (P.nat_degree - (j + 2))) hQ
-    simp_rw [sum_map, addLeftEmbedding_apply, add_mul, sum_mul, mul_assoc] at hQ 
+    simp_rw [sum_map, addLeftEmbedding_apply, add_mul, sum_mul, mul_assoc] at hQ
     rw [←
       insert_erase (mem_range.2 (tsub_pos_iff_lt.2 <| Nat.lt_of_succ_lt_succ <| mem_range.1 hj)),
       sum_insert (not_mem_erase 0 _), add_zero, sum_congr rfl hf₁, ← mul_sum, ← mul_sum, add_assoc,
-      ← mul_add, smul_mul_assoc, ← pow_add, Algebra.smul_def] at hQ 
+      ← mul_add, smul_mul_assoc, ← pow_add, Algebra.smul_def] at hQ
     replace hQ := congr_arg (norm K) (eq_sub_of_add_eq hQ)
     -- We obtain an equality of elements of `K`, but everything is integral, so we can move to `R`
     -- and simplify `hQ`.
@@ -395,7 +395,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
       rw [add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
       Β· exact zero_le _
       Β· refine' one_le_iff_ne_zero.2 fun h => _
-        rw [h] at hk 
+        rw [h] at hk
         simpa using hk
     obtain ⟨r, hr⟩ := is_integral_iff.1 (is_integral_norm K hintsum)
     rw [Algebra.smul_def, mul_assoc, ← mul_sub, _root_.map_mul, algebraMap_apply R K L, map_pow,
@@ -403,12 +403,12 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
       finrank B, ← hr, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map,
       show (-1 : K) = algebraMap R K (-1) by simp, ← map_pow, ← map_pow, ← _root_.map_mul, ←
-      map_pow, ← _root_.map_mul, ← map_pow, ← _root_.map_mul] at hQ 
+      map_pow, ← _root_.map_mul, ← map_pow, ← _root_.map_mul] at hQ
     -- We can now finish the proof.
     have hppdiv : p ^ B.dim ∣ p ^ B.dim * r := dvd_mul_of_dvd_left dvd_rfl _
     rwa [← IsFractionRing.injective R K hQ, mul_comm, ← Units.coe_neg_one, mul_pow, ←
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
-      IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv 
+      IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv
 #align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt
 -/
 
@@ -424,7 +424,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
     z ∈ adjoin R ({B.gen} : Set L) := by
   induction' n with n hn
   Β· simpa using hz
-  Β· rw [pow_succ, mul_smul] at hz 
+  Β· rw [pow_succ, mul_smul] at hz
     exact
       hn
         (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (IsIntegral.smul _ hzint)
Diff
@@ -108,8 +108,8 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       Β· simp only [ite_eq_right_iff]
         rintro ⟨k, hk⟩
         rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
-          nat_degree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _), Nat.succ_sub_one] at
-          hn hi 
+          nat_degree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _),
+          Nat.add_one_sub_one] at hn hi 
         rw [hk, pow_succ, mul_assoc] at hi 
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
@@ -189,8 +189,8 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
       (z * B.gen ^ n - βˆ‘ x : β„• in (range (Q.nat_degree + 1)).eraseβ‚“ 0, Q.coeff x β€’ f (x + n)) :=
     by
     refine'
-      isIntegral_sub (isIntegral_mul hzint (IsIntegral.pow hBint _))
-        (IsIntegral.sum _ fun i hi => isIntegral_smul _ _)
+      IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
+        (IsIntegral.sum _ fun i hi => IsIntegral.smul _ _)
     exact adjoin_le_integralClosure hBint (hf _ (aux i hi)).1
   obtain ⟨r, hr⟩ := is_integral_iff.1 (is_integral_norm K hintsum)
   use r
@@ -386,10 +386,10 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
             βˆ‘ x : β„• in range (j + 1), g x β€’ B.gen ^ x * B.gen ^ (P.nat_degree - (j + 2)))) :=
       by
       refine'
-        isIntegral_sub (isIntegral_mul hzint (IsIntegral.pow hBint _))
-          (isIntegral_add (IsIntegral.sum _ fun k hk => isIntegral_smul _ _)
+        IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
+          (IsIntegral.add (IsIntegral.sum _ fun k hk => IsIntegral.smul _ _)
             (IsIntegral.sum _ fun k hk =>
-              isIntegral_mul (isIntegral_smul _ (IsIntegral.pow hBint _)) (IsIntegral.pow hBint _)))
+              IsIntegral.mul (IsIntegral.smul _ (IsIntegral.pow hBint _)) (IsIntegral.pow hBint _)))
       refine' adjoin_le_integralClosure hBint (hf _ _).1
       rw [(minpoly.monic hBint).natDegree_map (algebraMap R L)]
       rw [add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
@@ -427,7 +427,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
   Β· rw [pow_succ, mul_smul] at hz 
     exact
       hn
-        (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (isIntegral_smul _ hzint)
+        (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (IsIntegral.smul _ hzint)
           hz hei)
 #align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
 -/
Diff
@@ -58,7 +58,7 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     refine' (cyclotomic.monic p β„€).comp (monic_X_add_C 1) fun h => _
     rw [nat_degree_X_add_C] at h 
     exact zero_ne_one h.symm
-  Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, LinearMap.map_sum]
+  Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, map_sum]
     conv =>
       congr
       congr
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2022 Riccardo Brasca. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
 -/
-import Mathbin.Data.Nat.Choose.Dvd
-import Mathbin.RingTheory.IntegrallyClosed
-import Mathbin.RingTheory.Norm
-import Mathbin.RingTheory.Polynomial.Cyclotomic.Expand
+import Data.Nat.Choose.Dvd
+import RingTheory.IntegrallyClosed
+import RingTheory.Norm
+import RingTheory.Polynomial.Cyclotomic.Expand
 
 #align_import ring_theory.polynomial.eisenstein.is_integral from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2022 Riccardo Brasca. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
-
-! This file was ported from Lean 3 source module ring_theory.polynomial.eisenstein.is_integral
-! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Nat.Choose.Dvd
 import Mathbin.RingTheory.IntegrallyClosed
 import Mathbin.RingTheory.Norm
 import Mathbin.RingTheory.Polynomial.Cyclotomic.Expand
 
+#align_import ring_theory.polynomial.eisenstein.is_integral from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
+
 /-!
 # Eisenstein polynomials
 
Diff
@@ -47,8 +47,8 @@ local notation "π“Ÿ" => Submodule.span β„€ {p}
 
 open Polynomial
 
-#print cyclotomic_comp_x_add_one_isEisensteinAt /-
-theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
+#print cyclotomic_comp_X_add_one_isEisensteinAt /-
+theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     ((cyclotomic p β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
   refine'
@@ -82,11 +82,11 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
     nth_rw 1 [← Nat.mul_one p] at hk 
     rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
-#align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_x_add_one_isEisensteinAt
+#align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_X_add_one_isEisensteinAt
 -/
 
-#print cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt /-
-theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
+#print cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt /-
+theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
     ((cyclotomic (p ^ (n + 1)) β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
   refine'
@@ -102,7 +102,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
   Β· induction' n with n hn
     Β· intro i hi
       rw [zero_add, pow_one] at hi ⊒
-      exact (cyclotomic_comp_x_add_one_isEisensteinAt p).Mem hi
+      exact (cyclotomic_comp_X_add_one_isEisensteinAt p).Mem hi
     Β· intro i hi
       rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd, ←
         Int.coe_castRingHom, ← coeff_map, map_comp, map_cyclotomic, Polynomial.map_add, map_X,
@@ -131,7 +131,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
     nth_rw 1 [← Nat.mul_one p] at hk 
     rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
-#align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt
+#align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt
 -/
 
 end Cyclotomic
@@ -148,12 +148,12 @@ local notation "π“Ÿ" => Submodule.span R {p}
 
 open IsIntegrallyClosed PowerBasis Nat Polynomial IsScalarTower
 
-#print dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at /-
+#print dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `Q : R[X]` is such that
 `aeval B.gen Q = p β€’ z`, then `p ∣ Q.coeff 0`. -/
-theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
+theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p β€’ z)
     (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.coeff 0 :=
   by
@@ -239,7 +239,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   Β· rw [aeval_eq_sum_range,
       Finset.add_sum_erase (range (Q.nat_degree + 1)) fun i => Q.coeff i β€’ B.gen ^ i]
     simp
-#align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at
+#align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt
 -/
 
 #print mem_adjoin_of_dvd_coeff_of_dvd_aeval /-
@@ -262,13 +262,13 @@ theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [Co
 #align mem_adjoin_of_dvd_coeff_of_dvd_aeval mem_adjoin_of_dvd_coeff_of_dvd_aeval
 -/
 
-#print mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at /-
+#print mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p β€’ z ∈ adjoin R {B.gen}`, then
 `z ∈ adjoin R {B.gen}`. -/
-theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
-    (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} (hzint : IsIntegral R z)
+theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L} (hp : Prime p)
+    (hBint : IsIntegral R B.gen) {z : L} (hzint : IsIntegral R z)
     (hz : p β€’ z ∈ adjoin R ({B.gen} : Set L)) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) :
     z ∈ adjoin R ({B.gen} : Set L) :=
   by
@@ -304,7 +304,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
   refine' mem_adjoin_of_dvd_coeff_of_dvd_aeval hp.ne_zero (fun i => _) hQ
   refine' Nat.case_strong_induction_on i _ fun j hind => _
   Β· intro H
-    exact dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at hp hBint hQ hzint hei
+    exact dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt hp hBint hQ hzint hei
   Β· intro hj
     refine' hp.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd _ hndiv
     exact n
@@ -412,16 +412,16 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     rwa [← IsFractionRing.injective R K hQ, mul_comm, ← Units.coe_neg_one, mul_pow, ←
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
       IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv 
-#align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at
+#align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt
 -/
 
-#print mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at /-
+#print mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p ^ n β€’ z ∈ adjoin R {B.gen}`,
 then `z ∈ adjoin R {B.gen}`. Together with `algebra.discr_mul_is_integral_mem_adjoin` this result
 often allows to compute the ring of integers of `L`. -/
-theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
+theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {n : β„•} {z : L} (hzint : IsIntegral R z)
     (hz : p ^ n β€’ z ∈ adjoin R ({B.gen} : Set L)) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) :
     z ∈ adjoin R ({B.gen} : Set L) := by
@@ -430,9 +430,9 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : Powe
   Β· rw [pow_succ, mul_smul] at hz 
     exact
       hn
-        (mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at hp hBint
-          (isIntegral_smul _ hzint) hz hei)
-#align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at
+        (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (isIntegral_smul _ hzint)
+          hz hei)
+#align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
 -/
 
 end IsIntegral
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
 
 ! This file was ported from Lean 3 source module ring_theory.polynomial.eisenstein.is_integral
-! leanprover-community/mathlib commit 5bfbcca0a7ffdd21cf1682e59106d6c942434a32
+! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.RingTheory.Polynomial.Cyclotomic.Expand
 
 /-!
 # Eisenstein polynomials
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
 In this file we gather more miscellaneous results about Eisenstein polynomials
 
 ## Main results
Diff
@@ -44,6 +44,7 @@ local notation "π“Ÿ" => Submodule.span β„€ {p}
 
 open Polynomial
 
+#print cyclotomic_comp_x_add_one_isEisensteinAt /-
 theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
     ((cyclotomic p β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
@@ -79,7 +80,9 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
     rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_x_add_one_isEisensteinAt
+-/
 
+#print cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt /-
 theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
     ((cyclotomic (p ^ (n + 1)) β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
@@ -126,6 +129,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
     rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt
+-/
 
 end Cyclotomic
 
@@ -141,6 +145,7 @@ local notation "π“Ÿ" => Submodule.span R {p}
 
 open IsIntegrallyClosed PowerBasis Nat Polynomial IsScalarTower
 
+#print dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `Q : R[X]` is such that
@@ -232,7 +237,9 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
       Finset.add_sum_erase (range (Q.nat_degree + 1)) fun i => Q.coeff i β€’ B.gen ^ i]
     simp
 #align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at
+-/
 
+#print mem_adjoin_of_dvd_coeff_of_dvd_aeval /-
 theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [CommRing B]
     [Algebra A B] [NoZeroSMulDivisors A B] {Q : A[X]} {p : A} {x z : B} (hp : p β‰  0)
     (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.coeff i) (hz : aeval x Q = p β€’ z) :
@@ -250,7 +257,9 @@ theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [Co
     Subalgebra.sum_mem _ fun _ _ =>
       Subalgebra.smul_mem _ (Subalgebra.pow_mem _ (subset_adjoin (Set.mem_singleton _)) _) _
 #align mem_adjoin_of_dvd_coeff_of_dvd_aeval mem_adjoin_of_dvd_coeff_of_dvd_aeval
+-/
 
+#print mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p β€’ z ∈ adjoin R {B.gen}`, then
@@ -401,7 +410,9 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
       IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv 
 #align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at
+-/
 
+#print mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at /-
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p ^ n β€’ z ∈ adjoin R {B.gen}`,
@@ -419,6 +430,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : Powe
         (mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at hp hBint
           (isIntegral_smul _ hzint) hz hei)
 #align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at
+-/
 
 end IsIntegral
 
Diff
@@ -40,7 +40,6 @@ section Cyclotomic
 
 variable (p : β„•)
 
--- mathport name: exprπ“Ÿ
 local notation "π“Ÿ" => Submodule.span β„€ {p}
 
 open Polynomial
@@ -138,7 +137,6 @@ variable [Algebra K L] [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSepa
 
 variable [IsDomain R] [IsFractionRing R K] [IsIntegrallyClosed R]
 
--- mathport name: exprπ“Ÿ
 local notation "π“Ÿ" => Submodule.span R {p}
 
 open IsIntegrallyClosed PowerBasis Nat Polynomial IsScalarTower
Diff
@@ -374,8 +374,8 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     have hintsum :
       IsIntegral R
         (z * B.gen ^ (P.nat_degree - (j + 2)) -
-          ((βˆ‘ x : β„• in (range (Q.nat_degree - j)).eraseβ‚“ 0,
-              Q.coeff (j + 1 + x) β€’ f (x + P.nat_degree - 1)) +
+          (βˆ‘ x : β„• in (range (Q.nat_degree - j)).eraseβ‚“ 0,
+              Q.coeff (j + 1 + x) β€’ f (x + P.nat_degree - 1) +
             βˆ‘ x : β„• in range (j + 1), g x β€’ B.gen ^ x * B.gen ^ (P.nat_degree - (j + 2)))) :=
       by
       refine'
Diff
@@ -203,7 +203,6 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
             βˆ‘ x : β„• in (range (Q.nat_degree + 1)).eraseβ‚“ 0, p β€’ Q.coeff x β€’ f (x + n)) :=
       (congr_arg (norm K) (eq_sub_of_add_eq _))
     _ = _ := _
-    
   Β· simp only [Algebra.smul_def, algebraMap_apply R K L, Algebra.norm_algebraMap, _root_.map_mul,
       _root_.map_pow, finrank_K_L, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map, ← hn]
@@ -224,7 +223,6 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
       by rw [pow_zero]
     _ = aeval B.gen Q * B.gen ^ n := _
     _ = _ := by rw [hQ, Algebra.smul_mul_assoc]
-    
   Β· have :
       βˆ€ i ∈ (range (Q.nat_degree + 1)).eraseβ‚“ 0,
         Q.coeff i β€’ (B.gen ^ i * B.gen ^ n) = p β€’ Q.coeff i β€’ f (i + n) :=
Diff
@@ -171,7 +171,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
     have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
       hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
     refine' Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd hp (_ : _ ^ n.succ ∣ _) hndiv
-    convert(IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
+    convert (IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
     push_cast
     ring_nf; simp [pow_right_comm _ _ 2]
   -- We claim the quotient of `Q^n * _` by `p^n` is the following `r`:
Diff
@@ -149,7 +149,7 @@ extension of `K`, generated by an integral power basis `B` such that the minimal
 `aeval B.gen Q = p β€’ z`, then `p ∣ Q.coeff 0`. -/
 theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p β€’ z)
-    (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.Coeff 0 :=
+    (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.coeff 0 :=
   by
   -- First define some abbreviations.
   letI := B.finite_dimensional
@@ -166,9 +166,9 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf 
   -- The Eisenstein condition shows that `p` divides `Q.coeff 0`
   -- if `p^n.succ` divides the following multiple of `Q.coeff 0^n.succ`:
-  suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).Coeff 0 ^ n)
+  suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).coeff 0 ^ n)
     by
-    have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).Coeff 0 := fun h =>
+    have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
       hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
     refine' Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd hp (_ : _ ^ n.succ ∣ _) hndiv
     convert(IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
@@ -239,7 +239,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
 
 theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [CommRing B]
     [Algebra A B] [NoZeroSMulDivisors A B] {Q : A[X]} {p : A} {x z : B} (hp : p β‰  0)
-    (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.Coeff i) (hz : aeval x Q = p β€’ z) :
+    (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.coeff i) (hz : aeval x Q = p β€’ z) :
     z ∈ adjoin A ({x} : Set B) := by
   choose! f hf using hQ
   rw [aeval_eq_sum_range, sum_range] at hz 
@@ -265,7 +265,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     z ∈ adjoin R ({B.gen} : Set L) :=
   by
   -- First define some abbreviations.
-  have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).Coeff 0 := fun h =>
+  have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
     hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
   letI := FiniteDimensional B
   set P := minpoly R B.gen with hP
@@ -349,7 +349,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     -- if `p^n.succ` divides the following multiple of `Q.coeff (succ j)^n.succ`:
     suffices
       p ^ n.succ ∣
-        Q.coeff (succ j) ^ n.succ * (minpoly R B.gen).Coeff 0 ^ (succ j + (P.nat_degree - (j + 2)))
+        Q.coeff (succ j) ^ n.succ * (minpoly R B.gen).coeff 0 ^ (succ j + (P.nat_degree - (j + 2)))
       by
       convert this
       rw [Nat.succ_eq_add_one, add_assoc, ← Nat.add_sub_assoc H, ← add_assoc, add_comm (j + 1),
Diff
@@ -56,7 +56,7 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
       (fun i hi => _) _
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine' (cyclotomic.monic p β„€).comp (monic_X_add_C 1) fun h => _
-    rw [nat_degree_X_add_C] at h
+    rw [nat_degree_X_add_C] at h 
     exact zero_ne_one h.symm
   Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, LinearMap.map_sum]
     conv =>
@@ -66,7 +66,7 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
       ext
       rw [lcoeff_apply, ← C_eq_nat_cast, C_mul_X_pow_eq_monomial, coeff_monomial]
     rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
-      nat_degree_cyclotomic, Nat.totient_prime hp.out] at hi
+      nat_degree_cyclotomic, Nat.totient_prime hp.out] at hi 
     simp only [hi.trans_le (Nat.sub_le _ _), sum_ite_eq', mem_range, if_true,
       Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.coe_nat_dvd]
     exact hp.out.dvd_choose_self i.succ_ne_zero (lt_tsub_iff_right.1 hi)
@@ -75,9 +75,9 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
       Ideal.mem_span_singleton]
     intro h
     obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
-    rw [← mul_assoc, mul_one, mul_assoc] at hk
-    nth_rw 1 [← Nat.mul_one p] at hk
-    rw [mul_right_inj' hp.out.ne_zero] at hk
+    rw [← mul_assoc, mul_one, mul_assoc] at hk 
+    nth_rw 1 [← Nat.mul_one p] at hk 
+    rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_x_add_one_isEisensteinAt
 
@@ -92,11 +92,11 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
       _ _
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine' (cyclotomic.monic _ β„€).comp (monic_X_add_C 1) fun h => _
-    rw [nat_degree_X_add_C] at h
+    rw [nat_degree_X_add_C] at h 
     exact zero_ne_one h.symm
   Β· induction' n with n hn
     Β· intro i hi
-      rw [zero_add, pow_one] at hi⊒
+      rw [zero_add, pow_one] at hi ⊒
       exact (cyclotomic_comp_x_add_one_isEisensteinAt p).Mem hi
     Β· intro i hi
       rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd, ←
@@ -107,12 +107,12 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rintro ⟨k, hk⟩
         rw [nat_degree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, nat_degree_X_add_C, mul_one,
           nat_degree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _), Nat.succ_sub_one] at
-          hn hi
-        rw [hk, pow_succ, mul_assoc] at hi
+          hn hi 
+        rw [hk, pow_succ, mul_assoc] at hi 
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
         rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
-          ← Int.coe_castRingHom, ← coeff_map] at hn
+          ← Int.coe_castRingHom, ← coeff_map] at hn 
         simpa [map_comp] using hn
       · exact ⟨p ^ n, by rw [pow_succ]⟩
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime_pow_eq_geom_sum hp.out, eval_add,
@@ -122,9 +122,9 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
       Ideal.mem_span_singleton]
     intro h
     obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
-    rw [← mul_assoc, mul_one, mul_assoc] at hk
-    nth_rw 1 [← Nat.mul_one p] at hk
-    rw [mul_right_inj' hp.out.ne_zero] at hk
+    rw [← mul_assoc, mul_one, mul_assoc] at hk 
+    nth_rw 1 [← Nat.mul_one p] at hk 
+    rw [mul_right_inj' hp.out.ne_zero] at hk 
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 #align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt
 
@@ -163,7 +163,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   choose! f hf using
     hei.is_weakly_eisenstein_at.exists_mem_adjoin_mul_eq_pow_nat_degree_le (minpoly.aeval R B.gen)
       (minpoly.monic hBint)
-  simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf
+  simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf 
   -- The Eisenstein condition shows that `p` divides `Q.coeff 0`
   -- if `p^n.succ` divides the following multiple of `Q.coeff 0^n.succ`:
   suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).Coeff 0 ^ n)
@@ -178,7 +178,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   have aux : βˆ€ i ∈ (range (Q.nat_degree + 1)).eraseβ‚“ 0, B.dim ≀ i + n :=
     by
     intro i hi
-    simp only [mem_range, mem_erase] at hi
+    simp only [mem_range, mem_erase] at hi 
     rw [hn]
     exact le_add_pred_of_pos _ hi.1
   have hintsum :
@@ -242,13 +242,13 @@ theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [Co
     (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.Coeff i) (hz : aeval x Q = p β€’ z) :
     z ∈ adjoin A ({x} : Set B) := by
   choose! f hf using hQ
-  rw [aeval_eq_sum_range, sum_range] at hz
+  rw [aeval_eq_sum_range, sum_range] at hz 
   conv_lhs at hz =>
     congr
     skip
     ext
     rw [hf i (mem_range.2 (Fin.is_lt i)), ← smul_smul]
-  rw [← smul_sum] at hz
+  rw [← smul_sum] at hz 
   rw [← smul_right_injective _ hp hz]
   exact
     Subalgebra.sum_mem _ fun _ _ =>
@@ -274,14 +274,14 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
   let P₁ := P.map (algebraMap R L)
   -- There is a polynomial `Q` such that `p β€’ z = aeval B.gen Q`. We can assume that
   -- `Q.degree < P.degree` and `Q β‰  0`.
-  rw [adjoin_singleton_eq_range_aeval] at hz
+  rw [adjoin_singleton_eq_range_aeval] at hz 
   obtain ⟨Q₁, hQ⟩ := hz
   set Q := Q₁ %β‚˜ P with hQ₁
   replace hQ : aeval B.gen Q = p β€’ z
-  Β· rw [← mod_by_monic_add_div Q₁ (minpoly.monic hBint)] at hQ
+  Β· rw [← mod_by_monic_add_div Q₁ (minpoly.monic hBint)] at hQ 
     simpa using hQ
   by_cases hQzero : Q = 0
-  Β· simp only [hQzero, Algebra.smul_def, zero_eq_mul, aeval_zero] at hQ
+  Β· simp only [hQzero, Algebra.smul_def, zero_eq_mul, aeval_zero] at hQ 
     cases' hQ with H H₁
     Β· have : Function.Injective (algebraMap R L) :=
         by
@@ -302,14 +302,14 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     exact n
     -- Two technical results we will need about `P.nat_degree` and `Q.nat_degree`.
     have H := degree_mod_by_monic_lt Q₁ (minpoly.monic hBint)
-    rw [← hQ₁, ← hP] at H
+    rw [← hQ₁, ← hP] at H 
     replace H :=
       Nat.lt_iff_add_one_le.1
         (lt_of_lt_of_le
           (lt_of_le_of_lt (Nat.lt_iff_add_one_le.1 (Nat.lt_of_succ_lt_succ (mem_range.1 hj)))
             (lt_succ_self _))
           (Nat.lt_iff_add_one_le.1 ((nat_degree_lt_nat_degree_iff hQzero).2 H)))
-    rw [add_assoc] at H
+    rw [add_assoc] at H 
     have Hj : Q.nat_degree + 1 = j + 1 + (Q.nat_degree - j) := by
       rw [← add_comm 1, ← add_comm 1, add_assoc, add_right_inj, ←
         Nat.add_sub_assoc (Nat.lt_of_succ_lt_succ (mem_range.1 hj)).le, add_comm,
@@ -342,7 +342,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
       rw [(minpoly.monic hBint).natDegree_map, add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
       Β· exact Nat.zero_le _
       Β· refine' one_le_iff_ne_zero.2 fun h => _
-        rw [h] at hk
+        rw [h] at hk 
         simpa using hk
       Β· infer_instance
     -- The Eisenstein condition shows that `p` divides `Q.coeff j`
@@ -361,15 +361,15 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     -- Using `hQ : aeval B.gen Q = p β€’ z`, we write `p β€’ z` as a sum of terms of degree less than
     -- `j+1`, that are multiples of `p` by induction, and terms of degree at least `j+1`.
     rw [aeval_eq_sum_range, Hj, range_add, sum_union (disjoint_range_add_left_embedding _ _),
-      sum_congr rfl hg, add_comm] at hQ
+      sum_congr rfl hg, add_comm] at hQ 
     -- We multiply this equality by `B.gen ^ (P.nat_degree-(j+2))`, so we can use `hf₁` on the terms
     -- we didn't know were multiples of `p`, and we take the norm on both sides.
     replace hQ := congr_arg (fun x => x * B.gen ^ (P.nat_degree - (j + 2))) hQ
-    simp_rw [sum_map, addLeftEmbedding_apply, add_mul, sum_mul, mul_assoc] at hQ
+    simp_rw [sum_map, addLeftEmbedding_apply, add_mul, sum_mul, mul_assoc] at hQ 
     rw [←
       insert_erase (mem_range.2 (tsub_pos_iff_lt.2 <| Nat.lt_of_succ_lt_succ <| mem_range.1 hj)),
       sum_insert (not_mem_erase 0 _), add_zero, sum_congr rfl hf₁, ← mul_sum, ← mul_sum, add_assoc,
-      ← mul_add, smul_mul_assoc, ← pow_add, Algebra.smul_def] at hQ
+      ← mul_add, smul_mul_assoc, ← pow_add, Algebra.smul_def] at hQ 
     replace hQ := congr_arg (norm K) (eq_sub_of_add_eq hQ)
     -- We obtain an equality of elements of `K`, but everything is integral, so we can move to `R`
     -- and simplify `hQ`.
@@ -390,7 +390,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
       rw [add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
       Β· exact zero_le _
       Β· refine' one_le_iff_ne_zero.2 fun h => _
-        rw [h] at hk
+        rw [h] at hk 
         simpa using hk
     obtain ⟨r, hr⟩ := is_integral_iff.1 (is_integral_norm K hintsum)
     rw [Algebra.smul_def, mul_assoc, ← mul_sub, _root_.map_mul, algebraMap_apply R K L, map_pow,
@@ -398,12 +398,12 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
       finrank B, ← hr, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map,
       show (-1 : K) = algebraMap R K (-1) by simp, ← map_pow, ← map_pow, ← _root_.map_mul, ←
-      map_pow, ← _root_.map_mul, ← map_pow, ← _root_.map_mul] at hQ
+      map_pow, ← _root_.map_mul, ← map_pow, ← _root_.map_mul] at hQ 
     -- We can now finish the proof.
     have hppdiv : p ^ B.dim ∣ p ^ B.dim * r := dvd_mul_of_dvd_left dvd_rfl _
     rwa [← IsFractionRing.injective R K hQ, mul_comm, ← Units.coe_neg_one, mul_pow, ←
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
-      IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv
+      IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv 
 #align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at
 
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
@@ -417,7 +417,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : Powe
     z ∈ adjoin R ({B.gen} : Set L) := by
   induction' n with n hn
   Β· simpa using hz
-  Β· rw [pow_succ, mul_smul] at hz
+  Β· rw [pow_succ, mul_smul] at hz 
     exact
       hn
         (mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at hp hBint
Diff
@@ -34,7 +34,7 @@ variable {R : Type u}
 
 open Ideal Algebra Finset
 
-open BigOperators Polynomial
+open scoped BigOperators Polynomial
 
 section Cyclotomic
 
Diff
@@ -173,8 +173,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
     refine' Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd hp (_ : _ ^ n.succ ∣ _) hndiv
     convert(IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
     push_cast
-    ring_nf
-    simp [pow_right_comm _ _ 2]
+    ring_nf; simp [pow_right_comm _ _ 2]
   -- We claim the quotient of `Q^n * _` by `p^n` is the following `r`:
   have aux : βˆ€ i ∈ (range (Q.nat_degree + 1)).eraseβ‚“ 0, B.dim ≀ i + n :=
     by
@@ -209,7 +208,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
       _root_.map_pow, finrank_K_L, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map, ← hn]
     ring
-  swap
+  swap;
   Β·
     simp_rw [← smul_sum, ← smul_sub, Algebra.smul_def p, algebraMap_apply R K L, _root_.map_mul,
       Algebra.norm_algebraMap, finrank_K_L, hr, ← hn]
Diff
@@ -4,14 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
 
 ! This file was ported from Lean 3 source module ring_theory.polynomial.eisenstein.is_integral
-! leanprover-community/mathlib commit ceb887ddf3344dab425292e497fa2af91498437c
+! leanprover-community/mathlib commit 5bfbcca0a7ffdd21cf1682e59106d6c942434a32
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.Nat.Choose.Dvd
 import Mathbin.RingTheory.IntegrallyClosed
 import Mathbin.RingTheory.Norm
-import Mathbin.RingTheory.Polynomial.Cyclotomic.Basic
+import Mathbin.RingTheory.Polynomial.Cyclotomic.Expand
 
 /-!
 # Eisenstein polynomials
Diff
@@ -149,7 +149,7 @@ extension of `K`, generated by an integral power basis `B` such that the minimal
 `aeval B.gen Q = p β€’ z`, then `p ∣ Q.coeff 0`. -/
 theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p β€’ z)
-    (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.coeff 0 :=
+    (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.Coeff 0 :=
   by
   -- First define some abbreviations.
   letI := B.finite_dimensional
@@ -166,9 +166,9 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   simp only [(minpoly.monic hBint).natDegree_map, deg_R_P] at hf
   -- The Eisenstein condition shows that `p` divides `Q.coeff 0`
   -- if `p^n.succ` divides the following multiple of `Q.coeff 0^n.succ`:
-  suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).coeff 0 ^ n)
+  suffices p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).Coeff 0 ^ n)
     by
-    have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
+    have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).Coeff 0 := fun h =>
       hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
     refine' Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd hp (_ : _ ^ n.succ ∣ _) hndiv
     convert(IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
@@ -240,7 +240,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
 
 theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [CommRing B]
     [Algebra A B] [NoZeroSMulDivisors A B] {Q : A[X]} {p : A} {x z : B} (hp : p β‰  0)
-    (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.coeff i) (hz : aeval x Q = p β€’ z) :
+    (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.Coeff i) (hz : aeval x Q = p β€’ z) :
     z ∈ adjoin A ({x} : Set B) := by
   choose! f hf using hQ
   rw [aeval_eq_sum_range, sum_range] at hz
@@ -266,7 +266,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     z ∈ adjoin R ({B.gen} : Set L) :=
   by
   -- First define some abbreviations.
-  have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
+  have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).Coeff 0 := fun h =>
     hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
   letI := FiniteDimensional B
   set P := minpoly R B.gen with hP
@@ -350,7 +350,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     -- if `p^n.succ` divides the following multiple of `Q.coeff (succ j)^n.succ`:
     suffices
       p ^ n.succ ∣
-        Q.coeff (succ j) ^ n.succ * (minpoly R B.gen).coeff 0 ^ (succ j + (P.nat_degree - (j + 2)))
+        Q.coeff (succ j) ^ n.succ * (minpoly R B.gen).Coeff 0 ^ (succ j + (P.nat_degree - (j + 2)))
       by
       convert this
       rw [Nat.succ_eq_add_one, add_assoc, ← Nat.add_sub_assoc H, ← add_assoc, add_comm (j + 1),
Diff
@@ -205,13 +205,13 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
       (congr_arg (norm K) (eq_sub_of_add_eq _))
     _ = _ := _
     
-  Β· simp only [Algebra.smul_def, algebra_map_apply R K L, Algebra.norm_algebraMap, _root_.map_mul,
+  Β· simp only [Algebra.smul_def, algebraMap_apply R K L, Algebra.norm_algebraMap, _root_.map_mul,
       _root_.map_pow, finrank_K_L, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map, ← hn]
     ring
   swap
   Β·
-    simp_rw [← smul_sum, ← smul_sub, Algebra.smul_def p, algebra_map_apply R K L, _root_.map_mul,
+    simp_rw [← smul_sum, ← smul_sub, Algebra.smul_def p, algebraMap_apply R K L, _root_.map_mul,
       Algebra.norm_algebraMap, finrank_K_L, hr, ← hn]
   calc
     _ =
@@ -394,8 +394,8 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
         rw [h] at hk
         simpa using hk
     obtain ⟨r, hr⟩ := is_integral_iff.1 (is_integral_norm K hintsum)
-    rw [Algebra.smul_def, mul_assoc, ← mul_sub, _root_.map_mul, algebra_map_apply R K L, map_pow,
-      Algebra.norm_algebraMap, _root_.map_mul, algebra_map_apply R K L, Algebra.norm_algebraMap,
+    rw [Algebra.smul_def, mul_assoc, ← mul_sub, _root_.map_mul, algebraMap_apply R K L, map_pow,
+      Algebra.norm_algebraMap, _root_.map_mul, algebraMap_apply R K L, Algebra.norm_algebraMap,
       finrank B, ← hr, power_basis.norm_gen_eq_coeff_zero_minpoly,
       minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, coeff_map,
       show (-1 : K) = algebraMap R K (-1) by simp, ← map_pow, ← map_pow, ← _root_.map_mul, ←
Diff
@@ -99,7 +99,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
       rw [zero_add, pow_one] at hi⊒
       exact (cyclotomic_comp_x_add_one_isEisensteinAt p).Mem hi
     Β· intro i hi
-      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_coe_zMod_eq_zero_iff_dvd, ←
+      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd, ←
         Int.coe_castRingHom, ← coeff_map, map_comp, map_cyclotomic, Polynomial.map_add, map_X,
         Polynomial.map_one, pow_add, pow_one, cyclotomic_mul_prime_dvd_eq_pow, pow_comp, ←
         ZMod.expand_card, coeff_expand hp.out.pos]
@@ -111,7 +111,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rw [hk, pow_succ, mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
-        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_coe_zMod_eq_zero_iff_dvd,
+        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
           ← Int.coe_castRingHom, ← coeff_map] at hn
         simpa [map_comp] using hn
       · exact ⟨p ^ n, by rw [pow_succ]⟩
Diff
@@ -171,7 +171,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
     have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
       hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
     refine' Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd hp (_ : _ ^ n.succ ∣ _) hndiv
-    convert (IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
+    convert(IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
     push_cast
     ring_nf
     simp [pow_right_comm _ _ 2]
Diff
@@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
 
 ! This file was ported from Lean 3 source module ring_theory.polynomial.eisenstein.is_integral
-! leanprover-community/mathlib commit 966e0cf0685c9cedf8a3283ac69eef4d5f2eaca2
+! leanprover-community/mathlib commit ceb887ddf3344dab425292e497fa2af91498437c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
+import Mathbin.Data.Nat.Choose.Dvd
 import Mathbin.RingTheory.IntegrallyClosed
 import Mathbin.RingTheory.Norm
 import Mathbin.RingTheory.Polynomial.Cyclotomic.Basic
Diff
@@ -45,7 +45,7 @@ local notation "π“Ÿ" => Submodule.span β„€ {p}
 open Polynomial
 
 theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
-    ((cyclotomic p β„€).comp (x + 1)).IsEisensteinAt π“Ÿ :=
+    ((cyclotomic p β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
   refine'
     monic.is_eisenstein_at_of_mem_of_not_mem _
@@ -81,7 +81,7 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
 #align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_x_add_one_isEisensteinAt
 
 theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
-    ((cyclotomic (p ^ (n + 1)) β„€).comp (x + 1)).IsEisensteinAt π“Ÿ :=
+    ((cyclotomic (p ^ (n + 1)) β„€).comp (X + 1)).IsEisensteinAt π“Ÿ :=
   by
   refine'
     monic.is_eisenstein_at_of_mem_of_not_mem _
Diff
@@ -201,7 +201,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
         norm K
           (p β€’ (z * B.gen ^ n) -
             βˆ‘ x : β„• in (range (Q.nat_degree + 1)).eraseβ‚“ 0, p β€’ Q.coeff x β€’ f (x + n)) :=
-      congr_arg (norm K) (eq_sub_of_add_eq _)
+      (congr_arg (norm K) (eq_sub_of_add_eq _))
     _ = _ := _
     
   Β· simp only [Algebra.smul_def, algebra_map_apply R K L, Algebra.norm_algebraMap, _root_.map_mul,

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -272,7 +272,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
     exact dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt hp hBint hQ hzint hei
   Β· intro hj
     convert hp.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd _ hndiv
-    exact n
+    Β· exact n
     -- Two technical results we will need about `P.natDegree` and `Q.natDegree`.
     have H := degree_modByMonic_lt Q₁ (minpoly.monic hBint)
     rw [← hQ₁, ← hP] at H
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
@@ -56,7 +56,7 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
       congr
       next => skip
       ext
-      rw [lcoeff_apply, ← C_eq_nat_cast, C_mul_X_pow_eq_monomial, coeff_monomial]
+      rw [lcoeff_apply, ← C_eq_natCast, C_mul_X_pow_eq_monomial, coeff_monomial]
     rw [natDegree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, natDegree_X_add_C, mul_one,
       natDegree_cyclotomic, Nat.totient_prime hp.out] at hi
     simp only [hi.trans_le (Nat.sub_le _ _), sum_ite_eq', mem_range, if_true,
@@ -88,7 +88,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       rw [Nat.zero_add, pow_one] at hi ⊒
       exact (cyclotomic_comp_X_add_one_isEisensteinAt p).mem hi
     Β· intro i hi
-      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
+      rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.intCast_zmod_eq_zero_iff_dvd,
         show ↑(_  : β„€) = Int.castRingHom (ZMod p) _ by rfl, ← coeff_map, map_comp, map_cyclotomic,
         Polynomial.map_add, map_X, Polynomial.map_one, pow_add, pow_one,
         cyclotomic_mul_prime_dvd_eq_pow, pow_comp, ← ZMod.expand_card, coeff_expand hp.out.pos]
@@ -100,7 +100,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rw [hk, pow_succ', mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
-        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
+        rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.intCast_zmod_eq_zero_iff_dvd,
            show ↑(_  : β„€) = Int.castRingHom (ZMod p) _ by rfl, ← coeff_map] at hn
         simpa [map_comp] using hn
       · exact ⟨p ^ n, by rw [pow_succ']⟩
chore(Data/Int): Rename coe_nat to natCast (#11637)

Reduce the diff of #11499

Renames

All in the Int namespace:

  • ofNat_eq_cast β†’ ofNat_eq_natCast
  • cast_eq_cast_iff_Nat β†’ natCast_inj
  • natCast_eq_ofNat β†’ ofNat_eq_natCast
  • coe_nat_sub β†’ natCast_sub
  • coe_nat_nonneg β†’ natCast_nonneg
  • sign_coe_add_one β†’ sign_natCast_add_one
  • nat_succ_eq_int_succ β†’ natCast_succ
  • succ_neg_nat_succ β†’ succ_neg_natCast_succ
  • coe_pred_of_pos β†’ natCast_pred_of_pos
  • coe_nat_div β†’ natCast_div
  • coe_nat_ediv β†’ natCast_ediv
  • sign_coe_nat_of_nonzero β†’ sign_natCast_of_ne_zero
  • toNat_coe_nat β†’ toNat_natCast
  • toNat_coe_nat_add_one β†’ toNat_natCast_add_one
  • coe_nat_dvd β†’ natCast_dvd_natCast
  • coe_nat_dvd_left β†’ natCast_dvd
  • coe_nat_dvd_right β†’ dvd_natCast
  • le_coe_nat_sub β†’ le_natCast_sub
  • succ_coe_nat_pos β†’ succ_natCast_pos
  • coe_nat_modEq_iff β†’ natCast_modEq_iff
  • coe_natAbs β†’ natCast_natAbs
  • coe_nat_eq_zero β†’ natCast_eq_zero
  • coe_nat_ne_zero β†’ natCast_ne_zero
  • coe_nat_ne_zero_iff_pos β†’ natCast_ne_zero_iff_pos
  • abs_coe_nat β†’ abs_natCast
  • coe_nat_nonpos_iff β†’ natCast_nonpos_iff

Also rename Nat.coe_nat_dvd to Nat.cast_dvd_cast

Diff
@@ -60,13 +60,13 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     rw [natDegree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, natDegree_X_add_C, mul_one,
       natDegree_cyclotomic, Nat.totient_prime hp.out] at hi
     simp only [hi.trans_le (Nat.sub_le _ _), sum_ite_eq', mem_range, if_true,
-      Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.coe_nat_dvd]
+      Ideal.submodule_span_eq, Ideal.mem_span_singleton, Int.natCast_dvd_natCast]
     exact hp.out.dvd_choose_self i.succ_ne_zero (lt_tsub_iff_right.1 hi)
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime, eval_add, eval_X, eval_one, zero_add,
       eval_geom_sum, one_geom_sum, Ideal.submodule_span_eq, Ideal.span_singleton_pow,
       Ideal.mem_span_singleton]
     intro h
-    obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
+    obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h
     rw [mul_assoc, mul_comm 1, mul_one] at hk
     nth_rw 1 [← Nat.mul_one p] at hk
     rw [mul_right_inj' hp.out.ne_zero] at hk
@@ -110,7 +110,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       submodule_span_eq, Ideal.submodule_span_eq, Ideal.span_singleton_pow,
       Ideal.mem_span_singleton]
     intro h
-    obtain ⟨k, hk⟩ := Int.coe_nat_dvd.1 h
+    obtain ⟨k, hk⟩ := Int.natCast_dvd_natCast.1 h
     rw [mul_assoc, mul_comm 1, mul_one] at hk
     nth_rw 1 [← Nat.mul_one p] at hk
     rw [mul_right_inj' hp.out.ne_zero] at hk
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : βˆ€ (n : β„•) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -97,13 +97,13 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
         rw [natDegree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, natDegree_X_add_C, mul_one,
           natDegree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _), Nat.add_one_sub_one]
           at hn hi
-        rw [hk, pow_succ, mul_assoc] at hi
+        rw [hk, pow_succ', mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
         replace hn := hn (lt_of_mul_lt_mul_left' hi)
         rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
            show ↑(_  : β„€) = Int.castRingHom (ZMod p) _ by rfl, ← coeff_map] at hn
         simpa [map_comp] using hn
-      · exact ⟨p ^ n, by rw [pow_succ]⟩
+      · exact ⟨p ^ n, by rw [pow_succ']⟩
   Β· rw [coeff_zero_eq_eval_zero, eval_comp, cyclotomic_prime_pow_eq_geom_sum hp.out, eval_add,
       eval_X, eval_one, zero_add, eval_finset_sum]
     simp only [eval_pow, eval_X, one_pow, sum_const, card_range, Nat.smul_one_eq_coe,
@@ -383,7 +383,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
     z ∈ adjoin R ({B.gen} : Set L) := by
   induction' n with n hn
   Β· simpa using hz
-  Β· rw [_root_.pow_succ, mul_smul] at hz
+  Β· rw [_root_.pow_succ', mul_smul] at hz
     exact
       hn (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (hzint.smul _) hz hei)
 #align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
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
@@ -123,9 +123,7 @@ end Cyclotomic
 section IsIntegral
 
 variable {K : Type v} {L : Type z} {p : R} [CommRing R] [Field K] [Field L]
-
 variable [Algebra K L] [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSeparable K L]
-
 variable [IsDomain R] [IsFractionRing R K] [IsIntegrallyClosed R]
 
 local notation "π“Ÿ" => Submodule.span R {(p : R)}
feat: sum and product of commuting semisimple endomorphisms (#10808)
  • Prove isSemisimple_of_mem_adjoin: if two commuting endomorphisms of a finite-dimensional vector space over a perfect field are both semisimple, then every endomorphism in the algebra generated by them (in particular their product and sum) is semisimple.

  • In the same file LinearAlgebra/Semisimple.lean, eq_zero_of_isNilpotent_isSemisimple and isSemisimple_of_squarefree_aeval_eq_zero are golfed, and IsSemisimple.minpoly_squarefree is proved

RingTheory/SimpleModule.lean:

  • Define IsSemisimpleRing R to mean that R is a semisimple R-module. add properties of simple modules and a characterization (they are exactly the quotients of the ring by maximal left ideals).

  • The annihilator of a semisimple module is a radical ideal.

  • Any module over a semisimple ring is semisimple.

  • A finite product of semisimple rings is semisimple.

  • Any quotient of a semisimple ring is semisimple.

  • Add Artin--Wedderburn as a TODO (proof_wanted).

  • Order/Atoms.lean: add the instance from IsSimpleOrder to ComplementedLattice, so that IsSimpleModule β†’ IsSemisimpleModule is automatically inferred.

Prerequisites for showing a product of semisimple rings is semisimple:

  • Algebra/Module/Submodule/Map.lean: generalize orderIsoMapComap so that it only requires RingHomSurjective rather than RingHomInvPair

  • Algebra/Ring/CompTypeclasses.lean, Mathlib/Algebra/Ring/Pi.lean, Algebra/Ring/Prod.lean: add RingHomSurjective instances

RingTheory/Artinian.lean:

  • quotNilradicalEquivPi: the quotient of a commutative Artinian ring R by its nilradical is isomorphic to the (finite) product of its quotients by maximal ideals (therefore a product of fields). equivPi: if the ring is moreover reduced, then the ring itself is a product of fields. Deduce that R is a semisimple ring and both R and R[X] are decomposition monoids. Requires RingEquiv.quotientBot in RingTheory/Ideal/QuotientOperations.lean.

  • Data/Polynomial/Eval.lean: the polynomial ring over a finite product of rings is isomorphic to the product of polynomial rings over individual rings. (Used to show R[X] is a decomposition monoid.)

Other necessary results:

  • FieldTheory/Minpoly/Field.lean: the minimal polynomial of an element in a reduced algebra over a field is radical.

  • RingTheory/PowerBasis.lean: generalize PowerBasis.finiteDimensional and rename it to .finite.

Annihilator stuff, some of which do not end up being used:

  • RingTheory/Ideal/Operations.lean: define Module.annihilator and redefine Submodule.annihilator in terms of it; add lemmas, including one that says an arbitrary intersection of radical ideals is radical. The new lemma Ideal.isRadical_iff_pow_one_lt depends on pow_imp_self_of_one_lt in Mathlib/Data/Nat/Interval.lean, which is also used to golf the proof of isRadical_iff_pow_one_lt.

  • Algebra/Module/Torsion.lean: add a lemma and an instance (unused)

  • Data/Polynomial/Module/Basic.lean: add a def (unused) and a lemma

  • LinearAlgebra/AnnihilatingPolynomial.lean: add lemma span_minpoly_eq_annihilator

Some results about idempotent linear maps (projections) and idempotent elements, used to show that any (left) ideal in a semisimple ring is spanned by an idempotent element (unused):

  • LinearAlgebra/Projection.lean: add def isIdempotentElemEquiv

  • LinearAlgebra/Span.lean: add two lemmas

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

Diff
@@ -140,7 +140,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p β€’ z)
     (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.coeff 0 := by
   -- First define some abbreviations.
-  letI := B.finiteDimensional
+  letI := B.finite
   let P := minpoly R B.gen
   obtain ⟨n, hn⟩ := Nat.exists_eq_succ_of_ne_zero B.dim_pos.ne'
   have finrank_K_L : FiniteDimensional.finrank K L = B.dim := B.finrank
@@ -243,7 +243,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
   -- First define some abbreviations.
   have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
     hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
-  letI := finiteDimensional B
+  have := B.finite
   set P := minpoly R B.gen with hP
   obtain ⟨n, hn⟩ := Nat.exists_eq_succ_of_ne_zero B.dim_pos.ne'
   haveI : NoZeroSMulDivisors R L := NoZeroSMulDivisors.trans R K L
refactor: optimize proofs with omega (#11093)

I ran tryAtEachStep on all files under Mathlib to find all locations where omega succeeds. For each that was a linarith without an only, I tried replacing it with omega, and I verified that elaboration time got smaller. (In almost all cases, there was a noticeable speedup.) I also replaced some slow aesops along the way.

Diff
@@ -328,7 +328,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
         (minpoly.monic hBint).natDegree_map (algebraMap R K), ←
         minpoly.isIntegrallyClosed_eq_field_fractions' K hBint, natDegree_minpoly, hn, Nat.sub_one,
         Nat.pred_succ]
-      linarith
+      omega
 
     -- Using `hQ : aeval B.gen Q = p β€’ z`, we write `p β€’ z` as a sum of terms of degree less than
     -- `j+1`, that are multiples of `p` by induction, and terms of degree at least `j+1`.
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -253,8 +253,8 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
   rw [adjoin_singleton_eq_range_aeval] at hz
   obtain ⟨Q₁, hQ⟩ := hz
   set Q := Q₁ %β‚˜ P with hQ₁
-  replace hQ : aeval B.gen Q = p β€’ z
-  Β· rw [← modByMonic_add_div Q₁ (minpoly.monic hBint)] at hQ
+  replace hQ : aeval B.gen Q = p β€’ z := by
+    rw [← modByMonic_add_div Q₁ (minpoly.monic hBint)] at hQ
     simpa using hQ
   by_cases hQzero : Q = 0
   Β· simp only [hQzero, Algebra.smul_def, zero_eq_mul, aeval_zero] at hQ
@@ -290,8 +290,9 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
     -- By induction hypothesis we can find `g : β„• β†’ R` such that
     -- `k ∈ range (j + 1) β†’ Q.coeff k β€’ B.gen ^ k = (algebraMap R L) p * g k β€’ B.gen ^ k`-
     choose! g hg using hind
-    replace hg : βˆ€ k ∈ range (j + 1), Q.coeff k β€’ B.gen ^ k = algebraMap R L p * g k β€’ B.gen ^ k
-    Β· intro k hk
+    replace hg : βˆ€ k ∈ range (j + 1), Q.coeff k β€’ B.gen ^ k =
+        algebraMap R L p * g k β€’ B.gen ^ k := by
+      intro k hk
       rw [hg k (mem_range_succ_iff.1 hk)
         (mem_range_succ_iff.2
           (le_trans (mem_range_succ_iff.1 hk) (succ_le_iff.1 (mem_range_succ_iff.1 hj)).le)),
feat: introduce IsRelPrime and DecompositionMonoid and refactor (#10327)
  • Introduce typeclass DecompositionMonoid, which says every element in the monoid is primal, i.e., whenever an element divides a product b * c, it can be factored into a product such that the factors divides b and c respectively. A domain is called pre-Schreier if its multiplicative monoid is a decomposition monoid, and these are more general than GCD domains.

  • Show that any GCDMonoid is a DecompositionMonoid. In order for lemmas about DecompositionMonoids to automatically apply to UniqueFactorizationMonoids, we add instances from UniqueFactorizationMonoid Ξ± to Nonempty (NormalizedGCDMonoid Ξ±) to Nonempty (GCDMonoid Ξ±) to DecompositionMonoid Ξ±. (Zulip) See the bottom of message for an updated diagram of classes and instances.

  • Introduce binary predicate IsRelPrime which says that the only common divisors of the two elements are units. Replace previous occurrences in mathlib by this predicate.

  • Duplicate all lemmas about IsCoprime in Coprime/Basic (except three lemmas about smul) to IsRelPrime. Due to import constraints, they are spread into three files Algebra/Divisibility/Units (including key lemmas assuming DecompositionMonoid), GroupWithZero/Divisibility, and Coprime/Basic.

  • Show IsCoprime always imply IsRelPrime and is equivalent to it in Bezout rings. To reduce duplication, the definition of Bezout rings and the GCDMonoid instance are moved from RingTheory/Bezout to RingTheory/PrincipalIdealDomain, and some results in PrincipalIdealDomain are generalized to Bezout rings.

  • Remove the recently added file Squarefree/UniqueFactorizationMonoid and place the results appropriately within Squarefree/Basic. All results are generalized to DecompositionMonoid or weaker except the last one.

Zulip

With this PR, all the following instances (indicated by arrows) now work; this PR fills the central part.

                                                                          EuclideanDomain (bundled)
                                                                              ↙          β†–
                                                                 IsPrincipalIdealRing ← Field (bundled)
                                                                            ↓             ↓
         NormalizationMonoid ←          NormalizedGCDMonoid β†’ GCDMonoid  IsBezout ← ValuationRing ← DiscreteValuationRing
                   ↓                             ↓                 β†˜       ↙
Nonempty NormalizationMonoid ← Nonempty NormalizedGCDMonoid β†’  Nonempty GCDMonoid β†’ IsIntegrallyClosed
                                                 ↑                    ↓
                    WfDvdMonoid ← UniqueFactorizationMonoid β†’ DecompositionMonoid
                                                 ↑
                                       IsPrincipalIdealRing

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: Oliver Nash <github@olivernash.org>

Diff
@@ -370,7 +370,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
     have hppdiv : p ^ B.dim ∣ p ^ B.dim * r := dvd_mul_of_dvd_left dvd_rfl _
     rwa [← IsFractionRing.injective R K hQ, mul_comm, ← Units.coe_neg_one, mul_pow, ←
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
-      IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv
+      Units.dvd_mul_left, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv
 #align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt
 
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
fix: patch for std4#203 (more sub lemmas for Nat) (#6216)
Diff
@@ -95,7 +95,7 @@ theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (
       Β· simp only [ite_eq_right_iff]
         rintro ⟨k, hk⟩
         rw [natDegree_comp, show (X + 1 : β„€[X]) = X + C 1 by simp, natDegree_X_add_C, mul_one,
-          natDegree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _), Nat.succ_sub_one]
+          natDegree_cyclotomic, Nat.totient_prime_pow hp.out (Nat.succ_pos _), Nat.add_one_sub_one]
           at hn hi
         rw [hk, pow_succ, mul_assoc] at hi
         rw [hk, mul_comm, Nat.mul_div_cancel _ hp.out.pos]
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

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

Diff
@@ -44,7 +44,7 @@ open Polynomial
 theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     ((cyclotomic p β„€).comp (X + 1)).IsEisensteinAt π“Ÿ := by
   refine Monic.isEisensteinAt_of_mem_of_not_mem ?_
-      (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (by exact_mod_cast hp.out.ne_zero)).2 <|
+      (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (mod_cast hp.out.ne_zero)).2 <|
         Nat.prime_iff_prime_int.1 hp.out) (fun {i hi} => ?_) ?_
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine (cyclotomic.monic p β„€).comp (monic_X_add_C 1) fun h => ?_
@@ -77,7 +77,7 @@ set_option linter.uppercaseLean3 false in
 theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
     ((cyclotomic (p ^ (n + 1)) β„€).comp (X + 1)).IsEisensteinAt π“Ÿ := by
   refine Monic.isEisensteinAt_of_mem_of_not_mem ?_
-      (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (by exact_mod_cast hp.out.ne_zero)).2 <|
+      (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (mod_cast hp.out.ne_zero)).2 <|
         Nat.prime_iff_prime_int.1 hp.out) ?_ ?_
   Β· rw [show (X + 1 : β„€[X]) = X + C 1 by simp]
     refine (cyclotomic.monic _ β„€).comp (monic_X_add_C 1) fun h => ?_
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_map β†’ RingHom.isIntegralElem_map RingHom.is_integral_of_mem_closure β†’ RingHom.IsIntegralElem.of_mem_closure RingHom.is_integral_zero/one β†’ RingHom.isIntegralElem_zero/one RingHom.is_integral_add/neg/sub/mul/of_mul_unit β†’ RingHom.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_trans β†’ RingHom.IsIntegral.trans RingHom.isIntegral_quotient/tower_bot/top_of_isIntegral β†’ RingHom.IsIntegral.quotient/tower_bot/top isIntegral_of_mem_closure' β†’ IsIntegral.of_mem_closure' (and the '' version) isIntegral_of_surjective β†’ Algebra.isIntegral_of_surjective

The next changed file is RingTheory/Algebraic:

  • Rename: of_larger_base β†’ tower_top (for consistency with IsIntegral) Algebra.isAlgebraic_of_finite β†’ Algebra.IsAlgebraic.of_finite Algebra.isAlgebraic_trans β†’ Algebra.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
@@ -174,9 +174,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
   have hintsum :
     IsIntegral R
       (z * B.gen ^ n - βˆ‘ x : β„• in (range (Q.natDegree + 1)).erase 0, Q.coeff x β€’ f (x + n)) := by
-    refine
-      IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
-        (IsIntegral.sum _ fun i hi => IsIntegral.smul _ ?_)
+    refine (hzint.mul (hBint.pow _)).sub (.sum _ fun i hi => .smul _ ?_)
     exact adjoin_le_integralClosure hBint (hf _ (aux i hi)).1
   obtain ⟨r, hr⟩ := isIntegral_iff.1 (isIntegral_norm K hintsum)
   use r
@@ -351,10 +349,9 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
         (βˆ‘ x : β„• in (range (Q.natDegree - j)).erase 0,
           Q.coeff (j + 1 + x) β€’ f (x + P.natDegree - 1) +
             βˆ‘ x : β„• in range (j + 1), g x β€’ B.gen ^ x * B.gen ^ (P.natDegree - (j + 2)))) := by
-      refine IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
-          (IsIntegral.add (IsIntegral.sum _ fun k hk => IsIntegral.smul _ ?_)
-            (IsIntegral.sum _ fun k _ =>
-              IsIntegral.mul (IsIntegral.smul _ (IsIntegral.pow hBint _)) (IsIntegral.pow hBint _)))
+      refine (hzint.mul (hBint.pow _)).sub
+        (.add (.sum _ fun k hk => .smul _ ?_)
+          (.sum _ fun k _ => .mul (.smul _ (.pow hBint _)) (hBint.pow _)))
       refine adjoin_le_integralClosure hBint (hf _ ?_).1
       rw [(minpoly.monic hBint).natDegree_map (algebraMap R L)]
       rw [add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
@@ -389,9 +386,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
   Β· simpa using hz
   Β· rw [_root_.pow_succ, mul_smul] at hz
     exact
-      hn
-        (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint
-          (IsIntegral.smul _ hzint) hz hei)
+      hn (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint (hzint.smul _) hz hei)
 #align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
 
 end IsIntegral
chore(RingTheory/{Algebraic, Localization/Integral}): rename decls to use dot notation (#8437)

This PR tests a string-based tool for renaming declarations.

Inspired by this Zulip thread, I am trying to reduce the diff of #8406.

This PR makes the following renames:

| From | To |

Diff
@@ -175,8 +175,8 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
     IsIntegral R
       (z * B.gen ^ n - βˆ‘ x : β„• in (range (Q.natDegree + 1)).erase 0, Q.coeff x β€’ f (x + n)) := by
     refine
-      isIntegral_sub (isIntegral_mul hzint (IsIntegral.pow hBint _))
-        (IsIntegral.sum _ fun i hi => isIntegral_smul _ ?_)
+      IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
+        (IsIntegral.sum _ fun i hi => IsIntegral.smul _ ?_)
     exact adjoin_le_integralClosure hBint (hf _ (aux i hi)).1
   obtain ⟨r, hr⟩ := isIntegral_iff.1 (isIntegral_norm K hintsum)
   use r
@@ -351,10 +351,10 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis
         (βˆ‘ x : β„• in (range (Q.natDegree - j)).erase 0,
           Q.coeff (j + 1 + x) β€’ f (x + P.natDegree - 1) +
             βˆ‘ x : β„• in range (j + 1), g x β€’ B.gen ^ x * B.gen ^ (P.natDegree - (j + 2)))) := by
-      refine isIntegral_sub (isIntegral_mul hzint (IsIntegral.pow hBint _))
-          (isIntegral_add (IsIntegral.sum _ fun k hk => isIntegral_smul _ ?_)
+      refine IsIntegral.sub (IsIntegral.mul hzint (IsIntegral.pow hBint _))
+          (IsIntegral.add (IsIntegral.sum _ fun k hk => IsIntegral.smul _ ?_)
             (IsIntegral.sum _ fun k _ =>
-              isIntegral_mul (isIntegral_smul _ (IsIntegral.pow hBint _)) (IsIntegral.pow hBint _)))
+              IsIntegral.mul (IsIntegral.smul _ (IsIntegral.pow hBint _)) (IsIntegral.pow hBint _)))
       refine adjoin_le_integralClosure hBint (hf _ ?_).1
       rw [(minpoly.monic hBint).natDegree_map (algebraMap R L)]
       rw [add_comm, Nat.add_sub_assoc, le_add_iff_nonneg_right]
@@ -391,7 +391,7 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBa
     exact
       hn
         (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint
-          (isIntegral_smul _ hzint) hz hei)
+          (IsIntegral.smul _ hzint) hz hei)
 #align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
 
 end IsIntegral
chore: use _root_.map_sum more consistently (#7189)

Also _root_.map_smul when in the neighbourhood.

Diff
@@ -50,7 +50,7 @@ theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     refine (cyclotomic.monic p β„€).comp (monic_X_add_C 1) fun h => ?_
     rw [natDegree_X_add_C] at h
     exact zero_ne_one h.symm
-  Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, LinearMap.map_sum]
+  Β· rw [cyclotomic_prime, geom_sum_X_comp_X_add_one_eq_sum, ← lcoeff_apply, map_sum]
     conv =>
       congr
       congr
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
@@ -216,7 +216,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
     simp
 #align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt
 
-theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [CommRing B]
+theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type*} [CommSemiring A] [CommRing B]
     [Algebra A B] [NoZeroSMulDivisors A B] {Q : A[X]} {p : A} {x z : B} (hp : p β‰  0)
     (hQ : βˆ€ i ∈ range (Q.natDegree + 1), p ∣ Q.coeff i) (hz : aeval x Q = p β€’ z) :
     z ∈ adjoin A ({x} : Set B) := by
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,17 +2,14 @@
 Copyright (c) 2022 Riccardo Brasca. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Riccardo Brasca
-
-! This file was ported from Lean 3 source module ring_theory.polynomial.eisenstein.is_integral
-! leanprover-community/mathlib commit 5bfbcca0a7ffdd21cf1682e59106d6c942434a32
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Nat.Choose.Dvd
 import Mathlib.RingTheory.IntegrallyClosed
 import Mathlib.RingTheory.Norm
 import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand
 
+#align_import ring_theory.polynomial.eisenstein.is_integral from "leanprover-community/mathlib"@"5bfbcca0a7ffdd21cf1682e59106d6c942434a32"
+
 /-!
 # Eisenstein polynomials
 In this file we gather more miscellaneous results about Eisenstein polynomials
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
@@ -162,7 +162,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow
       p ^ n.succ ∣ Q.coeff 0 ^ n.succ * ((-1) ^ (n.succ * n) * (minpoly R B.gen).coeff 0 ^ n) by
     have hndiv : ¬p ^ 2 ∣ (minpoly R B.gen).coeff 0 := fun h =>
       hei.not_mem ((span_singleton_pow p 2).symm β–Έ Ideal.mem_span_singleton.2 h)
-    refine @Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd R _ _ _ _ n hp (?_ : _ ∣ _)  hndiv
+    refine @Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd R _ _ _ _ n hp (?_ : _ ∣ _) hndiv
     convert (IsUnit.dvd_mul_right ⟨(-1) ^ (n.succ * n), rfl⟩).mpr this using 1
     push_cast
     ring_nf
chore: tidy various files (#5458)
Diff
@@ -18,11 +18,11 @@ import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand
 In this file we gather more miscellaneous results about Eisenstein polynomials
 
 ## Main results
-* `mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at`: let `K` be the field of fraction
+* `mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt`: let `K` be the field of fraction
   of an integrally closed domain `R` and let `L` be a separable extension of `K`, generated by an
   integral power basis `B` such that the minimal polynomial of `B.gen` is Eisenstein at `p`. Given
   `z : L` integral over `R`, if `p ^ n β€’ z ∈ adjoin R {B.gen}`, then `z ∈ adjoin R {B.gen}`.
-  Together with `algebra.discr_mul_is_integral_mem_adjoin` this result often allows to compute the
+  Together with `Algebra.discr_mul_isIntegral_mem_adjoin` this result often allows to compute the
   ring of integers of `L`.
 
 -/
@@ -40,13 +40,11 @@ section Cyclotomic
 
 variable (p : β„•)
 
--- Porting note: to prevent Lean complaigning about this notation
-set_option quotPrecheck false
-local notation "π“Ÿ" => Submodule.span β„€ {↑p}
+local notation "π“Ÿ" => Submodule.span β„€ {(p : β„€)}
 
 open Polynomial
 
-theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
+theorem cyclotomic_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] :
     ((cyclotomic p β„€).comp (X + 1)).IsEisensteinAt π“Ÿ := by
   refine Monic.isEisensteinAt_of_mem_of_not_mem ?_
       (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (by exact_mod_cast hp.out.ne_zero)).2 <|
@@ -77,9 +75,9 @@ theorem cyclotomic_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] :
     rw [mul_right_inj' hp.out.ne_zero] at hk
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 set_option linter.uppercaseLean3 false in
-#align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_x_add_one_isEisensteinAt
+#align cyclotomic_comp_X_add_one_is_eisenstein_at cyclotomic_comp_X_add_one_isEisensteinAt
 
-theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
+theorem cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt [hp : Fact p.Prime] (n : β„•) :
     ((cyclotomic (p ^ (n + 1)) β„€).comp (X + 1)).IsEisensteinAt π“Ÿ := by
   refine Monic.isEisensteinAt_of_mem_of_not_mem ?_
       (Ideal.IsPrime.ne_top <| (Ideal.span_singleton_prime (by exact_mod_cast hp.out.ne_zero)).2 <|
@@ -91,7 +89,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
   Β· induction' n with n hn
     Β· intro i hi
       rw [Nat.zero_add, pow_one] at hi ⊒
-      exact (cyclotomic_comp_x_add_one_isEisensteinAt p).mem hi
+      exact (cyclotomic_comp_X_add_one_isEisensteinAt p).mem hi
     Β· intro i hi
       rw [Ideal.submodule_span_eq, Ideal.mem_span_singleton, ← ZMod.int_cast_zmod_eq_zero_iff_dvd,
         show ↑(_  : β„€) = Int.castRingHom (ZMod p) _ by rfl, ← coeff_map, map_comp, map_cyclotomic,
@@ -121,7 +119,7 @@ theorem cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt [hp : Fact p.Prime] (
     rw [mul_right_inj' hp.out.ne_zero] at hk
     exact Nat.Prime.not_dvd_one hp.out (Dvd.intro k hk.symm)
 set_option linter.uppercaseLean3 false in
-#align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_x_add_one_isEisensteinAt
+#align cyclotomic_prime_pow_comp_X_add_one_is_eisenstein_at cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt
 
 end Cyclotomic
 
@@ -133,9 +131,7 @@ variable [Algebra K L] [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSepa
 
 variable [IsDomain R] [IsFractionRing R K] [IsIntegrallyClosed R]
 
--- Porting note: to prevent Lean complaigning about this notation
-set_option quotPrecheck false
-local notation "π“Ÿ" => Submodule.span R {p}
+local notation "π“Ÿ" => Submodule.span R {(p : R)}
 
 open IsIntegrallyClosed PowerBasis Nat Polynomial IsScalarTower
 
@@ -143,7 +139,7 @@ open IsIntegrallyClosed PowerBasis Nat Polynomial IsScalarTower
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `Q : R[X]` is such that
 `aeval B.gen Q = p β€’ z`, then `p ∣ Q.coeff 0`. -/
-theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
+theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p β€’ z)
     (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) : p ∣ Q.coeff 0 := by
   -- First define some abbreviations.
@@ -221,7 +217,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at {B :
   Β· rw [aeval_eq_sum_range,
       Finset.add_sum_erase (range (Q.natDegree + 1)) fun i => Q.coeff i β€’ B.gen ^ i]
     simp
-#align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at
+#align dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt
 
 theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [CommRing B]
     [Algebra A B] [NoZeroSMulDivisors A B] {Q : A[X]} {p : A} {x z : B} (hp : p β‰  0)
@@ -245,7 +241,7 @@ theorem mem_adjoin_of_dvd_coeff_of_dvd_aeval {A B : Type _} [CommSemiring A] [Co
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p β€’ z ∈ adjoin R {B.gen}`, then
 `z ∈ adjoin R {B.gen}`. -/
-theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
+theorem mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} (hzint : IsIntegral R z)
     (hz : p β€’ z ∈ adjoin R ({B.gen} : Set L)) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) :
     z ∈ adjoin R ({B.gen} : Set L) := by
@@ -276,15 +272,15 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     Β· rw [H₁]
       exact Subalgebra.zero_mem _
   -- It is enough to prove that all coefficients of `Q` are divisible by `p`, by induction.
-  -- The base case is `dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at`.
+  -- The base case is `dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt`.
   refine mem_adjoin_of_dvd_coeff_of_dvd_aeval hp.ne_zero (fun i => ?_) hQ
   induction' i using Nat.case_strong_induction_on with j hind
   Β· intro _
-    exact dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_is_eiseinstein_at hp hBint hQ hzint hei
+    exact dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt hp hBint hQ hzint hei
   Β· intro hj
     convert hp.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd _ hndiv
     exact n
-    -- Two technical results we will need about `P.nat_degree` and `Q.nat_degree`.
+    -- Two technical results we will need about `P.natDegree` and `Q.natDegree`.
     have H := degree_modByMonic_lt Q₁ (minpoly.monic hBint)
     rw [← hQ₁, ← hP] at H
     replace H := Nat.lt_iff_add_one_le.1
@@ -342,7 +338,7 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     -- `j+1`, that are multiples of `p` by induction, and terms of degree at least `j+1`.
     rw [aeval_eq_sum_range, Hj, range_add, sum_union (disjoint_range_addLeftEmbedding _ _),
       sum_congr rfl hg, add_comm] at hQ
-    -- We multiply this equality by `B.gen ^ (P.nat_degree-(j+2))`, so we can use `hf₁` on the terms
+    -- We multiply this equality by `B.gen ^ (P.natDegree-(j+2))`, so we can use `hf₁` on the terms
     -- we didn't know were multiples of `p`, and we take the norm on both sides.
     replace hQ := congr_arg (fun x => x * B.gen ^ (P.natDegree - (j + 2))) hQ
     simp_rw [sum_map, addLeftEmbedding_apply, add_mul, sum_mul, mul_assoc] at hQ
@@ -381,14 +377,14 @@ theorem mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at {B : PowerBas
     rwa [← IsFractionRing.injective R K hQ, mul_comm, ← Units.coe_neg_one, mul_pow, ←
       Units.val_pow_eq_pow_val, ← Units.val_pow_eq_pow_val, mul_assoc,
       IsUnit.dvd_mul_left _ _ _ ⟨_, rfl⟩, mul_comm, ← Nat.succ_eq_add_one, hn] at hppdiv
-#align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at
+#align mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt
 
 /-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
 extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
 `B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p ^ n β€’ z ∈ adjoin R {B.gen}`,
-then `z ∈ adjoin R {B.gen}`. Together with `algebra.discr_mul_is_integral_mem_adjoin` this result
+then `z ∈ adjoin R {B.gen}`. Together with `Algebra.discr_mul_isIntegral_mem_adjoin` this result
 often allows to compute the ring of integers of `L`. -/
-theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : PowerBasis K L}
+theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
     (hp : Prime p) (hBint : IsIntegral R B.gen) {n : β„•} {z : L} (hzint : IsIntegral R z)
     (hz : p ^ n β€’ z ∈ adjoin R ({B.gen} : Set L)) (hei : (minpoly R B.gen).IsEisensteinAt π“Ÿ) :
     z ∈ adjoin R ({B.gen} : Set L) := by
@@ -397,8 +393,8 @@ theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at {B : Powe
   Β· rw [_root_.pow_succ, mul_smul] at hz
     exact
       hn
-        (mem_adjoin_of_smul_prime_smul_of_minpoly_is_eiseinstein_at hp hBint
+        (mem_adjoin_of_smul_prime_smul_of_minpoly_isEisensteinAt hp hBint
           (isIntegral_smul _ hzint) hz hei)
-#align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at
+#align mem_adjoin_of_smul_prime_pow_smul_of_minpoly_is_eiseinstein_at mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt
 
 end IsIntegral
feat: port RingTheory.Polynomial.Eisenstein.IsIntegral (#5302)

Fix also some names in RingTheory.Polynomial.Eisenstein.Basic that are in the wrong namespace.

Dependencies 12 + 922

923 files ported (98.7%)
395618 lines ported (98.6%)
Show graph

The unported dependencies are

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