First and second partial derivatives in one additional counting level #
The first- and second-partial evaluators extract short addressed coefficients of a translated
polynomial. Both use one coefficient sum, so a uniform F_a evaluator gives F_(a+1) access.
The second-partial evaluator includes factor two when its two coordinates coincide.
Correctness requires total degree below p - 1, with primes p > 2 for first partials
and p > 3 for second partials.
Variable arity is supplied in unary, with binary derivative indices, modulus and point
coordinates; missing coordinates are zero. The auxiliary coefficient-address lists are local
implementation details, with their polynomial-time construction charged in each certificate.
Adapted from the address construction and derivative evaluators in lean-canny.
theorem Cslib.Complexity.RealAlgebraic.firstPartialResidue_mem {α : Type} {enc : α ↪ List Bool} {a : ℕ} (E : Turing.MultiTapeTM.Decoder enc) {p n i : α → ℕ} {z : α → List ℕ} {value : α × List ℕ → ℕ} (hp : Turing.MultiTapeTM.ComputableInPolyTime p enc Turing.MultiTapeTM.encNat) (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encUnary) (hi : Turing.MultiTapeTM.ComputableInPolyTime i enc Turing.MultiTapeTM.encNat) (hz : Turing.MultiTapeTM.ComputableInPolyTime z 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 : α) => firstPartialResidue (p w) (n w) (i w) (z w) fun (y : List ℕ) => value (w, y)) ∈ CountingFunction (a + 1) enc Turing.MultiTapeTM.encNat
theorem Cslib.Complexity.RealAlgebraic.secondPartialResidue_mem {α : Type} {enc : α ↪ List Bool} {a : ℕ} (E : Turing.MultiTapeTM.Decoder enc) {p n i j : α → ℕ} {z : α → List ℕ} {value : α × List ℕ → ℕ} (hp : Turing.MultiTapeTM.ComputableInPolyTime p enc Turing.MultiTapeTM.encNat) (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encUnary) (hi : Turing.MultiTapeTM.ComputableInPolyTime i enc Turing.MultiTapeTM.encNat) (hj : Turing.MultiTapeTM.ComputableInPolyTime j enc Turing.MultiTapeTM.encNat) (hz : Turing.MultiTapeTM.ComputableInPolyTime z 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 : α) => secondPartialResidue (p w) (n w) (i w) (j w) (z w) fun (y : List ℕ) => value (w, y)) ∈ CountingFunction (a + 1) enc Turing.MultiTapeTM.encNat
theorem Cslib.Complexity.RealAlgebraic.firstPartialResidue_cast {p n : ℕ} [Fact (Nat.Prime p)] (F : MvPolynomial (Fin n) (ZMod p)) (i : Fin n) (z : List ℕ) (value : List ℕ → ℕ) (hF : F.totalDegree < p - 1) (hp : 2 < p) (hv : ∀ (y : List ℕ), ↑(value y) = (MvPolynomial.eval fun (j : Fin n) => ↑(y[↑j]?.getD 0)) F) :
↑(firstPartialResidue p n (↑i) z value) = (MvPolynomial.eval fun (j : Fin n) => ↑(z[↑j]?.getD 0)) ((MvPolynomial.pderiv i) F)
theorem Cslib.Complexity.RealAlgebraic.secondPartialResidue_cast {p n : ℕ} [Fact (Nat.Prime p)] (F : MvPolynomial (Fin n) (ZMod p)) (i j : Fin n) (z : List ℕ) (value : List ℕ → ℕ) (hF : F.totalDegree < p - 1) (hp : 3 < p) (hv : ∀ (y : List ℕ), ↑(value y) = (MvPolynomial.eval fun (k : Fin n) => ↑(y[↑k]?.getD 0)) F) :
↑(secondPartialResidue p n (↑i) (↑j) z value) = (MvPolynomial.eval fun (k : Fin n) => ↑(z[↑k]?.getD 0)) ((MvPolynomial.pderiv j) ((MvPolynomial.pderiv i) F))