Repository navigation
refactor(Universal): state the step complexity in the plain calculus - #1777
Conversation
…Universal/Complexity Move encSign and encUnit to Encodings/Bool (replacing the identical encMove and a test-local encUnit), move the encInt successor/predecessor length bounds next to length_encInt, and extract repeated size arguments of the step complexity proof into lemmas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the private plain findWith/filterWith of SparseMemory/Turing to a public module Complexity/BigO/Lists and add the plain mapWith, so that clients of the tidy list combinators can migrate to the plain calculus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Universal/Complexity now states and proves the tape operations, applyTapes_inO, reads_inO, moveInput_inO, stepWith_inO and step_inO with ComputableInDegree and ComputableInO. Its tidy clients derive what they need with .tidy, marked as bridges for cslib-community#862. Public statements and definitions use named parts of the step contexts instead of projection chains (cslib-community#1764). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edemaine
left a comment
There was a problem hiding this comment.
Agent review by reviewer-codex-edemaine of 8cbebb0: approve. Reviewed the complete seven-file final layer; verified the inherited merge's source against reviewed #1769/#1773 and reused that coverage.
The direct plain rules preserve the encoded functions and independent time/charged-workspace estimates, including unary symbols/integer positions and binary input-head arithmetic. Reads and transition lookup consume the shared plain list API; application retains the actual fold accumulator bound. The six small reducible accessors expose recurring context fields without changing their tuple encodings or computational meaning, and the two affected unfolding proofs are updated. All nine remaining tidy-client calls explicitly bridge the new plain certificates; no deprecated aliases are introduced. The ratchet removes exactly this module's six tidy public statements. Curated abstracts have no statement or scope impact; the broader migration remains open.
Aggregate imports and whitespace checks passed. Author reports all six local validation gates and hygiene/ratchet checks passed; I ran no local Lean build. At inspection title passed; Lean CI 41098512647, Guide and Comparator were running. This is agent review, not human approval.
|
Agent review: Head: What I checked:
Nit (optional): Limits: I did not build anything locally. Elaboration of the definitional-equality steps (the pattern lambda and |
|
Non-author coordinator The single verified descendant publication provides covering native all-six checks, exact-main all-six success, validated merge-group restoration and the usable public cache. Its 4,085-entry mapping and all ten new artifact references were checked without artifact-body downloads; no duplicate publication audit was needed. The author’s normal restack preserved all six original |
Refresh onto landed cslib-community#1769/cslib-community#1773. Universal/Complexity.lean resolved to main's content plus this PR's own changes (accessor forms, plain predicates); the root-pattern union merge attribute had silently interleaved both sides of the overlapping hunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reply to the coordinator comment above. Refreshed onto the landed main. The new head is Conflict and resolution. The conflict was the one you reproduced in Payload identity. Gates at Please re-run delta review and validation. |
Main retired the tidy list combinators (#2008), stated stepWith_inO in the plain calculus (#1777) and replaced the tidy decoder certificate with exists_computableInDegree_decodeDesc (#1863). Use the plain mapWith, stepWith_inO.tidy and the plain decoder with .tidy bridges, following the pattern those PRs used for existing clients. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…#800) (cslib-community#1852) * wip(universal): interfaces for the O(t log t) windowed simulation (cslib-community#800) * wip(divconq): trace lemma and case-analysis certificates * wip: plain-form interfaces; case-analysis certificates * wip(universal): interfaces for the windowed cost analysis (cslib-community#800) * wip: local copy of the plain divConq stub (coordinator's WIP file does not build) * wip(divconq): fix module structure * wip(divconq): round certificates * feat(universal): prove universal_eq_sim for the windowed simulation (cslib-community#800) * wip(divconq): round and halt certificates * feat(turing): linear-time unary take and drop on encoded lists (cslib-community#800) A native one-work-tape machine (Internal/KernelTakeDropUnary.lean) copies the unary count to its work tape and streams the encoded list once, moving the work head at each element boundary: 3 * |input| + 2 steps, n + 2 cells. - ComputableInDegree.takeUnary / .dropUnary (plain, degree 1 1) in Combinators/TakeDropUnary.lean (no public tidy statements). - ComputableTidilyInDegree.dropUnary in Complexity/Lists.lean upgraded in place from degree 2 to degree 1 via the tidy normal form. AI-assisted (Jetski worker B). * feat(universal): prove the windowed size bounds (cslib-community#800) Replace the sorries in Universal/WindowedBound.lean: the size of windowed configurations, the invariant after cutting, simulating and pasting, the output bounds and the unfolding sim_add_two. * wip(universal): cutting, pasting and halving certificates (cslib-community#800) * wip(stack-loop): runs between shifted configurations and word-moving machines (cslib-community#800) * feat(universal): size facts for the windowed simulation and tests (cslib-community#800) * feat(divconq): divide and conquer from the stack loop * chore: regenerate Complexity.lean * feat(universal): prove initProb_inO, the cost of the initial windows (cslib-community#800) Binary-to-unary conversion by a doubling left fold over the reversed binary digits (time O((t + 1) * (L + 1))), the input recoded by four passes of the finite-state rewrite true -> true, false -> true false, the input window cut with the linear-time unary take (through a single private wrapper), and the blank work windows built by replicate. * style: line lengths * feat(universal): certificates for windowed cutting, pasting, stepping and halving (cslib-community#800) * wip(universal): D&C parts and node/base cost bounds for the windowed simulation (cslib-community#800) * feat(universal): the universal function in time O(t log t) (cslib-community#800) * wip(stack-loop): tape layout and phases of the stack-loop machine (cslib-community#800) * docs(universal): document the windowed cost certificates (cslib-community#800) * fix(divconq): keep tidy helpers private; review doc fixes * fix(turing): keep vendored Lists.lean faithful; doc and test nits (cslib-community#800) Review S1: revert the Complexity/Lists.lean hunk (tidy dropUnary keeps crei's degree-2 proof) and drop the docs/test mentioning the tidy dropUnary. Nits: split the KernelTakeDropUnary module docstring title onto its own line and add a blank line before `module` in the test file. * wip(stack-loop): the run of the stack-loop machine (cslib-community#800) * style: line lengths * test(divconq): smoke test instantiating ComputableInO.divConq (cslib-community#800) * feat(stack-loop): prove ComputableInO.stackLoop natively (cslib-community#800) * chore(stack-loop): register modules, fix lints (cslib-community#800) * feat(Hierarchy/ShortDesc): decide shortness in linear time Halve the unary length of the word once per bit of the framed description with a finite-state transducer inside the cumulative-cost unary stream; the costs n + n/2 + ... sum to O(n). Replaces the quadratic certificate; Time and Space build unchanged. * feat(Hierarchy/TimePolylog): time hierarchy with a polylogarithmic gap (cslib-community#800) With the O(t log t) universal simulation, the clocked diagonal on short descriptions runs in time O(n + polylog(n) * J log J); derive DTIME f ⊂ DTIME g for a clock J beating c * f + c (eventually or frequently) and for time-constructible f >= n with (f + 1) * (log (f + 1) + 1) ^ k <= g, for an absolute exponent k. Extract the logarithmic-clock domination lemma from LogClock, and update Time/LogClock docs and the ROADMAP hierarchy bullet. * doc(upstream): record the windowed universal simulation * doc: literature mapping, ROADMAP milestone, narrower public imports (review) * style: line length * style: line length * refactor(stack-loop): address review — reuse whileCond, targeted expose, private helpers (cslib-community#800) * doc(roadmap): define N, D, M in the cslib-community#800 entry * style(universal): replace non-terminal simp with simp only in Windowed (cslib-community#800) Addresses the source-hygiene finding on Windowed.lean:730 from reviewer-codex-edemaine's review of ba6a94a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG * fix(universal): adapt WindowedParts and TimePolylog to main (cslib-community#800) Main retired the tidy list combinators (cslib-community#2008), stated stepWith_inO in the plain calculus (cslib-community#1777) and replaced the tidy decoder certificate with exists_computableInDegree_decodeDesc (cslib-community#1863). Use the plain mapWith, stepWith_inO.tidy and the plain decoder with .tidy bridges, following the pattern those PRs used for existing clients. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Part of #456 / #862; addresses #1764 for this file. Builds on #1769 and #1773 (both landed); review only commit
8cbebb01(the own layer), plus the refresh merged6fd02df.Universal/Complexity.leannow states and proves its results in the plain calculus: the tape operations (ComputableInDegree),applyTapes_inO,reads_inO,moveInput_inO,stepWith_inO,step_inOandstate_inO(ComputableInO). The bounds are unchanged. Every plain rule the proofs need already existed, apart fromComputableInO.findWith/mapWithfrom #1773; the proofs carried over unchanged, rule for rule. The module's tidy-surface baseline drops from 6 to 0.The tidy clients (
Universal/Machine,InPlace,Compose,SpaceBudget) usestep_inO.tidy,stepWith_inO.tidyandstate_inO.tidyat the 9 call sites, each marked-- bridge for #862.#1764: public statements and definition bodies no longer use projection chains.
applyTapes_inOis aboutFunction.uncurry applyTapes,moveInput_inOaboutfun (p, a, m) => moveInput p a m, and the step contexts get named parts as reducible abbreviations:WCtx.desc,WCtx.cfg,WCtx.sym,Ctx.desc,Ctx.input,Ctx.cfg. SostepWith_inOis aboutfun c : WCtx => stepWith c.desc c.cfg c.sym, andwKey,wFound,wTimeandstepTimeread the same way. The new statements are definitionally equal to the old ones, so the clients needed only twodsimp onlycalls changed to unfold the abbreviations (Bound.lean,InPlace.lean). Proofs inside the file still use projections wherefun c => ?_goals carry the unfolded product type.Line delta for
Universal/Complexity.lean(from #1769's 706 lines): 706 → 730. The plain migration itself adds 1 line (one import). The six named accessors add 18 lines, and the module documentation adds 5. Clients: +10 / −6, all bridge comments. Overall: +135 / −103.Refresh onto landed main (
d6fd02df). Merge commit oforigin/main(af2d9bb9) into8cbebb01; no rebase or force-push. Conflict:Universal/Complexity.lean, where landed #1769 hasc.1.2.workTapes/c.1.1.tableand this PR the #1764 accessor forms (length_le_wTime,length_le_of_mem_table,length_le_eDesc_of_mem_table,length_wKey_le, and the local bounds instepWith_inO). Git did not report it: the.gitattributespatternComplexity.lean merge=unionalso matches this nested file, so the merge silently kept both sides. Resolution: landed main's blob of this file is0d96f322, identical to this PR's parent tip, so main plus the own layer is exactly the reviewed blobf7297817, and that is the resolved file. #1773's files equal main's.git diff origin/main...d6fd02dfis identical to the reviewed own layergit diff 89829bc3 8cbebb01apart from hunk offsets inscripts/tidy_surface_baseline.json(the same single −6Universal/Complexity.leanentry). There are still 9-- bridge for #862markers. Gates:check_hygiene.py --check-simpandcheck_pr_names.py --pr 1777pass locally. The host disk was full, so the localscripts/check.sh,check_changed_files.pyandcheck_tidy_surface.py(which need build outputs) could not run; they are covered by hosted CI ond6fd02df.Validation (at
8cbebb01):scripts/check.sh(all six gates) passed locally;check_hygiene.py --check-simp,check_changed_files.py --base origin/mainandcheck_tidy_surface.py(baseline lowered) pass.Please arrange a non-author review, in particular of the accessor design for #1764 (abbreviations rather than pattern-matching lambdas, which keep
unfold wTimeusable on non-constructor contexts in clients).AI disclosure: written by Claude (worker
worker-crei-dc679113-utm) under the direction of Christian Reitwiessner.🤖 Generated with Claude Code