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.OfFn

15 declarations. Mathlib docs · Source

Polynomial.ofFn and Polynomial.toFn

In this file we introduce ofFn and toFn, two functions that associate a polynomial to the vector of its coefficients and vice versa. We prove some basic APIs for these functions.

Main definitions

  • Polynomial.toFn n associates to a polynomial the vector of its first n coefficients.
  • Polynomial.ofFn n associates to a vector of length n the polynomial that has the entries of the vector as coefficients.

def Polynomial.toFn E1 #

{R : Type u_1} → [inst : Semiring R] → (n : ℕ) → Polynomial R →ₗ[R] Fin n → R

toFn n f is the vector of the first n coefficients of the polynomial f.

theorem Polynomial.toFn_zero E1 #

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

def Polynomial.ofFn E1 #

{R : Type u_1} → [inst : Semiring R] → [DecidableEq R] → (n : ℕ) → (Fin n → R) →ₗ[R] Polynomial R

ofFn n v is the polynomial whose coefficients are the entries of the vector v.

theorem Polynomial.ofFn_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] (n : ℕ), (Polynomial.ofFn n) 0 = 0

theorem Polynomial.ofFn_zero' E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] (v : Fin 0 → R), (Polynomial.ofFn 0) v = 0

theorem Polynomial.ne_zero_of_ofFn_ne_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n : ℕ} {v : Fin n → R}, (Polynomial.ofFn n) v ≠ 0 → n ≠ 0

theorem Polynomial.ofFn_coeff_eq_val_of_lt E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n i : ℕ} (v : Fin n → R) (hi : i < n),
  ((Polynomial.ofFn n) v).coeff i = v ⟨i, hi⟩

If i < n the i-th coefficient of ofFn n v is v i.

theorem Polynomial.ofFn_coeff_eq_zero_of_ge E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n i : ℕ} (v : Fin n → R),
  n ≤ i → ((Polynomial.ofFn n) v).coeff i = 0

If n ≤ i the i-th coefficient of ofFn n v is 0.

theorem Polynomial.ofFn_natDegree_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n : ℕ},
  1 ≤ n → ∀ (v : Fin n → R), ((Polynomial.ofFn n) v).natDegree < n

ofFn n v has natDegree smaller than n.

theorem Polynomial.ofFn_degree_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n : ℕ} (v : Fin n → R),
  ((Polynomial.ofFn n) v).degree < ↑n

ofFn n v has degree smaller than n.

theorem Polynomial.ofFn_eq_sum_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n : ℕ} (v : Fin n → R),
  (Polynomial.ofFn n) v = ∑ i, (Polynomial.monomial ↑i) (v i)

theorem Polynomial.toFn_comp_ofFn_eq_id E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] (n : ℕ) (v : Fin n → R),
  (Polynomial.toFn n) ((Polynomial.ofFn n) v) = v

theorem Polynomial.injective_ofFn E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] (n : ℕ), Function.Injective ⇑(Polynomial.ofFn n)

theorem Polynomial.surjective_toFn E1 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ), Function.Surjective ⇑(Polynomial.toFn n)

theorem Polynomial.ofFn_comp_toFn_eq_id_of_natDegree_lt E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : DecidableEq R] {n : ℕ} {p : Polynomial R},
  p.natDegree < n → (Polynomial.ofFn n) ((Polynomial.toFn n) p) = p