mathlib documentation

data.polynomial.ring_division

Theory of univariate polynomials #

This file starts looking like the ring theory of $ R[X] $

theorem polynomial.nat_degree_pos_of_aeval_root {R : Type u} {S : Type v} [comm_ring R] [semiring S] [algebra R S] {p : R[X]} (hp : p 0) {z : S} (hz : (polynomial.aeval z) p = 0) (inj : ∀ (x : R), (algebra_map R S) x = 0x = 0) :
theorem polynomial.degree_pos_of_aeval_root {R : Type u} {S : Type v} [comm_ring R] [semiring S] [algebra R S] {p : R[X]} (hp : p 0) {z : S} (hz : (polynomial.aeval z) p = 0) (inj : ∀ (x : R), (algebra_map R S) x = 0x = 0) :
0 < p.degree
theorem polynomial.mod_by_monic_eq_of_dvd_sub {R : Type u} [comm_ring R] {q : R[X]} (hq : q.monic) {p₁ p₂ : R[X]} (h : q p₁ - p₂) :
p₁ %ₘ q = p₂ %ₘ q
theorem polynomial.add_mod_by_monic {R : Type u} [comm_ring R] {q : R[X]} (p₁ p₂ : R[X]) :
(p₁ + p₂) %ₘ q = p₁ %ₘ q + p₂ %ₘ q
theorem polynomial.smul_mod_by_monic {R : Type u} [comm_ring R] {q : R[X]} (c : R) (p : R[X]) :
c p %ₘ q = c (p %ₘ q)
noncomputable def polynomial.mod_by_monic_hom {R : Type u} [comm_ring R] (q : R[X]) :

_ %ₘ q as an R-linear map.

Equations
@[simp]
theorem polynomial.mod_by_monic_hom_apply {R : Type u} [comm_ring R] (q p : R[X]) :
theorem polynomial.aeval_mod_by_monic_eq_self_of_root {R : Type u} {S : Type v} [comm_ring R] [ring S] [algebra R S] {p q : R[X]} (hq : q.monic) {x : S} (hx : (polynomial.aeval x) q = 0) :
@[protected, instance]
theorem polynomial.nat_degree_mul {R : Type u} [semiring R] [no_zero_divisors R] {p q : R[X]} (hp : p 0) (hq : q 0) :
@[simp]
theorem polynomial.nat_degree_pow {R : Type u} [semiring R] [no_zero_divisors R] (p : R[X]) (n : ) :
theorem polynomial.degree_le_mul_left {R : Type u} [semiring R] [no_zero_divisors R] {q : R[X]} (p : R[X]) (hq : q 0) :
p.degree (p * q).degree
theorem polynomial.nat_degree_le_of_dvd {R : Type u} [semiring R] [no_zero_divisors R] {p q : R[X]} (h1 : p q) (h2 : q 0) :
theorem polynomial.nat_degree_sub_eq_of_prod_eq {R : Type u} [semiring R] [no_zero_divisors R] {p₁ p₂ q₁ q₂ : R[X]} (hp₁ : p₁ 0) (hq₁ : q₁ 0) (hp₂ : p₂ 0) (hq₂ : q₂ 0) (h_eq : p₁ * q₂ = p₂ * q₁) :

This lemma is useful for working with the int_degree of a rational function.

