Rename and split QED anomaly cancellation plane definitions for clarity#1047
Rename and split QED anomaly cancellation plane definitions for clarity#1047
Conversation
Extract Section A (charge splitting definitions) from Physlib/QFT/QED/AnomalyCancellation/Odd/BasisLinear.lean into a new file Physlib/QFT/QED/AnomalyCancellation/Odd/BasisLinear/ChargeSplits.lean. The new file contains all definitions and lemmas from the theDeltas section: oddFst, oddSnd, oddMid, oddShiftFst, oddShiftSnd, oddShiftZero, oddShiftShiftZero, oddShiftShiftFst, oddShiftShiftMid, oddShiftShiftSnd, and all lemmas relating the splittings together. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Extract Section B (the first/symmetric plane) from Odd/BasisLinear.lean into a new file at Odd/BasisLinear/SymmPlane.lean, renaming all identifiers with symm- prefixes (e.g. basisAsCharges → symmBasisAsCharges, P → Psymm, basis → symmBasis, etc.) and updating all internal references accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Extract the shifted plane content (lines 494-747) from BasisLinear.lean into a new file BasisLinear/ShiftPlane.lean, following the same pattern as SymmPlane.lean. All names are updated: - basis! → shiftBasis - P! → Pshift Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Extract Section A (charge splitting definitions) from Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear.lean into a new file Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear/ChargeSplits.lean. This includes: - A.1: evenFst, evenSnd, ext_even, sum_even - A.2: n_cond₂, evenShiftFst, evenShiftSnd, evenShiftZero, evenShiftLast, sum_evenShift - A.3: All relating lemmas between the two splittings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Extract Section B (lines 221-474) from BasisLinear.lean into a new file BasisLinear/SymmPlane.lean, renaming all definitions with symm prefix (e.g. basisAsCharges → symmBasisAsCharges, P → Psymm, etc.) and updating all internal references and documentation accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…ifiers Extract Section C (the shifted plane) from BasisLinear.lean into its own file at BasisLinear/ShiftPlane.lean. All identifiers are renamed to use and the evenShftSnd typo is fixed to evenShiftSnd. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…Pshift - Remove sections A, B, C (now in ChargeSplits, SymmPlane, ShiftPlane) - Import SymmPlane and ShiftPlane publicly - Update module doc to reflect new structure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…name identifiers - Changed imports to public import SymmPlane and ShiftPlane submodules - Removed sections A (ChargeSplits), B (SymmPlane), C (ShiftPlane) - Kept sections D, E, F with updated references - Fixed typo Pa_evenShitZero → Pa_evenShiftZero - Renamed Pa_zero! → Pa_zero_shift - Partially updated Even/LineInCubic.lean references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…cancellation Rename first plane: basis/P/P' → symmBasis/Psymm/Psymm' (symmetric plane) Rename second plane: basis!/P!/P!' → shiftBasis/Pshift/Pshift' (shifted plane) Split into ChargeSplits.lean, SymmPlane.lean, ShiftPlane.lean sub-files Update downstream references in LineInCubic and Parameterization files Agent-Logs-Url: https://github.com/leanprover-community/physlib/sessions/b925f308-353b-4b1d-9802-a285d5d40e54 Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
jstoobysmith
left a comment
There was a problem hiding this comment.
I've given you some comments for the Even case. The analogous comments hold for the odd case.
| -/ | ||
|
|
||
| /-- A point in the span of the shifted plane basis. -/ | ||
| def Pshift' (f : Fin n → ℚ) : (PureU1 (2 * n.succ)).LinSols := ∑ i, f i • shiftBasis i |
There was a problem hiding this comment.
Renamed Pshift' → shiftPlaneLinSols in both Even and Odd cases. See commit e03833b.
| -/ | ||
|
|
||
| /-- A point in the span of the symmetric plane basis. -/ | ||
| def Psymm' (f : Fin n.succ → ℚ) : (PureU1 (2 * n.succ)).LinSols := ∑ i, f i • symmBasis i |
There was a problem hiding this comment.
Renamed Psymm' → symmPlaneLinSols in both Even and Odd cases. See commit e03833b.
|
|
||
| /-- The inclusion of `Fin n.succ` into `Fin (n.succ + n.succ)` via the first `n.succ`, | ||
| casted into `Fin (2 * n.succ)`. -/ | ||
| def evenFst (j : Fin n.succ) : Fin (2 * n.succ) := |
There was a problem hiding this comment.
These should go into the appropriate file with the corresponding plane. There is no need to make a new file for these.
There was a problem hiding this comment.
Removed the ChargeSplits.lean files. The symmetric charge splits (evenFst/evenSnd/oddFst/oddSnd) are now in SymmPlane.lean and the shifted charge splits (evenShiftFst/oddShiftFst etc.) are in ShiftPlane.lean. See commit e03833b.
|
@copilot Address the review. |
|
@copilot address the concerns in the review of this PR |
Extract section A.1 (even split definitions) and section B (first plane) from BasisLinear.lean into a new SymmPlane.lean file with renamed definitions: - basisAsCharges → symmBasisAsCharges - basis → symmBasis - P → symmPlane - P' → symmPlaneLinSols - basis_linear_independent → symmBasis_linear_independent and all related lemma names updated accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Extract sections A.2, A.3, C, and D from BasisLinear.lean into a new ShiftPlane.lean module with descriptive renamings: - basis! (LinSols) → shiftBasis - P! → shiftPlane Also fixes the evenShftSnd typo to evenShiftSnd. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…imports Include Section A.1 (symmetric split: odd_shift_eq, oddFst, oddSnd, oddMid, sum_odd) directly in SymmPlane.lean alongside Section B (symmetric plane). Import from BasisLinear and VectorLike directly instead of ChargeSplits. Apply all renamings consistently: - P → symmPlane, P' → symmPlaneLinSols - basisAsCharges → symmBasisAsCharges, basis → symmBasis - All lemma names updated to match (e.g. P_oddFst → symmPlane_oddFst) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…ntent Replace the existing ShiftPlane.lean with a version that: - Imports SymmPlane instead of ChargeSplits - Includes sections A.2-A.4 (shifted split, shifted-shifted split, relating lemmas) - Adds section D (mixed cubic ACC: symmPlane_symmPlane_shiftBasisAsCharges_accCube) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…dentifiers Rewrite BasisLinear.lean to contain only the combined basis (sections E and F), importing SymmPlane and ShiftPlane via the ShiftPlane transitive import. All identifiers are renamed to the new convention: - P → symmPlane, P! → shiftPlane - P' → symmPlaneLinSols, P!' → shiftPlaneLinSols - basis → symmBasis, basis! → shiftBasis - Pa_zero! → Pa_zero_shift - Pa_evenShitZero → Pa_evenShiftZero (typo fix) - span_basis_swap! → span_basis_swapShift Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…renamed identifiers imports from ShiftPlane and renamed identifiers (symmPlane, shiftPlane, symmPlaneLinSols, shiftPlaneLinSols, symmBasis, shiftBasis, etc.). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…rgeSplits, move charge splits into plane files, move mixed cubic ACC into ShiftPlane Renames applied: - Psymm/P → symmPlane, Psymm'/P' → symmPlaneLinSols - Pshift/P! → shiftPlane, Pshift'/P!' → shiftPlaneLinSols - basisAsCharges → symmBasisAsCharges, basis!AsCharges → shiftBasisAsCharges - basis → symmBasis, basis! → shiftBasis File restructuring: - Removed ChargeSplits.lean (charge splits moved into SymmPlane/ShiftPlane) - Mixed cubic ACC results moved from BasisLinear.lean into ShiftPlane.lean - ShiftPlane imports SymmPlane, BasisLinear imports ShiftPlane Agent-Logs-Url: https://github.com/leanprover-community/physlib/sessions/aa00691e-9564-4dcd-b911-c97145618373 Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Applied all review feedback to both Even and Odd cases in commit e03833b:
Note: The renaming in |
jstoobysmith
left a comment
There was a problem hiding this comment.
Given comments for the Even case, also all apply for the odd case.
|
|
||
| /-! | ||
|
|
||
| ### C.6. The vectors as linear solutions |
There was a problem hiding this comment.
Make these headers more descriptive
There was a problem hiding this comment.
Made section headers more descriptive (e.g. "The basis vectors as LinSols" instead of "The vectors as linear solutions"). Applied in commit 5f7d373.
|
|
||
| /-! | ||
|
|
||
| ### C.7. The inclusion of the shifted plane into charges |
There was a problem hiding this comment.
Added a new section break before the shiftPlaneAsCharges definition (the inclusion into charges), separating it from the shiftBasis LinSols results. Applied in commit 5f7d373.
| -/ | ||
|
|
||
| /-- A point in the span of the shifted basis as a charge. -/ | ||
| def shiftPlane (f : Fin n → ℚ) : (PureU1 (2 * n.succ)).Charges := |
There was a problem hiding this comment.
Would rename to shiftPlaneAsCharges
There was a problem hiding this comment.
Renamed shiftPlane (Charges version) → shiftPlaneAsCharges. Similarly symmPlane (Charges) → symmPlaneAsCharges. Applied to both Even and Odd in commit 5f7d373.
| -/ | ||
|
|
||
| /-- A point in the span of the shifted basis as a linear solution. -/ | ||
| def shiftPlaneLinSols (f : Fin n → ℚ) : (PureU1 (2 * n.succ)).LinSols := |
There was a problem hiding this comment.
would rename to shiftPlane. Similar with all of the examples in the other files.
There was a problem hiding this comment.
Renamed shiftPlaneLinSols → shiftPlane (and analogously symmPlaneLinSols → symmPlane) throughout all Even and Odd files. Commit 5f7d373.
|
|
||
| -/ | ||
|
|
||
| theorem shiftBasis_linear_independent : LinearIndependent ℚ (@shiftBasis n) := by |
There was a problem hiding this comment.
Needs moving up to other results on shiftBasis
There was a problem hiding this comment.
Moved shiftBasis_linear_independent up to be right after the shiftBasis definition (now section C.5/C.6), before shiftPlaneAsCharges. Applied to both Even and Odd in commit 5f7d373.
|
|
||
| /-- Swapping the elements evenShiftFst j and evenShiftSnd j is equivalent to | ||
| adding a vector shiftBasisAsCharges j. -/ | ||
| lemma swapShift_as_add {S S' : (PureU1 (2 * n.succ)).LinSols} (j : Fin n) |
There was a problem hiding this comment.
Give this a better name, more in line with Mathlib conventions.
There was a problem hiding this comment.
Renamed swapShift_as_add → linSolRep_swap_evenShift_eq_add (Even) and linSolRep_swap_oddShift_eq_add (Odd), following Mathlib naming conventions. Commit 5f7d373.
| @@ -826,8 +79,8 @@ lemma P_P!_P!_accCube (g : Fin n → ℚ) (j : Fin n.succ) : | |||
| /-- The whole basis as `LinSols`. -/ | |||
| def basisa : (Fin n.succ) ⊕ (Fin n) → (PureU1 (2 * n.succ)).LinSols := fun i => | |||
There was a problem hiding this comment.
Renamed basisa → basis (and basisaAsBasis → basisAsBasis, basisa_linear_independent → basis_linear_independent, basisa_card → basis_card). Commit 5f7d373.
|
|
||
| /-! | ||
|
|
||
| ## E. The combined basis |
There was a problem hiding this comment.
Fix numbering. I would also rename this file Basis.
There was a problem hiding this comment.
Fixed section numbering (E./F. → 1./2.) and renamed the file BasisLinear.lean → Basis.lean for both Even and Odd. All imports updated. Commit 5f7d373.
|
|
||
| /-- A point in the span of the basis as a charge. -/ | ||
| def Pa (f : Fin n.succ → ℚ) (g : Fin n → ℚ) : (PureU1 (2 * n.succ)).Charges := P f + P! g | ||
| def Pa (f : Fin n.succ → ℚ) (g : Fin n → ℚ) : (PureU1 (2 * n.succ)).Charges := |
There was a problem hiding this comment.
I would give a more descriptive name to Pa an Pa'. Similar to the names given below.
There was a problem hiding this comment.
Renamed Pa → basisCharge and Pa' → basisLinSol (descriptive names: "a charge in the span of the combined basis" / "a LinSols in the span"). All associated lemmas renamed accordingly (basisCharge_evenShiftFst, basisLinSol_eq, etc.). Commit 5f7d373.
|
@copilot fix the review comments above. |
- Rename Charges versions: symmPlane → symmPlaneAsCharges, shiftPlane → shiftPlaneAsCharges - Rename LinSols versions: symmPlaneLinSols → symmPlane, shiftPlaneLinSols → shiftPlane - Rename all associated lemmas: symmPlane_* → symmPlaneAsCharges_*, etc. - Rename basisa → basis, basisaAsBasis → basisAsBasis, basisa_* → basis_* - Rename Pa → basisCharge, Pa' → basisLinSol - Rename all Pa_* lemmas → basisCharge_* and Pa'_* → basisLinSol_* - Rename swapShift_as_add → linSolRep_swap_evenShift_eq_add (Mathlib-style) - Rename BasisLinear.lean → Basis.lean - Restructure ShiftPlane.lean sections: add C.1 header, move shiftBasis_linear_independent to C.6 (with new proof avoiding forward reference), move linSolRep_swap_evenShift_eq_add to C.7, renumber remaining sections - Renumber Basis.lean sections from E./F. to 1./2. style - Update Physlib.lean to import Even.Basis instead of Even.BasisLinear - Update LineInCubic.lean and Parameterization.lean with cascading renames Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Apply same pattern as Even case to Odd BasisLinear files: - Rename BasisLinear.lean -> Basis.lean - SymmPlane.lean: symmPlane (Charges) -> symmPlaneAsCharges, symmPlaneLinSols -> symmPlane (LinSols) - ShiftPlane.lean: shiftPlane (Charges) -> shiftPlaneAsCharges, shiftPlaneLinSols -> shiftPlane (LinSols), swapShift_as_add -> linSolRep_swap_oddShift_eq_add, move shiftBasis_linear_independent after shiftBasis def (C.5), restructure section numbering - Basis.lean: basisa -> basis, basisaAsBasis -> basisAsBasis, Pa -> basisCharge, Pa' -> basisLinSol, Pa_* lemmas -> basisCharge_*, Pa'_* lemmas -> basisLinSol_*, renumber sections E/F -> 1/2 - LineInCubic.lean: update import to Odd.Basis, cascade renames - Parameterization.lean: rename P/P'/P!/P!' -> symmPlane*/shiftPlane* - Physlib.lean: update import from Odd.BasisLinear to Odd.Basis Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
…n.lean Agent-Logs-Url: https://github.com/leanprover-community/physlib/sessions/d94e6cfc-4fd7-43a2-af34-c890c833de6a Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
All review comments have been applied to both Even and Odd cases in commit 5f7d373.
All review comments addressed in commit 5f7d373. Key changes: renamed |
jstoobysmith
left a comment
There was a problem hiding this comment.
Again comments given for the Even case but should carry over to the Odd case aswell.
|
|
||
| -/ | ||
| /-- A point in the span of the whole basis. -/ | ||
| def basisLinSol (f : (Fin n.succ) ⊕ (Fin n) → ℚ) : (PureU1 (2 * n.succ)).LinSols := |
There was a problem hiding this comment.
maybe spanBasis would be better here.
There was a problem hiding this comment.
Renamed basisLinSol → spanBasis (with associated lemmas spanBasis_symmPlane_shiftPlane, spanBasis_eq, spanBasis_elim_eq_iff) in both Even and Odd cases. Commit 7ee7905.
|
|
||
| /-! | ||
|
|
||
| ### A.2. The shifted even split: Spltting the charges up via `1 + (n + n + 1)` |
There was a problem hiding this comment.
These numberings should start at e.g. A.1.
There was a problem hiding this comment.
Fixed — sections now start at A.1. in ShiftPlane.lean (A.2→A.1, A.3→A.2 for Even; A.2→A.1, A.3→A.2, A.4→A.3 for Odd). Applied to both Even and Odd. Commit 7ee7905.
|
|
||
| /-! | ||
|
|
||
| ## C. The vectors of the basis spanning the second plane, via the shifted even split |
There was a problem hiding this comment.
Rename this section to B. don't use second plane here.
There was a problem hiding this comment.
Renamed to ## B. The shifted plane and renumbered all subsections C.x → B.x in both Even and Odd ShiftPlane.lean. Commit 7ee7905.
| · simp | ||
|
|
||
| set_option backward.isDefEq.respectTransparency false in | ||
| lemma shiftPlane_shiftPlane_symmBasisAsCharges_accCube (g : Fin n → ℚ) (j : Fin n.succ) : |
There was a problem hiding this comment.
These results should likely go in the Basis.lean file
There was a problem hiding this comment.
Moved symmPlane_symmPlane_shiftBasisAsCharges_accCube and shiftPlane_shiftPlane_symmBasisAsCharges_accCube from ShiftPlane.lean to a new ## 3. Mixed cubic anomaly cancellation conditions involving both planes section in Basis.lean. Applied to both Even and Odd. Commit 7ee7905.
| @@ -0,0 +1,497 @@ | |||
| /- | |||
There was a problem hiding this comment.
I would rename the directory these results are in to Planes.
There was a problem hiding this comment.
Renamed BasisLinear/ → Planes/ for both Even and Odd (files are now at Even/Planes/SymmPlane.lean, Even/Planes/ShiftPlane.lean, etc.). All imports updated. Commit 7ee7905.
|
@copilot Address the review comments above. |
…iers - Rename BasisLinear/ → Planes/ for both Even and Odd subdirectories - Rename basisLinSol → spanBasis (and associated lemmas spanBasis_symmPlane_shiftPlane, spanBasis_eq, spanBasis_elim_eq_iff) in Even/Basis.lean and Odd/Basis.lean - Fix section numbering in ShiftPlane.lean: A.2/A.3 → A.1/A.2 (Even), A.2/A.3/A.4 → A.1/A.2/A.3 (Odd) - Rename section C → B (The shifted plane) in both ShiftPlane.lean files - Move mixed cubic ACC lemmas from ShiftPlane.lean to Basis.lean: symmPlane_symmPlane_shiftBasisAsCharges_accCube and shiftPlane_shiftPlane_symmBasisAsCharges_accCube (Even), symmPlane_symmPlane_shiftBasisAsCharges_accCube (Odd) - Update all import statements to use new Planes/ paths Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com>
All changes applied to both Even and Odd cases in commit 7ee7905.
All review comments addressed in commit 7ee7905: |
The two planes in
Odd/BasisLinearandEven/BasisLinearused non-descriptive naming (basis/P/P'vsbasis!/P!/P!') with no indication of what distinguishes them. The!suffix convention was particularly opaque.Naming
Renamed definitions after the charge-index splitting each plane is built from. The
AsChargessuffix now consistently distinguishes theChargesinclusion from theLinSolsinclusion:symmBasisAsCharges/symmPlaneAsCharges/symmPlane): basis vectors pair charges at positions from the symmetric split ((n+1) + nodd,n.succ + n.succeven)shiftBasisAsCharges/shiftPlaneAsCharges/shiftPlane): basis vectors pair charges at positions from the shifted split (1 + n + nodd,1 + (n + n + 1)even)The combined-basis helpers in
Basis.leanare also renamed:basisa→basis,basisaAsBasis→basisAsBasisPa→basisCharge(a charge in the span of the combined basis)Pa'→spanBasis(aLinSolsin the span of the combined basis)swapShift_as_add→linSolRep_swap_evenShift_eq_add/linSolRep_swap_oddShift_eq_add(Mathlib-style)File organisation
Each monolithic
BasisLinear.lean(~1000 lines) is split into sub-modules. The subdirectory is renamedPlanes/and the top-level file is renamedBasis.lean:Planes/SymmPlane.lean— symmetric charge splits, symmetric plane basis (symmBasisAsCharges/symmBasis), inclusion (symmPlaneAsCharges/symmPlane), ACC proofs; sections labelledA.andB.Planes/ShiftPlane.lean— shifted charge splits (sectionsA.1–A.2), shifted plane basis and inclusion (sectionB.,shiftBasisAsCharges/shiftBasis/shiftPlaneAsCharges/shiftPlane), ACC proofs;shiftBasis_linear_independentplaced directly aftershiftBasisBasis.lean(formerlyBasisLinear.lean) — combined basis (basis,basisCharge,spanBasis), span theorem, mixed cubic ACC lemmas (symmPlane_symmPlane_shiftBasisAsCharges_accCube,shiftPlane_shiftPlane_symmBasisAsCharges_accCube), imports aboveCharge index splitting definitions are co-located with their corresponding plane (no separate
ChargeSplitsfile).Documentation
Module docs explain the naming motivation. Section numbering is sequential within each file (
A.1,A.2,B.1, … inShiftPlane.lean;1.,2.,3.inBasis.lean).Status
All renames and file splits are complete for both Odd and Even cases, including
Odd/Parameterization.leanandEven/Parameterization.lean, withPhyslib.leanimports updated.