Skip to content

refactor: drop a duplicated pseudoMassFromParamsAtPair J=0 h=0 lemma - #4657

Merged
phasetr merged 2 commits into
mainfrom
refactor/drop-duplicate-pseudomass-jzero-hzero
Jul 22, 2026
Merged

refactor: drop a duplicated pseudoMassFromParamsAtPair J=0 h=0 lemma#4657
phasetr merged 2 commits into
mainfrom
refactor/drop-duplicate-pseudomass-jzero-hzero

Conversation

@phasetr

@phasetr phasetr commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Motivation

Simplification refactor under the user's standing authorization, continuing the scanner-vetted deletions of #4636/#4641/#4648/#4651/#4655. Two theorems state the identical proposition — pseudoMassFromParamsAtPair hα hr d Λ ⟨0,0,β⟩ x z = 0 under the same hypotheses (, hr, d, Λ, edge-Fintype instance, 0 < β, arbitrary x z) — a duplicate proof of one fact:

  • pseudoMassFromParamsAtPair_J_zero_h_zero (IsingModel/PseudoMass/FromParamsBasic/BasicSlices.lean:105)
  • pseudoMassFromParamsAtPair_J_zero_h_zero_any_pair (IsingModel/PseudoMass/FromParamsHZero/JZeroValues.lean:61)

Both are referenced nowhere in the repository outside their own declaration, and neither is cited by docs/index.md or tex/proof-guide.tex.

Decision: which to delete

Per the issue #4639 adoption rule, when both candidates are reference-0 only one is removed. The JZeroValues hub (_any_pair) is kept and the BasicSlices direct copy (_J_zero_h_zero) is deleted, because:

  • _any_pair is the canonical "J-zero value cases" module head and case-splits (x = z / x ≠ z) into the granular helpers pseudoMassFromParamsAtPair_diag_h_zero and pseudoMassFromParamsAtPair_at_J_zero_h_zero_eq_zero, which are referenced only by _any_pair.
  • Deleting _any_pair would cascade those two helpers into new reference-0 declarations. Deleting the BasicSlices direct copy (whose proof uses only general library lemmas — correlationInfinite_J_zero, pseudoMassExt_of_not_mem) leaves the dependency graph intact.
  • The two statements are literally identical (same binders, same conclusion), so keeping _any_pair loses no information.

Post-deletion the two helpers remain load-bearing (scanner re-run) → cascade = 0.