theorem polynomial.root_mul {R : Type u} {a : R} [comm_semiring R] [no_zero_divisors R] {p q : R[X]} :
(p * q).is_root a p.is_root a q.is_root a
theorem polynomial.root_or_root_of_root_mul {R : Type u} {a : R} [comm_semiring R] [no_zero_divisors R] {p q : R[X]} (h : (p * q).is_root a) :
@[protected, instance]
def polynomial.is_domain {R : Type u} [ring R] [is_domain R] :
theorem polynomial.nat_trailing_degree_mul {R : Type u} [ring R] [is_domain R] {p q : R[X]} (hp : p 0) (hq : q 0) :
theorem polynomial.degree_eq_zero_of_is_unit {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (h : is_unit p) :
p.degree = 0
@[simp]
theorem polynomial.degree_coe_units {R : Type u} [comm_ring R] [is_domain R] (u : R[X]ˣ) :
theorem polynomial.monic.prime_of_degree_eq_one {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp1 : p.degree = 1) (hm : p.monic) :
theorem polynomial.monic.irreducible_of_degree_eq_one {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp1 : p.degree = 1) (hm : p.monic) :
theorem polynomial.eq_of_monic_of_associated {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (hp : p.monic) (hq : q.monic) (hpq : associated p q) :
p = q

The multiplicity of a as root of (X - a) ^ n is n.

theorem polynomial.root_multiplicity_of_dvd {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} {a : R} {n : } (hzero : p 0) (h : (polynomial.X - polynomial.C a) ^ n p) :

If (X - a) ^ n divides a polynomial p then the multiplicity of a as root of p is at least n.

The multiplicity of p + q is at least the minimum of the multiplicities.

theorem polynomial.exists_multiset_roots {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp : p 0) :
noncomputable def polynomial.roots {R : Type u} [comm_ring R] [is_domain R] (p : R[X]) :

roots p noncomputably gives a multiset containing all the roots of p, including their multiplicities.

Equations
@[simp]
theorem polynomial.roots_zero {R : Type u} [comm_ring R] [is_domain R] :
0.roots = 0
theorem polynomial.card_roots {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp0 : p 0) :
theorem polynomial.card_roots_sub_C {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} {a : R} (hp0 : 0 < p.degree) :
theorem polynomial.card_roots_sub_C' {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} {a : R} (hp0 : 0 < p.degree) :
@[simp]
theorem polynomial.count_roots {R : Type u} {a : R} [comm_ring R] [is_domain R] (p : R[X]) :
@[simp]
theorem polynomial.mem_roots {R : Type u} {a : R} [comm_ring R] [is_domain R] {p : R[X]} (hp : p 0) :
theorem polynomial.card_le_degree_of_subset_roots {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} {Z : finset R} (h : Z.val p.roots) :
theorem polynomial.eq_zero_of_infinite_is_root {R : Type u} [comm_ring R] [is_domain R] (p : R[X]) (h : {x : R | p.is_root x}.infinite) :
p = 0
theorem polynomial.exists_max_root {R : Type u} [comm_ring R] [is_domain R] [linear_order R] (p : R[X]) (hp : p 0) :
∃ (x₀ : R), ∀ (x : R), p.is_root xx x₀
theorem polynomial.exists_min_root {R : Type u} [comm_ring R] [is_domain R] [linear_order R] (p : R[X]) (hp : p 0) :
∃ (x₀ : R), ∀ (x : R), p.is_root xx₀ x
theorem polynomial.eq_of_infinite_eval_eq {R : Type u_1} [comm_ring R] [is_domain R] (p q : R[X]) (h : {x : R | polynomial.eval x p = polynomial.eval x q}.infinite) :
p = q
theorem polynomial.roots_mul {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (hpq : p * q 0) :
(p * q).roots = p.roots + q.roots
theorem polynomial.roots.le_of_dvd {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (h : q 0) :
p qp.roots q.roots
@[simp]
theorem polynomial.mem_roots_sub_C {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} {a x : R} (hp0 : 0 < p.degree) :
@[simp]
theorem polynomial.roots_X_sub_C {R : Type u} [comm_ring R] [is_domain R] (r : R) :
@[simp]
theorem polynomial.roots_C {R : Type u} [comm_ring R] [is_domain R] (x : R) :
@[simp]
theorem polynomial.roots_one {R : Type u} [comm_ring R] [is_domain R] :
theorem polynomial.roots_smul_nonzero {R : Type u} [comm_ring R] [is_domain R] (p : R[X]) {r : R} (hr : r 0) :
(r p).roots = p.roots
theorem polynomial.roots_list_prod {R : Type u} [comm_ring R] [is_domain R] (L : list R[X]) :
theorem polynomial.roots_prod {R : Type u} [comm_ring R] [is_domain R] {ι : Type u_1} (f : ι → R[X]) (s : finset ι) :
s.prod f 0(s.prod f).roots = s.val.bind (λ (i : ι), (f i).roots)
theorem polynomial.roots_prod_X_sub_C {R : Type u} [comm_ring R] [is_domain R] (s : finset R) :
(∏ (a : R) in s, (polynomial.X - polynomial.C a)).roots = s.val
theorem polynomial.card_roots_X_pow_sub_C {R : Type u} [comm_ring R] [is_domain R] {n : } (hn : 0 < n) (a : R) :
theorem polynomial.le_root_multiplicity_map {K : Type u_1} {L : Type u_2} [comm_ring K] [comm_ring L] {p : K[X]} {f : K →+* L} (hf : function.injective f) (a : K) :
theorem polynomial.count_map_roots {K : Type u_1} {L : Type u_2} [comm_ring K] [is_domain K] [comm_ring L] {p : K[X]} {f : K →+* L} (hf : function.injective f) (a : L) :
noncomputable def polynomial.nth_roots {R : Type u} [comm_ring R] [is_domain R] (n : ) (a : R) :

nth_roots n a noncomputably returns the solutions to x ^ n = a

Equations
@[simp]
theorem polynomial.mem_nth_roots {R : Type u} [comm_ring R] [is_domain R] {n : } (hn : 0 < n) {a x : R} :
@[simp]
theorem polynomial.nth_roots_zero {R : Type u} [comm_ring R] [is_domain R] (r : R) :
theorem polynomial.card_nth_roots {R : Type u} [comm_ring R] [is_domain R] (n : ) (a : R) :
noncomputable def polynomial.nth_roots_finset (n : ) (R : Type u_1) [comm_ring R] [is_domain R] :

The multiset nth_roots ↑n (1 : R) as a finset.

Equations
@[simp]
theorem polynomial.mem_nth_roots_finset {R : Type u} [comm_ring R] [is_domain R] {n : } (h : 0 < n) {x : R} :
theorem polynomial.monic.comp {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (hp : p.monic) (hq : q.monic) (h : q.nat_degree 0) :
(p.comp q).monic
theorem polynomial.monic.comp_X_add_C {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp : p.monic) (r : R) :
theorem polynomial.monic.comp_X_sub_C {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hp : p.monic) (r : R) :
theorem polynomial.units_coeff_zero_smul {R : Type u} [comm_ring R] [is_domain R] (c : R[X]ˣ) (p : R[X]) :
c.coeff 0 p = (c) * p
@[simp]
theorem polynomial.nat_degree_coe_units {R : Type u} [comm_ring R] [is_domain R] (u : R[X]ˣ) :
theorem polynomial.comp_eq_zero_iff {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} :
p.comp q = 0 p = 0 polynomial.eval (q.coeff 0) p = 0 q = polynomial.C (q.coeff 0)
theorem polynomial.zero_of_eval_zero {R : Type u} [comm_ring R] [is_domain R] [infinite R] (p : R[X]) (h : ∀ (x : R), polynomial.eval x p = 0) :
p = 0
theorem polynomial.funext {R : Type u} [comm_ring R] [is_domain R] [infinite R] {p q : R[X]} (ext : ∀ (r : R), polynomial.eval r p = polynomial.eval r q) :
p = q
def polynomial.root_set {T : Type w} [comm_ring T] (p : T[X]) (S : Type u_1) [comm_ring S] [is_domain S] [algebra T S] :
set S

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
theorem polynomial.root_set_def {T : Type w} [comm_ring T] (p : T[X]) (S : Type u_1) [comm_ring S] [is_domain S] [algebra T S] :
@[simp]
theorem polynomial.root_set_zero {T : Type w} [comm_ring T] (S : Type u_1) [comm_ring S] [is_domain S] [algebra T S] :
@[simp]
theorem polynomial.root_set_C {S : Type v} {T : Type w} [comm_ring T] [comm_ring S] [is_domain S] [algebra T S] (a : T) :
@[protected, instance]
noncomputable def polynomial.root_set_fintype {T : Type w} [comm_ring T] (p : T[X]) (S : Type u_1) [comm_ring S] [is_domain S] [algebra T S] :
Equations
theorem polynomial.root_set_finite {T : Type w} [comm_ring T] (p : T[X]) (S : Type u_1) [comm_ring S] [is_domain S] [algebra T S] :
theorem polynomial.mem_root_set_iff' {T : Type w} [comm_ring T] {p : T[X]} {S : Type u_1} [comm_ring S] [is_domain S] [algebra T S] (hp : polynomial.map (algebra_map T S) p 0) (a : S) :
theorem polynomial.mem_root_set_iff {T : Type w} [comm_ring T] {p : T[X]} (hp : p 0) {S : Type u_1} [comm_ring S] [is_domain S] [algebra T S] [no_zero_smul_divisors T S] (a : S) :
theorem polynomial.is_unit_iff {R : Type u} [comm_ring R] [is_domain R] {f : R[X]} :
is_unit f ∃ (r : R), is_unit r polynomial.C r = f
theorem polynomial.coeff_coe_units_zero_ne_zero {R : Type u} [comm_ring R] [is_domain R] (u : R[X]ˣ) :
theorem polynomial.degree_eq_degree_of_associated {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (h : associated p q) :
theorem polynomial.degree_eq_one_of_irreducible_of_root {R : Type u} [comm_ring R] [is_domain R] {p : R[X]} (hi : irreducible p) {x : R} (hx : p.is_root x) :
p.degree = 1
theorem polynomial.leading_coeff_div_by_monic_of_monic {R : Type u} [comm_ring R] {p q : R[X]} (hmonic : q.monic) (hdegree : q.degree p.degree) :

Division by a monic polynomial doesn't change the leading coefficient.

theorem polynomial.eq_of_monic_of_dvd_of_nat_degree_le {R : Type u} [comm_ring R] [is_domain R] {p q : R[X]} (hp : p.monic) (hq : q.monic) (hdiv : p q) (hdeg : q.nat_degree p.nat_degree) :
q = p
theorem polynomial.is_unit_of_is_unit_leading_coeff_of_is_unit_map {R : Type u} {S : Type v} [semiring R] [comm_ring S] [is_domain S] (φ : R →+* S) (f : R[X]) (hf : is_unit f.leading_coeff) (H : is_unit (polynomial.map φ f)) :
theorem polynomial.monic.irreducible_of_irreducible_map {R : Type u} {S : Type v} [comm_ring R] [is_domain R] [comm_ring S] [is_domain S] (φ : R →+* S) (f : R[X]) (h_mon : f.monic) (h_irr : irreducible (polynomial.map φ f)) :

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.