Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.InSpace.BinaryFieldHorner

Binary-label Horner evaluation with a supplied modulus #

The coefficient of degree i is the width-bit block at offset width * i in a binary label. Horner evaluation visits these blocks in descending order with a binary counter. The supplied modulus and evaluation point remain available throughout; no coefficient table is constructed. This component belongs to the native weight-generator development in #6747. Modulus selection, seed access and the full generator are separate components.

Main results #

Runtime data for evaluating a polynomial packed into a binary label. The coefficient width is the degree modulus.length - 1; the coefficient count is supplied in binary.

  • modulus : List Bool

    Little-endian modulus coefficients.

  • point : List Bool

    Coordinate word of the evaluation point.

  • label : ℕ

    Coefficients packed least-significant block first.

  • count : ℕ

    Number of coefficient blocks, including any leading zero blocks.

theorem Turing.BinaryField.encHornerInput_label_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → HornerInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encHornerInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).label) encIn✝ MultiTapeTM.encNat S✝
theorem Turing.BinaryField.encHornerInput_label_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → HornerInput} :
theorem Turing.BinaryField.encHornerInput_count_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → HornerInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encHornerInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).count) encIn✝ MultiTapeTM.encNat S✝
@[reducible, inline]

The tuple of the fields of encHornerInput.

theorem Turing.BinaryField.encHornerInput_point_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → HornerInput} :
theorem Turing.BinaryField.encHornerInput_mk_polyTime {γ : Type} {encIn : γ ↪ List Bool} {x0 x1 : γ → List Bool} {x2 x3 : γ → ℕ} (h0 : MultiTapeTM.ComputableInPolyTime x0 encIn encCoefficients) (h1 : MultiTapeTM.ComputableInPolyTime x1 encIn encCoefficients) (h2 : MultiTapeTM.ComputableInPolyTime x2 encIn MultiTapeTM.encNat) (h3 : MultiTapeTM.ComputableInPolyTime x3 encIn MultiTapeTM.encNat) :
MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { modulus := x0 x, point := x1 x, label := x2 x, count := x3 x }) encIn encHornerInput
theorem Turing.BinaryField.encHornerInput_count_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → HornerInput} :
theorem Turing.BinaryField.encHornerInput_modulus_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → HornerInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encHornerInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).modulus) encIn✝ encCoefficients S✝
theorem Turing.BinaryField.encHornerInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 x2 T2 S2 x3 T3 S3 : γ → ℕ} (h0 : MultiTapeTM.ComputableInO x0 encIn encCoefficients T0 S0) (h1 : MultiTapeTM.ComputableInO x1 encIn encCoefficients T1 S1) (h2 : MultiTapeTM.ComputableInO x2 encIn MultiTapeTM.encNat T2 S2) (h3 : MultiTapeTM.ComputableInO x3 encIn MultiTapeTM.encNat T3 S3) :
MultiTapeTM.ComputableInO (fun (x : γ) => { modulus := x0 x, point := x1 x, label := x2 x, count := x3 x }) encIn encHornerInput (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))

Framed modulus and point words followed by the binary label and coefficient count.

theorem Turing.BinaryField.encHornerInput_mk_deg :
MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × ℕ × ℕ) => { modulus := p.1, point := p.2.1, label := p.2.2.1, count := p.2.2.2 }) encHornerInputFields encHornerInput 1 1
theorem Turing.BinaryField.encHornerInput_point_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → HornerInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encHornerInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).point) encIn✝ encCoefficients S✝
theorem Turing.BinaryField.encHornerInput_modulus_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → HornerInput} :
theorem Turing.BinaryField.encHornerInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 x3 : γ → ℕ} (h0 : MultiTapeTM.ComputableInSpace x0 encIn encCoefficients budget) (h1 : MultiTapeTM.ComputableInSpace x1 encIn encCoefficients budget) (h2 : MultiTapeTM.ComputableInSpace x2 encIn MultiTapeTM.encNat budget) (h3 : MultiTapeTM.ComputableInSpace x3 encIn MultiTapeTM.encNat budget) :
MultiTapeTM.ComputableInSpace (fun (x : γ) => { modulus := x0 x, point := x1 x, label := x2 x, count := x3 x }) encIn encHornerInput budget

Evaluate the packed coefficient blocks at the supplied point, reducing products modulo the supplied polynomial. A request with zero coefficient blocks returns the empty word.

Each coefficient supplied to Horner is the fixed-width block at its binary offset.

Packed Horner evaluation uses workspace linear in the encoded request length.