File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Mathlib/Algebra/Polynomial Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,20 @@ theorem card_roots_X_pow_sub_C {n : ℕ} (hn : 0 < n) (a : R) :
286286 card_roots (X_pow_sub_C_ne_zero hn a)
287287 _ = n := degree_X_pow_sub_C hn a
288288
289+ theorem roots_eq_of_degree_le_card_of_ne_zero {S : Finset R}
290+ (hS : ∀ x ∈ S, p.eval x = 0 ) (hcard : p.degree ≤ S.card) (hp : p ≠ 0 ) : p.roots = S.val := by
291+ refine (Multiset.eq_of_le_of_card_le ?_ ?_).symm
292+ · exact (Finset.val_le_iff_val_subset.mpr (fun x hx ↦ (p.mem_roots hp).mpr (hS x hx)))
293+ · simpa using (p.card_roots hp).trans hcard
294+
295+ theorem roots_eq_of_degree_le_card {S : Finset R}
296+ (hS : ∀ x ∈ S, p.eval x = 0 ) (hcard : S.card = p.degree) : p.roots = S.val :=
297+ roots_eq_of_degree_le_card_of_ne_zero hS (by lia) (by contrapose! hcard; simp [hcard])
298+
299+ theorem roots_eq_of_natDegree_le_card_of_ne_zero {S : Finset R}
300+ (hS : ∀ x ∈ S, p.eval x = 0 ) (hcard : p.natDegree ≤ S.card) (hp : p ≠ 0 ) : p.roots = S.val :=
301+ roots_eq_of_degree_le_card_of_ne_zero hS (degree_le_of_natDegree_le hcard) hp
302+
289303section NthRoots
290304
291305/-- `nthRoots n a` noncomputably returns the solutions to `x ^ n = a`. -/
You can’t perform that action at this time.
0 commit comments