Documentation

CslibFrontier.Foundations.Data.MvPolynomial.LastVariable

Polynomials in the last variable #

The last-variable equivalence represents a multivariate polynomial as a univariate polynomial with multivariate coefficients in the prefix variables. Evaluating the univariate variable specializes the last coordinate. Degree in the last variable becomes univariate degree, and prefix-degree bounds become bounds on every coefficient. The underlying option equivalence also gives a total-degree bound when the outer variable is joined to the coefficient variables. Evaluation in another coefficient semiring agrees with evaluating the coefficients and then the outer variable.

Main definitions #

Main results #

theorem MvPolynomial.totalDegree_optionEquivLeft_symm_le {R : Type u_1} [CommSemiring R] {κ : Type u_2} (p : Polynomial (MvPolynomial κ R)) {D : ℕ} (h : ∀ k ∈ p.support, (p.coeff k).totalDegree + k ≤ D) :

Bound the total degree after bringing the univariate variable into the index type. The degree of each coefficient contributes together with its own outer exponent.

theorem MvPolynomial.eval₂_optionEquivLeft_symm {R : Type u_1} [CommSemiring R] {κ : Type u_2} {T : Type u_3} [CommSemiring T] (φ : R →+* T) (y : T) (x : κ → T) (p : Polynomial (MvPolynomial κ R)) :
eval₂ φ (fun (i : Option κ) => i.elim y x) ((optionEquivLeft R κ).symm p) = Polynomial.eval₂ (eval₂Hom φ x) y p

Evaluate the outer variable at the value assigned to none, while evaluating the coefficients at the values assigned to the remaining variables.

noncomputable def MvPolynomial.lastVariableEquiv (R : Type u_2) [CommSemiring R] (m : ℕ) :

Isolate the last variable of a multivariate polynomial.

@[simp]
theorem MvPolynomial.lastVariableEquiv_C {R : Type u_1} {m : ℕ} [CommSemiring R] (a : R) :
theorem MvPolynomial.eval_lastVariableEquiv {R : Type u_1} {m : ℕ} [CommSemiring R] (g : MvPolynomial (Fin m) R) (p : MvPolynomial (Fin (m + 1)) R) :
Polynomial.eval g ((lastVariableEquiv R m) p) = (aeval fun (i : Fin (m + 1)) => Fin.lastCases g X i) p

Evaluating the last variable at a polynomial substitutes that polynomial for the last variable and leaves the prefix variables fixed.

noncomputable def MvPolynomial.specializeLast {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) :

Substitute a scalar for the last variable, keeping all the preceding variables.

theorem MvPolynomial.specializeLast_apply {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) (p : MvPolynomial (Fin (m + 1)) R) :

Specializing the last variable is univariate evaluation at the corresponding constant.

@[simp]
theorem MvPolynomial.specializeLast_X_last {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) :
@[simp]
theorem MvPolynomial.specializeLast_X_castSucc {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) (i : Fin m) :
theorem MvPolynomial.eval_specializeLast {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) (u : Fin m → R) (p : MvPolynomial (Fin (m + 1)) R) :
(eval u) ((specializeLast x) p) = (eval (Fin.snoc u x)) p

Specialization corresponds to evaluating on the last-coordinate slice.

noncomputable def MvPolynomial.evalPrefix {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin m → R) (p : MvPolynomial (Fin (m + 1)) R) :

Retain the last variable and evaluate all preceding variables at u.

theorem MvPolynomial.eval_evalPrefix {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin m → R) (p : MvPolynomial (Fin (m + 1)) R) (x : R) :
theorem MvPolynomial.natDegree_evalPrefix_le {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin m → R) (p : MvPolynomial (Fin (m + 1)) R) :

Evaluating the prefix does not increase the degree in the remaining variable.

noncomputable def MvPolynomial.evalCoordinate {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin (m + 1) → R) (i : Fin (m + 1)) (p : MvPolynomial (Fin (m + 1)) R) :

Evaluate all variables except the selected one, retaining it as a univariate variable.

theorem MvPolynomial.eval_evalCoordinate {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin (m + 1) → R) (i : Fin (m + 1)) (p : MvPolynomial (Fin (m + 1)) R) (t : R) :

Evaluating the coordinate restriction is the same as updating that coordinate.

theorem MvPolynomial.natDegree_evalCoordinate_le {R : Type u_1} {m : ℕ} [CommSemiring R] (u : Fin (m + 1) → R) (i : Fin (m + 1)) (p : MvPolynomial (Fin (m + 1)) R) :

Evaluating the other variables cannot increase the degree of the retained variable.

theorem MvPolynomial.degreeOf_castSucc_le_iff {R : Type u_1} {m : ℕ} [CommSemiring R] (i : Fin m) (p : MvPolynomial (Fin (m + 1)) R) (d : ℕ) :
degreeOf i.castSucc p ≤ d ↔ ∀ (k : ℕ), degreeOf i (((lastVariableEquiv R m) p).coeff k) ≤ d

A prefix variable has degree at most d exactly when it has that bound in each coefficient of the polynomial in the last variable.

theorem MvPolynomial.degreeOf_specializeLast_le {R : Type u_1} {m : ℕ} [CommSemiring R] (x : R) (p : MvPolynomial (Fin (m + 1)) R) (i : Fin m) :

Specializing the last variable preserves each bound on the prefix variables.