Theory of univariate polynomials #
We define the multiset of roots of a polynomial, and prove basic results about it.
Main definitions #
Polynomial.roots p: The multiset containing all the roots ofp, including their multiplicities.Polynomial.rootSet p E: The set of distinct roots ofpin an algebraE.
Main statements #
Polynomial.C_leadingCoeff_mul_prod_multiset_X_sub_C: If a polynomial has as many roots as its degree, it can be written as the product of its leading coefficient with∏ (X - a)wherearanges through its roots.
roots p noncomputably gives a multiset containing all the roots of p,
including their multiplicities.
Equations
- p.roots = if h : p = 0 then ∅ else Classical.choose ⋯
Instances For
nthRoots n a noncomputably returns the solutions to x ^ n = a.
Equations
- Polynomial.nthRoots n a = (Polynomial.X ^ n - Polynomial.C a).roots
Instances For
The multiset nthRoots ↑n a as a Finset. Previously nthRootsFinset n was defined to be
nthRoots n (1 : R) as a Finset. That situation can be recovered by setting a to be (1 : R)
Equations
Instances For
Given a polynomial p with coefficients in a ring T and a T-algebra S, aroots p S is
the multiset of roots of p regarded as a polynomial over S.
Equations
- p.aroots S = (Polynomial.map (algebraMap T S) p).roots
Instances For
The set of distinct roots of p in S.
If you have a non-separable polynomial, use Polynomial.aroots for the multiset
where multiple roots have the appropriate multiplicity.
Instances For
Equations
- p.rootSetFintype S = FinsetCoe.fintype (p.aroots S).toFinset
The product ∏ (X - a) for a inside the multiset p.roots divides p.
A Galois connection.
A polynomial p that has as many roots as its degree
can be written p = p.leadingCoeff * ∏(X - a), for a in p.roots.
To check a monic polynomial is irreducible, it suffices to check only for divisors that have smaller degree.
See also: Polynomial.Monic.irreducible_iff_natDegree.