The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.Algebra.Polynomial.EraseLead

53 declarations. Mathlib docs · Source

Erase the leading term of a univariate polynomial

Definition

  • eraseLead f: the polynomial f - leading term of f

eraseLead serves as reduction step in an induction, shaving off one monomial from a polynomial. The definition is set up so that it does not mention subtraction in the definition, and thus works for polynomials over semirings as well as rings.

def Polynomial.eraseLead E1 #

{R : Type u_1} → [inst : Semiring R] → Polynomial R → Polynomial R

eraseLead f for a polynomial f is the polynomial obtained by subtracting from f the leading term of f.

theorem Polynomial.eraseLead_support E1 #

∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R), f.eraseLead.support = f.support.erase f.natDegree

theorem Polynomial.eraseLead_coeff E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} (i : ℕ),
  f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i

theorem Polynomial.eraseLead_coeff_natDegree E0 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead.coeff f.natDegree = 0

theorem Polynomial.eraseLead_coeff_of_ne E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} (i : ℕ), i ≠ f.natDegree → f.eraseLead.coeff i = f.coeff i

theorem Polynomial.eraseLead_zero E0 #

∀ {R : Type u_1} [inst : Semiring R], Polynomial.eraseLead 0 = 0

theorem Polynomial.eraseLead_add_monomial_natDegree_leadingCoeff E0 #

∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R),
  f.eraseLead + (Polynomial.monomial f.natDegree) f.leadingCoeff = f

theorem Polynomial.eraseLead_add_C_mul_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R),
  f.eraseLead + Polynomial.C f.leadingCoeff * Polynomial.X ^ f.natDegree = f

theorem Polynomial.self_sub_monomial_natDegree_leadingCoeff E0 #

∀ {R : Type u_2} [inst : Ring R] (f : Polynomial R), f - (Polynomial.monomial f.natDegree) f.leadingCoeff = f.eraseLead

theorem Polynomial.self_sub_C_mul_X_pow E0 #

∀ {R : Type u_2} [inst : Ring R] (f : Polynomial R),
  f - Polynomial.C f.leadingCoeff * Polynomial.X ^ f.natDegree = f.eraseLead

theorem Polynomial.eraseLead_ne_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, 2 ≤ f.support.card → f.eraseLead ≠ 0

theorem Polynomial.lt_natDegree_of_mem_eraseLead_support E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} {a : ℕ}, a ∈ f.eraseLead.support → a < f.natDegree

theorem Polynomial.ne_natDegree_of_mem_eraseLead_support E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} {a : ℕ}, a ∈ f.eraseLead.support → a ≠ f.natDegree

theorem Polynomial.natDegree_notMem_eraseLead_support E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.natDegree ∉ f.eraseLead.support

theorem Polynomial.eraseLead_support_card_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f ≠ 0 → f.eraseLead.support.card < f.support.card

theorem Polynomial.card_support_eraseLead_add_one E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f ≠ 0 → f.eraseLead.support.card + 1 = f.support.card

theorem Polynomial.card_support_eraseLead E0 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead.support.card = f.support.card - 1

theorem Polynomial.card_support_eraseLead' E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} {c : ℕ}, f.support.card = c + 1 → f.eraseLead.support.card = c

theorem Polynomial.card_support_eq_one_of_eraseLead_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f ≠ 0 → f.eraseLead = 0 → f.support.card = 1

theorem Polynomial.card_support_le_one_of_eraseLead_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead = 0 → f.support.card ≤ 1

theorem Polynomial.eraseLead_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] (i : ℕ) (r : R), ((Polynomial.monomial i) r).eraseLead = 0

theorem Polynomial.eraseLead_C E0 #

∀ {R : Type u_1} [inst : Semiring R] (r : R), (Polynomial.C r).eraseLead = 0

theorem Polynomial.eraseLead_X E0 #

∀ {R : Type u_1} [inst : Semiring R], Polynomial.X.eraseLead = 0

theorem Polynomial.eraseLead_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ), (Polynomial.X ^ n).eraseLead = 0

