Repository navigation
refactor(classes): make proof helpers private across the classes area - #634
Conversation
|
Requesting cross-review from |
Makes 734 theorems and definitions private in 129 modules of the classes area (#610 item 2). Statements and proofs are unchanged; only the `private` modifier and signature line breaks change, plus five redundant `@[expose]` attributes on definitions that became private. Rule: a declaration becomes private when `scripts/quality_report.py` (#604) lists it as a privatization candidate (no reference from another library module, test or abstract, not named in a module doc or README, no implicit-use attribute, not pinned by a public statement or exposed body), it is used in its own module, and its name is not API-shaped. API-shaped names stay public: `…_iff`, `mono`, `anti`, `nonneg`, `apply`, `ext`, `comm`, `congr`, `symm`, `trans` and similar, names containing a class or problem name (`mem_BPP`, `UP_subset_ModP`, `inter_mem_ParityP`), `isVerifier`, and the definitional modules of communication, decision-tree and query complexity, Kolmogorov complexity and learning, except their proof developments (`Switching`, `CanonicalTree`, `SensitivitySeparation.Internal`). Refs #610, #587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
2e4cd04 to
8bca8c4
Compare
|
Agent review — All 734 privatizations preserve declaration contents: removing visibility changes, the five redundant Review used source comparisons and hosted validation, with no additional local Lean builds. This is agent review, not human approval. |
…munity#691) * refactor(classes): make proof helpers private, second pass Second pass of cslib-community#610 item 2, over the classes-area modules that the first pass (cslib-community#634) skipped because the deprecation sweep (cslib-community#631), cslib-community#632 or cslib-community#621 edited them. Makes 199 theorems and definitions private in 25 modules with the same rule as cslib-community#634: a privatization candidate of `scripts/quality_report.py` (no reference from another module, test or abstract, not named in a module doc, no implicit-use attribute, not pinned by a public statement or exposed body) that its own module uses and whose name is not API-shaped. Statements and proofs are unchanged; only the `private` modifier and signature line breaks change. Three definitions of `ValiantVazirani/Reduction` (`point`, `auxValue`, `solutions`) stay public because public declarations of that module need them. Modules that cslib-community#610 item 9 moves to Machines, the graph modules of cslib-community#689 and files under other open PRs are left out. Refs cslib-community#610 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB * refactor(classes): keep five core API rules public Review 5636431835 on cslib-community#691: `ProofSystem.mem`, `ProofSystem.polynomiallyBounded_ofVerifier`, `PolyTimeReducible.of_subset` and the two error-exponent-to-verifier conversions (`IsMerlinArthurVerifierWithErrorExponent.isMerlinArthurVerifier`, `IsArthurMerlinVerifierWithErrorExponent.isArthurMerlinVerifier`) are interface rules, not proof steps. Restore them as on `main`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…mmunity#590) (cslib-community#841) * refactor(Circuit): make proof helpers private across the circuits area (cslib-community#590) Makes 773 theorems, lemmas and definitions private across 194 modules of the Circuits area (cslib-community#590 item 2), following the same judged rule as cslib-community#634 and cslib-community#691: a declaration becomes private only when scripts/quality_report.py (cslib-community#604) lists it as a privatization candidate (zero references from any other library module, test module, or abstract, not named in any module docstring, README, ROADMAP or UPSTREAM, carrying no implicit-use attribute, and not pinned by the exported statement or exposed body of any declaration that stays public), it is referenced at least once in its own module, and its name is not API-shaped. Kept public: API-shaped names (..._iff, mono, anti, nonneg, pos, apply, ext, comm, assoc, congr, symm, trans, inj, bijective, surjective, injective, refl, unique, eval_*, size_*, depth_*, depthWith_*, depths_*, depthsWith_*, wireDepths_*, wireDepthsWith_*, outputDepths_*, computes_*, isUniform*, mem_*, subset_*), core definitional and high-fanout hub modules (Circuit/Basic, Evaluation, Family, Depth, CompositionDepth, MapLines, MapOp, SourceComplexity, BranchingProgram/MonoidProgram, PolyLength, Boolean/BinaryCost, NonconstantCost, AtLeast, ACC0/Basic, Tableau/Layout), and all files touched by open PRs (cslib-community#819, cslib-community#825, cslib-community#830, cslib-community#831, cslib-community#835) or active worktrees. Statements and proofs are unchanged; only the private modifier and 100-column signature line breaks change. Refs cslib-community#590, cslib-community#587 * refactor(Circuit): restore 9 public theorems per PR cslib-community#841 review (cslib-community#590)
… general declarations public again and drop one re-proof (cslib-community#926) (cslib-community#934) * refactor(DecisionTree,QueryComplexity,Communication): make 16 API and general declarations public again (cslib-community#926) Earlier privatization passes (cslib-community#634, cslib-community#628 and others) hid these declarations because nothing outside their module used them. Under the privatize-by-intent rule of cslib-community#926 they are library API or general mathematics, so they become public again. Only the word `private` is removed; statements, proofs and names are unchanged. Part of cslib-community#587. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB * refactor(QueryComplexity): reuse certificateComplexityFor_restrict_le instead of a re-proof (cslib-community#926) `QueryComplexity.certificateComplexityFor_comp_piecewise_le` proved the same statement as `certificateComplexityFor_restrict_le` in `DecisionTree/Certificate.lean`, which `Relations.lean` already imports. Make the original public and use it; delete the copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…clarations public again (cslib-community#926) (cslib-community#936) Earlier privatization passes (mostly cslib-community#634 and cslib-community#691) hid these declarations because nothing outside their module used them. Under the privatize-by-intent rule of cslib-community#926 they are library API or general mathematics, so they become public again. Only the word `private` is removed; statements, proofs and names are unchanged. Part of cslib-community#587. Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Makes 734 proof helpers private, in 129 modules of the classes area. This is item 2 of #610, sized as one mechanical PR following Samuel's rule change on #587. Statements and proofs are unchanged. The only edits are the
privatemodifier, line breaks in signatures that it pushed past 100 columns, and five@[expose]attributes removed from definitions that became private (they are redundant there, and--wfailrejects them).Rule. A declaration becomes private when all of the following hold:
scripts/quality_report.py(feat(scripts): report public surface and quality signals per area #604, run at d52fd12) lists it as a privatization candidate. That means:simp,fun_prop,aesop, instance, …);The following stay public even when they meet the rule:
_iff,mono,anti,nonneg,pos,apply,ext,comm,congr,symm,trans,refl,def,injectiveand the like;mem_BPP,UP_subset_ModP,inter_mem_ParityP,SATH_notMem_P) or areisVerifier;DecisionTree/Switching,DecisionTree/CanonicalTree,SensitivitySeparation/Internal) and nine Huang and sensitivity proof steps;TFNP,PH,ZPP,RP,BooleanHierarchy,Alternation,Constructible,Parameterized,FineGrained,FineGrained/Exponents,Reduction/TruthTable,Classes/PCP,MIP/Defs,TFNP/Subclasses/Principles,TreeEval/Instance), and the PCP modules whose fate quality(classes): area checklist #610 leaves open (ConstraintGraph,RegularConstraintGraph,LocalTest,Amplification,Amplifier,GapTheorem,Approximation).Build exceptions. Nine more declarations stay public because the build needs them public:
iffTokens,Graph.vertexEquiv,mod_lt_of_lt_mul,Interaction.pushStep,natDegree_minpoly_of_aeval_eq_zero,ModelChecker.tupleExprandEncoded.Graph.readLabel;USTCON.Reader.card_label_eq_numLabelsandwalkFrom.Scope. Files touched by an open PR or by the deprecation sweep (#631) are left out, for example
Hierarchy,Ladner/PolyTime,MIP/NEXP,ValiantVazirani/ReductionandTreeEval/Reader/Cert/Weight. That covers 201 candidates, plus the 12 modules that #632 and #621 also edit (124 declarations, dropped in 8bca8c4). These files follow in a second pass once those PRs land.105 of them have tidy statements, so #456's S2 sweep has 105 fewer public statements to rename.
Why. Users and agents get about 730 fewer public names to navigate. Editing these proof steps also no longer changes the exported module interfaces that downstream builds depend on (#609).
Review. Check against the rule above, with spot checks. Proof steps such as
Reader.hTup,IP.PSPACE.pushStepand theSwitchingencode/decode lemmas illustrate the rule, while a result that a module's doc should list would be an exception.Risk. Low. The build rejects any private name that another module, a test, an abstract or an exposed body uses; that check found the nine exceptions above. No aliases are needed (#588).
Validation at 8bca8c4 (on 375ea68):
scripts/check.sh: all six gates;python3 -B scripts/check_hygiene.py --check-simp;python3 -B scripts/build_abstracts.py --check.Abstract impact. None. Abstracts and bridges reference no changed declaration, which the report confirms (zero abstract references) and the build of
ComplexityAbstractschecks.AI disclosure: Claude Code (Opus 5.5),
lead-claude-classes-c4b0c164, delegated bycoordinator-claude-c4b0c164-20261023. This is agent work; it has not had human review.Refs #610, #587, #584
🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB