Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Physlib.Relativity.Tensors.RealTensor.Metrics.Pre public import Physlib.Relativity.Tensors.Contraction.Basis public import Physlib.Relativity.Tensors.Elab

Real Lorentz tensors

Within this directory Pre is used to denote that the definitions are preliminary and which are used to define realLorentzTensor.

@[expose] public section

The colors associated with complex representations of SL(2, ℂ) of interest to physics.

The color associated with contravariant Lorentz vectors.

The color associated with covariant Lorentz vectors.

inductive Color | up : Color | down : Color deriving Fintype

Color for complex Lorentz tensors is decidable.

instance : DecidableEq Color := fun x y => match x, y with | Color.up, Color.up => isTrue rfl | Color.down, Color.down => isTrue rfl /- The false -/ | Color.up, Color.down => isFalse fun h => Color.noConfusion h | Color.down, Color.up => isFalse fun h => Color.noConfusion h

The modules associated with each of the different types of real Lorentz vector space.

abbrev modules (d : ) : Color Type | Color.up => Lorentz.ContrMod d | Color.down => Lorentz.CoMod d
instance modulesAddCommGroup (d : ) : c, AddCommGroup (modules d c) | Color.up => inferInstance | Color.down => inferInstanceinstance modulesModule (d : ) : c, Module (modules d c) | Color.up => inferInstance | Color.down => inferInstanceTODO "Replace Lorentz.ContrMod and Lorentz.CoMod in the definition of realLorentzTensor directly with Lorentz.Vector and Lorentz.Covector, and representations defined on them."

Notation for a real Lorentz tensor.

syntax (name := realLorentzTensorSyntax) "ℝT[" term,* "]" : term
macro_rules | `(ℝT[$termDim:term, $term:term, $terms:term,*]) => `(((realLorentzTensor $termDim).Tensor (vecCons $term ![$terms,*]))) | `(ℝT[$termDim:term, $term:term]) => `(((realLorentzTensor $termDim).Tensor (vecCons $term ![]))) | `(ℝT[$termDim:term]) =>`(((realLorentzTensor $termDim).Tensor (vecEmpty))) | `(ℝT[]) =>`(((realLorentzTensor 3).Tensor (vecEmpty)))

Notation for a real Lorentz tensor.

set_option quotPrecheck false inscoped[realLorentzTensor] notation "ℝT(" d "," c ")" => (realLorentzTensor d).Tensor c

Basis and discrete functor objects

These re-express fields of realLorentzTensor d in terms of Lorentz data.

@[simp] lemma basisIdxCongr_eq_refl {d : } {c1 c2 : realLorentzTensor.Color} (h : c1 = c2) : TensorSpecies.basisIdxCongr (basisIdx := fun _ => Fin 1 Fin d) h = Equiv.refl _ := d:c1:Colorc2:Colorh:c1 = c2TensorSpecies.basisIdxCongr h = Equiv.refl (Fin 1 Fin d) All goals completed! 🐙lemma basisIdxCongr_apply {d : } {c1 c2 : realLorentzTensor.Color} (h : c1 = c2) (i : Fin 1 Fin d) : TensorSpecies.basisIdxCongr (basisIdx := fun _ => Fin 1 Fin d) h i = i := d:c1:Colorc2:Colorh:c1 = c2i:Fin 1 Fin d(TensorSpecies.basisIdxCongr h) i = i All goals completed! 🐙

Simplifying τ

@[simp] lemma τ_up_eq_down {d : } : (realLorentzTensor d).τ Color.up = Color.down := rfl@[simp] lemma τ_down_eq_up {d : } : (realLorentzTensor d).τ Color.down = Color.up := rfl

Contractions and to Field

