refactor(Electromagnetism): replace fieldStrengthMatrix with index-evaluation components - #1614
refactor(Electromagnetism): replace fieldStrengthMatrix with index-evaluation components#1614zhikaip wants to merge 5 commits into
fieldStrengthMatrix with index-evaluation components#1614Conversation
…aluation components
Resolves both TODOs in FieldStrength.lean. Components of the field strength
tensor are now accessed via `toField {A.toFieldStrength x | [μ] [ν]}ᵀ`
everywhere; `fieldStrengthMatrix` and the Finsupp-representation lemmas are
removed and replaced by `toFieldStrength_eval_*` lemmas.
To allow concrete indices such as `[Sum.inl 0]`, the tensor index-evaluation
bracket syntax in Relativity/Tensors/Elab.lean is widened from `ident` to
`term`.
Files using `simp` on evaluation terms gain
`attribute [-simp] Fin.succAbove_zero`, matching the guard already used in
the tensor library.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…wskiProduct options `canonicalMomentum_eq` is reproved through `Lorentz.Vector.inner_eq_sum` without `backward.isDefEq.respectTransparency` (possible now that `Lorentz.Vector` is implicit-reducible). The two remaining options in `Vector/MinkowskiProduct.lean` need both the implicit-reducible change and the tensor-action priority fix, so they are removed here, on top of both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…o files IsExtrema and GaugeTransformation compile without it; Boosts, MagneticField, KineticTerm and Hamiltonian still need it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
…eq_zero The simpNF linter runs without the file-local `Fin.succAbove_zero` guard, under which the eval left-hand side is not in simp normal form. The lemma is now passed explicitly at the five `simp` sites that relied on it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Btw I think toField is extremely confusing with all the field strengths EM fields etc. flying around, I'm thinking of changing it to something like |
|
I think this would make sense. Sorry am at a conference, so haven't had time to look at this properly yet. |
…ow-up PR Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
First of two PRs for the TODOs in
Electromagnetism/Kinematics/FieldStrength.lean; thefollow-up
fieldstrength_refactorremoves the basis-representation lemmas.Changes
toField {A.toFieldStrength x | [μ] [ν]}ᵀeverywhere.
fieldStrengthMatrixand its API are removed, and every lemma stated with it isrestated in eval form, with
fieldStrengthMatrix↦toFieldStrength_evalin the name.toFieldStrength_eval_eq_tensor_basis_reprandtoFieldStrength_tensor_basis_repr_eq_eval, bridge eval components and the coefficients inTensor.basis, the tensor library's canonical basis. They replace the role of thefieldStrengthMatrixbridge lemmas:KineticTermexpandsF_{μν}F^{μν}as a sum overTensor.basiscoefficients and needs to turn each coefficient into a component, andantisymmetry, additivity and homogeneity of
toFieldStrengthare derived from theircomponent versions through the same bridge.
Tensors/Elab.lean: the bracket index syntax accepts aterminstead of anident, soconcrete components such as
[Sum.inl 0] [Sum.inr i]can be written. Existing uses areunaffected.
attribute [-simp] Fin.succAbove_zero(MagneticField, Boosts, KineticTerm,Hamiltonian); each fails without it.
canonicalMomentum_eqis reproved viaLorentz.Vector.inner_eq_sum, and the two optionsin
Vector/MinkowskiProduct.leanare dropped. With feat(Lorentz.Vector): mark Vector and CoVector implicit_reducible, add inner_eq_sum #1610 and fix(Tensors): rank the tensor action above the Tensorial action #1611 norespectTransparencyoption remains in the electromagnetism files.Why
fieldStrengthMatrixwas a second representation of the same thing with a duplicate API.
Fin.succAbove_zero: plainsimprewritesFin.succAbove 0toFin.succinside theimplicit colour index of
evalT, after which no eval lemma matches. The tensor librarydisables it file-locally for the same reason; the attribute does not propagate.
replacements are mostly mechanical and AI seem to do a good job. I checked it to the best of my ability