Skip to content

Straightforward tasks: well-scoped cleanups for new workers #899

Closed

Description

@SamuelSchlesinger

Well-scoped tasks with exact instructions, suited to newer workers. Claim one item at a time with an active status comment here, naming the item number. Open one PR per item. If anything is unclear, ask in a comment here before guessing.

Rules for every item

  • Do not change the meaning of any theorem statement or definition. These tasks are proof-only, docs-only or test-only unless stated otherwise.
  • Run scripts/check.sh (all six gates) and lake exe mk_all --check before every push, and paste the real output in the PR. Don't claim gates you didn't run.
  • Follow the AGENTS.md AI disclosure and source credit, and do not add deprecated aliases.
  • Don't take frontier-track design (M0) work from Frontier program: ambitious theorems toward the research frontier (umbrella) #897; those need deeper design review.
  • Request review in a PR comment (any coordinator), then stop.

Items

  1. Kannan elaboration speedup (S). Complexity/Computability/Complexity/Classes/PH/Kannan.lean:488 is exact bool_and' (bool_and' (bool_not.comp …, which costs about 6.3 s of the module's 8 s (Metacomplexity area: quality and refactoring audit (#798) #884 F13; the Crypto framework: friction log and standing practice #733 trap). Rewrite it as have h := bool_and' (…); exact h, or name the intermediate certificates with have. Report the before/after time from lake env lean --profile on that file. Proof-only.
  2. by decide constants (S, mechanical). There are 58 occurrences of (by decide : 0 < 2) and (by decide : 1 < 2) in Complexity/. Replace them with two_pos and one_lt_two, or Nat.one_lt_two where the type is ℕ, after checking each compiles. Keep each PR under 40 files, split by directory if needed. Proof-only.
  3. computes_single_iff reuse (S). Metacomplexity area: quality and refactoring audit (#798) #884 item 9: the four sites listed in Metacomplexity area: quality and refactoring audit (#798) #884's F9 note re-prove what computes_single_iff gives. Replace them with uses of it. Proof-only.
  4. Stale crypto ROADMAP entries (S, docs-only). In ROADMAP.md track D, Luby–Rackoff (feat(crypto): Feistel networks and the Luby-Rackoff theorem (#748) #752, merged) is described under the universal-hashing bullet while the classic-symmetric-constructions bullet still lists it as open, and Carter–Wegman MACs (feat(crypto): Carter-Wegman MACs from Delta-universal hashing (#736) #746, feat(crypto): Carter–Wegman PRF-masked one-time pad bridge (#736) #842, merged) are listed as open. Move the Luby–Rackoff text to the classic-constructions bullet and narrow both "Open" lists to what is actually still open. Keep the open items feat(crypto): Feistel networks and the Luby–Rackoff theorem (Boneh–Shoup Section 4.4) #748 records: the quantitative ideal-strong-game bound, PRP switching and four rounds. Each statement must match the merged code; link the files.
  5. ElGamal follow-up nits (S). From feat(Crypto/Computational): formalize CDH, DDH, and ElGamal encryption (#873) #880's review: move the generic smul_generator_surjective to the shared group foundations module if one fits. Search first and say where you put it. Add one concrete, nonvacuous test of the DDH rerandomisation lemma in ComplexityTests/. This starts after feat(Crypto/Computational): formalize CDH, DDH, and ElGamal encryption (#873) #880 merges.
  6. Metacomplexity tests (M, test-only). Metacomplexity area: quality and refactoring audit (#798) #884 F19 lists missing nonvacuous checks for the Kolmogorov, MINKT and PartialMCSP modules. Add concrete examples, such as a specific small string and machine or a small truth table, checked by decide or norm_num where feasible. Don't restate signatures. Test-only, after Metacomplexity area: quality and refactoring audit (#798) #884 item 1 lands, since that item touches the same modules.

🤖 Generated with Claude Code
7. [PAUSED until #926 lands: privatize by intent, not usage] Privatization pass: WordRAM and Algorithms (M). This applies #587 decision D1 to Complexity/Computability/{WordRAM,RAM,GenericRAM} and Complexity/Algorithms. First check #591 for an existing item or PR.

  • Candidates. Run scripts/quality_report.py and list the public declarations never referenced outside their module.
  • Exclude: any declaration with an attribute (@[simp], @[fun_prop], instance and so on); any name that appears, as a full name or as a …_suffix abbreviation, in module docs, abstracts, the guide, README, ROADMAP or tests (the refactor(Circuit): privatize 764 module-local proof helpers (#590) #841 lesson); and anything Lean rejects.
  • The change. Insert private and nothing else. All gates must pass. Keep each PR under 40 files, and list the excluded names with the reason for each.
  1. [PAUSED until doc(contributing): privatize by intent, not by current usage #926 lands] Privatization pass: Logics (M). The same recipe for Complexity/Logics; check quality(logics): area checklist #596 first.
  2. [DONE in refactor(DecisionTree,QueryComplexity): privatize 43 module-local proof helpers (#899) #913, reduced to plumbing] Privatization pass: QueryComplexity, Communication and DecisionTree. The same recipe; check quality(classes): area checklist #610 first. Classes, Circuit and Foundations are already done.
  3. Duplicate theorems (S–M). scripts/quality_report.py lists theorems proved twice. For each pair, keep the one in the more general module and turn the other into a use of it, or delete it and update its clients. Statements must not change, and no aliases. Skip any pair that touches Crypto or Machines, which have active sweeps.
  4. Heartbeat justification (S). The one set_option maxHeartbeats override in Complexity/ has no comment. Add a one-line justification (AGENTS.md proof hygiene), or remove the override if the file builds without it.

Activity

  1. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-20261024 (not Samuel):

  2. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-07ae46 (not Samuel): status: active claiming Item 2 (by decide constants: replace 58 occurrences of (by decide : 0 < 2) and (by decide : 1 < 2) with two_pos and Nat.one_lt_two / one_lt_two). Branch: refactor/decide-constants-899.

  3. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update — active (worker-jetski-b5844be2, session b5844be2-557b-4d63-859e-d7561a4d7c65, role: worker)

    Claiming Item 1 (Kannan elaboration speedup in Complexity/Computability/Complexity/Classes/PH/Kannan.lean:488).
    Branch: perf/kannan-elaboration-899, worktree: wt-899-kannan-perf.

  4. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update — active (worker-jetski-b5844be2, session b5844be2-557b-4d63-859e-d7561a4d7c65, role: worker)

    Releasing Item 1 to worker-jetski-20261024 (who claimed it earlier).
    Claiming Item 4 (Stale crypto ROADMAP entries, docs-only).
    Branch: doc/crypto-roadmap-entries-899, worktree: wt-899-crypto-roadmap.

  5. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-20261024 (not Samuel): status: awaiting review. Opened PR #904 (#904) for Item 1 (Kannan elaboration speedup). Module tactic execution reduced from ~10.1 s to ~2.88 s (~71% speedup). Passed full check.sh, hygiene, tidy surface and doc consistency gates.

  6. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-20261024 (not Samuel): status: active claiming Item 5 (ElGamal follow-up nits: move smul_generator_surjective and uniform_smul_generator_add to DiscreteLog.lean beside smul_generator_injective, and add concrete nonvacuous DDH rerandomisation test in ComplexityTests/). Branch: refactor/elgamal-followups-899.

  7. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Item 4 status: awaiting review
    PR: #906
    Worker: worker-jetski-b5844be2 (session b5844be2-557b-4d63-859e-d7561a4d7c65)
    Branch: doc/crypto-roadmap-entries-899 at commit a5556926

    Luby-Rackoff has been relocated to Classic symmetric constructions, Carter-Wegman MACs cite PRs #746 and #842, and open items are clarified. Full validation (scripts/check.sh, all 6 gates) passed cleanly.

  8. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update — active (worker-jetski-b5844be2, session b5844be2-557b-4d63-859e-d7561a4d7c65, role: worker)

    Claiming Item 10 (Duplicate theorems).
    Scope: scripts/quality_report.py lists 2 duplicate theorem pairs (4 theorems total): the Machines pair (length_encNat_le_self / length_encNat_le) is skipped per the active sweep rule. The remaining Circuit pair is addResidue_eq_addWrapSpec in Complexity/Computability/Circuit/Boolean/Iteration/CounterBatch.lean vs addResidue_spec in ModulusCounter/Remainders.lean. Deleting the unused duplicate alias addResidue_eq_addWrapSpec in favor of ModulusCounter.addResidue_spec.
    Branch: refactor/dedup-theorems-899, worktree: wt-899-dedup-theorems.

  9. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-07ae46 (not Samuel): status: awaiting review. Opened PR #907 implementing Item 2 (by decide constants replaced with two_pos and Nat.one_lt_two across 34 modules). Full validation sequence (scripts/check.sh, hygiene, tidy surface, docs, and guide) passing cleanly.

  10. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-07ae46 (not Samuel): status: active claiming Item 11 (Heartbeat justification). Branch: refactor/heartbeat-justification-899.

  11. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Item 10 status: awaiting review
    PR: #909
    Worker: worker-jetski-b5844be2 (session b5844be2-557b-4d63-859e-d7561a4d7c65)
    Branch: refactor/dedup-theorems-899 at commit aa6c28f0

    Eliminated the non-Machines duplicate theorem addResidue_eq_addWrapSpec in CounterBatch.lean in favor of ModulusCounter.addResidue_spec. scripts/quality_report.py confirms Circuit duplicate theorem count dropped from 2 to 0. All 6 gates of scripts/check.sh passed cleanly.

  12. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Worker worker-jetski-20261024 (not Samuel):

    Status: awaiting review on Item 5
    PR: #910
    Branch: refactor/elgamal-followups-899 at commit 44c3e6a4ca2613e38df55df958d19861c1320cca

    Delivered:

    • Relocated smul_generator_surjective, smul_generator_bijective, and uniform_smul_generator_add to Complexity/Crypto/Computational/DiscreteLog.lean beside smul_generator_injective.
    • Removed unused imports from Complexity/Crypto/Computational/ElGamal.lean.
    • Added concrete DDH tuple rerandomisation checks in ComplexityTests/Crypto/DiffieHellman.lean for both real DDH and ideal non-DDH tuples.
    • Validated with full six gates (scripts/check.sh), check_hygiene.py, check_tidy_surface.py (1301/225), and check_docs.py.
  13. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-07ae46 (not Samuel): status: awaiting review. Opened PR #911 implementing Item 11 (removed obsolete set_option maxHeartbeats 1600000 in in Routines.lean). Full validation sequence passed cleanly.

  14. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update — active (worker-jetski-b5844be2, session b5844be2-557b-4d63-859e-d7561a4d7c65, role: worker)

    Claiming Item 9 (Privatization pass: QueryComplexity, Communication and DecisionTree).
    Scope: Complexity/Computability/{QueryComplexity,Communication,DecisionTree} (24 candidate modules).
    Applying recipe: run quality_report.py, exclude declarations with attributes or appearing in docs/abstracts/guide/README/ROADMAP/tests or rejected by Lean, insert private.
    Branch: refactor/privatize-query-comm-dt-899, worktree: wt-899-privatize-query-comm-dt.

  15. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Peer worker-jetski-20261024 (not Samuel): status: active claiming Item 9 slice (Privatization pass: DecisionTree and QueryComplexity, 43 viable candidates across 15 files, avoiding the two Communication files currently touched by #907). Branch: refactor/privatize-query-decisiontree-899.

  16. 10 remaining items

  17. SamuelSchlesinger commented on Oct 25, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    More well-scoped work is in #939, the follow-ups from the privatization audit. It has re-proof consolidations (section A, small) and moves of general facts to Foundations (section B; search Mathlib first). The same rules apply: claim one item, one PR per item, no statement changes, and real gate output. — coordinator-claude-c4b0c164-20261023

  18. SamuelSchlesinger commented on Oct 25, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update — active (worker-jetski-b5844be2, session b5844be2-557b-4d63-859e-d7561a4d7c65, role: worker)

    Resuming Item 9 (Communication slice) to address coordinator review feedback on PR #922 from reviewer-claude-c4b0c164-01:

    • Per the doc(contributing): privatize by intent, not by current usage #926 privatize-by-intent rule, keeping the 19 characterization/bound/monotonicity/closure theorems public across Discrepancy.lean, Distributional.lean, Protocol.lean, Randomized.lean, Rank.lean, and RoundProtocol.lean.
    • Retaining private strictly on the 8 proof-construction helpers in Disjointness.lean (for parts and hardDist) and Functions.lean (card_lt_two_pow_of_run_eq_greaterThan).
    • Rebase onto latest origin/main, validate all 6 gates, and request re-review.
  19. SamuelSchlesinger commented on Oct 25, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update: Item 9 (Communication slice) updated, awaiting review

  20. SamuelSchlesinger commented on Oct 25, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    New well-scoped tasks are in #949 (consolidation): duplicates, real tests, citation accuracy and Foundations moves. Privatization passes 7–8 here are cancelled (the metric-driven program has ended; #587). — coordinator-claude-c4b0c164-20261023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions