Skip to content

Commit aef4be2

Browse files
committed
refactor(Algebra/Polynomial/Splits): continue deprecation (leanprover-community#32752)
This PR continues the deprecation in Splits.lean as we move over to the new API in Factors.lean. Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent 7feaee8 commit aef4be2

7 files changed

Lines changed: 60 additions & 49 deletions

File tree

Mathlib/Algebra/Polynomial/Factors.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,28 @@ theorem Splits.adjoin_rootSet_eq_range {A B : Type*} [CommRing A] [CommRing B]
376376
rw [← hf.image_rootSet g, Algebra.adjoin_image, ← Algebra.map_top]
377377
exact (Subalgebra.map_injective g.injective).eq_iff
378378

379+
theorem Splits.coeff_zero_eq_leadingCoeff_mul_prod_roots (hf : Splits f) :
380+
f.coeff 0 = (-1) ^ f.natDegree * f.leadingCoeff * f.roots.prod := by
381+
conv_lhs => rw [hf.eq_prod_roots]
382+
simp [coeff_zero_eq_eval_zero, eval_multiset_prod, hf.natDegree_eq_card_roots,
383+
mul_assoc, mul_left_comm]
384+
385+
/-- If `f` is a monic polynomial that splits, then `coeff f 0` equals the product of the roots. -/
386+
theorem Splits.coeff_zero_eq_prod_roots_of_monic (hf : Splits f) (hm : Monic f) :
387+
coeff f 0 = (-1) ^ f.natDegree * f.roots.prod := by
388+
simp [hf.coeff_zero_eq_leadingCoeff_mul_prod_roots, hm]
389+
390+
theorem Splits.nextCoeff_eq_neg_sum_roots_mul_leadingCoeff (hf : Splits f) :
391+
f.nextCoeff = -f.leadingCoeff * f.roots.sum := by
392+
conv_lhs => rw [hf.eq_prod_roots]
393+
simp [Multiset.sum_map_neg', monic_X_sub_C, Monic.nextCoeff_multiset_prod]
394+
395+
/-- If `f` is a monic polynomial that splits, then `f.nextCoeff` equals the negative of the sum
396+
of the roots. -/
397+
theorem Splits.nextCoeff_eq_neg_sum_roots_of_monic (hf : Splits f) (hm : Monic f) :
398+
f.nextCoeff = -f.roots.sum := by
399+
simp [hf.nextCoeff_eq_neg_sum_roots_mul_leadingCoeff,hm]
400+
379401
theorem splits_X_sub_C_mul_iff {a : R} : Splits ((X - C a) * f) ↔ Splits f := by
380402
refine ⟨fun hf ↦ ?_, ((Splits.X_sub_C _).mul ·)⟩
381403
by_cases hf₀ : f = 0
@@ -518,6 +540,18 @@ theorem Splits.natDegree_eq_one_of_irreducible {f : R[X]} (hf : Splits f)
518540
(h : Irreducible f) : natDegree f = 1 :=
519541
natDegree_eq_of_degree_eq_some (hf.degree_eq_one_of_irreducible h)
520542

543+
theorem Splits.eval_derivative_eq_eval_mul_sum (hf : Splits f) {x : R} (hx : f.eval x ≠ 0) :
544+
f.derivative.eval x = f.eval x * (f.roots.map fun z ↦ 1 / (x - z)).sum := by
545+
classical
546+
simp only [hf.eval_derivative, hf.eval_eq_prod_roots, ← Multiset.sum_map_mul_left, mul_assoc]
547+
refine congr_arg Multiset.sum (Multiset.map_congr rfl fun z hz ↦ ?_)
548+
rw [← Multiset.prod_map_erase hz, mul_one_div, mul_div_cancel_left₀]
549+
aesop (add simp sub_eq_zero)
550+
551+
theorem Splits.eval_derivative_div_eval_of_ne_zero (hf : Splits f) {x : R} (hx : f.eval x ≠ 0) :
552+
f.derivative.eval x / f.eval x = (f.roots.map fun z ↦ 1 / (x - z)).sum := by
553+
rw [hf.eval_derivative_eq_eval_mul_sum hx, mul_div_cancel_left₀ _ hx]
554+
521555
theorem Splits.mem_subfield_of_isRoot (F : Subfield R) {f : F[X]} (hf : Splits f) (hf0 : f ≠ 0)
522556
{x : R} (hx : (f.map F.subtype).IsRoot x) : x ∈ F := by
523557
simpa using hf.mem_range_of_isRoot hf0 hx

Mathlib/Algebra/Polynomial/Splits.lean

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -285,48 +285,25 @@ alias eval_derivative_of_splits := Splits.eval_derivative
285285
@[deprecated (since := "2025-12-08")]
286286
alias aeval_root_derivative_of_splits := Splits.eval_root_derivative
287287

288-
theorem eval_derivative_eq_eval_mul_sum_of_splits {p : K[X]} {x : K}
289-
(h : p.Splits) (hx : p.eval x ≠ 0) :
290-
p.derivative.eval x = p.eval x * (p.roots.map fun z ↦ 1 / (x - z)).sum := by
291-
classical
292-
suffices p.roots.map (fun z ↦ p.leadingCoeff * ((p.roots.erase z).map (fun w ↦ x - w) ).prod) =
293-
p.roots.map fun i ↦ p.leadingCoeff * ((x - i)⁻¹ * (p.roots.map (fun z ↦ x - z)).prod) by
294-
nth_rw 2 [Splits.eq_prod_roots h]
295-
simp [h.eval_derivative, ← Multiset.sum_map_mul_left, this, eval_multiset_prod,
296-
mul_comm, mul_left_comm]
297-
refine Multiset.map_congr rfl fun z hz ↦ ?_
298-
rw [← Multiset.prod_map_erase hz, inv_mul_cancel_left₀]
299-
aesop (add simp sub_eq_zero)
300-
301-
theorem eval_derivative_div_eval_of_ne_zero_of_splits {p : K[X]} {x : K}
302-
(h : p.Splits) (hx : p.eval x ≠ 0) :
303-
p.derivative.eval x / p.eval x = (p.roots.map fun z ↦ 1 / (x - z)).sum := by
304-
rw [eval_derivative_eq_eval_mul_sum_of_splits h hx]
305-
exact mul_div_cancel_left₀ _ hx
306-
307-
theorem coeff_zero_eq_leadingCoeff_mul_prod_roots_of_splits {P : K[X]}
308-
(hP : P.Splits) :
309-
P.coeff 0 = (-1) ^ P.natDegree * P.leadingCoeff * P.roots.prod := by
310-
nth_rw 1 [hP.eq_prod_roots]
311-
simp only [coeff_zero_eq_eval_zero, eval_mul, eval_C, eval_multiset_prod, Function.comp_apply,
312-
Multiset.map_map, eval_sub, eval_X, zero_sub, Multiset.prod_map_neg]
313-
grind [splits_iff_card_roots]
314-
315-
/-- If `P` is a monic polynomial that splits, then `coeff P 0` equals the product of the roots. -/
316-
theorem coeff_zero_eq_prod_roots_of_monic_of_splits {P : K[X]} (hmo : P.Monic)
317-
(hP : P.Splits) : coeff P 0 = (-1) ^ P.natDegree * P.roots.prod := by
318-
simp [hmo, coeff_zero_eq_leadingCoeff_mul_prod_roots_of_splits hP]
319-
320-
theorem nextCoeff_eq_neg_sum_roots_mul_leadingCoeff_of_splits {P : K[X]}
321-
(hP : P.Splits) : P.nextCoeff = -P.leadingCoeff * P.roots.sum := by
322-
nth_rw 1 [Splits.eq_prod_roots hP]
323-
simp [Multiset.sum_map_neg', monic_X_sub_C, Monic.nextCoeff_multiset_prod]
324-
325-
/-- If `P` is a monic polynomial that splits, then `P.nextCoeff` equals the negative of the sum
326-
of the roots. -/
327-
theorem nextCoeff_eq_neg_sum_roots_of_monic_of_splits {P : K[X]} (hmo : P.Monic)
328-
(hP : P.Splits) : P.nextCoeff = -P.roots.sum := by
329-
simp [hmo, nextCoeff_eq_neg_sum_roots_mul_leadingCoeff_of_splits hP]
288+
@[deprecated (since := "2025-12-12")]
289+
alias eval_derivative_eq_eval_mul_sum_of_splits := Splits.eval_derivative_eq_eval_mul_sum
290+
291+
@[deprecated (since := "2025-12-12")]
292+
alias eval_derivative_div_eval_of_ne_zero_of_splits := Splits.eval_derivative_div_eval_of_ne_zero
293+
294+
@[deprecated (since := "2025-12-12")]
295+
alias coeff_zero_eq_leadingCoeff_mul_prod_roots_of_splits :=
296+
Splits.coeff_zero_eq_leadingCoeff_mul_prod_roots
297+
298+
@[deprecated (since := "2025-12-12")]
299+
alias coeff_zero_eq_prod_roots_of_monic_of_splits := Splits.coeff_zero_eq_prod_roots_of_monic
300+
301+
@[deprecated (since := "2025-12-12")]
302+
alias nextCoeff_eq_neg_sum_roots_mul_leadingCoeff_of_splits :=
303+
Splits.nextCoeff_eq_neg_sum_roots_mul_leadingCoeff
304+
305+
@[deprecated (since := "2025-12-12")]
306+
alias nextCoeff_eq_neg_sum_roots_of_monic_of_splits := Splits.nextCoeff_eq_neg_sum_roots_of_monic
330307

331308
@[deprecated (since := "2025-10-08")]
332309
alias prod_roots_eq_coeff_zero_of_monic_of_splits := coeff_zero_eq_prod_roots_of_monic_of_splits

Mathlib/Analysis/Complex/Polynomial/GaussLucas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ theorem eq_centerMass_of_eval_derivative_eq_zero (hP : 0 < P.degree)
8686
_ = conj (P.roots.map fun x ↦ 1 / (z - x)).sum := by
8787
simp only [Finset.sum_multiset_map_count, P.count_roots, s]
8888
_ = 0 := by
89-
rw [← eval_derivative_div_eval_of_ne_zero_of_splits (IsAlgClosed.splits _) hzP]
89+
rw [← (IsAlgClosed.splits _).eval_derivative_div_eval_of_ne_zero hzP]
9090
simp [hz]
9191

9292
/-- *Gauss-Lucas Theorem*: if $P$ is a nonconstant polynomial with complex coefficients,

Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ theorem spectralNorm_eq_norm_coeff_zero_rpow (x : L) :
963963
← @spectralNorm_extends K _ L _ _ ((minpoly K x).coeff 0),
964964
@spectralNorm.eq_of_tower K _ E _ _ L, ← spectralMulAlgNorm_def,
965965
← spectralMulAlgNorm_def, Polynomial.coeff_zero_of_isScalarTower,
966-
Polynomial.coeff_zero_eq_prod_roots_of_monic_of_splits _ hspl, map_mul, map_pow,
966+
hspl.coeff_zero_eq_prod_roots_of_monic _, map_mul, map_pow,
967967
map_neg_eq_map, map_one, one_pow, one_mul, spectralNorm_pow_natDegree_eq_prod_roots _ _ x]
968968
· simp [monic_mapAlg_iff, minpoly.monic (Algebra.IsAlgebraic.isAlgebraic x).isIntegral]
969969
· exact_mod_cast (minpoly.natDegree_pos (Algebra.IsIntegral.isIntegral x)).ne'

Mathlib/LinearAlgebra/Matrix/Charpoly/Eigs.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ theorem mem_spectrum_iff_isRoot_charpoly {r : K} : r ∈ spectrum K A ↔ IsRoot
8080
theorem det_eq_prod_roots_charpoly_of_splits (hAps : A.charpoly.Splits) :
8181
A.det = (Matrix.charpoly A).roots.prod := by
8282
rw [det_eq_sign_charpoly_coeff, ← charpoly_natDegree_eq_dim A,
83-
Polynomial.coeff_zero_eq_prod_roots_of_monic_of_splits A.charpoly_monic hAps, ← mul_assoc,
83+
hAps.coeff_zero_eq_prod_roots_of_monic A.charpoly_monic, ← mul_assoc,
8484
← pow_two, pow_right_comm, neg_one_sq, one_pow, one_mul]
8585

8686
theorem trace_eq_sum_roots_charpoly_of_splits (hAps : A.charpoly.Splits) :
@@ -90,7 +90,7 @@ theorem trace_eq_sum_roots_charpoly_of_splits (hAps : A.charpoly.Splits) :
9090
det_eq_one_of_card_eq_zero (Fintype.card_eq_zero_iff.2 h), Polynomial.roots_one,
9191
Multiset.empty_eq_zero, Multiset.sum_zero]
9292
· rw [trace_eq_neg_charpoly_nextCoeff, neg_eq_iff_eq_neg,
93-
Polynomial.nextCoeff_eq_neg_sum_roots_of_monic_of_splits A.charpoly_monic hAps]
93+
hAps.nextCoeff_eq_neg_sum_roots_of_monic A.charpoly_monic]
9494

