Repository navigation
Optimize PDL proof search and tableau measures - #667
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Low impact] No actionable defect was found in this proof-only refactor. SummaryThis PR narrows proof search across 32 existing PDL modules without changing source declaration signatures or the public import graph.
Validation limits: builds, timing samples, and the complete elaborated-declaration audit were not rerun. External source and license evidence were not independently reverified; this PR leaves the project card and attribution unchanged. Acknowledged limitation: Reviews (1) · Last reviewed commit: "Limit PDL box proof search to relevant f..." · Reviewed by Greptile |
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | proof and tactic rewrites |
| Introduces tech debt | ✅ no |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
Explicit proof steps and narrower searches improve maintainability without introducing actionable technical debt.
Tokens: 1,876,369 in / 8,413 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $7.6317 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
Vilin97
left a comment
There was a problem hiding this comment.
{
"summary": "At 3a40360, the PDL refactor narrows Aesop/Grind search and replaces inferred membership, path and history arguments with explicit witnesses. Qsteps_append now exposes composition directly, localTableauTruth carries the child/leaf witnesses in both directions, and PathIn.elem_allPaths follows the path constructors. These changes make the argument easier to follow without an observed API or import change. The author's reported 12.98% median wall-time reduction is advisory; I did not rerun the benchmark or independently reproduce the compiled declaration manifest.",
"assessment": {
"scope": "proof-search and tableau-measure refactor",
"introduces_tech_debt": false,
"maintainability": "improved",
"brittleness": "more_robust",
"risk": "low",
"assessment_one_sentence": "The complete 32-file proof refactor improves local reasoning and constrains automation without a source-level compatibility concern."
},
"verdict": "approve",
"findings": []
}
PDL was chosen as a large, completed target with 52 modules and repeated broad automation in interpolation, local tableau rules, and path/measure arguments. Those proof bodies offered concrete optimization opportunities while leaving its public import graph and definitions intact. PDL repeatedly reconstructs finite-set membership, tableau paths, and natural-number measure facts with broad automation. Use direct witnesses and existing lemmas for those steps, and restrict proof search and local simplification contexts to the facts each proof uses.
The selected completed project is
LeanPool/PDL(52 owned modules). The audited base is6cce96e685eab8843a5ee5de170cf28313d31fbeand the measured head is3a4036061f4509778d7d2b7487c9eb7da222fe59. Main was verified immediately before commit at2fc3a737eb236f260197b4ef2e296d5f076ca728; its selected project, dependency, policy, and pin inputs match the audited base. The original base was retained under the native-queue policy. The unchanged repository pins are Lean4.35.0-rc3and Mathlibc55e6e786f49471c72fbddbec5415808896aec1e.Finsetlemmas.Qsteps_appendandlocalTableauTruth, use path-structural induction forPathIn.elem_allPaths, and transport histories directly along tableau edges.omegaand a direct successor inequality for eligible natural-number arguments. Existing arithmetic steps are retained where a different certificate would remove an old generated helper.grindand Aesop searches and remove unused large hypotheses inside local box/model-graph arguments. The public import graph is preserved;lake shakewas investigated with public imports retained.Before the first edit, Lean environment inspection recorded every project-owned declaration, including private helpers, generated matchers, and recursive auxiliary definitions: 9,423 module records and 9,416 distinct names. The baseline manifest SHA-256 is
9a1bb5498cf51e6c21e3f6b8fa0dd53af4b9177d4206bf2ba507d9d7ff06949d.The audit compares complete elaborated types, universes, binder order/implicitness, names, safety, mutual membership, all definition/opaque values and reducibility hints, and inductive/constructor/recursor metadata. Only theorem proof values are exempt. All 9,423 old records remain present and compare identically after omitting nonsemantic source metadata and applying
Name.eraseMacroScopesonly to bound lambda/forall/let names. Ordinary binder names, constant names, and universe names are retained; there is no expression reduction or logical-equivalence comparison. All old definition values also match the raw manifest structurally. The 52 raw type differences are bound hygienic identifiers in generated helpers (includingPDL.Q_then_relate._mutual). Source declaration signatures are unchanged. There are 34 additional private proof helpers. All 52 audited source Git blobs match this committed head.Measurement uses isolated base/head worktrees, removes only PDL build artifacts, retains identical prebuilt pinned dependencies, and runs
LEAN_NUM_THREADS=4 lake build --wfail LeanPool.PDL.Importsin base/head/head/base/base/head order. GNUtimerecords wall time, child CPU, and maximum compiler-process RSS. Every completed sample is included:The observed median meets the 10% stopping criterion.
Validation passed: the warning-free target build; Mathlib declaration linters over all 52 modules;
lake exe lint-style LeanPool.PDL.Imports;lake exe mk_all --module --check; repository header, forbidden-text, file/proof-size, project-card, Lake/style-option, axiom-closure, and option-backdoor audits; dependency pin checks; andgit diff --check. The lint command wasLEAN_NUM_THREADS=4 lake env lean --run scripts/ci/lint-project.leanwith the complete 52-module list. The quality/trust run invoked unchanged repository checker functions scoped to all owned PDL files and its card.The VM is heavily shared, so wall time varies substantially. Peak RSS measures one compiler process; aggregate build memory was not measured. Standalone synchronous profiles are advisory: a Local.Rules variant exceeded the unchanged default heartbeat limit, and that failed timing was excluded. Normal project builds and all required local checks passed. This PR is submitted for review; this task requests no merge or auto-merge.