Documentation

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

Linear workspace for table-free binary-polynomial operations #

This is a scalar kernel for the generator, not its native logspace certificate (#6747). fieldMulMod_inSpace concerns the existing total evaluator, including padding and truncation, with no irreducibility or nonempty-word assumptions. Coefficients are little-endian Boolean lists. Each bit uses the existing framed-list encoding; its length is three times the word length. The modulus and operands are retained while the multiplication fold executes. Remainder uses the same fold and native step, initialized with the coefficient word for one instead of an operand. The fold rule charges the callee as well as both live coefficient words at every prefix.

This is an original resource analysis of the existing executable algorithm. Modulus search, binary dimension processing, Horner composition and seed-tape queries remain under #6747.

Main results #

@[reducible, inline]

Framed little-endian coefficient bits, three encoded symbols per coefficient.

Inputs to the supplied-modulus multiplication kernel.

  • modulus : List Bool

    Little-endian modulus coefficients.

  • left : List Bool

    Left coefficient word, padded or truncated by the evaluator.

  • right : List Bool

    Right coefficient word, padded or truncated by the evaluator.

@[reducible, inline]

The tuple of the fields of encMulInput.

theorem Turing.BinaryField.encMulInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 x2 : γ → List Bool} (h0 : MultiTapeTM.ComputableInSpace x0 encIn encCoefficients budget) (h1 : MultiTapeTM.ComputableInSpace x1 encIn encCoefficients budget) (h2 : MultiTapeTM.ComputableInSpace x2 encIn encCoefficients budget) :
MultiTapeTM.ComputableInSpace (fun (x : γ) => { modulus := x0 x, left := x1 x, right := x2 x }) encIn encMulInput budget
theorem Turing.BinaryField.encMulInput_left_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MulInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encMulInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).left) encIn✝ encCoefficients S✝
theorem Turing.BinaryField.encMulInput_modulus_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → MulInput} :
theorem Turing.BinaryField.encMulInput_mk_polyTime {γ : Type} {encIn : γ ↪ List Bool} {x0 x1 x2 : γ → List Bool} (h0 : MultiTapeTM.ComputableInPolyTime x0 encIn encCoefficients) (h1 : MultiTapeTM.ComputableInPolyTime x1 encIn encCoefficients) (h2 : MultiTapeTM.ComputableInPolyTime x2 encIn encCoefficients) :
MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { modulus := x0 x, left := x1 x, right := x2 x }) encIn encMulInput
theorem Turing.BinaryField.encMulInput_modulus_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MulInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encMulInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).modulus) encIn✝ encCoefficients S✝
theorem Turing.BinaryField.encMulInput_right_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MulInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encMulInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).right) encIn✝ encCoefficients S✝

Modulus, left operand and right operand in order; each is a framed Boolean list and all record fields except the last are framed again by enc_structure.

theorem Turing.BinaryField.encMulInput_right_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → MulInput} :
theorem Turing.BinaryField.encMulInput_left_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → MulInput} :
theorem Turing.BinaryField.encMulInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : MultiTapeTM.ComputableInO x0 encIn encCoefficients T0 S0) (h1 : MultiTapeTM.ComputableInO x1 encIn encCoefficients T1 S1) (h2 : MultiTapeTM.ComputableInO x2 encIn encCoefficients T2 S2) :
MultiTapeTM.ComputableInO (fun (x : γ) => { modulus := x0 x, left := x1 x, right := x2 x }) encIn encMulInput (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)

Coefficient-wise XOR uses linear workspace in the encoded pair of coefficient words. The output ends at the shorter word.

The existing table-free evaluator is computable by a native machine in workspace linear in its three framed coefficient words. This includes all intermediate fold states and scalar callees, with no assumptions about the supplied modulus.

Arguments to the supplied-modulus polynomial-remainder evaluator.

  • modulus : List Bool

    Little-endian modulus coefficients, with no monicity assumption.

  • dividend : List Bool

    Little-endian coefficients to scan.

Modulus followed by dividend, both framed Boolean lists; the modulus field is additionally framed by the record encoding. Each coefficient contributes three symbols before record framing.

theorem Turing.BinaryField.encRemainderInput_dividend_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RemainderInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encRemainderInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).dividend) encIn✝ encCoefficients S✝
theorem Turing.BinaryField.encRemainderInput_mk_polyTime {γ : Type} {encIn : γ ↪ List Bool} {x0 x1 : γ → List Bool} (h0 : MultiTapeTM.ComputableInPolyTime x0 encIn encCoefficients) (h1 : MultiTapeTM.ComputableInPolyTime x1 encIn encCoefficients) :
MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { modulus := x0 x, dividend := x1 x }) encIn encRemainderInput
theorem Turing.BinaryField.encRemainderInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} (h0 : MultiTapeTM.ComputableInSpace x0 encIn encCoefficients budget) (h1 : MultiTapeTM.ComputableInSpace x1 encIn encCoefficients budget) :
MultiTapeTM.ComputableInSpace (fun (x : γ) => { modulus := x0 x, dividend := x1 x }) encIn encRemainderInput budget
theorem Turing.BinaryField.encRemainderInput_modulus_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RemainderInput} :
MultiTapeTM.ComputableInSpace g✝ encIn✝ encRemainderInput S✝ → MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).modulus) encIn✝ encCoefficients S✝
@[reducible, inline]

The tuple of the fields of encRemainderInput.

theorem Turing.BinaryField.encRemainderInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : MultiTapeTM.ComputableInO x0 encIn encCoefficients T0 S0) (h1 : MultiTapeTM.ComputableInO x1 encIn encCoefficients T1 S1) :
MultiTapeTM.ComputableInO (fun (x : γ) => { modulus := x0 x, dividend := x1 x }) encIn encRemainderInput (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

Native linear workspace for the existing total supplied-modulus modBits evaluator. The modulus is retained throughout the scan; at every prefix both registers have at most modulus.length - 1 coefficients. The native fold also charges each shift/XOR callee. For monic moduli, algebraic remainder agreement is supplied by Cslib.mk_polyOfBits_modBits; no algebraic meaning is asserted here for malformed modulus words.