theorem Polynomial.eraseLead_C_mul_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] (r : R) (n : ℕ), (Polynomial.C r * Polynomial.X ^ n).eraseLead = 0

theorem Polynomial.eraseLead_C_mul_X E0 #

∀ {R : Type u_1} [inst : Semiring R] (r : R), (Polynomial.C r * Polynomial.X).eraseLead = 0

theorem Polynomial.eraseLead_add_of_degree_lt_left E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : Polynomial R}, q.degree < p.degree → (p + q).eraseLead = p.eraseLead + q

theorem Polynomial.eraseLead_add_of_natDegree_lt_left E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : Polynomial R},
  q.natDegree < p.natDegree → (p + q).eraseLead = p.eraseLead + q

theorem Polynomial.eraseLead_add_of_degree_lt_right E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : Polynomial R}, p.degree < q.degree → (p + q).eraseLead = p + q.eraseLead

theorem Polynomial.eraseLead_add_of_natDegree_lt_right E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : Polynomial R},
  p.natDegree < q.natDegree → (p + q).eraseLead = p + q.eraseLead

theorem Polynomial.eraseLead_degree_le E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead.degree ≤ f.degree

theorem Polynomial.degree_eraseLead_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f ≠ 0 → f.eraseLead.degree < f.degree

theorem Polynomial.eraseLead_natDegree_le_aux E0 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead.natDegree ≤ f.natDegree

theorem Polynomial.eraseLead_natDegree_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, 2 ≤ f.support.card → f.eraseLead.natDegree < f.natDegree

theorem Polynomial.natDegree_pos_of_eraseLead_ne_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead ≠ 0 → 0 < f.natDegree

theorem Polynomial.eraseLead_natDegree_lt_or_eraseLead_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R), f.eraseLead.natDegree < f.natDegree ∨ f.eraseLead = 0

theorem Polynomial.eraseLead_natDegree_le E1 #

∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R), f.eraseLead.natDegree ≤ f.natDegree - 1

theorem Polynomial.natDegree_eraseLead E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.nextCoeff ≠ 0 → f.eraseLead.natDegree = f.natDegree - 1

theorem Polynomial.natDegree_eraseLead_add_one E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.nextCoeff ≠ 0 → f.eraseLead.natDegree + 1 = f.natDegree

theorem Polynomial.natDegree_eraseLead_le_of_nextCoeff_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.nextCoeff = 0 → f.eraseLead.natDegree ≤ f.natDegree - 2

theorem Polynomial.two_le_natDegree_of_nextCoeff_eraseLead E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead ≠ 0 → f.nextCoeff = 0 → 2 ≤ f.natDegree

theorem Polynomial.leadingCoeff_eraseLead_eq_nextCoeff E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.nextCoeff ≠ 0 → f.eraseLead.leadingCoeff = f.nextCoeff

theorem Polynomial.nextCoeff_eq_zero_of_eraseLead_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R}, f.eraseLead = 0 → f.nextCoeff = 0

theorem Polynomial.eraseLead_mul_eq_mul_eraseLead_of_nextCoeff_zero E1 #

∀ {R : Type u_2} [inst : Ring R] [NoZeroDivisors R] [Nontrivial R] {x : R} {P : Polynomial R},
  x ≠ 0 →
    P.nextCoeff = 0 →
      ((Polynomial.X - Polynomial.C x) * P).eraseLead.eraseLead = (Polynomial.X - Polynomial.C x) * P.eraseLead

If we erase the leading coefficient of a Polynomial.coeffList like [+,0,...], and then multiply by a linear term, it's equivalent to erasing the first two coefficients of the product.

theorem Polynomial.induction_with_natDegree_le E1 #

∀ {R : Type u_1} [inst : Semiring R] (motive : Polynomial R → Prop) (N : ℕ),
  motive 0 →
    (∀ (n : ℕ) (r : R), r ≠ 0 → n ≤ N → motive (Polynomial.C r * Polynomial.X ^ n)) →
      (∀ (f g : Polynomial R), f.natDegree < g.natDegree → g.natDegree ≤ N → motive f → motive g → motive (f + g)) →
        ∀ (f : Polynomial R), f.natDegree ≤ N → motive f

