@@ -618,9 +618,22 @@ lemma exists_eval_ne_zero_of_natDegree_lt_card (f : R[X]) (hf : f ≠ 0) (hfR :
618
618
contrapose! hf
619
619
exact eq_zero_of_forall_eval_zero_of_natDegree_lt_card f hf hfR
620
620
621
- theorem monic_prod_multiset_X_sub_C : Monic (p.roots.map fun a => X - C a).prod :=
621
+ section
622
+
623
+ omit [IsDomain R]
624
+
625
+ theorem monic_multisetProd_X_sub_C (s : Multiset R) : Monic (s.map fun a => X - C a).prod :=
622
626
monic_multiset_prod_of_monic _ _ fun a _ => monic_X_sub_C a
623
627
628
+ theorem monic_prod_X_sub_C {α : Type *} (b : α → R) (s : Finset α) :
629
+ Monic (∏ a ∈ s, (X - C (b a))) :=
630
+ monic_prod_of_monic _ _ fun a _ => monic_X_sub_C (b a)
631
+
632
+ theorem monic_finprod_X_sub_C {α : Type *} (b : α → R) : Monic (∏ᶠ k, (X - C (b k))) :=
633
+ monic_finprod_of_monic _ _ fun a _ => monic_X_sub_C (b a)
634
+
635
+ end
636
+
624
637
theorem prod_multiset_root_eq_finset_root [DecidableEq R] :
625
638
(p.roots.map fun a => X - C a).prod =
626
639
p.roots.toFinset.prod fun a => (X - C a) ^ rootMultiplicity a p := by
@@ -629,7 +642,8 @@ theorem prod_multiset_root_eq_finset_root [DecidableEq R] :
629
642
/-- The product `∏ (X - a)` for `a` inside the multiset `p.roots` divides `p`. -/
630
643
theorem prod_multiset_X_sub_C_dvd (p : R[X]) : (p.roots.map fun a => X - C a).prod ∣ p := by
631
644
classical
632
- rw [← map_dvd_map _ (IsFractionRing.injective R <| FractionRing R) monic_prod_multiset_X_sub_C]
645
+ rw [← map_dvd_map _ (IsFractionRing.injective R <| FractionRing R)
646
+ (monic_multisetProd_X_sub_C p.roots)]
633
647
rw [prod_multiset_root_eq_finset_root, Polynomial.map_prod]
634
648
refine Finset.prod_dvd_of_coprime (fun a _ b _ h => ?_) fun a _ => ?_
635
649
· simp_rw [Polynomial.map_pow, Polynomial.map_sub, map_C, map_X]
@@ -660,16 +674,17 @@ theorem exists_prod_multiset_X_sub_C_mul (p : R[X]) :
660
674
simp
661
675
constructor
662
676
· conv_rhs => rw [he]
663
- rw [monic_prod_multiset_X_sub_C.natDegree_mul' hq, natDegree_multiset_prod_X_sub_C_eq_card]
677
+ rw [(monic_multisetProd_X_sub_C p.roots).natDegree_mul' hq,
678
+ natDegree_multiset_prod_X_sub_C_eq_card]
664
679
· replace he := congr_arg roots he.symm
665
680
rw [roots_mul, roots_multiset_prod_X_sub_C] at he
666
- exacts [add_eq_left.1 he, mul_ne_zero monic_prod_multiset_X_sub_C .ne_zero hq]
681
+ exacts [add_eq_left.1 he, mul_ne_zero (monic_multisetProd_X_sub_C p.roots) .ne_zero hq]
667
682
668
683
/-- A polynomial `p` that has as many roots as its degree
669
684
can be written `p = p.leadingCoeff * ∏(X - a)`, for `a` in `p.roots`. -/
670
685
theorem C_leadingCoeff_mul_prod_multiset_X_sub_C (hroots : Multiset.card p.roots = p.natDegree) :
671
686
C p.leadingCoeff * (p.roots.map fun a => X - C a).prod = p :=
672
- (eq_leadingCoeff_mul_of_monic_of_dvd_of_natDegree_le monic_prod_multiset_X_sub_C
687
+ (eq_leadingCoeff_mul_of_monic_of_dvd_of_natDegree_le (monic_multisetProd_X_sub_C p.roots)
673
688
p.prod_multiset_X_sub_C_dvd
674
689
((natDegree_multiset_prod_X_sub_C_eq_card _).trans hroots).ge).symm
675
690
0 commit comments