Theory of univariate polynomials #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file starts looking like the ring theory of $ R[X] $
Main definitions #
polynomial.roots p: The multiset containing all the roots ofp, including their multiplicities.polynomial.root_set p E: The set of distinct roots ofpin an algebraE.
Main statements #
polynomial.C_leading_coeff_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.
_ %ₘ q as an R-linear map.
Equations
- q.mod_by_monic_hom = {to_fun := λ (p : polynomial R), p %ₘ q, map_add' := _, map_smul' := _}
This lemma is useful for working with the int_degree of a rational function.
The multiplicity of a as root of a nonzero polynomial p is at least n iff
(X - a) ^ n divides p.
The multiplicity of p + q is at least the minimum of the multiplicities.
The multiplicity of a as root of (X - a) ^ n is n.
roots p noncomputably gives a multiset containing all the roots of p,
including their multiplicities.
nth_roots n a noncomputably returns the solutions to x ^ n = a
Equations
- polynomial.nth_roots n a = (polynomial.X ^ n - ⇑polynomial.C a).roots
The set of distinct roots of p in E.
If you have a non-separable polynomial, use polynomial.roots for the multiset
where multiple roots have the appropriate multiplicity.
Equations
- p.root_set S = ↑((polynomial.map (algebra_map T S) p).roots.to_finset)
Instances for ↥polynomial.root_set
Equations
- p.root_set_fintype S = finset_coe.fintype (polynomial.map (algebra_map T S) p).roots.to_finset
The set of roots of all polynomials of bounded degree and having coefficients in a finite set is finite.
Division by a monic polynomial doesn't change the leading coefficient.
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.leading_coeff * ∏(X - a), for a in p.roots.
A monic polynomial p that has as many roots as its degree
can be written p = ∏(X - a), for a in p.roots.
A polynomial over an integral domain R is irreducible if it is monic and
irreducible after mapping into an integral domain S.
A special case of this lemma is that a polynomial over ℤ is irreducible if
it is monic and irreducible over ℤ/pℤ for some prime p.