9595
variable (A)
9696

Mathlib/RingTheory/Norm/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
7676
have := minpoly.monic pb.isIntegral_gen
7777
rw [PowerBasis.norm_gen_eq_coeff_zero_minpoly, ← pb.natDegree_minpoly, map_mul,
7878
← coeff_map,
79-
coeff_zero_eq_prod_roots_of_monic_of_splits (this.map _) hf,
79+
hf.coeff_zero_eq_prod_roots_of_monic (this.map _),
8080
this.natDegree_map, map_pow, ← mul_assoc, ← mul_pow]
8181
simp only [map_neg, map_one, neg_mul, neg_neg, one_pow, one_mul]
8282

Mathlib/RingTheory/Trace/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ theorem PowerBasis.trace_gen_eq_sum_roots [Nontrivial S] (pb : PowerBasis K S)
9090
(hf : ((minpoly K pb.gen).map (algebraMap K F)).Splits) :
9191
algebraMap K F (trace K S pb.gen) = ((minpoly K pb.gen).aroots F).sum := by
9292
rw [PowerBasis.trace_gen_eq_nextCoeff_minpoly, map_neg,
93-
← nextCoeff_map_eq, nextCoeff_eq_neg_sum_roots_of_monic_of_splits
94-
((minpoly.monic (PowerBasis.isIntegral_gen _)).map _) hf,
93+
← nextCoeff_map_eq, hf.nextCoeff_eq_neg_sum_roots_of_monic
94+
((minpoly.monic (PowerBasis.isIntegral_gen _)).map _),
9595
neg_neg]
9696

9797
namespace IntermediateField.AdjoinSimple

0 commit comments

Comments
 (0)