feat(tensors): prove the Levi-Civita contraction identities - #1565
feat(tensors): prove the Levi-Civita contraction identities#1565Robby955 wants to merge 3 commits into
Conversation
|
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. |
|
Will try and give a proper review tomorrow, but I think this could do with lemmas moved around bit. For example there are some IsReindexing lemmas here which should likely be in the corresponding file not here |
jstoobysmith
left a comment
There was a problem hiding this comment.
Some more things to move.
There are also lots of small definitions/lemmas that are:
- Either not needed,
- Can be reframed in terms of useful physics API.
| rw [Finset.sum_congr rfl (fun v _ => epsEtaSummand_eq v), Finset.sum_neg_distrib, h] | ||
|
|
||
| set_option backward.isDefEq.respectTransparency false in | ||
| lemma unitTensor_down_repr {d : ℕ} |
There was a problem hiding this comment.
This should be moved to the unitTensor file
| exact Fintype.sum_equiv (Equiv.arrowCongr (Equiv.refl (Fin 4)) | ||
| (finSumFinEquiv : (Fin 1 ⊕ Fin 3) ≃ Fin 4)) _ _ (fun _ => rfl) | ||
|
|
||
| lemma prod_eta_diag_of_injective {v : Fin 4 → Fin 1 ⊕ Fin 3} (hv : Function.Injective v) : |
There was a problem hiding this comment.
Should be moved to the minkowskiMatrix file
| simp only [Fintype.sum_prod_type] | ||
| rfl | ||
|
|
||
| lemma sum_reindex_finSumFinEquiv {M : Type} [AddCommMonoid M] (F : (Fin 4 → Fin 4) → M) : |
There was a problem hiding this comment.
This is not likely needed as a sperate lemma, similar with a lot of otherr small definitions here.
| rw [IsReindexing.inv_equiv_symm_eq, ← Fin.append_succAbove_const_eq_cycleIcc i, | ||
| Fin.append_right] | ||
|
|
||
| lemma metricTensor_repr_apply {d : ℕ} (cc : Color) |
There was a problem hiding this comment.
MOve e.g. to the metricTensor file
| simp only [basisIdxCongr_eq_refl, Equiv.refl_apply] | ||
| exact congrArg b (IsReindexing.inv_id_eq _ _) | ||
|
|
||
| lemma crossToSlot_basis_repr {d nA : ℕ} {c : Fin (nA+1) → Color} {cM : Fin 2 → Color} |
|
awaiting-author |
|
(May also help to split this PR up into smaller bits each touching a single file) |
Move reusable contraction, metric, unit, Minkowski, and Kronecker component lemmas into their owning modules. Keep the finite-index proof scaffolding private and the headline identities in LeviCivita/Contractions.
|
Thanks for the review. I have reorganized the proof around the owning APIs in
The exact one-sum and Kronecker/Minkowski formulas are specific to the real Lorentz bases. Putting those statements directly in the generic tensor files would either create an import cycle or require basis/contraction compatibility not present in The two headline theorem statements are unchanged. The targeted build, full -awaiting-author |
Proves the two remaining epsilon-epsilon identities for the Lorentzian Levi-Civita tensor,
leviCivita_contract_selfandleviCivita_contract_three, left as stated goals in #1348. Bothstatements are unchanged.
The route is through components. Both sides are compared under
(Tensor.basis _).reprand thecontractions collapse to finite sums over
Fin 1 ⊕ Fin 3, where the product of two symbols is ageneralizedKroneckerDeltaand the contraction machinery from #1335 gives the 24 and the 6. Thesign comes out of the metric: when the symbol is nonzero the index map is injective, hence a
bijection on a four-element type, so the four diagonal metric factors multiply to the determinant,
which is minus one in this signature.
Two component lemmas that did not exist before carry the argument and may be useful beyond it:
toDualMapAtIndex_basis_repr, the basis representation of index lowering, andunitTensor_down_repr, the basis representation of the unit tensor of color down. The rest of thenew material is rank-four bookkeeping for this file.
The proofs elaborate within the default heartbeat budget, so no
maxHeartbeatsoption is needed.The
nolint checkTypeonleviCivita_contract_selfstays: that linter re-typechecks the statement,which this change does not alter, and its comment now names the current toolchain. The Tensors API
map entry for these identities is flipped to done with a real location.
One question on placement. The two component lemmas would sit naturally next to their definitions,
toDualMapAtIndex_basis_reprin Dual.lean in particular, rather than in this file. I kepteverything local so the diff stays reviewable, and can move them wherever you prefer, here or in a
follow-up.