attribute [-simp] Fintype.sum_sum_typelemma contrPCoeff_basis {d n : } {c : Fin n realLorentzTensor.Color} (i j : Fin n) (hij : i j (realLorentzTensor d).τ (c i) = c j) (b : ComponentIdx (S := realLorentzTensor d) c) : Pure.contrPCoeff i j hij (Pure.basisVector c b) = if b i = b j then 1 else 0 := d:n:c:Fin n Colori:Fin nj:Fin nhij:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx cPure.contrPCoeff i j hij (Pure.basisVector c b) = if b i = b j then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nhij:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx c((realLorentzTensor d).contr (c i)) ((match c i with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) (b i) ⊗ₜ[] (LinearEquiv.cast ) ((match c j with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) (b j))) = if b i = b j then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nhij:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )h2:c j = (realLorentzTensor d).τ (c i)((realLorentzTensor d).contr (c i)) ((match c i with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) (b i) ⊗ₜ[] (LinearEquiv.cast h2) ((match c j with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) (b j))) = if b i = b j then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nhij:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )h2:c j = (realLorentzTensor d).τ (c i)b1:Fin 1 Fin d((realLorentzTensor d).contr (c i)) ((match c i with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast h2) ((match c j with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) (b j))) = if b1 = b j then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nhij:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )h2:c j = (realLorentzTensor d).τ (c i)b1:Fin 1 Fin db2:Fin 1 Fin d((realLorentzTensor d).contr (c i)) ((match c i with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast h2) ((match c j with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dci:Colorhij:i j (realLorentzTensor d).τ ci = c jh2:c j = (realLorentzTensor d).τ ci((realLorentzTensor d).contr ci) ((match ci with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast h2) ((match c j with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dci:Colorcj:Colorhij:i j (realLorentzTensor d).τ ci = cjh2:cj = (realLorentzTensor d).τ ci((realLorentzTensor d).contr ci) ((match ci with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast h2) ((match cj with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dci:Colorhij:i j (realLorentzTensor d).τ ci = (realLorentzTensor d).τ ci((realLorentzTensor d).contr ci) ((match ci with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((match (realLorentzTensor d).τ ci with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.up((realLorentzTensor d).contr Color.up) ((match Color.up with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((match (realLorentzTensor d).τ Color.up with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.down((realLorentzTensor d).contr Color.down) ((match Color.down with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((match (realLorentzTensor d).τ Color.down with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.up((realLorentzTensor d).contr Color.up) ((match Color.up with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((match (realLorentzTensor d).τ Color.up with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.upLorentz.contrCoContract ((Lorentz.contrBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 erw [d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.upLorentz.contrCoContract ((Lorentz.contrBasis d) b1 ⊗ₜ[] cast ((Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.upLorentz.contrCoContract ((Lorentz.contrBasis d) b1 ⊗ₜ[] cast ((Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.upLorentz.contrCoContract ((Lorentz.contrBasis d) b1 ⊗ₜ[] (Lorentz.coBasis d) b2) = if b1 = b2 then 1 else 0 erw [d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.up = (realLorentzTensor d).τ Color.up(if b1 = b2 then 1 else 0) = if b1 = b2 then 1 else 0All goals completed! 🐙 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.down((realLorentzTensor d).contr Color.down) ((match Color.down with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((match (realLorentzTensor d).τ Color.down with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.downLorentz.coContrContract ((Lorentz.coBasis d) b1 ⊗ₜ[] (LinearEquiv.cast ) ((Lorentz.contrBasis d) b2)) = if b1 = b2 then 1 else 0 erw [d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.downLorentz.coContrContract ((Lorentz.coBasis d) b1 ⊗ₜ[] cast ((Lorentz.contrBasis d) b2)) = if b1 = b2 then 1 else 0d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.downLorentz.coContrContract ((Lorentz.coBasis d) b1 ⊗ₜ[] cast ((Lorentz.contrBasis d) b2)) = if b1 = b2 then 1 else 0 d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.downLorentz.coContrContract ((Lorentz.coBasis d) b1 ⊗ₜ[] (Lorentz.contrBasis d) b2) = if b1 = b2 then 1 else 0 erw [d:n:c:Fin n Colori:Fin nj:Fin nb:ComponentIdx ch1:RingHomInvPair (RingHom.id ) (RingHom.id )b1:Fin 1 Fin db2:Fin 1 Fin dhij:i j (realLorentzTensor d).τ Color.down = (realLorentzTensor d).τ Color.down(if b1 = b2 then 1 else 0) = if b1 = b2 then 1 else 0All goals completed! 🐙All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch0:i.succAbove ((Fin.predAbove 0 i).predAbove j) = jh₁:b i = b j_:¬b j = b i(basis (c i.succSuccAbove j)) (ComponentIdx.dropPair i j b) = 0 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch0:i.succAbove ((Fin.predAbove 0 i).predAbove j) = jh₁:b j = b i_:¬b j = b i(basis (c i.succSuccAbove j)) (ComponentIdx.dropPair i j b) = 0; All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch0:i.succAbove ((Fin.predAbove 0 i).predAbove j) = jh₁:¬b i = b jh₂:b j = b i0 = (permT id ) ((basis ((c i.succAbove) ((Fin.predAbove 0 i).predAbove j).succAbove)) fun j_1 => b (i.succAbove (((Fin.predAbove 0 i).predAbove j).succAbove j_1))) n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch0:i.succAbove ((Fin.predAbove 0 i).predAbove j) = jh₁:¬b i = b jh₂:b i = b j0 = (permT id ) ((basis ((c i.succAbove) ((Fin.predAbove 0 i).predAbove j).succAbove)) fun j_1 => b (i.succAbove (((Fin.predAbove 0 i).predAbove j).succAbove j_1))); All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jb:ComponentIdx ch0:i.succAbove ((Fin.predAbove 0 i).predAbove j) = jh₁:¬b i = b jh₂:¬b j = b i0 = 0 All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c j(contrT n i j h) 0 = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) 0)) All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h✝:i j (realLorentzTensor d).τ (c i) = c jr:t:(realLorentzTensor d).Tensor ch:(contrT n i j h✝) t = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) t))(contrT n i j h✝) (r t) = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) (r t))) All goals completed! 🐙 n:d:c:Fin (n + 1 + 1) Colori:Fin (n + 1 + 1)j:Fin (n + 1 + 1)h:i j (realLorentzTensor d).τ (c i) = c jt1:(realLorentzTensor d).Tensor ct2:(realLorentzTensor d).Tensor ch1:(contrT n i j h) t1 = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) t1))h2:(contrT n i j h) t2 = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) t2))(contrT n i j h) (t1 + t2) = μ, (permT id ) ((evalT ((Fin.predAbove 0 i).predAbove j) μ) ((evalT i μ) (t1 + t2))) All goals completed! 🐙d:c:Fin 2 Colorh:0 1 (realLorentzTensor d).τ (c 0) = c 1t:(realLorentzTensor d).Tensor c x, toField ((permT id ) ((evalT ((Fin.predAbove 0 0).predAbove 1) x) ((evalT 0 x) t))) = μ, toField ((evalT 0 μ) ((evalT 0 μ) t)) d:c:Fin 2 Colorh:0 1 (realLorentzTensor d).τ (c 0) = c 1t:(realLorentzTensor d).Tensor c(fun x => toField ((permT id ) ((evalT ((Fin.predAbove 0 0).predAbove 1) x) ((evalT 0 x) t)))) = fun μ => toField ((evalT 0 μ) ((evalT 0 μ) t)) d:c:Fin 2 Colorh:0 1 (realLorentzTensor d).τ (c 0) = c 1t:(realLorentzTensor d).Tensor cμ:Fin 1 Fin dtoField ((permT id ) ((evalT ((Fin.predAbove 0 0).predAbove 1) μ) ((evalT 0 μ) t))) = toField ((evalT 0 μ) ((evalT 0 μ) t)) d:c:Fin 2 Colorh:0 1 (realLorentzTensor d).τ (c 0) = c 1t:(realLorentzTensor d).Tensor cμ:Fin 1 Fin dtoField ((evalT ((Fin.predAbove 0 0).predAbove 1) μ) ((evalT 0 μ) t)) = toField ((evalT 0 μ) ((evalT 0 μ) t)) All goals completed! 🐙