The areas / V09. Commutative algebra I: ideals, polynomials, factorization
Mathlib.Algebra.Polynomial.Inductions
21 declarations. Mathlib docs · Source
Induction on polynomials
This file contains lemmas dealing with different flavours of induction on polynomials.
def Polynomial.divX E1 #
{R : Type u} → [inst : Semiring R] → Polynomial R → Polynomial R
divX p returns a polynomial q such that q * X + C (p.coeff 0) = p.
It can be used in a semiring where the usual division algorithm is not possible
theorem Polynomial.coeff_divX E0 #
∀ {R : Type u} {n : ℕ} [inst : Semiring R] {p : Polynomial R}, p.divX.coeff n = p.coeff (n + 1)
theorem Polynomial.divX_mul_X_add E1 #
∀ {R : Type u} [inst : Semiring R] (p : Polynomial R), p.divX * Polynomial.X + Polynomial.C (p.coeff 0) = p
theorem Polynomial.X_mul_divX_add E0 #
∀ {R : Type u} [inst : Semiring R] (p : Polynomial R), Polynomial.X * p.divX + Polynomial.C (p.coeff 0) = p
theorem Polynomial.divX_C E0 #
∀ {R : Type u} [inst : Semiring R] (a : R), (Polynomial.C a).divX = 0
theorem Polynomial.divX_eq_zero_iff E0 #
∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.divX = 0 ↔ p = Polynomial.C (p.coeff 0)
theorem Polynomial.divX_add E1 #
∀ {R : Type u} [inst : Semiring R] {p q : Polynomial R}, (p + q).divX = p.divX + q.divX
theorem Polynomial.divX_zero E0 #
∀ {R : Type u} [inst : Semiring R], Polynomial.divX 0 = 0
theorem Polynomial.divX_one E0 #
∀ {R : Type u} [inst : Semiring R], Polynomial.divX 1 = 0
theorem Polynomial.divX_C_mul E0 #
∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R}, (Polynomial.C a * p).divX = Polynomial.C a * p.divX
theorem Polynomial.divX_X_pow E1 #
∀ {R : Type u} {n : ℕ} [inst : Semiring R], (Polynomial.X ^ n).divX = if n = 0 then 0 else Polynomial.X ^ (n - 1)
def Polynomial.divX_hom E1 #
{R : Type u} → [inst : Semiring R] → Polynomial R →+ Polynomial R
divX as an additive homomorphism.
theorem Polynomial.divX_hom_toFun E0 #
∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, Polynomial.divX_hom p = p.divX
theorem Polynomial.natDegree_divX_eq_natDegree_tsub_one E1 #
∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.divX.natDegree = p.natDegree - 1
theorem Polynomial.natDegree_divX_le E1 #
∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.divX.natDegree ≤ p.natDegree
theorem Polynomial.divX_C_mul_X_pow E1 #
∀ {R : Type u} {a : R} {n : ℕ} [inst : Semiring R],
(Polynomial.C a * Polynomial.X ^ n).divX = if n = 0 then 0 else Polynomial.C a * Polynomial.X ^ (n - 1)
theorem Polynomial.degree_divX_lt E1 #
∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p ≠ 0 → p.divX.degree < p.degree
def Polynomial.recOnHorner E1 #
{R : Type u} →
[inst : Semiring R] →
{M : Polynomial R → Sort u_1} →
(p : Polynomial R) →
M 0 →
((p : Polynomial R) → (a : R) → p.coeff 0 = 0 → a ≠ 0 → M p → M (p + Polynomial.C a)) →
((p : Polynomial R) → p ≠ 0 → M p → M (p * Polynomial.X)) → M p
A Sort-valued induction principle for polynomials over a semiring R, with cases
0,p + a, witha ∈ R,p ∈ R[X],p * X, withp ∈ R[X],
with appropriate restrictions on each term.
See recOnHorner_const for a variant with a constant base case.
def Polynomial.recOnHornerConst E1 #
{R : Type u} →
[inst : Semiring R] →
{motive : Polynomial R → Sort u_1} →
((a : R) → motive (Polynomial.C a)) →
((p : Polynomial R) →
(a : R) → p.coeff 0 = 0 → 0 < p.natDegree → a ≠ 0 → motive p → motive (p + Polynomial.C a)) →
((p : Polynomial R) → p ≠ 0 → motive p → motive (p * Polynomial.X)) → (p : Polynomial R) → motive p
A Sort-valued induction principle for polynomials over a semiring R, with cases
a, witha ∈ R,p + a, witha ∈ R,p ∈ R[X],p * X, withp ∈ R[X],
with appropriate restrictions on each term.
See recOnHorner for a variant with a zero base case.
theorem Polynomial.degree_pos_induction_on E1 #
∀ {R : Type u} [inst : Semiring R] {P : Polynomial R → Prop} (p : Polynomial R),
0 < p.degree →
(∀ {a : R}, a ≠ 0 → P (Polynomial.C a * Polynomial.X)) →
(∀ {p : Polynomial R}, 0 < p.degree → P p → P (p * Polynomial.X)) →
(∀ {p : Polynomial R} {a : R}, 0 < p.degree → P p → P (p + Polynomial.C a)) → P p
A property holds for all polynomials of positive degree over a semiring R if it holds for
a * X, witha ∈ R,p * X, withp ∈ R[X],p + a, witha ∈ R,p ∈ R[X],
with appropriate restrictions on each term.
See natDegree_ne_zero_induction_on for a similar statement involving no explicit multiplication.
theorem Polynomial.natDegree_ne_zero_induction_on E1 #
∀ {R : Type u} [inst : Semiring R] {M : Polynomial R → Prop} {f : Polynomial R},
f.natDegree ≠ 0 →
(∀ {a : R} {p : Polynomial R}, M p → M (Polynomial.C a + p)) →
(∀ {p q : Polynomial R}, M p → M q → M (p + q)) →
(∀ {n : ℕ} {a : R}, a ≠ 0 → n ≠ 0 → M ((Polynomial.monomial n) a)) → M f
A property holds for all polynomials of non-zero natDegree over a semiring R if it holds for
p + a, witha ∈ R,p ∈ R[X],p + q, withp, q ∈ R[X],- monomials with nonzero coefficient and non-zero exponent,
with appropriate restrictions on each term.
Note that multiplication is "hidden" in the assumption on monomials, so there is no explicit
multiplication in the statement.
See degree_pos_induction_on for a similar statement involving more explicit multiplications.