The checker's scratch account: assembling the bounded-enumeration workspace bound #
Provenance: [Decoupling] §5.4 (Remark, the per-constituent capacity bound) and §6.3 (Theorem 6.3, and the Remark "time to the verdict").
Two accounts meet here.
ReflectiveSubsystems/GodelInternalization.lean bounds the §6.3 checker's memory per constituent:
capacity_bound hosts the enumerating recursor in capacity n = 2n work bits, and
proofcode_workspace_bound fits each candidate proof code p ≤ M_chk in the same 2n — both
stated as bit-lengths in the form Nat.clog 2 (· + 1).
CodeLayer/TimeCost.lean supplies a native workspace measure spaceCost on the
rfind'-free fragment of
Nat.Partrec.Code, whose bounded-recursion bound spaceCost_prec_le is a max — independent of
the iteration count, where the time bound tc_prec_le' is a sum linear in it.
This file assembles the two into the statement §6.3 needs about the enumeration itself: the
checker's loop over the M_chk + 1 candidate proof codes runs in a workspace bounded independently
of M_chk, stated in §6.3's own bit-length vocabulary.
The dictionary #
The two accounts speak different dialects of one quantity: Nat.size p (the native measure) and
Nat.clog 2 (p + 1) (the capacity vocabulary). size_eq_clog proves them equal on the nose, so a
§6.3 capacity bound is a spaceCost hypothesis and conversely — no constant is lost in
translation.
What enters as a hypothesis, and why #
The per-candidate check is not modelled here: no checker code over Nat.Partrec.Code is
constructed, and the Δ₀/poly-time verification of a held candidate (Buss 1986) is the
paper-level input flagged in the [Decoupling] §5.4 Remark. It enters as the hypothesis hstep of
checker_scratch_closure: given that one step of the loop runs in S workspace whenever the
carried verdict occupies S bits, the assembled total is max (spaceCost cf a) S, with M_chk
absent. That boundary is the paper's own, and it is exactly where this formalization stops.
Note the shape of hstep: it is conditioned on the carried accumulator's bit-length. The
uniform form ∀ x, spaceCost cg x ≤ S is unsatisfiable for a space measure — a leaf node holds its
input, so no constant bounds Nat.size over all inputs (the discussion at spaceCost_prec_le).
The space/time contrast #
checker_space_time_contrast puts the two costs of the same loop side by side, which is the
machine-checked form of the §6.3 Remark "time to the verdict": the budget hypothesis M_chk ≤ g^2
is consumed by the time half alone — tc ≤ tc cf a + (B + 1)·g² + 1, exhaustive search,
polynomial in the value g hence exponential in its bit-length — while the space half needs
no budget hypothesis at all and returns a bound in which M_chk does not occur.
The bit-length dictionary. The native workspace measure counts bits with Nat.size; the
capacity account of [Decoupling] §5.4/§6.3 writes the same quantity as ⌈log₂(p+1)⌉. They agree on
the nose: Nat.size p ≤ k ↔ p < 2^k ↔ p + 1 ≤ 2^k ↔ Nat.clog 2 (p+1) ≤ k, and a natural number is
determined by which k bound it.
The capacity bound on a candidate proof code, in the native measure's vocabulary: for the
concrete budget M_chk ≤ g² of [Decoupling] §6.3, every candidate p ≤ M_chk occupies at most
capacity n = 2n bits, n := ⌈log₂(g+1)⌉ the size of the Gödel sentence. This is
proofcode_workspace_bound read through size_eq_clog.
The closure: the enumeration's workspace does not grow with the budget #
The scratch bound of the bounded enumeration ([Decoupling] §6.3). The checker's loop is the
bounded recursion prec cf cg run to the budget M_chk. Given
hstep— one step of the loop uses at mostSworkspace on a candidatep ≤ M_chkwhenever the verdictbit carries occupies at mostSbits; andhverdict— every verdict the loop actually carries does occupy at mostSbits,
the whole enumeration runs in max (spaceCost cf a) S workspace. The content is the max: the
budget M_chk — the number of candidates enumerated — does not appear in the bound. Enumerating
more candidates costs more time (checker_space_time_contrast), never more space.
Both hypotheses are stated in the §6.3 vocabulary ⌈log₂(· + 1)⌉, which is the bit-length in which
capacity_bound and proofcode_workspace_bound speak; size_eq_clog is the whole of the
translation into spaceCost_prec_le's native measure.
The per-candidate Δ₀/poly-time check of a held candidate (Buss 1986) is not constructed here: it
is the paper-level input of the [Decoupling] §5.4 Remark, and it enters precisely as hstep.
Space and time for the same enumeration ([Decoupling] §6.3, Remark "time to the verdict"). The bounded checker's loop, priced twice:
- space —
max (spaceCost cf a) S, theM_chk-free bound ofchecker_scratch_closure; - time —
tc cf a + (B + 1)·g² + 1, one bounded check per candidate.
The asymmetry is the point, and it is visible in the hypotheses: the budget hypothesis
hM : M_chk ≤ g² is consumed by the time half only. The space half never sees it, so no
polynomial in g can enter that bound. The verdict therefore costs a number of steps polynomial in
the value g — exponential in its bit-length n = ⌈log₂(g+1)⌉, there being 2^{Θ(n)} candidate
codes to rule out — while the workspace stays poly(n): the subsystem affords the verdict in
poly(n) space and pays exhaustive-search time for it.
B bounds the cost of one check on the states the loop actually visits (htime, the visited-states
form), so a step cost that grows with the accumulator is admissible.
Holding the loop's input: the pairing cost #
The loop's step input fits in linear capacity. One iteration of the §6.3 checker is handed
⟨a, ⟨p, b⟩⟩: the sentence data a, a candidate code p ≤ M_chk, and the one-bit running verdict
b ≤ 1. With the sentence data itself within capacity, that packed input occupies
≤ 4·capacity n + 4 bits — poly(n), indeed linear in n = ⌈log₂(g+1)⌉. The additive slack
absorbs the degenerate g = 0 case, where the capacity is 0 but a held bit still costs one.
Fidelity note. This ≈ 8n figure prices Nat.pair — Cantor square pairing — applied twice.
It is not the paper's ≈ 4n for holding the sentence and the current candidate together: that
figure is concatenation arithmetic (component bit-lengths add — prodAsm_fitsIn, FV-14), a
different packing. The two are not to be identified.
The loop's verdict agrees with the decision morphism #
The running verdict of the enumeration, in closed form. A bounded recursion whose base returns
1 and whose step multiplies the carried verdict by ¬Prf(φ, p) computes, at counter k, exactly
"no candidate below k was accepted".
The enumeration decides bounded non-provability ([Decoupling] §6.3, L2b). The loop of
checkerLoop_val, run to counter M_chk + 1, returns 1 exactly when the decision morphism
Decide returns true: the native bounded recursion over Nat.Partrec.Code computes the same
verdict as the finite fold ⋀_{p ≤ M_chk} ¬Prf(φ, p).
The counter is M_chk + 1, not M_chk: prec at ⟨a, k⟩ runs its step at counters 0, …, k-1,
while Decide folds over the M_chk + 1 codes p ≤ M_chk.