feat(ClusterExpansion): prove the general pathGraph closed form and drop the six decide instances - #4638
Merged
Merged
Conversation
10 tasks
…ating sum
Add `IsingModel/ClusterExpansion/PathGraphAlternatingSum.lean` proving
alternatingConnectedSubgraphSum (pathGraph (n+1)) = (-1)^n (all n : ℕ)
by a pure edge count: a connected spanning subgraph on `n+1` vertices needs at
least `n` edges (`Connected.card_vert_le_card_edgeSet_add_one`), the path has
exactly `n` (`card_pathGraph_edgeFinset`), so the full edge set is the unique
connected spanning subset (`pathGraph_connectedSpanning_charac`) and the sum
collapses to a single term. No tree/bridge theory is needed.
Derive the six `…_pathGraph_{three,…,eight}` values in `GraphCases.lean` as
instances of the closed form, replacing the per-`n` `decide +kernel`
evaluations. The six private `DecidableRel (pathGraph k).Adj` duplicates and
the `maxHeartbeats 400000` escalation are dropped; the imported
`TransferMatrix.pathGraph_decidableAdj` is definitionally equal, so the `#check`
dump of all six statements is unchanged.
`AnalyticityLambdaCapstones`/`AnalyticityLambdaPolymer` relied on reaching
`AlternatingCompleteGraph.MayerConnectedFilter` transitively through the import
of `CycleGraphAlternatingSum` that `GraphCases` no longer needs; make that
dependency explicit in both files.
`GraphCases` module build time: 38s -> 2.0s.
Part of #4637
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`alternatingConnectedSubgraphSum_pathGraph_{three,…,eight}` had zero consumers
anywhere in the library and are now plain instantiations of
`alternatingConnectedSubgraphSum_pathGraph`, which proves the same six values
(and `pathGraph 1 = 1`, `pathGraph 2 = -1` on top). Deleting them follows the
policy already applied to the cycle-graph numerals in #4633/#4636.
Their derivability from the closed form is recorded permanently by the previous
commit, where the six statements — `#check` dump byte-identical to the
`decide +kernel` era — are closed by the general theorem.
`GraphCases.lean` held nothing else, so the module is removed and its sole
importer `StrictPositivity/TanhBounds.lean` is repointed at
`ClusterExpansion.HighTempGeneralRegularity`.
Docs: `docs/index.md` and `tex/proof-guide.tex` now cite the general path
formula (with the counting proof) instead of the per-`n` `decide` family and the
`maxHeartbeats 400000` regime, mirroring the existing cycle-formula paragraph.
Part of #4637
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
phasetr
force-pushed
the
feat/pathgraph-alternating-sum-closed-form
branch
from
July 21, 2026 00:07
6dabc7f to
7274a9f
Compare
Removing `GraphCases.lean` dropped `PathGraphAlternatingSum` and `CycleGraphAlternatingSum` out of the `IsingModel` root import closure, leaving them buildable (lakefile glob) but invisible to `scripts/audit_gate.py` V3, which runs `#print axioms` from a file that only does `import IsingModel`. Import both modules from the umbrella so their capstones stay auditable; both now resolve through `import IsingModel` with axiom set [propext, Classical.choice, Quot.sound]. Also disambiguate the value table in the doc comment of `alternatingConnectedSubgraphSum_pathGraph`: `n` is the exponent, not the vertex count, so the entries are now spelled `n = 2 ↦ pathGraph 3 = 1` etc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
dev-issue-manager: pre-merge resolution verification (HEAD d76f85d)Verdict: PASS. Merge-ready. Independent re-verification (not relying on prior gate reports)
Mathematical-content preservation (no information loss from the GraphCases.lean deletion)
PR body checklistReviewed dev-implement's Full ledgerSee |
phasetr
marked this pull request as ready for review
July 21, 2026 00:46
This was referenced Jul 21, 2026
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.
Motivation
IsingModel/ClusterExpansion/GraphCases.leanprovesalternatingConnectedSubgraphSum (pathGraph k) = ±1separately for k = 3..8, each bydecide +kernel. That file is the most expensive in the repository to elaborate (~36.8s wall even after PR #4629 cut it from 63.7s). A general closed form removes thedecidedependence entirely, generalizes the result to every n, and is estimated to bring the file down to ~4-6s.Statement
alternatingConnectedSubgraphSum (pathGraph (n+1)) = (-1)^nfor alln.Proof sketch
A connected spanning subgraph on
n+1vertices needs at leastnedges (SimpleGraph.Connected.card_vert_le_card_edgeSet_add_one), andpathGraph (n+1)has exactlynedges (card_pathGraph_edgeFinset), so squeezing withFinset.eq_of_subset_of_card_leforces the subset to be the whole edge set; the converse direction isSimpleGraph.pathGraph_connected. HenceconnectedSpanningEdgeSubsets (pathGraph (n+1)) = {edgeFinset}and the alternating sum collapses to a single term viaFinset.sum_singleton. No acyclicity or bridge argument is needed — this is strictly simpler than the existingcycleGraphcounterpart it is modelled on (CycleGraphAlternatingSum.lean:134,197).Plan
Add
IsingModel/ClusterExpansion/PathGraphAlternatingSum.lean(sibling ofCycleGraphAlternatingSum.lean) with one private characterisation lemma and one public closed form; then replace the sixdecideproofs inGraphCases.leanwith instantiations of it, verify the#check @dumps are unchanged, and remove the now-unnecessary privateDecidableRel (pathGraph k).Adjinstances and theset_option maxHeartbeats 400000.Note that the six instances are then reference-0 duplicates of the general form; whether to delete them outright (updating the
docs/index.mdandtex/proof-guide.texmentions to cite the general theorem instead) is decided in this PR.Review follow-up (commit
d76f85d4)Two review findings addressed:
GraphCases.leanremoved the only path by whichPathGraphAlternatingSumandCycleGraphAlternatingSumreached theIsingModelroot import closure (previouslyGraphCases ← TanhBounds), leaving both modules orphaned: still built by the lakefile glob, but invisible toscripts/audit_gate.pyV3, which runs#print axiomsfrom a temporary file that only doesimport IsingModel. Both modules are now imported fromIsingModel.lean(next toAlternatingFinThree), restoring auditability. Demonstrated: from a file whose sole import isIsingModel, bothalternatingConnectedSubgraphSum_pathGraphandalternatingConnectedSubgraphSum_cycleGraphresolve and report[propext, Classical.choice, Quot.sound].alternatingConnectedSubgraphSum_pathGraphwroten = 2 ↦ 1wherencould be read as either the exponent or the vertex count; entries are now spelledn = 2 ↦ pathGraph 3 = 1, etc.lake exe shakedoes not flag either new umbrella import as redundant. (It does report a pre-existing import-narrowing suggestion insideCycleGraphAlternatingSum.leanitself —AlternatingCompleteGraph→AlternatingCompleteGraph.SignedSums— which predates this PR and is left alone.)Out of scope for this PR, recorded for follow-up: three modules are orphaned from the root closure on
mainas well, i.e. not caused by this PR —ClusterExpansion.MayerCore.MayerTermThreeEval,PseudoMass.Composition,PseudoMass.FromParamsBounds.JZeroComparisons(0 importers on bothmainand this branch).Verification checklist
autoImpliciton, so a missing import silently becomes an auto-bound implicit)#check @dumps for the six instances identical before/after the proof replacement — superseded: the six per-ninstances were deleted outright (commit7274a9f5) rather than reproved, so there is no before/after dump to compare;rgconfirms no remaining reference to any of the six names inIsingModel/,docs/index.mdortex/proof-guide.texlake buildwarning-free (5063 jobs, zerowarninglines)#print axioms= [propext, Classical.choice, Quot.sound] with nodecide-specific assumptions — verified throughimport IsingModel, so V3 can see itscripts/audit_gate.py --fullV1-V4 all PASS (13 capstones)lake exe GKSTestGraphCases.leanreported before/after — moot:GraphCases.leanis deleted, so its full ~36.8s elaboration cost is removed rather than reduceddocs/index.mdcitesalternatingConnectedSubgraphSum_pathGraph; zero stale references to the six deleted per-nlemma names indocs/index.md/tex/proof-guide.tex)Part of #4637
🤖 Generated with Claude Code