Scanner output (issue #4639 adoption rule)

python3 scripts/dead_candidate_scan.py --name pseudoMassFromParamsAtPair_J_zero_h_zero --name pseudoMassFromParamsAtPair_J_zero_h_zero_any_pair --lean:

--lean cross-check: 2 candidate(s) compared against the elaborated graph; no consumer seen by Lean was missed on a safe-to-delete verdict
== dead-candidate scan ==
canary: 1096 declarations carrying 'Λ'x1093, 'β'x1, 'σ'x2 each find themselves: PASS
canary: 10903 code citations in tex/proof-guide.tex, none broken across a line: PASS

-- published-result: 0 --

-- load-bearing: 0 --

-- uncertain: 0 --

-- safe-to-delete: 2 --
  IsingModel.pseudoMassFromParamsAtPair_J_zero_h_zero  [theorem]  IsingModel/PseudoMass/FromParamsBasic/BasicSlices.lean:105
      reason: no reference outside the delete set, no citation in the scanned documentation (README.md, docs/**/*.md, tex/proof-guide.tex)
  IsingModel.pseudoMassFromParamsAtPair_J_zero_h_zero_any_pair  [theorem]  IsingModel/PseudoMass/FromParamsHZero/JZeroValues.lean:61
      reason: no reference outside the delete set, no citation in the scanned documentation (README.md, docs/**/*.md, tex/proof-guide.tex)

-- cascade (informational, never auto-deleted): 2 --
  depth 1: IsingModel.pseudoMassFromParamsAtPair_at_J_zero_h_zero_eq_zero (IsingModel/PseudoMass/FromParamsBasic/MonotonicityBounds.lean:91)
  depth 1: IsingModel.pseudoMassFromParamsAtPair_diag_h_zero (IsingModel/PseudoMass/FromParamsBasic/BasicSlices.lean:146)

-- coverage warnings: 0 (each forces `uncertain` on every candidate it could be citing) --

elapsed: 40.7s

LIMITS: this scan is textual. It cannot see simp/aesop set usage, tactic-generated
references, open/export-shortened names, or metaprogrammed names. It does not check
autoImplicit binder drift (a `#check @` dump is a separate gate). Doc rows that depend
on a lemma without naming it are invisible. Run with --lean on a green build to
cross-check the elaborated dependency graph; run --explain for the full table.
A "safe-to-delete" verdict is a necessary, not a sufficient, condition for deletion.

The cascade list above is why the BasicSlices copy is chosen for deletion: those two helpers are reachable only through _any_pair, so the hub is retained. Post-deletion scan of the two helpers reports them load-bearing (referenced by the surviving _any_pair), i.e. cascade = 0, zero new reference-0 declarations.

Verification

  • Full scanner output with LIMITS: banner pasted (textual scan + --lean cross-check); both classify safe-to-delete
  • Deleted name pseudoMassFromParamsAtPair_J_zero_h_zero absent repo-wide (IsingModel/docs/tex/README)
  • Post-deletion scanner: two helpers load-bearing, cascade = 0 (no new reference-0 decl)
  • Surviving _any_pair #check @ dump unchanged and #print axioms = [propext, Classical.choice, Quot.sound] unchanged (before/after deletion)
  • lake build error-free / warning-free
  • scripts/audit_gate.py --full V1-V4 PASS
  • audit_gate.py --self-test (166 OK) and dead_candidate_scan.py --self-test (79 OK)
  • lake exe GKSTest PASS
  • Declaration-name-set diff vs main = exactly 1 deletion, 0 additions (only BasicSlices.lean changed)

🤖 Generated with Claude Code

Duplicate lemmas pseudoMassFromParamsAtPair_J_zero_h_zero and
pseudoMassFromParamsAtPair_J_zero_h_zero_any_pair state identical
propositions with identical hypotheses. Scanner-vetted deletion
under standing authorization (issue #4639).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two theorems stated the identical proposition under identical
hypotheses for arbitrary (x, z):

  pseudoMassFromParamsAtPair hα hr d Λ ⟨0,0,β⟩ x z = 0

- pseudoMassFromParamsAtPair_J_zero_h_zero
    (PseudoMass/FromParamsBasic/BasicSlices.lean) — direct proof via
    correlationInfinite_J_zero; references no exclusive helpers.
- pseudoMassFromParamsAtPair_J_zero_h_zero_any_pair
    (PseudoMass/FromParamsHZero/JZeroValues.lean) — the canonical
    "J-zero value cases" hub that case-splits into the granular helpers
    pseudoMassFromParamsAtPair_diag_h_zero and
    pseudoMassFromParamsAtPair_at_J_zero_h_zero_eq_zero.

scripts/dead_candidate_scan.py --lean classified both as
safe-to-delete (reference-0, no doc/tex citation). Deleting only one
per the issue #4639 adoption rule. The direct BasicSlices copy is
removed and the JZeroValues hub kept, because deleting the hub would
cascade its two exclusively-referenced helpers into new reference-0
declarations, whereas removing the direct copy leaves the dependency
graph intact (post-deletion cascade = 0, both helpers still
load-bearing). The surviving lemma's `#check @` dump and
`#print axioms` ([propext, Classical.choice, Quot.sound]) are
unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@phasetr

phasetr commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

dev-issue-manager resolution verification — PASS

Independently re-verified (not just re-reading the PR body):

Governance sync: tracking issue #4658, this PR, and the local mirror .self-local/issues/4658.md are consistent; no drift found against #4655/#4656/#4639 (all closed/merged appropriately) from this /goal session.

Verdict: resolved, PR is mergeable, tracking issue #4658 may be closed on merge.

@phasetr
phasetr marked this pull request as ready for review July 22, 2026 05:38
@phasetr
phasetr merged commit 2b3aa91 into main Jul 22, 2026
1 check passed
@phasetr
phasetr deleted the refactor/drop-duplicate-pseudomass-jzero-hzero branch July 22, 2026 05:38
phasetr added a commit that referenced this pull request Jul 22, 2026
…ster 1)

Sixth application of the #4639 adoption rule (continuing #4648/#4655/#4657/
#4659). Delete the first self-contained closure-component of the
`ratio_bound_bundle` family: the six base-Conditioning conjunction wrappers

  freeEnergy_high_temp_h_zero_ratio_bound_bundle{,_ferromagnetic}
  log_partitionFunction_high_temp_expansion_h_zero_ratio_bound_bundle{,_ferromagnetic}
  partitionFunction_high_temp_expansion_h_zero_ratio_bound_bundle{,_ferromagnetic}

in `Conditioning/HighTempClosed/{FreeEnergyRatios,PartitionRatios}.lean`.

These wrappers only re-pair the underlying `_ratio_bound` / `_ratio_bound_beta_zero`
lemmas, which survive (still consumed by the `triple_ratio_bound_bundle` and the
`_ferromagnetic` single-slice variants), so the scanner reports zero cascade for
this subset. The component is self-contained: each member's only consumer is its
own same-file `_ferromagnetic` companion, all of which are in the delete set.

`dead_candidate_scan.py` verdict for the subset: 6/6 safe-to-delete, cascade 0;
`--lean` cross-check on the green build finds no consumer missed. No `docs/index.md`
or `tex/proof-guide.tex` citation touched; no module docstring named these decls.

Recalibrate the `_ferromagnetic` family fixture: total 259 -> 256 and safe
128 -> 125 (both drop by the three deleted `_ferromagnetic` wrappers), zero-consumer
141 -> 138; uncertain/load-bearing/published unchanged -- the healthy signature that
no live lemma was reclassified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
phasetr added a commit that referenced this pull request Jul 22, 2026
* refactor: drop the first ratio_bound_bundle cluster

WIP: placeholder for the first self-contained closure-component subset of ratio_bound_bundle deletions under standing authorization.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: drop six base-Conditioning ratio_bound_bundle wrappers (cluster 1)

Sixth application of the #4639 adoption rule (continuing #4648/#4655/#4657/
#4659). Delete the first self-contained closure-component of the
`ratio_bound_bundle` family: the six base-Conditioning conjunction wrappers

  freeEnergy_high_temp_h_zero_ratio_bound_bundle{,_ferromagnetic}
  log_partitionFunction_high_temp_expansion_h_zero_ratio_bound_bundle{,_ferromagnetic}
  partitionFunction_high_temp_expansion_h_zero_ratio_bound_bundle{,_ferromagnetic}

in `Conditioning/HighTempClosed/{FreeEnergyRatios,PartitionRatios}.lean`.

These wrappers only re-pair the underlying `_ratio_bound` / `_ratio_bound_beta_zero`
lemmas, which survive (still consumed by the `triple_ratio_bound_bundle` and the
`_ferromagnetic` single-slice variants), so the scanner reports zero cascade for
this subset. The component is self-contained: each member's only consumer is its
own same-file `_ferromagnetic` companion, all of which are in the delete set.

`dead_candidate_scan.py` verdict for the subset: 6/6 safe-to-delete, cascade 0;
`--lean` cross-check on the green build finds no consumer missed. No `docs/index.md`
or `tex/proof-guide.tex` citation touched; no module docstring named these decls.

Recalibrate the `_ferromagnetic` family fixture: total 259 -> 256 and safe
128 -> 125 (both drop by the three deleted `_ferromagnetic` wrappers), zero-consumer
141 -> 138; uncertain/load-bearing/published unchanged -- the healthy signature that
no live lemma was reclassified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
phasetr added a commit that referenced this pull request Jul 22, 2026
Seventh application of the #4639 adoption rule (continuing
#4648/#4651/#4655/#4657/#4659/#4661). Remove the second self-contained
closure-component of the `ratio_bound_bundle` family: the eight
`freeEnergy{Λ,AlongExhaustion}{,_latticeGraph}_high_temp*_h_zero_ratio_bound_bundle`
wrappers (general + ferromagnetic) across the Λ / latticeGraph /
AlongExhaustion layers. These are unused conjunction bundles; the
underlying non-bundle `*_ratio_bound` / `*_ratio_bound_beta_zero`
slices they pass through are retained and still consumed by the
triple-ratio and log-Fe wrappers.

The component is self-contained: every reference to a member is a
def-site or a use-site inside another member, and none is cited by
`docs/index.md` / `tex/proof-guide.tex`. Two files empty out and are
removed (`HighTemperatureBoundsRatioLogFeFreeEnergyBound{,Ferro}.lean`);
their umbrella imports are dropped from `HighTemperatureBounds.lean` and
`HighTemperatureBoundsRatioLogFe.lean`, and reachability is preserved
because every consumer of the surviving `BoundOnly` slices imports that
child directly. Module-docstring prose mentioning the removed wrappers
is updated in the same commit.

Cascade is zero: the scanner's cascade set is unchanged (7 entries),
and the `_ferromagnetic` family calibration moves along the healthy
signature -- total 256->252 and safe 125->121 both drop by the four
deleted ferromagnetic wrappers, with uncertain/load-bearing/published
unchanged (no live lemma reclassified) and zero-consumer 138->136.
Fixture constants in `test_dead_candidate_scan.py` recalibrated
accordingly.

Verification: `lake build` green (warning-free), `audit_gate --full`
V1-V4 PASS, `audit_gate --self-test` 166 OK, `dead_candidate_scan
--self-test` 79 OK, `lake exe GKSTest` PASS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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