Repository navigation
doc(contributing): privatize by intent, not by current usage - #926
Merged
Merged
Conversation
Samuel's decision (2026-10-24). Privatization passes used 'never referenced outside its module' as the criterion, which also hid characterizations, bounds, invariance lemmas and named results about public definitions (for example Nisan's D(f) <= C(f) bs(f) and the randomized-complexity characterizations in #913). Define a helper as proof plumbing, keep expected API public even when unused, move general mathematics to Foundations, and prefer making a private fact public over re-proving it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
SamuelSchlesinger
added a commit
that referenced
this pull request
Oct 25, 2026
…public Under the privatize-by-intent rule (#926), only proof plumbing stays private in this pass (11 declarations). The 32 characterizations, bounds, invariance lemmas and named results about public definitions (for example randomizedComplexity_le_iff, sensitivityAt_not and complexity_le_certificateComplexityFor_mul_blockSensitivity) return to their public state on main. Coordinator fix under the AGENTS.md validated-fix rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
This was referenced Oct 25, 2026
refactor(Circuit/Rational,Arithmetic): make 51 API and general declarations public again (#926)
#933
Merged
Merged
SamuelSchlesinger
added a commit
that referenced
this pull request
Oct 25, 2026
…ointness and Functions (#899) Privatize 8 module-local proof helpers in Communication per the #926 privatize-by-intent rule: - Disjointness.lean: 7 proof-construction helpers for parts and hardDist (mem_parts, compl_insert_eq_of_mem_parts, sum_parts, sum_parts_swap, card_parts_pos, hardWeight_nonneg, hardDist_apply_toReal). - Functions.lean: card_lt_two_pow_of_run_eq_greaterThan. Keeping public, per #922 coordinator review, characterization, bound, monotonicity and closure theorems across Discrepancy, Distributional, Protocol, Randomized, Rank, and RoundProtocol. Refs #899 (Item 9)
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…of helpers (cslib-community#899) (cslib-community#913) * refactor(DecisionTree,QueryComplexity): privatize 43 module-local proof helpers (cslib-community#899) Privatize 43 module-local proof helpers across 15 files in `Complexity/Computability/DecisionTree` and `Complexity/Computability/QueryComplexity`. Candidate selection follows scripts/quality_report.py, excluding declarations with attributes or names appearing in tests, abstracts, the guide, or documentation. Resolves Item 9 (DecisionTree & QueryComplexity slice) of cslib-community#899. * refactor(QueryComplexity,DecisionTree): keep API-shaped declarations public Under the privatize-by-intent rule (cslib-community#926), only proof plumbing stays private in this pass (11 declarations). The 32 characterizations, bounds, invariance lemmas and named results about public definitions (for example randomizedComplexity_le_iff, sensitivityAt_not and complexity_le_certificateComplexityFor_mul_blockSensitivity) return to their public state on main. Coordinator fix under the AGENTS.md validated-fix rule. 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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…c again (cslib-community#926) (cslib-community#931) Earlier privatization passes (mostly cslib-community#841) 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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…in Frontier, Fusion, Monotone and root modules (cslib-community#926) (cslib-community#932) Earlier privatization passes (cslib-community#841) 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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…ations public again (cslib-community#926) (cslib-community#933) Earlier privatization passes (mostly cslib-community#841) 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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
… 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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…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>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…ions public again (cslib-community#926) (cslib-community#937) Earlier privatization passes (cslib-community#601, cslib-community#606 and cslib-community#868) 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>
SamuelSchlesinger
left a comment
Collaborator
Author
There was a problem hiding this comment.
Peer coordinator-reviewer-codex-20261023 (not Samuel): FINAL APPROVED at 99ffe23. The rule distinguishes local proof plumbing from useful public API and removes reference count as the deciding criterion, matching Samuel's direction. It also correctly prefers exposing an existing result to copying its proof. Documentation only; no declaration or abstract changes. Exact-head CI.
Nonblocking placement clarification: interpret the Foundations example together with the existing lowest-suitable-home rule; shared probability results may belong in the existing Complexity/Probability modules.
This was referenced Oct 25, 2026
Merged
This was referenced Oct 25, 2026
SamuelSchlesinger
added a commit
to chris-ai1/complexitylib
that referenced
this pull request
Oct 25, 2026
…-community#926) Edge.proofVerdict_answers and Graph.proofLabels_proofOfLabels state the evaluation law of proofQueries and the round trip of proofOfLabels/proofLabels; both are API under privatize-by-intent, so they stay public with Main entries, per reviewer-claude-c4b0c164-18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
SamuelSchlesinger
added a commit
to chris-ai1/complexitylib
that referenced
this pull request
Oct 25, 2026
…mmunity#926) PCPVerifier.isPolyTime_queryTable is the polynomial-time bound of the Main definition queryTable, so it stays public with a Main entry, per reviewer-claude-c4b0c164-18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
This was referenced Oct 25, 2026
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…ointness and Functions (cslib-community#899) (cslib-community#922) Privatize 8 module-local proof helpers in Communication per the cslib-community#926 privatize-by-intent rule: - Disjointness.lean: 7 proof-construction helpers for parts and hardDist (mem_parts, compl_insert_eq_of_mem_parts, sum_parts, sum_parts_swap, card_parts_pos, hardWeight_nonneg, hardDist_apply_toReal). - Functions.lean: card_lt_two_pow_of_run_eq_greaterThan. Keeping public, per cslib-community#922 coordinator review, characterization, bound, monotonicity and closure theorems across Discrepancy, Distributional, Protocol, Randomized, Rank, and RoundProtocol. Refs cslib-community#899 (Item 9)
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…cslib-community#886) (cslib-community#942) * feat(FineGrained): the satisfiability coding lemma and PPZ for unique k-SAT (cslib-community#894) (cslib-community#928) * feat(FineGrained): the satisfiability coding lemma and PPZ for unique k-SAT (cslib-community#894) Define the PPZ algorithm (random variable order, unit-clause forcing, random bits otherwise), prove that a run in a fixed order produces the unique solution with probability 2^{-u}, construct critical clauses, show a variable is last among m variables in a 1/m fraction of orders, and conclude by AM-GM that one round succeeds with probability at least 2^{-(1-1/k)n}. AI-assisted: Jetski (worker-jetski-17d3679e). * chore(bib): keep references.bib sorted by key (cslib-community#953) * doc(MCSP,PH,FineGrained): clean up process references and missing docstrings (cslib-community#884) (cslib-community#941) * doc(MCSP,PH,FineGrained): clean up process references and missing docstrings (cslib-community#884) Address finding F16 on issue cslib-community#884: - In Partial.lean and PartialNP.lean: remove temporary development process references ('Decision D5', 'Risk R3', 'Issue cslib-community#798 comment 3'), retaining canonical literature citations to Ilango and Hirahara. - In Kannan.lean: cite Arora-Barak Theorem 6.22 explicitly in the module header and theorem docstring. - In FineGrained/PermutationIndependentSet.lean: add docstring to BipartitePermutationIndependentSet.mem_iff_exists_satisfiesUndirected. - In Promise/Reduction.lean: add docstrings to ofSet_mem_PromiseBPP, ofSet_mem_PromiseRP, and ofSet_mem_PromiseCoRP. AI-assisted: Jetski (worker-jetski-b5844be2). * doc(MCSP,PH,FineGrained): address reviewer feedback on citations and process references * refactor(Circuit): generalize FanIn input support bounds to weighted gate costs (cslib-community#884) (cslib-community#929) * refactor(Circuit): generalize FanIn input support bounds to weighted gate costs (cslib-community#884) Generalize Program.card_reachableInputs_le in Complexity.Computability.Circuit.FanIn to arbitrary per-operation weights w satisfying ∀ op, σ.Arity op ≤ 1 + w op, exposing Program.card_reachableInputs_le_cost and Program.card_biUnion_wireSupport_le_cost. Deduce Program.card_biUnion_wireSupport_le_cost_binaryCost in Complexity.Computability.Circuit.Boolean.BinaryCost as a one-line specialization, eliminating 90 lines of duplicate induction and helper theorems. Refs cslib-community#884 (Item 7, F4) * refactor(Circuit): privatize reachableInputs helpers, dedup wire_castSucc_injective'' * refactor(Communication): privatize module-local proof helpers in Disjointness and Functions (cslib-community#899) (cslib-community#922) Privatize 8 module-local proof helpers in Communication per the cslib-community#926 privatize-by-intent rule: - Disjointness.lean: 7 proof-construction helpers for parts and hardDist (mem_parts, compl_insert_eq_of_mem_parts, sum_parts, sum_parts_swap, card_parts_pos, hardWeight_nonneg, hardDist_apply_toReal). - Functions.lean: card_lt_two_pow_of_run_eq_greaterThan. Keeping public, per cslib-community#922 coordinator review, characterization, bound, monotonicity and closure theorems across Discrepancy, Distributional, Protocol, Randomized, Rank, and RoundProtocol. Refs cslib-community#899 (Item 9) * refactor(Foundations,Circuit,MCSP): consolidate pow_self_le_three_pow_mul_factorial (cslib-community#939) (cslib-community#945) Move the elementary factorial-power comparison bound `Nat.pow_self_le_three_pow_mul_factorial` (n ^ n ≤ 3 ^ n * n!) to `Complexity.Foundations.Data.Nat.Factorial`. Eliminate the duplicate private copies in: - `Complexity/Computability/Circuit/Boolean/ShallowSymmetric/Covering.lean` - `Complexity/Computability/MCSP/Shannon.lean` and drop their now-unused ExponentialBounds imports. Refs cslib-community#939 (Item A.1) AI-assisted: Jetski (worker-jetski-b5844be2). * refactor(Foundations,Circuit,AffineDisperser): consolidate sum_map_range (cslib-community#939) (cslib-community#947) Move `List.sum_map_range` (`((List.range n).map f).sum = ∑ i : Fin n, f i`) to `Complexity.Foundations.Data.List.OfFn`. Eliminate the duplicate private copies: - `sum_range_eq_sum_fin` in `Complexity/Computability/Circuit/Rational/Runtime/Lift/Defs.lean` - `sum_map_range` in `Complexity/Computability/Complexity/AffineDisperser/Coordinates.lean` Refs cslib-community#939 (Item A.2) AI-assisted: Jetski (worker-jetski-b5844be2). * feat(Probability): Holenstein's correlated sampling and local embedding lemma (cslib-community#886) (cslib-community#940) * feat(Probability): Holenstein's correlated sampling (cslib-community#886) Shared randomness is a weighted order of finitely many cells under the graphs of a finite family of distributions. Each party outputs the first cell under its own graph: its marginal is exact (map_sample) and two parties agree with probability at least (1 - δ)/(1 + δ) (agree_ge), disagreeing with probability at most 2δ (disagree_le). Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> * feat(Probability): Holenstein's local embedding lemma and the coupling inequality (cslib-community#886) Alice and Bob sample from their own kernels with correlated sampling; the result is within 2ε₁ + 2ε₂ of a common sample from the target kernel (dist_embed_le, Holenstein's Lemma 8). Add the coupling inequality dist (p.map f) (p.map g) ≤ Pr[f ≠ g] (dist_map_map_le). Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> * fix(Probability): use simp only for non-terminal simp calls (cslib-community#886) * style(Probability): wrap a long line (cslib-community#886) * chore(bib): keep references.bib sorted by key (cslib-community#953) * fix(bib): remove entries duplicated by a faulty restack; keep only this PR's additions, sorted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB --------- Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(FineGrained): PPZ for satisfiable k-SAT via the isolation inequality (cslib-community#894) (cslib-community#930) Generalize the PPZ analysis from uniquely satisfiable to arbitrary satisfiable k-CNF formulas. Add Cslib.BitString.isolation with the isolation inequality 2^n ≤ ∑_{σ∈S} 2^{isolation S σ}, a critical clause for every variable whose flip falsifies the formula, the per-assignment bound round_apply_ge, and round_success_of_satisfiable. Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> * feat(Interactive): layered arithmetic circuits and the GKR identity (cslib-community#892) (cslib-community#944) * feat(Interactive): layered arithmetic circuits and the GKR identity (cslib-community#892) Add Cslib.Interactive.GKR.LayeredCircuit with layer-by-layer evaluation, the wiring predicates add_i and mult_i, closed forms of their multilinear extensions, and the GKR identity (Thaler, Lemma 4.7) expressing the multilinear extension of a layer through the layer below. Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> * refactor(Interactive): reuse indicatorPoly; move bitPoint and eval_multilinearExtension_eq_sum to MultilinearExtension (cslib-community#892) * chore(bib): keep references.bib sorted by key (cslib-community#953) * fix(bib): remove entries duplicated by a faulty restack; keep only this PR's additions, sorted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB * docs(GKR): name the existing wiring-predicate lemma in the module doc The Main results list named eval_multilinearExtension_addPred and eval_multilinearExtension_multPred, which do not exist; the closed form is eval_multilinearExtension_wiringPred, of which addPred and multPred are instances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB --------- Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(Probability): Raz's conditioning lemma for product distributions (cslib-community#886) Conditioning independent coordinates on an event W moves their marginals by ∑ⱼ ‖P_{Uⱼ|W} − P_{Uⱼ}‖² ≤ ln(1/Pr[W])/2, with Holenstein's forms Pr[W] ≤ 2^(−∑ⱼ‖·‖²) and ∑ⱼ‖·‖ ≤ √(k ln(1/Pr[W])). The proof uses the divergence of conditioning, superadditivity of divergence from a product, and Pinsker. Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> * chore(bib): keep references.bib sorted by key (cslib-community#953) --------- Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…erences (cslib-community#949) (cslib-community#1009) * doc(PCP): document or privatize declarations left without outside references (cslib-community#949 item 8) Item 8 of cslib-community#949, area Computability.PCP, entries marked † but not ‡. Twelve declarations are API: their docstrings already state their purpose, and they get Main entries. Three are proof plumbing used only in their own file and become private: cnfVertexNumber_injective, Edge.proofVerdict_answers and Graph.proofLabels_proofOfLabels. No statement changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(PCP): keep the proof-evaluation and round-trip laws public (cslib-community#926) Edge.proofVerdict_answers and Graph.proofLabels_proofOfLabels state the evaluation law of proofQueries and the round trip of proofOfLabels/proofLabels; both are API under privatize-by-intent, so they stay public with Main entries, per reviewer-claude-c4b0c164-18. 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> Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.com>
orbitingflea
pushed a commit
to orbitingflea/complexitylib2
that referenced
this pull request
Oct 25, 2026
…ide references (cslib-community#949) (cslib-community#1010) * doc(Complexity): document or privatize declarations left without outside references (cslib-community#949 item 8) Item 8 of cslib-community#949, area Computability.Complexity, entries marked † but not ‡. Ten declarations are API and get Main entries. The docstring of MIP.exists_checkCert_of_detProver now states its completeness claim, not only the length bound. Two are proof plumbing used only in their own file and become private: PCPVerifier.isPolyTime_queryTable and MonotoneCircuitValue.encMonotoneCircuitValue_dualTableauInstance. No statement changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * doc(PCP): keep the query-table polynomial-time bound public (cslib-community#926) PCPVerifier.isPolyTime_queryTable is the polynomial-time bound of the Main definition queryTable, so it stays public with a Main entry, per reviewer-claude-c4b0c164-18. 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> Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.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.
Records Samuel's decision of 2026-10-24. The concern is that privatization hides library-wide API, so later work re-implements it.
Problem. The quality program's privatization rule (#587, D1) was applied as "never referenced outside its module ⇒
private". That measures current usage, not intent. #913, for example, privatizedrandomizedComplexity_le_iffandle_randomizedComplexity_iff, negation invariance of sensitivity, block sensitivity and certificate complexity, Nisan's D(f) ≤ C(f)·bs(f) and a direction of Yao's minimax, alongside genuine plumbing. The next contributor who needs one of those can't see it, and re-proves it.Change (CONTRIBUTING "Public surface under the module system"):
Follow-ups, tracked on #587:
Validation. Documentation only. I authored this, so review is requested from
coordinator-reviewer-codex-20261023.AI disclosure. Written by Claude Code (Opus 5.5) as
coordinator-claude-c4b0c164-20261023, from Samuel's direction.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB