Documentation

CslibFrontier.Computability.Complexity.Classes.Hierarchy.LazyDiagonalVerifier

Resource certificates for lazy-diagonal verifiers #

Assemble the common input decoding, simulation, negated exhaustive search and conditional branches of a lazy-diagonal verifier. Clock construction and its estimates belong to callers: the polynomial and exponential hierarchies use different clocks. The resulting time bound charges only the branch taken; the space witness is independent of that time bound.

Main results #

@[reducible, inline]

Description, input and certificate encoding for lazy acceptance simulation. The word is frame description ++ frame input ++ certificate.

theorem Cslib.Complexity.Diagonal.exists_computableInO_lazyAccepts (β : List Bool → List Bool → ℕ) (a : ℕ) (hclock : Turing.MultiTapeTM.ComputableInO (fun (q : List Bool × List Bool × List Bool) => β q.2.1 q.2.2) encLazyAcceptsInput Turing.MultiTapeTM.encNat (fun (q : List Bool × List Bool × List Bool) => (encLazyAcceptsInput q).length + β q.2.1 q.2.2) fun (q : List Bool × List Bool × List Bool) => (encLazyAcceptsInput q).length + β q.2.1 q.2.2) (hlen : ∀ (y v : List Bool), (Turing.MultiTapeTM.encNat (β y v)).length ≤ (a + 4) * (y.length + v.length + 1)) (hpos : ∀ (y v : List Bool), 1 ≤ β y v) :
∃ (D : ℕ), Turing.MultiTapeTM.ComputableInO (fun (q : List Bool × List Bool × List Bool) => lazyAccepts β q.1 q.2.1 q.2.2) encLazyAcceptsInput Turing.MultiTapeTM.encBool (fun (q : List Bool × List Bool × List Bool) => ((q.1.length + 1) ^ D + q.2.1.length + q.2.2.length + 1) ^ 4 * β q.2.1 q.2.2 ^ 2) fun (q : List Bool × List Bool × List Bool) => ((q.1.length + 1) ^ D + q.2.1.length + q.2.2.length + 1) ^ 4 * β q.2.1 q.2.2 ^ 2

Construct the acceptance simulation with an arbitrary binary clock. Its time and space budgets include input access; positivity and a linear binary-length bound suffice for the shared universal-simulation estimate. The clock may depend on both input and certificate.

theorem Cslib.Complexity.Diagonal.exists_computableInO_lazyBrute {α : Type} {encA : α ↪ List Bool} {β : List Bool → List Bool → ℕ} {param : α → List Bool × List Bool} {ℓ : α → ℕ} (hacc : Turing.MultiTapeTM.ComputableInPolyTime (fun (q : List Bool × List Bool × List Bool) => lazyAccepts β q.1 q.2.1 q.2.2) encLazyAcceptsInput Turing.MultiTapeTM.encBool) (hparam : Turing.MultiTapeTM.ComputableInPolyTime param encA (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) (hℓ : Turing.MultiTapeTM.ComputableInPolyTime ℓ encA Turing.MultiTapeTM.encUnary) :
∃ (K : ℕ), Turing.MultiTapeTM.ComputableInO (fun (x : α) => (BitString.enumList (ℓ x)).any (lazyAccepts β (param x).1 (param x).2)) encA Turing.MultiTapeTM.encBool (fun (x : α) => 2 ^ (K * ((encA x).length + ℓ x))) fun (x : α) => 2 ^ (K * ((encA x).length + ℓ x))

Exhaustive acceptance search after polynomial-time parameter selection. The parameter may include a unary certificate length, so the same construction covers both directly constructible lengths and lengths supplied by a separate, more expensive preprocessing step. The bound charges the entire encoded parameter, preserving that preprocessing interface.

Construct a horizon comparison from a unary clock certificate. The tested word may be the input or its one-bit extension. Only its time and length bounds are needed; its space bound and the clock's space bound remain independent.

theorem Cslib.Complexity.Diagonal.exists_computableInO_lazyTests {H : ℕ → ℕ} {C SE : List Bool × List Bool → ℕ} {M : ℕ} (hE : Turing.MultiTapeTM.ComputableInO (fun (p : List Bool × List Bool) => H (2 * (Turing.MultiTapeTM.unframe p.1).length + 1)) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encUnary C SE) (hC : ∀ (p : List Bool × List Bool), ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) p).length + 1 ≤ C p) (hQ : ∀ (p : List Bool × List Bool), (2 * ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) p).length + 4 + H (2 * (Turing.MultiTapeTM.unframe p.1).length + 1)) ^ 2 ≤ M * C p) :

Construct all three lazy-verifier tests from a unary horizon certificate. The common time budget covers input access and the comparison square; each test keeps its own space witness, independently of the clock's space budget.

theorem Cslib.Complexity.Diagonal.exists_computableInO_lazyVerifier {β : List Bool → List Bool → ℕ} {L H : ℕ → ℕ} {C S₀ S₁ S₂ : List Bool × List Bool → ℕ} {B SB : List Bool × List Bool × List Bool → ℕ} {R SR : List Bool × List Bool → ℕ} (hacc : Turing.MultiTapeTM.ComputableInO (fun (q : List Bool × List Bool × List Bool) => lazyAccepts β q.1 q.2.1 q.2.2) encLazyAcceptsInput Turing.MultiTapeTM.encBool B SB) (hbrute : Turing.MultiTapeTM.ComputableInO (fun (q : List Bool × List Bool) => (BitString.enumList (L q.2.length)).any (lazyAccepts β q.1 q.2)) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool R SR) (hc₀ : Turing.MultiTapeTM.ComputableInO (fun (p : List Bool × List Bool) => shortDesc (Turing.MultiTapeTM.unframe p.1)) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool C S₀) (hc₁' : Turing.MultiTapeTM.ComputableInO (fun (p : List Bool × List Bool) => decide ((p.1.length + 1).size ≤ H (2 * (Turing.MultiTapeTM.unframe p.1).length + 1))) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool C S₁) (hc₂' : Turing.MultiTapeTM.ComputableInO (fun (p : List Bool × List Bool) => decide (p.1.length.size ≤ H (2 * (Turing.MultiTapeTM.unframe p.1).length + 1))) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool C S₂) (hC : ∀ (p : List Bool × List Bool), ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) p).length + 1 ≤ C p) :

Compose the lazy verifier without replacing branch costs by their worst case. The caller supplies three tests at cost C, an acceptance simulation at cost B, and exhaustive search at cost R. Test space bounds may differ from each other and from time.