Uniform multivariate coefficient extraction at one counting level #
The number of variables is unary, while the prime, address and coefficient
indices are binary. One sum over addresses below p^n extracts a coefficient
of a polynomial supplied through uniform modular evaluation access.
Adapted from lean-canny.
Main definitions #
Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue: addressed grid-sum evaluator.
Main results #
Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue_mem: coefficient extraction costs one additional counting level, even with variable arity.Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue_eq_val: canonical coefficient residues from evaluations on canonical grid points.
References #
theorem Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue_mem {α : Type} {enc : α ↪ List Bool} {a : ℕ} (E : Turing.MultiTapeTM.Decoder enc) {p n : α → ℕ} {β : α → List ℕ} {value : α × List ℕ → ℕ} (hp : Turing.MultiTapeTM.ComputableInPolyTime p enc Turing.MultiTapeTM.encNat) (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encUnary) (hβ : Turing.MultiTapeTM.ComputableInPolyTime β enc (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (hv :
value ∈ CountingFunction a (Turing.MultiTapeTM.encPair enc (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat))
Turing.MultiTapeTM.encNat) :
(fun (w : α) => multivariateCoefficientResidue (p w) (n w) (β w) fun (z : List ℕ) => value (w, z)) ∈ CountingFunction (a + 1) enc Turing.MultiTapeTM.encNat
Variable arity costs no additional counting depth: all coordinates are handled by the polynomial-time address decoder and weight computation.
theorem Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue_cast {p n : ℕ} [Fact (Nat.Prime p)] (P : MvPolynomial (Fin n) (ZMod p)) (e : Fin n →₀ ℕ) (β : List ℕ) (value : List ℕ → ℕ) (hP : P.totalDegree < p - 1) (he : ∀ (i : Fin n), e i < p - 1) (hβ : ∀ (i : Fin n), β[↑i]?.getD 0 = e i) (hvalue :
∀ r < p ^ n, ↑(value (gridPoint p n r)) = (MvPolynomial.eval fun (i : Fin n) => ↑((gridPoint p n r)[↑i]?.getD 0)) P) :
Correctness requires modular evaluation only at the addressed canonical points.
theorem Cslib.Complexity.RealAlgebraic.multivariateCoefficientResidue_eq_val {p n : ℕ} [Fact (Nat.Prime p)] (P : MvPolynomial (Fin n) (ZMod p)) (e : Fin n →₀ ℕ) (β : List ℕ) (value : List ℕ → ℕ) (hP : P.totalDegree < p - 1) (he : ∀ (i : Fin n), e i < p - 1) (hβ : ∀ (i : Fin n), β[↑i]?.getD 0 = e i) (hvalue :
∀ r < p ^ n, ↑(value (gridPoint p n r)) = (MvPolynomial.eval fun (i : Fin n) => ↑((gridPoint p n r)[↑i]?.getD 0)) P) :
The natural output is the canonical representative of the actual coefficient.