Documentation

CslibFrontier.Computability.Complexity.Classes.SharpP.Time

Time-bounded accepting-path counting #

SharpTIME enc t consists of the natural-valued functions counting the accepting terminal branches of one fixed finite-control binary native List-choice machine. Every branch halts by c₁ * t n + c₂ on instances whose encoding has length n; the constants and machine are fixed before the input. Transition occurrences, including repeated identical actions, are separate choices. Acceptance means the terminal output is exactly [true].

This reuses the native counting model of SharpP.Machine. The machine is globally nonblocking, as in the existing native characterization of SharpP; all-branch halting is required on the image of the instance encoding. Increasing a sufficient clock does not multiply the count: a terminal branch is counted once, with no extra choices after its first halt. Thus SharpTIME is distinct from a count of freely padded fair-coin strings.

Main definitions #

Main results #

References #

The occurrence-labelled counting model and its verifier correspondence are developed in MultiTape.Counting and Classes.SharpP.Machine, with the source references recorded there.

def Cslib.Complexity.SharpTIME {α : Type} (enc : α ↪ List Bool) (t : ℕ → ℕ) :
Set (α → ℕ)

Exact accepting terminal-branch counts of fixed nonblocking finite-control native machines whose every branch halts within time c₁ * t n + c₂. Repeated transition occurrences retain multiplicity, while post-halting padding contributes no new branch.

theorem Cslib.Complexity.mem_SharpTIME {α : Type} {enc : α ↪ List Bool} {t : ℕ → ℕ} {f : α → ℕ} :
f ∈ SharpTIME enc t ↔ ∃ (c₁ : ℕ) (c₂ : ℕ) (k : ℕ) (State : Type) (_ : Finite State) (machine : Turing.MultiTapeCTM k Bool State), machine.Nonblocking ∧ ∀ (a : α), machine.HaltsWithin (c₁ * t (enc a).length + c₂) (Turing.Cfg.init machine.initial (enc a)) ∧ machine.acceptCount (c₁ * t (enc a).length + c₂) (Turing.Cfg.init machine.initial (enc a)) = f a

The native machine, its constants and finite control are chosen before the input; the count is the accepting terminal-path count at the all-branches clock.

theorem Cslib.Complexity.SharpTIME_mono_of_le_mul_add {α : Type} {enc : α ↪ List Bool} {t₁ t₂ : ℕ → ℕ} {C : ℕ} (h : ∀ (n : ℕ), t₁ n ≤ C * t₂ n + C) :
SharpTIME enc t₁ ⊆ SharpTIME enc t₂

Constant factors and additive constants of the time bound are absorbed by the constants of SharpTIME. This uses stability of terminal counts after a sufficient all-branches clock, rather than freely padding accepting coin strings.

theorem Cslib.Complexity.SharpTIME_mono {α : Type} {enc : α ↪ List Bool} {t₁ t₂ : ℕ → ℕ} (h : ∀ (n : ℕ), t₁ n ≤ t₂ n) :
SharpTIME enc t₁ ⊆ SharpTIME enc t₂

SharpTIME is monotone in the time bound.

theorem Cslib.Complexity.SharpTIME_pow_mono {α : Type} {enc : α ↪ List Bool} {d D : ℕ} (h : d ≤ D) :
(SharpTIME enc fun (x : ℕ) => x ^ d) ⊆ SharpTIME enc fun (x : ℕ) => x ^ D

Polynomial slices are monotone in the degree: a smaller degree gives a smaller class. At input length 0 the clocks are 0 ^ d ≤ 0 ^ D + 1, which the additive constant absorbs.

theorem Cslib.Complexity.SharpTIME.subset_SharpP {α : Type} {enc : α ↪ List Bool} (d : ℕ) :
(SharpTIME enc fun (x : ℕ) => x ^ d) ⊆ SharpP enc

A polynomial-time accepting-path counter belongs to the existing verifier-defined #P. This is the forward native-machine correspondence, with its affine polynomial clock.

theorem Cslib.Complexity.mem_SharpP_iff_exists_mem_SharpTIME {α : Type} {enc : α ↪ List Bool} {f : α → ℕ} :
f ∈ SharpP enc ↔ ∃ (d : ℕ), f ∈ SharpTIME enc fun (x : ℕ) => x ^ d

The existing verifier-defined #P is the union of the polynomial-time native counting classes. The all-branches clock can be enlarged to an affine power without changing the count.