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 nassociates to a polynomial the vector of its firstncoefficients.Polynomial.ofFn nassociates to a vector of lengthnthe polynomial that has the entries of the vector as coefficients.
toFn n f is the vector of the first n coefficients of the polynomial f.
Equations
- Polynomial.toFn n = LinearMap.pi fun (i : Fin n) => Polynomial.lcoeff R ↑i
Instances For
ofFn n v is the polynomial whose coefficients are the entries of the vector v.
Equations
- Polynomial.ofFn n = { toFun := fun (v : Fin n → R) => { toFinsupp := AddMonoidAlgebra.ofCoeff (List.ofFn v).toFinsupp }, map_add' := ⋯, map_smul' := ⋯ }
Instances For
@[simp]
theorem Polynomial.ne_zero_of_ofFn_ne_zero {R : Type u_1} [Semiring R] [DecidableEq R] {n : ℕ} {v : Fin n → R} (h : (ofFn n) v ≠ 0) :
theorem Polynomial.toFn_comp_ofFn_eq_id {R : Type u_1} [Semiring R] [DecidableEq R] (n : ℕ) (v : Fin n → R) :
theorem Polynomial.injective_ofFn {R : Type u_1} [Semiring R] [DecidableEq R] (n : ℕ) :
Function.Injective ⇑(ofFn n)
theorem Polynomial.surjective_toFn {R : Type u_1} [Semiring R] (n : ℕ) :
Function.Surjective ⇑(toFn n)
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) :