Skip to content

Reuse proved matrix entries in the Dirac Fierz proof - #1057

Merged
Vilin97 merged 1 commit into
LeanPool:mainfrom
gpartin:fix/dirac-v35-review
Nov 27, 2026
Merged

Vilin97 merged 1 commit into
LeanPool:mainfrom
gpartin:fix/dirac-v35-review

Conversation

@gpartin

@gpartin gpartin commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Reuse proved matrix-entry formulas for the inherited gamma, axial, and sigma operators in Fierz completeness.
  • Remove the unused Fierz import from the moving-spin invariant module.
  • Explain the six independent antisymmetric tensor components and the factor of one half in the sum over ordered pairs.

This is an AI-assisted follow-up to the three findings in the refactor review of #1055.

Verification

  • lake build LeanPool.LatticeDiracDerivation.Imports passed. The refactored Fierz module built in 25 seconds on the local machine.
  • Lean re-elaborated all twelve public theorem statements from the merged V3.5 source against the refactor. A source comparison also found all 23 public declarations in the two edited files unchanged.
  • The axiom audit for Fierz completeness and the moving-spin certificate reported propext, Classical.choice, and Quot.sound. git diff --check passed.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

No blocking issue was found in this proof refactor or import removal.RetriggerView in Greptile

[Low impact] No blocking issue was found in this proof refactor or import removal.

Summary

The PR replaces repeated operator unfolding with proved coordinate formulas in the Fierz proof.

  • Fierz entries reuse proved coordinate formulas.
  • The moving-spin module no longer re-exports bilinear closure.

No actionable issues were found. External upstream source and license claims were not independently verified. The reported build timing was not independently measured.

Reviews (1) · Last reviewed commit: "Reuse proved matrix entries in the Dirac..." · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

Statement changes

✅ No statements changed — all 116 tracked declarations across 2 modified files kept their type; only proofs / definition bodies changed.

Also: 13 declarations added, 0 removed. A reorganization moves declarations between files, which shows up here as an add in one file and a remove in another.

➕ Declarations added (13)
  • LeanDirac.V2.axial_lower_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.axial_upper_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gammaCoefficient — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gammaColumn — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gammaFiveColumn — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gammaSignature — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gamma_apply — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gamma_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gamma_five_apply — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gamma_five_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.gamma_lower_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.sigma_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean
  • LeanDirac.V2.sigma_lower_entry — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean

Statements are compared textually against the merge base (comments and whitespace ignored; by proof terms embedded in a type are treated as proof-irrelevant), the same method as physlib's /check-golf. Anonymous instances and examples are not tracked.

Compile cost of modified files — base → head

Heartbeats: 7,631,572 → 2,965,775 (-4,665,798, -61.1%). Commands: 129 → 142.

Per-file wall sum: 520.5 s → 206.5 s (-60.3%). Wall clock is measured under parallel load and is noisy; heartbeats are deterministic and are the regression signal.

Files: 2 compared — 1 cheaper, 0 costlier, 1 within noise (threshold: |Δ heartbeats| ≥ 1,000 and ≥ 1%).

Both sides are elaborated against the merge-base build of the pool — sound when only proofs and definition bodies change; a file whose statements changed may fail there and is flagged ⚠. Heartbeats come from disjoint root command traces with trace.profiler.useHeartbeats and synchronous elaboration, converted to maxHeartbeats units. Failed measurements are not classified as cheaper or costlier. Δ lines counts added/deleted lines from this PR diff.

File Δ lines HB base HB head Δ HB Δ HB % Wall base (s) Wall head (s)
LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean +86/-12 7,526,846 2,861,048 -4,665,798 -62.0% 507.92 191.24
LeanPool/LatticeDiracDerivation/V35MovingSpinInvariant.lean +0/-1 104,727 104,726 -0 -0.0% 12.55 15.22
Total +86/-13 7,631,572 2,965,775 -4,665,798 -61.1% 520.5 206.5

Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at f3189443c6fb1aa28893a376d36d64f387a2d679.

  • The private formulas are proved from the inherited gamma, axial and sigma operators. The Fierz proof reuses them across the same 256 entries, with the tensor count and normalizations preserved. The hosted profile reports 116 unchanged declaration types and a 62% heartbeat reduction in the Fierz module. Proof Profile
  • The project entry points still export Fierz and moving spin. A caller importing only V35MovingSpinInvariant for Fierz should import V35BilinearCliffordClosure explicitly. The module overview now explains the six independent tensor components and the factor of one half for the ordered sum.

@Vilin97
Vilin97 added this pull request to the merge queue Nov 27, 2026
@Vilin97

Vilin97 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

🤖 LLM review — refactor (gpt-6.2-sol)

Reviewed head: f3189443c6fb1aa28893a376d36d64f387a2d679

Verdict: 🛑 request_changes

The Fierz proof now reuses proved gamma, axial, and sigma entry formulas across all 256 cases. Moving spin drops its Fierz dependency, and the module overview explains the factor of one half in the ordered tensor sum. The project import target built with pinned dependencies, and the PR profile reports 62% fewer heartbeats for the Fierz module. PR proof profile

Aspect Value
Scope Fierz proof refactor and import cleanup
Introduces tech debt 🛑 yes
Maintainability ✅ improved
Brittleness 🛑 more_brittle
Risk ✅ low

The entry lemmas make the proof easier to debug, and the exported tactic needs to work after import before this merges.

Findings (1)

  • api-regression — LeanPool/LatticeDiracDerivation/V35BilinearCliffordClosure.lean:181
    The exported v35FierzFinish tactic now expands to private names such as gamma_lower_entry. I compiled the same one-entry caller in a separate importing module against both revisions. It succeeds on the base and fails on the PR head with unknown-constant errors. Keep the case solver local and define the exported tactic after v35_fierz_completeness, using that public theorem to close entry goals.

Tokens: 2,865,864 in / 16,017 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $11.7037 (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.
request_changes is an ask, not a close: of the reviewer's past request_changes verdicts, 39% were merged after a human looked. Read the findings before acting on the verdict.

Merged via the queue into LeanPool:main with commit 074979d Nov 27, 2026
27 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.

2 participants