Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.PolyTime.List.AdjacentTrace

Plain native cost of stable adjacent trace generation #

encResult stores binary original keys followed by binary request positions, with the ordinary pair/list framing. The joint insertion certificate covers EVERY raw accumulator, including huge arbitrary old requests. The outer fold establishes its own storage bound: keys retain their encoded mass, there are at most quadratically many requests, and request widths are at most the actual input list length. Shifting/copying the trace is charged, not just the insertion sort comparison count. This is original instrumentation cost analysis.

Binary sorted original keys first (framed), then binary requests; each list uses the standard framed element encoding. No unary key or binary-value-funded clock is used.

theorem Cslib.AdjacentSortTrace.encResult_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List ℕ} {T0 S0 : γ → ℕ} {x1 : γ → List ℕ} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { sortedKeys := x0 x, requests := x1 x }) encIn encResult (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.AdjacentSortTrace.encResult_sortedKeys_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Result} :
theorem Cslib.AdjacentSortTrace.encResult_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { sortedKeys := x0 x, requests := x1 x }) encIn encResult budget
theorem Cslib.AdjacentSortTrace.encResult_requests_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Result} :
@[reducible, inline]

The tuple of the fields of encResult.

Generate the actual stable trace on EVERY binary key list in plain polynomial time. The actual list length clocks the fold/scans/ranges; reachable key mass, quadratic request count and linear index width prove the accumulator bound internally.