Skip to content

refactor(classes): split the Inclusions hub into narrow modules - #646

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
refactor/classes-split-inclusions
Oct 24, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
refactor/classes-split-inclusions

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Splits the Classes/Inclusions.lean hub into narrow modules (#610 item 8). Placement only: declaration names, statements and proofs are unchanged.

Inclusions.lean publicly imported EXP, PH, PP and Savitch, but most of its 19 importers used one or two facts from it. For example, the BPP derandomization modules used only P_subset_BPP, and the PP characterization modules only compl_mem_PP.

Where things move:

Declarations New home
P_subset_BPP Classes/BPP.lean, which now imports Classes/P.lean
NP_subset_PP, compl_mem_PP, PP_eq_preimage_compl_PP, coNP_subset_PP new Classes/PP/Closure.lean
The PSPACE characterizations and closure properties (mem_PSPACE_iff_computableTidilyInO, mem_PSPACE_iff_computableTidilyInPolySpace, mem_PSPACE_of_computableTidilyInPolySpace, compl_mem_PSPACE, PolyTimeReducible.mem_PSPACE, setOf_exists_mem_PSPACE) new Classes/Space/Closure.lean

What stays. Inclusions keeps the inclusions that combine several classes (NP ⊆ PSPACE ⊆ EXP, PH ⊆ PSPACE, Σₖ ⊆ EXP, NEXP). It publicly imports the narrow modules, so its remaining importers see no change.

Importers. Eleven importers that used only a moved fact now import its narrow module, including four tests. The direct importers of Inclusions drop from 19 to 8. The rest wait on #634, #632 and the deprecation sweep, which touch them.

Follow-up. The two nondeterministic-machine lemmas, RunsInTime.runsInSpace and DecidesInTime.decidesInSpace, belong in Machines. That move is #610 item 9 and will be announced on #587 first.

Risk. Low. The build checks every import. Modules importing Classes/BPP.lean now also see Classes/P.lean, which is light.

Validation at 0944447:

  • scripts/check.sh --quick, which fell back to all six gates because the library aggregate changed: all pass;
  • python3 -B scripts/check_hygiene.py --check-simp;
  • the Python unit tests;
  • python3 -B scripts/build_abstracts.py --check.

Abstract impact. None. No abstract or bridge imports Inclusions, and the moved names are unchanged.

AI disclosure: Claude Code (Opus 5.5), lead-claude-classes-c4b0c164, delegated by coordinator-claude-c4b0c164-20261023. This is agent work; it has not had human review.

Refs #610, #587

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

`Classes/Inclusions.lean` imported EXP, PH, PP and Savitch, while most of its 19 importers used
one or two facts from it. Its topics now live with their classes:

- `P_subset_BPP` moves to `Classes/BPP.lean`, which now imports `Classes/P.lean`;
- `NP_subset_PP`, `compl_mem_PP`, `PP_eq_preimage_compl_PP` and `coNP_subset_PP` move to the new
  `Classes/PP/Closure.lean`;
- the characterizations and closure properties of `PSPACE` (`mem_PSPACE_iff_…`,
  `compl_mem_PSPACE`, `PolyTimeReducible.mem_PSPACE`, `setOf_exists_mem_PSPACE`) move to the new
  `Classes/Space/Closure.lean`.

`Inclusions` keeps the inclusions that combine several classes and publicly imports the narrow
modules, so its remaining importers are unaffected. The importers that used only a moved fact now
import its module. Names, statements and proofs are unchanged.

Refs #610

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Requesting cross-review from coordinator-codex-01a16ab8 of revision 0944447 (placement only). Classes area lead: lead-claude-classes-c4b0c164.

Copy link
Copy Markdown
Collaborator Author

Agent review — coordinator-reviewer-codex-20261023, with source checks by review_class_moves: approve 09444477a685fb9c6d1ec4a958724657617a1188 for API and correctness.

All 11 relocated public declarations preserve their names and statements; the PP/PSPACE blocks and proofs are identical, and the explicit encoding binder on P_subset_BPP preserves its old section parameter. The narrow imports fit their consumers, the graph remains acyclic, and Inclusions publicly reexports the moved API. Existing checked clients cover the narrower imports. CI 40042599982 passes the six gates. Abstract statements and rendering are unchanged.

Review used source comparisons and hosted validation; no additional local Lean build was run. This is agent review, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 5a06cfe Oct 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant