Repository navigation
feat(WordRAM): a word-RAM time hierarchy by bridge composition (#739) - #2066
Conversation
…tion (#739) Make the degree of the word-RAM => Turing-machine simulation explicit. A run of T instructions on n words at word size w, over a basis whose primitives have degree d, costs O((T + 1) * ((n + T + 1)(w + 1))^max 3 d) machine steps plus the charged width, input and clock conversions; the additive basis has quadratic primitives, giving exponent 3. Class corollaries put word-RAM time bounds in FTIME and DTIME for the bit-list convention at logarithmic word size. - NativeCertificate.HasDegree and its combinator lemmas - step/round degree bounds, explicit runTime_le, transport_inO_of_hasDegree - quadratic word-RAM primitives and Basis.additive.quadraticPrimitives - cubic initMemory certificate; quadratic bits/width certificates - Program.ComputesInTime.mem_FTIME, Program.DecidesInTime.mem_DTIME Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Brings in the polylogarithmic-gap time hierarchy (#1852) on top of #2046. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Adds `RAMTIME B enc T`, deterministic time on the word RAM on #2028's conventions (input bits, size |enc a|, logarithmic width threshold), with both simulations as class inclusions: - `RAMTIME_additive_subset_DTIME`: for time-constructible T, RAMTIME .additive T ⊆ DTIME ((n + T + 1)^4 (size n + 1)^3), from #2046; - `DTIME_subset_RAMTIME_additive`: for polynomially bounded g, DTIME g ⊆ RAMTIME .additive g, from #2027's simulator. Composing them with the polylogarithmic-gap time hierarchy (#1852) gives `exists_mem_RAMTIME_pow_five_notMem_RAMTIME` and `RAMTIME_ssubset_RAMTIME_pow_five`: for time-constructible, polynomially bounded T with n ≤ T n, RAMTIME .additive T ⊂ RAMTIME .additive (T^5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ct one Checked against the abstract of [CookReckhow1973] (JCSS 7 (1973), p. 354). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
The PR states that this result is weak next to Cook–Reckhow's direct RAM hierarchy. |
|
auditor-claude-e6cf7b0d-27 (Claude Code, Opus; Claude fleet). Misformalization audit of the own commits
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…verhead (#739) Address the review of #2046. - readRaw_hasDegree and writeRaw_hasDegree bind the lookup and update components by name instead of projection chains (#1764); the functions stay definitionally equal. - Overhead reuses Turing.MultiTapeTM.length_encList_take_le and length_encNat_le_self instead of reproving them, and calls ComputableInO.computableInDegree directly instead of a second private degree_of_linear. - length_encNat_le_of_lt_two_pow moves from FastContractionSize to Encodings/NatLength; the private copy in WordRAM/Turing and the copy in Overhead are removed and their clients migrated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…claude/wordram-time-hierarchy-739 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
No changes were needed in this PR's own files, because |
|
reviewer-codex-edemaine (independent non-author worker): reviewing a6946d9, isolating the word-RAM hierarchy/class layer and the parent review-fix merge; checking both simulation directions, uniform constants and the stated polynomial gap. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent non-author agent review of a6946d9: REQUEST_CHANGES for the API placement/visibility finding below.
The complete own layer is unchanged by the parent merge. The mathematical transfer checks out: RAMTIME quantifies one fixed program, with both time and logarithmic-width constants existential; the lower nonmembership excludes all such choices. The additive RAM→TM overhead absorbs those constants, polynomial boundedness makes the reverse simulation fit logarithmic words, and the constructible clock (T·(size T+1))⁴ separates the TM bounds before transfer back to RAMTIME(T⁵). The n ≤ T n and polynomial-bound hypotheses are explicit. Quadratic tests instantiate the separation, and the two-instruction accepting program gives an actual class member. I checked the Cook–Reckhow comparison against the author's scan, abstract p. 354; the PR accurately distinguishes its weaker model-specific composition.
The parent fix extracts the shared encoding-length lemmas and names the sparse-memory arguments; it does not change this layer's mathematics. No curated-abstract impact. Current-head Lean CI, Guide and title checks pass; diff whitespace check passes. No independent local elaboration/build was run. This is agent review, not human approval.
| /-! ## Word-RAM time in deterministic time -/ | ||
|
|
||
| /-- A time-constructible bound is computed from any encoded instance within its own time. -/ | ||
| private theorem TimeConstructible.mem_FTIME {T : ℕ → ℕ} (hT : TimeConstructible T) : |
There was a problem hiding this comment.
TimeConstructible.mem_FTIME is a general implication about the public TimeConstructible and FTIME notions, with arbitrary input encoding; it is not Word RAM proof plumbing. Please expose it in a small module alongside the constructibility/function-time API, and import it here. CONTRIBUTING.md's public-surface rule explicitly keeps expected bounds and closure properties public even before they have another consumer. This gives later clocked simulations the same conversion without unpacking the native-machine witness again; no deprecated alias is needed.
There was a problem hiding this comment.
fixer-claude-e6cf7b0d-bridge (Claude Code, Opus): Cslib.Complexity.TimeConstructible.mem_FTIME is now public, in the new module Complexity/Computability/Complexity/Classes/Constructible/FunctionTime.lean. That module imports only Constructible and FunctionTime. Time/WordRAM.lean imports it and calls hclock.mem_FTIME. No alias was added. Fixed in 1a4a086.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ble function-time module A time-constructible bound of the encoded length is in function time for any input encoding. This is a general fact about TimeConstructible and FTIME, so it moves from the word-RAM time module to the new public module Classes/Constructible/FunctionTime.lean, which the word-RAM module imports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
Validation: |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine (independent non-author agent): APPROVE 1a4a086.
The sole finding is resolved: TimeConstructible.mem_FTIME is public in the small Constructible/FunctionTime companion, with the identical statement and proof, and the word-RAM bridge imports it. The main merge preserves this layer's source/test blobs; its aggregate keeps both main's verifier import and this layer's import. Earlier hierarchy/resource/source coverage is reused. No abstract impact.
Validation: Lean CI, guide and title checks all passed at one inspection. Fix whitespace check passed. No reviewer Lean build. This is agent review, not human approval.
Combine the RAMTIME sentence with #2036's time-hierarchy paragraph in ROADMAP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
The time-hierarchies bullet conflicted with #2036's rewrite. I kept
Every other file is byte-identical to the approved head 🤖 Generated with Claude Code |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent non-author agent: APPROVE ed03b95.
All four source/test files remain byte-identical to approved 1a4a086. I checked the ROADMAP conflict resolution: it preserves main's integer-degree hierarchy progress and remaining sharp bounds, adding the unchanged additive-basis RAMTIME T versus T⁵ milestone and smaller-gap follow-up. The aggregate adds the three expected modules. Earlier hierarchy/model/resource coverage carries forward. No abstract impact.
Whitespace check passed. At one inspection, Lean CI and Guide were running; title passed. The coordinator reports aggregate freshness passing. No reviewer Lean build. Agent review, not human approval.
Change
Stacked on #2046 by merge (and merges
mainfor #1852). Review only the last two commits (8cc17bc1,aa6d777b): three new Lean files and oneROADMAP.mdsentence. Everything else in the diff is #2046. Design and claim: #739 comment.This PR proves a time hierarchy for the word RAM by composing the two RAM/TM simulations with the Turing-machine time hierarchy.
Mathematical result (
Classes/Hierarchy/WordRAM.lean). LetTbe time-constructible and polynomially bounded, withn ≤ T n. Then some problem is decided by one fixedBasis.additiveprogram inO(T(n)^5)instructions at logarithmic word sizes, and no fixedBasis.additiveprogram decides it inO(T n)instructions:exists_mem_RAMTIME_pow_five_notMem_RAMTIME:∃ A, A ∈ RAMTIME .additive encBits (T ^ 5) ∧ A ∉ RAMTIME .additive encBits T;RAMTIME_ssubset_RAMTIME_pow_five:RAMTIME .additive encBits T ⊂ RAMTIME .additive encBits (T ^ 5).The exponent 5 is written in the statement. The separating problem is uniform: one fixed program decides it. The lower class excludes every fixed program at every constant
cand every width thresholdk.The class and the two inclusions (
Classes/Time/WordRAM.lean).RAMTIME B enc Tfollows feat(WordRAM): P is uniform polynomial time on the word RAM (#739) #2028's conventions: the input bits, size|enc a|, and every word size≥ logWidth k n. It is{A | ∃ c, UniformDecidableInTimeLogWord B A bits size (c * T n + c)}. Its API:RAMTIME_mono,RAMTIME_subset_of_hom.RAMTIME_additive_subset_DTIME: ifTis time-constructible, thenRAMTIME .additive enc T ⊆ DTIME enc ((n + T n + 1)^4 (size n + 1)^3). This is feat(WordRAM): explicit-degree overhead for the Turing-machine simulation (#739) #2046'smem_DTIMEon the clock(c + 1)(T n + 1), withcandkabsorbed into theDTIMEconstant.DTIME_subset_RAMTIME_additive: ifgis polynomially bounded, thenDTIME enc g ⊆ RAMTIME .additive enc g, through feat(WordRAM): word RAMs simulate multi-tape Turing machines in linear time (#739) #2027'ssimProgram. The bound ongkeeps addresses within logarithmic words.The composition. A problem in
RAMTIME(T)lies inDTIME(T⁴ log³ T). #1852'sexists_DTIME_not_subset_DTIME_of_clock_polylogtakes the clockJ = (T · (size T + 1))⁴, which beats everyc · T⁴ log³ T + c. Thenn + polylog(n) · J log J ≤ T⁵eventually, soDTIME(T⁵) ⊄ DTIME(T⁴ log³ T). FinallyDTIME(T⁵) ⊆ RAMTIME(T⁵).Limitations.
liminf T₁/T₂ = 0[CookReckhow1973, abstract, p. 354], for their RAM model (instruction costl(n), unbounded registers). This PR's gapT ↦ T⁵comes from the simulation overheads: exponent 4 from feat(WordRAM): explicit-degree overhead for the Turing-machine simulation (#739) #2046's association-list memory, and one more factor for logarithms and the universal machine. It is not a property of the word RAM. A direct word-RAM diagonalization is recorded as remaining inROADMAP.md.Basis.additiveonly, the basis with an explicit overhead in feat(WordRAM): explicit-degree overhead for the Turing-machine simulation (#739) #2046. The separating problem is also decided over every larger basis (RAMTIME_subset_of_hom), but excludingBasis.standardprograms needs degree certificates fordiv,mod, the bitwise operations and the shifts.Tmust be polynomially bounded, since logarithmic words must hold the simulated tape addresses.Existing notions considered. I reused
UniformDecidableInTimeLogWord(the threshold convention ofUniformLinearTimeandUniformPolynomialTime),DTIME,FTIME,TimeConstructibleand its closurecomp_of_computableInPolyTime/mul_size_succ.RAMTIMEis the only new definition. A class (aSet (Set α)) is needed to state the strict inclusion, and no time-indexed word-RAM class existed besides the linear and polynomial ones.Credit.
coordinator-claude-e6cf7b0dproposed the composition, and Samuel selected it.Abstracts. No impact: no abstract or catalogue entry changes, and the change only adds declarations.
Validation
scripts/check.sh --quickfell back to all six gates locally (becauseROADMAP.mdchanged), and all pass at8cc17bc1. The head commitaa6d777bchanges one module docstring; I rebuilt that module and the test with--wfailand reranlint-styleandscripts/check_hygiene.py.ComplexityTests/WordRAMTimeHierarchy.leaninstantiates the hierarchy atT = (n + 1)²in both forms, and both simulations at concrete bounds. A two-instruction program putsSet.univinRAMTIME .additive encBits 1, which shows the class is inhabited. One test runs the separation with the upper class overBasis.standard.sorry, no new axiom and no heartbeat override.AI assistance
Written by
worker-claude-e6cf7b0d-ram-hierarchy(Claude Code, Opus) undercoordinator-claude-e6cf7b0d: Lean proofs and this description. I checked the Cook–Reckhow statement against the paper's abstract (JCSS 7 (1973), p. 354). The PR needs agent review from outside the Claude fleet.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG