Repository navigation
test: drop per-module named axiom guards that repeat the global audit - #1004
Merged
Merged
Conversation
`ComplexityTests/Axioms.lean` audits every declaration of the imported `Complexity` modules against `propext`, `Classical.choice` and `Quot.sound`. Delete the 2,666 named `#guard_msgs ... #print axioms X` blocks in other test modules whose expected list is exactly that set; keep the 102 blocks that pin a narrower set, byte for byte. Remove the section headers and `open` lines that only served the deleted guards, and the module-doc mentions of axiom guards in files that no longer have any. Files touched by open pull requests, and `ComplexityTests/Axioms.lean` (#996), are skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
Collaborator
Author
|
reviewer-claude-c4b0c164-14 — APPROVED at fe82f21 (delegated-review exception, AGENTS.md; classification: test-only) I checked this with my own parser, which is comment-aware and handles CRLF, over
Non-blocking notes:
|
This was referenced Oct 25, 2026
Merged
Merged
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
cslib-community#949) (cslib-community#1012) Item 8 of cslib-community#949, area Algorithms (Algorithms.Lean, Algorithms.Reachability, Algorithms.WordRAM). This is documentation and visibility only: no statement or definition changes. Add Main entries for declarations left without outside references after cslib-community#996 and cslib-community#1004 removed the named axiom guards: • Algorithms/Lean/FusionTree/Compression.lean: exists_compression • Algorithms/Reachability/InductiveCounting/Bounds.lean: accepts_complete_bounded • Algorithms/Reachability/InductiveCounting/Completeness.lean: accepts_iff, accepts_iff_not_reachable • Algorithms/WordRAM/PrefixSums/Dynamic.lean: instruction_bound_log, execOp_frame • Algorithms/WordRAM/Stack.lean: frame All 29 declarations in Algorithms on the orphan list are confirmed public API and fully documented.
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…global audit `ComplexityTests/Axioms.lean` audits every declaration of the `Complexity` modules against `propext`, `Classical.choice` and `Quot.sound`, and upstream (cslib-community#1004) removed the named guards whose expected list is exactly that set. The three guards here, on `logLinearStatement`, `logLinearSpec` and `heapDijkstra_spec`, were of that kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
orbitingflea
added a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…global audit `ComplexityTests/Axioms.lean` audits every declaration of the `Complexity` modules against `propext`, `Classical.choice` and `Quot.sound`, and upstream (cslib-community#1004) removed the named guards whose expected list is exactly that set. The three guards here, on `logLinearStatement`, `logLinearSpec` and `heapDijkstra_spec`, were of that kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chris-ai1
pushed a commit
to chris-ai1/complexitylib
that referenced
this pull request
Oct 28, 2026
…me with a formal abstract (cslib-community#1098) * refactor(Computability/WordRAM): scope the word-RAM statement syntax and ram_eval The statement forms of `wramStmt`, the `macro_rules` that expand `ram[`, `ram_block%` and `ram_stmt%`, and the tactic `ram_eval` with its `macro_rules` are now `scoped` to `Cslib.WordRAM`, like the entry points `ram[`, `ram_block%` and `ram_stmt%` already were. Only the category `wramStmt` and the syntax abbreviation `wramBlock` stay global, since Lean cannot scope them; without the open they parse nothing. Every current user is inside a `Cslib.WordRAM` namespace or opens it before use, so no other file changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(Algorithms/WordRAM): Dijkstra's algorithm in O((m + 1) log n) time with a formal abstract Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(Algorithms/WordRAM/Dijkstra): use the scoped word-RAM statement syntax `ExactNotation` writes its rules over the `wramStmt` statements, which are now scoped to `Cslib.WordRAM`, so it opens that scope, and its own `macro_rules` are scoped to `Cslib.Algorithms.WordRAM.Dijkstra`. The bridge's note on syntax in its imports now says that only the category `wramStmt` and the abbreviation `wramBlock` are global. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(Algorithms/WordRAM/Dijkstra): drop axiom guards that repeat the global audit `ComplexityTests/Axioms.lean` audits every declaration of the `Complexity` modules against `propext`, `Classical.choice` and `Quot.sound`, and upstream (cslib-community#1004) removed the named guards whose expected list is exactly that set. The three guards here, on `logLinearStatement`, `logLinearSpec` and `heapDijkstra_spec`, were of that kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(Algorithms/WordRAM): list the Dijkstra phase specs and helpers in their module docs Add Main-list entries for the declarations that cslib-community#949 item 8 flags as having no outside reference, and a docstring for decodeDist_encodeDist. Doc comments only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(Algorithms/WordRAM): use Fin.sum_univ_def and drop a transparency option in Dijkstra `ListEncode` uses Mathlib's `Fin.sum_univ_def` instead of a private copy of it. `execWithin_append` is stated for any basis and register count, as `appendCode` is. `Invariant` no longer sets `backward.isDefEq.respectTransparency false`: its two path proofs apply `Quiver.Path.addWeight_cons` and `addWeight_nil` with `V := I.Vertex` given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(Abstracts): say which Dijkstra abstract definitions come from WordRAMAbstract `Runs` is new in `DijkstraAbstract`; the other machine definitions are those of `WordRAMAbstract`. The paragraph is rewrapped; the theorem statement is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(Algorithms/WordRAM): run Dijkstra on a graph with no edges Two vertices and no edge: the interpreter leaves `0` in the unreachable vertex's output cell within the bound of `heapDijkstra_spec`, where `m + 1 = 1`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(Algorithms/WordRAM): add References sections to six Dijkstra modules Upstream's file template asks for `## References` in each module docstring. `BinaryHeap` and `HeapSift` cite `CLRS2009`; `ListEncode`, `HeapRelax` and `LogLinear` cite `Dijkstra1959` and `CLRS2009`; `ExactNotation`, which has no source of its own, points to the `ram[` notation and `Algolean2026`, as upstream's `WordRAM/Notation` does. Doc comments only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(Algorithms/WordRAM): import WordRAM.Time in Dijkstra's HeapStatement, not Statement `Statement` uses no declaration of `Complexity.Computability.WordRAM.Time`. It needs only the `Fintype` instance on products for `maxWeight`, now imported from `Mathlib.Data.Fintype.Prod`, and `Cslib.Init`, now imported through `Complexity.Init` as upstream's file template asks. `HeapStatement`, whose `LogLinearSpec` is stated with the word-RAM machine, imports `Time`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(Algorithms/WordRAM): define Dijkstra's sift-down step from its two halves `siftDownBody` was written out in full in `HeapProgram` and again, for its proof, as the private `chooseCode` and `sinkCode` in `HeapSift`. Define the halves once, as the public `siftDownChoose` and `siftDownSink`, and `siftDownBody` as their sequence. `HeapSift` uses the new names, and `siftDownBody_spec` composes the two runs with `ExecWithin.seq`, so the split lemma `siftDownBody_eq` is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(Algorithms/WordRAM): port Dijkstra to Code.rand and instrOf outOfBounds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(Complexity): sort the root imports after the upstream merge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(Algorithms/WordRAM): describe the bridge's rand-free step agreement Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
ComplexityTests/Axioms.leanaudits every declaration stored in the importedComplexitymodules and rejects any dependency outsidepropext,Classical.choiceandQuot.sound. #996 deletes the named guards in that file that restate this set, and changes the rule so that a named#print axiomsguard is added only when a result is meant to depend on fewer axioms. This PR applies the same cleanup to the other test modules. Samuel approved removing these guards on 2026-10-25: names that need pinning are pinned by documentation and a stated purpose instead.A script parsed every
/-- info: … -/ #guard_msgs … in #print axioms Xblock, includingopen … inprefixes, wrapped messages and names on the next line, and classified it by its expected axiom set. Blocks with exactly the standard three were deleted, and every other block was kept byte for byte. For each file, the script checked three things: the parsed blocks account for every#print axioms, the kept blocks appear unchanged and in their original order, and the number of#guard_msgsdrops by exactly the number of deleted blocks. Other#guard_msgsuses, such as#evaland#checkoutputs, are untouched.ComplexityTests/(top level)ComplexityTests/CircuitHammingComplexityTests/CodeComplexityTests/ComputabilityComplexityTests/CryptoComplexityTests/FineGrainedComplexityTests/IterationComplexityTests/MassProductionComplexityTests/NPCompleteGraphsComplexityTests/OracleCompositionComplexityTests/ProofComplexityComplexityTests/QueryComplexityComplexityTests/RationalHittingComplexityTests/SpaceThe 102 kept guards record narrower sets: 55
[propext, Quot.sound], 26[propext], 17 with no axioms and 4[Quot.sound]. Six files hold only kept guards and are unchanged.The deletions left some text with nothing to describe, which this PR also removes:
/-! ### Axioms -/, that headed only deleted guards.openlines left directly beforeend.No test file was left with nothing but boilerplate, so no file is deleted. Imports are unchanged.
This PR changes only tests: no library module, statement or definition is modified.
Skipped files. Files changed by open PRs are left alone to avoid conflicts:
ComplexityTests/Axioms.leanis handled by test(axioms): drop named guards that repeat the global audit #996 (and also touched by feat(Crypto/OneWay): formalize Yao's weak-to-strong OWF hardness amplification #995).ComplexityTests/PolyTimePlain.lean(refactor(calculus): prove the canonical plain core directly #671) keeps its 8 standard-set guards.BitStringRows.lean(feat(BitString,Probability): add row replacement and PMF Boolean map/bind bounds (#733) #998),PolyTimeMixes.leanandSmoke.lean(refactor(calculus): prove the canonical plain core directly #671), andPolyTimePlainDriver.lean(refactor(computability): use plain resource and Crypto interfaces #810) have no guards onmain.OneWayAmplification.lean(feat(Crypto/OneWay): formalize Yao's weak-to-strong OWF hardness amplification #995),PlainCalculus.leanandPlainProjection.lean(refactor(calculus): prove the canonical plain core directly #671),PlainDirect.lean(refactor(machines): spike, plain closure rules without a tidy calculus (#862) #869), andPolyTimePlainClients.leanandPolyTimePlainSource.lean(refactor(computability): use plain resource and Crypto interfaces #810) do not exist onmain.Follow-up. With these guards and those of #996 gone, 1,257 library declarations have no reference outside their own module. The list, grouped by module, is in #949 as a new item: #949 (comment). That item is not part of this PR.
Validation and review
fe82f216(baseb3cbabf9):scripts/check.sh(all six gates;lake testre-elaborates the changed test files),python3 scripts/check_hygiene.py,python3 -m unittest discover -s scripts -p 'test_*.py'(351 tests, 3 skipped) andlake exe mk_all --check.fe82f216.Headline abstracts
abstracts/are untouched.AI assistance
Prepared with Claude Code as
worker-claude-axioms2-c4b0c164, delegated bycoordinator-claude-c4b0c164-20261023. The worker wrote and ran the parsing and tidying scripts, edited the module docs, ran the validation above and computed the #949 follow-up list from the build's.ileanreference data.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB