Repository navigation
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>
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>
Keep the transition lookup, reads_inO, applyTapes_inO and moveInput_inO as hand-written plain certificates with their precise bounds, register them and the field and constructor rules for SCfg, Act and Key as local fun_prop rules, and let fun_prop assemble wKey, wAct and stepWith. One final comparison with wTime replaces the per-component bound bookkeeping. Public statements are unchanged. 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 7ff1081: approve. Reviewed the complete one-file layer over d6fd02d and reused #1777's current-head source/restack coverage.
All 39 public declaration headers and every public definition body are unchanged. The new rules use existing plain composition, pairing, projections and linear outer computations, retaining independent time and output-charged workspace estimates. Transition lookup still bounds entry size by the description; the final wTime comparison separately accounts for work-tape passes and binary input-position arithmetic. No whole-configuration square or new tidy bridge is introduced. The unchanged Machine.round_inO client still consumes step_inO through its existing explicit bridge.
The local rules and private intermediate certificates make step assembly and its final resource comparison easier to inspect. I consider that a useful bounded refactor despite the net line increase; global rule extraction is an optional subsequent improvement, not a prerequisite. Registrations remain local, removed WPart has no clients, and there are no deprecated aliases or curated-abstract changes. No findings.
Whitespace and source/interface comparisons passed. Author records all six local gates and default-budget heartbeat checks; I ran no local Lean build or independent timing measurement. At inspection title passed; Lean CI 41128091988, Guide and Comparator were running. Agent review, not human approval.
|
🤖 Generated with Claude Code |
|
Re-measured on top of #1826, which adds global compositional With the global rules,
Since it is not net-negative against #1777, I have not pushed it here. Most of the remaining cost is the 7 field rules and 2 constructor rules for |
|
Non-blocking notes from
Fine to handle in a follow-up. |
Stacked on #1777 (branch
utm-plainatd6fd02df). Review only the last commit. Part of #456 / #862.This PR tries the "pragmatic hybrid" for the UTM step:
fun_propassemblesstepWith_inOfrom plainComputableInOrules, and the bound is checked againstwTimeonce at the end. The precise bound stays: per-step time remains linear in the configuration length, andUniversal/Boundand the time hierarchy depend on that. Public statements (stepWith_inO,step_inO,applyTapes_inO,reads_inO,moveInput_inO,wTime,stepTime) are unchanged. Downstream modules (Machine,Bound,InPlace,Compose,Hierarchy) compile without edits. No tidy uses are added.Still hand-written (precise bounds):
wFound_inO:findWithwith thelistMaxestimate, about |table|·(|key|+|entry|);applyTapes_inO,reads_inOandmoveInput_inO, which are unchanged.Automated: local
@[fun_prop]rules in compositional form, where each rule adds up the bounds of its arguments:ComputableInO.const,.prod,.fst',.snd',.iteand an identity rule;Option.isSomeandOption.getD;SCfgandAct, and the constructorsSCfg.mkandKey.mk;With these rules,
fun_propproveswKey_inO,wAct_inOand the body ofstepWith_inO, aftersimp only [stepWith_eq]. Each certificate is then closed by onemonostep, withsplit_ifs <;> nlinarithfor time andomegafor space. This replaces the per-partwTimebounds threaded withle_wTimethroughhreads,hsym,hkey,hmove,happandhlive/hhalt/hidle.step_inOkeeps its old plumbing. Doing it withfun_propneeded two more rules (about 20 lines) but saved only about 5.Line delta: the hope of −100 lines did not work out.
Universal/Complexity.leangrows from 730 to 773 lines (+209 / −166):wKey_inO15,wAct_inO5,stepWith_inO24,le_wTime3.So for a composition this small,
fun_propsaves bound bookkeeping but costs more in rules than it saves.Heartbeats: no options needed. Both the old and the new
stepWith_inOneed between 55k and 100k heartbeats, within the default 200k.wKey_inO,wFound_inO,wAct_inOandstep_inOeach stay under 30k.What would let
fun_propdo more:ComputableInOrules in compositional form forfun_prop. Today onlyComputableInDegreehas them;ComputableInOregisters just a few atoms inBigO/SumandBigO/Pi. The needed rules are const, prod, fst'/snd', ite, an identity rule,Option.isSome/getD, and a composition rule withT₁ a + T₂ (g a). That would remove about 25 lines here and help every plain client.Universal/Basicor by a small command for field-wise encodings. These are the main cost here.findWithin compositional form with a simpler bound shape, so that the lookup could also be assembled. ItslistMaxinequality would still need to be written by hand.Also: while trying
step_inO, a rule whose function contains amatch(herestepWith) had to elaborate the composition beforeexact. Otherwise unification unfolded thematchand timed out.Validation:
scripts/check.sh: all six gates passed.check_hygiene.py --check-simp,check_changed_files.py --base origin/main,check_tidy_surface.pyandcheck_pr_names.pypass.Please arrange a non-author review. The main question is whether this trade-off (less bookkeeping, more rule boilerplate) is worth merging as is, or only after rules 1–2 exist globally.
AI disclosure: written by Claude (worker
worker-crei-dc679113-hybrid) under the direction of Christian Reitwiessner.🤖 Generated with Claude Code