Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.BigO.Pi

Parameterized resource bounds for finite tuples #

Finite tuples use encPi, so reading, gathering, and updating fixed entries costs linear time and space in the complete encoded input. Dimensions and index maps are fixed independently of the input; the hidden machine constants may depend on them. Construction retains the original input for each component and sums the supplied time and space bounds. These are asymptotic native-machine bounds, including encoded output size, not exact transition counts.

Main results #

References #

Uses Christian Reitwiessner's native degree/resource calculus and list primitives. The finite-family construction follows CslibFrontier/PolyTime/Pi.lean, which credits the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8.

theorem Turing.MultiTapeTM.ComputableInO.ofFn {α Value : Type} {input : α ↪ List Bool} {enc : Value ↪ List Bool} {count : ℕ} {values : α → Fin count → Value} {T S : Fin count → α → ℕ} (hvalues : ∀ (i : Fin count), ComputableInO (fun (a : α) => values a i) input enc (T i) (S i)) :
ComputableInO (fun (a : α) => List.ofFn (values a)) input (encList enc) (fun (a : α) => (input a).length + ∑ i : Fin count, T i a) fun (a : α) => (input a).length + ∑ i : Fin count, S i a

Construct a fixed-length list, charging each computation and retention of the input.

theorem Turing.MultiTapeTM.ComputableInO.pi {α Index Value : Type} {input : α ↪ List Bool} {enc : Value ↪ List Bool} [Fintype Index] {values : α → Index → Value} {T S : Index → α → ℕ} (hvalues : ∀ (i : Index), ComputableInO (fun (a : α) => values a i) input enc (T i) (S i)) :
ComputableInO values input (encPi enc) (fun (a : α) => (input a).length + ∑ i : Index, T i a) fun (a : α) => (input a).length + ∑ i : Index, S i a

Construct a finite tuple from arbitrary resource certificates for its entries.

theorem Turing.MultiTapeTM.ComputableInO.pi_apply {Index Value : Type} [Fintype Index] (enc : Value ↪ List Bool) (i : Index) :
ComputableInO (fun (values : Index → Value) => values i) (encPi enc) enc (fun (values : Index → Value) => ((encPi enc) values).length) fun (values : Index → Value) => ((encPi enc) values).length

Read a fixed tuple entry without assuming that the value type is inhabited.

theorem Turing.MultiTapeTM.ComputableInO.pi_gather {Index Value Target : Type} [Fintype Index] [Fintype Target] (enc : Value ↪ List Bool) (indices : Target → Index) :
ComputableInO (fun (values : Index → Value) => values ∘ indices) (encPi enc) (encPi enc) (fun (values : Index → Value) => ((encPi enc) values).length) fun (values : Index → Value) => ((encPi enc) values).length

Gather fixed entries into a fixed tuple; the map need not be injective.

theorem Turing.MultiTapeTM.ComputableInO.pi_update {Index Value : Type} [Fintype Index] [DecidableEq Index] (enc : Value ↪ List Bool) (i : Index) :
ComputableInO (fun (p : (Index → Value) × Value) => Function.update p.1 i p.2) (encPair (encPi enc) enc) (encPi enc) (fun (p : (Index → Value) × Value) => ((encPair (encPi enc) enc) p).length) fun (p : (Index → Value) × Value) => ((encPair (encPi enc) enc) p).length

Replace one fixed entry of a stored tuple with a stored value, preserving all other entries.