Documentation

Mathlib.Algebra.Polynomial.ofFn

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 #

def Polynomial.toFn {R : Type u_1} [Semiring R] (n : ) :

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

Equations
Instances For
    theorem Polynomial.toFn_zero {R : Type u_1} [Semiring R] (n : ) :
    (toFn n) 0 = 0
    def Polynomial.ofFn {R : Type u_1} [Semiring R] [DecidableEq R] (n : ) :
    (Fin nR) →ₗ[R] Polynomial R

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

    Equations
    Instances For
      theorem Polynomial.ofFn_zero {R : Type u_1} [Semiring R] [DecidableEq R] (n : ) :
      (ofFn n) 0 = 0
      @[simp]
      theorem Polynomial.ofFn_zero' {R : Type u_1} [Semiring R] [DecidableEq R] (v : Fin 0R) :
      (ofFn 0) v = 0
      theorem Polynomial.ne_zero_of_ofFn_ne_zero {R : Type u_1} [Semiring R] [DecidableEq R] {n : } {v : Fin nR} (h : (ofFn n) v 0) :
      n 0
      @[simp]
      theorem Polynomial.ofFn_coeff_eq_val_of_lt {R : Type u_1} [Semiring R] [DecidableEq R] {n i : } (v : Fin nR) (hi : i < n) :
      ((ofFn n) v).coeff i = v i, hi

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

      @[simp]
      theorem Polynomial.ofFn_coeff_eq_zero_of_ge {R : Type u_1} [Semiring R] [DecidableEq R] {n i : } (v : Fin nR) (hi : n i) :
      ((ofFn n) v).coeff i = 0

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

      theorem Polynomial.ofFn_natDegree_lt {R : Type u_1} [Semiring R] [DecidableEq R] {n : } (h : 1 n) (v : Fin nR) :
      ((ofFn n) v).natDegree < n

      ofFn n v has natDegree smaller than n.

      theorem Polynomial.ofFn_degree_lt {R : Type u_1} [Semiring R] [DecidableEq R] {n : } (v : Fin nR) :
      ((ofFn n) v).degree < n

      ofFn n v has degree smaller than n.

      theorem Polynomial.ofFn_eq_sum_monomial {R : Type u_1} [Semiring R] [DecidableEq R] {n : } (v : Fin nR) :
      (ofFn n) v = i : Fin n, (monomial i) (v i)
      theorem Polynomial.toFn_comp_ofFn_eq_id {R : Type u_1} [Semiring R] [DecidableEq R] (n : ) (v : Fin nR) :
      (toFn n) ((ofFn n) v) = v
      theorem Polynomial.ofFn_comp_toFn_eq_id_of_natDegree_lt {R : Type u_1} [Semiring R] [DecidableEq R] {n : } {p : Polynomial R} (h_deg : p.natDegree < n) :
      (ofFn n) ((toFn n) p) = p