An induction lemma for polynomials. It takes a natural number N as a parameter, that is required to be at least as big as the natDegree of the polynomial. This is useful to prove results where you want to change each term in a polynomial to something else depending on the natDegree of the polynomial itself and not on the specific natDegree of each term.

theorem Polynomial.mono_map_natDegree_eq E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_2} {F : Type u_3} [inst_1 : Semiring S]
  [inst_2 : FunLike F (Polynomial R) (Polynomial S)] [AddMonoidHomClass F (Polynomial R) (Polynomial S)] {φ : F}
  {p : Polynomial R} (k : ℕ) (fu : ℕ → ℕ),
  (∀ {n : ℕ}, n ≤ k → fu n = 0) →
    (∀ {n m : ℕ}, k ≤ n → n < m → fu n < fu m) →
      (∀ {f : Polynomial R}, f.natDegree < k → φ f = 0) →
        (∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = fu n) → (φ p).natDegree = fu p.natDegree

Let φ : R[x] → S[x] be an additive map, k : ℕ a bound, and fu : ℕ → ℕ a "sufficiently monotone" map. Assume also that

  • φ maps to 0 all monomials of degree less than k,
  • φ maps each monomial m in R[x] to a polynomial φ m of degree fu (deg m).

Then, φ maps each polynomial p in R[x] to a polynomial of degree fu (deg p).

theorem Polynomial.map_natDegree_eq_sub E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_2} {F : Type u_3} [inst_1 : Semiring S]
  [inst_2 : FunLike F (Polynomial R) (Polynomial S)] [AddMonoidHomClass F (Polynomial R) (Polynomial S)] {φ : F}
  {p : Polynomial R} {k : ℕ},
  (∀ (f : Polynomial R), f.natDegree < k → φ f = 0) →
    (∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = n - k) → (φ p).natDegree = p.natDegree - k

theorem Polynomial.map_natDegree_eq_natDegree E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_2} {F : Type u_3} [inst_1 : Semiring S]
  [inst_2 : FunLike F (Polynomial R) (Polynomial S)] [AddMonoidHomClass F (Polynomial R) (Polynomial S)] {φ : F}
  (p : Polynomial R),
  (∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = n) → (φ p).natDegree = p.natDegree

theorem Polynomial.card_support_eq' E1 #

∀ {R : Type u_1} [inst : Semiring R] {n : ℕ} (k : Fin n → ℕ) (x : Fin n → R),
  Function.Injective k → (∀ (i : Fin n), x i ≠ 0) → (∑ i, Polynomial.C (x i) * Polynomial.X ^ k i).support.card = n

theorem Polynomial.card_support_eq E0 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R} {n : ℕ},
  f.support.card = n ↔
    ∃ k x, ∃ (_ : StrictMono k) (_ : ∀ (i : Fin n), x i ≠ 0), f = ∑ i, Polynomial.C (x i) * Polynomial.X ^ k i

theorem Polynomial.card_support_eq_one E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R},
  f.support.card = 1 ↔ ∃ k x, ∃ (_ : x ≠ 0), f = Polynomial.C x * Polynomial.X ^ k

theorem Polynomial.card_support_eq_two E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R},
  f.support.card = 2 ↔
    ∃ k m,
      ∃ (_ : k < m),
        ∃ x y, ∃ (_ : x ≠ 0) (_ : y ≠ 0), f = Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m

theorem Polynomial.card_support_eq_three E1 #

∀ {R : Type u_1} [inst : Semiring R] {f : Polynomial R},
  f.support.card = 3 ↔
    ∃ k m n,
      ∃ (_ : k < m) (_ : m < n),
        ∃ x y z,
          ∃ (_ : x ≠ 0) (_ : y ≠ 0) (_ : z ≠ 0),
            f =
              Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m + Polynomial.C z * Polynomial.X ^ n