feat(Tensors): HasContrDualBases, the dual-basis class, and the component formulas it collapses - #1722
Conversation
…nent formulas it collapses Adds `TensorSpecies.HasContrDualBases`: at every color some bijection of labels (`IsContrDualMatching`) makes the basis at `S.τ c` dual to the basis at `c` under `S.contr c`. Over a nontrivial ring the bijection is unique (`IsContrDualMatching.unique`), so `contrDualIdxEquiv`, chosen by `Classical.choose`, is identified per species through `contrDualIdxEquiv_eq_of_isContrDualMatching`, and the double-dual law `contrDualIdxEquiv_tau` is a theorem. `contr_tmul_basis_eq_dualBasis` relates the class to `Module.Basis.dualBasis`. `Pure.contrPCoeff_basisVector` and `contrT_basis_repr_apply_eq_sum_dual` give the contraction coefficient and components for any such species. The real and complex Lorentz species instantiate the class, with the identity and `finCongr repDim_tau`, and their `contrPCoeff_basis` and `contrT_basis_repr_apply_eq_fin` now follow from the general lemmas with unchanged statements. Co-authored-by: Claude Opus 5.5 <no-reply+claude-opus-5-5@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. |
jstoobysmith
left a comment
There was a problem hiding this comment.
One small comment here. Otherwise this looks good.
| /-- A complex Lorentz color and its dual have the same representation dimension (`repDim_tau`), | ||
| and the matching `finCongr repDim_tau` satisfies the δ law: it is the basis contraction of each of | ||
| the six Weyl and Lorentz pairings. -/ | ||
| lemma isContrDualMatching_finCongr (c : complexLorentzTensor.Color) : |
There was a problem hiding this comment.
I think the doc-string of this result can be made a bit simpler.
There was a problem hiding this comment.
I simplified the docstring. I did the same for the RealTensor too.
|
awaiting-author |
…r and isContrDualMatching_refl State only the result: the bases at a color and its dual are dual bases under the given matching. Co-authored-by: Claude Opus 5.5 <no-reply+claude-opus-5-5@anthropic.com>
|
-awaiting-author |
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved. Will merge shortly. Many thanks.
d630c36
The axioms of
TensorSpeciesdo not say whatS.contrgives on basis vectors. The generalcomponent formula for a contraction therefore keeps
S.contr (b x₁ ⊗ₜ b x₂)as an unevaluatedfactor in a double sum, and each species proved its own single-sum formula by evaluating that
factor case by case. This PR states the missing fact once, as a class: at every color the basis at
S.τ cis dual to the basis atcunderS.contr c, up to a bijection of labels. The real andcomplex Lorentz species instantiate it, and their case-by-case proofs now follow from two general
lemmas (the −57 lines).
The class is a
Propasking only that some label bijection satisfies the δ law, so the label typesat
candS.τ cneed not be equal (Fin 4againstFin 1 ⊕ Fin 3is allowed). Over anontrivial ring the bijection is unique, so the one picked by
Classical.chooseis canonical, eachspecies identifies it by a
simplemma, and the double-dual law is a theorem rather than a field.The functionals
v ↦ S.contr c (v ⊗ₜ b (S.τ c) x)are proved to beModule.Basis.dualBasis.Added
Physlib/Relativity/Tensors/TensorSpecies/DualBasis.lean(new)IsContrDualMatching S c e: the bijectione : basisIdx (S.τ c) ≃ basisIdx csatisfies the δlaw,
S.contr c (b c x₁ ⊗ₜ b (S.τ c) x₂) = if x₁ = e x₂ then 1 else 0.IsContrDualMatching.unique: over a nontrivial ring two such bijections are equal.HasContrDualBases: the class, with one fieldexists_matching : ∀ c, ∃ e, IsContrDualMatching S c e.HasContrDualBases.contrDualIdxEquiv: the bijection, chosen byClassical.choose.HasContrDualBases.contr_basis_eq_ite: the δ law forcontrDualIdxEquiv.HasContrDualBases.contrDualIdxEquiv_eq_of_isContrDualMatching: any bijection satisfying the δlaw is
contrDualIdxEquiv; this is how a species identifies it.HasContrDualBases.contrDualIdxEquiv_tau: the bijection atS.τ cis the inverse of the one atc, throughS.τ (S.τ c) = c, proved fromcontr_tmul_symmand uniqueness.HasContrDualBases.contr_tmul_basis_eq_dualBasis: contracting withb (S.τ c) xis theModule.Basis.dualBasisfunctional at the matched label.Physlib/Relativity/Tensors/TensorSpecies/Basic.leanequivCast_basis:map_basis_eqwith the cast written asEquiv.cast, the formcontr_tmul_symmproduces; used incontrDualIdxEquiv_tau.Physlib/Relativity/Tensors/Contraction/Basis.leanPure.contrPCoeff_basisVector: the contraction coefficient of a basis vector is the δ.contrT_basis_repr_apply_eq_sum_dual: a component of a contraction is a single sum over thelabels at the first contracted index.
Physlib/Relativity/Tensors/RealTensor/Basic.leanisContrDualMatching_refl, the instance, andcontrDualIdxEquiv_eq_refl(simp): thebijection is the identity.
contrPCoeff_basis,contrT_basis_repr_apply_eq_fin: statements unchanged, proofs now two lines.Physlib/Relativity/Tensors/ComplexTensor/Basic.leanisContrDualMatching_finCongr, the instance, andcontrDualIdxEquiv_eq_finCongr(simp): thebijection is
finCongr repDim_tau.contrPCoeff_basis: statement unchanged, proof now three lines.Removed: none.
Reviewer map
DualBasis.lean, sections A to C: the δ law, uniqueness, the class and the chosen bijection.DualBasis.lean, sections D and E, withequivCast_basis: the double-dual law and the linkto
Module.Basis.dualBasis.Contraction/Basis.lean: the two general lemmas.RealTensor/Basic.lean, thenComplexTensor/Basic.lean: the instances and the shortened proofs.