mathlib3 documentation

data.polynomial.inductions

Induction on polynomials #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file contains lemmas dealing with different flavours of induction on polynomials.

noncomputable def polynomial.div_X {R : Type u} [semiring R] (p : polynomial R) :

div_X 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

Equations
@[simp]
theorem polynomial.coeff_div_X {R : Type u} {n : ℕ} [semiring R] {p : polynomial R} :
p.div_X.coeff n = p.coeff (n + 1)
@[simp]
theorem polynomial.div_X_C {R : Type u} [semiring R] (a : R) :
theorem polynomial.div_X_add {R : Type u} [semiring R] {p q : polynomial R} :
(p + q).div_X = p.div_X + q.div_X
theorem polynomial.degree_div_X_lt {R : Type u} [semiring R] {p : polynomial R} (hp0 : p ≠ 0) :
noncomputable def polynomial.rec_on_horner {R : Type u} [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

An induction principle for polynomials, valued in Sort* instead of Prop.

Equations
theorem polynomial.degree_pos_induction_on {R : Type u} [semiring R] {P : polynomial R → Prop} (p : polynomial R) (h0 : 0 < p.degree) (hC : ∀ {a : R}, a ≠ 0 → P (⇑polynomial.C a * polynomial.X)) (hX : ∀ {p : polynomial R}, 0 < p.degree → P p → P (p * polynomial.X)) (hadd : ∀ {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 with coefficients in a semiring R if it holds for

  • a * X, with a ∈ R,
  • p * X, with p ∈ R[X],
  • p + a, with a ∈ R, p ∈ R[X], with appropriate restrictions on each term.

See nat_degree_ne_zero_induction_on for a similar statement involving no explicit multiplication.

theorem polynomial.nat_degree_ne_zero_induction_on {R : Type u} [semiring R] {M : polynomial R → Prop} {f : polynomial R} (f0 : f.nat_degree ≠ 0) (h_C_add : ∀ {a : R} {p : polynomial R}, M p → M (⇑polynomial.C a + p)) (h_add : ∀ {p q : polynomial R}, M p → M q → M (p + q)) (h_monomial : ∀ {n : ℕ} {a : R}, a ≠ 0 → n ≠ 0 → M (⇑(polynomial.monomial n) a)) :
M f

A property holds for all polynomials of non-zero nat_degree with coefficients in a semiring R if it holds for

  • p + a, with a ∈ R, p ∈ R[X],
  • p + q, with p, 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.