Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.FormulaGateCoordinateEvaluation

Indexed coordinate evaluation at Kronecker points #

An indexed evaluator for individual bivariate coordinates supplies the list needed by the formula gate evaluator. The query uses the two values z and z ^ radix in the same order as the variables of the substituted polynomial. The second value is computed by modular powering. The list length is the raw formula word length, so collecting the residues preserves the evaluator's counting-function level.

This combines the indexed coordinate queries in LeanCanny.ETR.BivariateTermReader.coordinates at lean-canny 970f28a5ecefc1327402ade16c068aa4b1b2c183 with Frontier's modular list builder.

Evaluate one coordinate at a bivariate point over the supplied modulus.

  • context : α

    The input instance used by the coordinate family.

  • modulus : ℕ

    The modulus of the coordinate query.

  • innerValue : ℕ

    The value of the inner variable.

  • outerValue : ℕ

    The value of the outer variable.

  • index : ℕ

    The index of the requested coordinate.

theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_context_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → FormulaGateCoordinateQuery α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encFormulaGateCoordinateQuery enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).context) encIn✝ enc S✝
theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_mk_deg {α : Type} (enc : α ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : α × ℕ × ℕ × ℕ × ℕ) => { context := p.1, modulus := p.2.1, innerValue := p.2.2.1, outerValue := p.2.2.2.1, index := p.2.2.2.2 }) (encFormulaGateCoordinateQueryFields enc) (encFormulaGateCoordinateQuery enc) 1 1
theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_index_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → FormulaGateCoordinateQuery α} :

The context, modulus, inner value and outer value are framed in order, followed by the coordinate index. All four numbers use binary encoding.

theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_modulus_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → FormulaGateCoordinateQuery α} :
theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_mk_inO {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → α} {T0 S0 x1 T1 S1 x2 T2 S2 x3 T3 S3 x4 T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn enc T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encNat T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encNat T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encNat T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { context := x0 x, modulus := x1 x, innerValue := x2 x, outerValue := x3 x, index := x4 x }) encIn (encFormulaGateCoordinateQuery enc) (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
theorem Cslib.Complexity.RealAlgebraic.encFormulaGateCoordinateQuery_mk_budget {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → α} {x1 x2 x3 x4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn enc budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encNat budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encNat budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encNat budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { context := x0 x, modulus := x1 x, innerValue := x2 x, outerValue := x3 x, index := x4 x }) encIn (encFormulaGateCoordinateQuery enc) budget

Read the coordinate residues at a Kronecker point in variable order. The zero modulus uses modulus one, which gives a list of zeros.

Collecting coordinate values at a Kronecker point preserves their counting-function level. The query is a context paired with a binary modulus, then paired with a binary field representative.

theorem Cslib.Complexity.RealAlgebraic.formulaWordGateKroneckerCoordinates_get_cast {α : Type} (word : List Bool) (context : α) {p : ℕ} (hp : 0 < p) (z inner : ℕ) (hz : z < p) (coordinates : Fin word.length → Polynomial (Polynomial ℤ)) (value : FormulaGateCoordinateQuery α → ℕ) (hvalue : ∀ (x y : ℕ), x < p → y < p → ∀ (k : Fin word.length), ↑(value { context := context, modulus := p, innerValue := x, outerValue := y, index := ↑k }) = (Polynomial.aevalAeval ↑x ↑y) (coordinates k)) (k : Fin word.length) :
↑((formulaWordGateKroneckerCoordinates word context p z inner value)[↑k]?.getD 0) = (Polynomial.aevalAeval (↑z) (↑z ^ formulaWordGateKroneckerRadix word inner)) (coordinates k)

If a scalar query agrees with bivariate evaluation on canonical field representatives, the collected list gives the specialized coordinate at each variable of the formula word.