Imports
/- Copyright (c) 2026 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.Vector.Representation public import Physlib.Relativity.Tensors.RealTensor.CoVector.Representation public import Mathlib.RepresentationTheory.Intertwining

Contraction of Real Lorentz Vectors and Covectors

We define the intertwining maps which define the contraction of a contravariant Lorentz vector with a covariant Lorentz vector, and vice versa.

Note: This file will eventually replace ./Pre/Contraction.lean when we move realLorentzTensor over to Vector and CoVector.

@[expose] public sectionattribute [-simp] Fintype.sum_sum_type

A. The definitions

TODO "In a similar way to `Vector.contract` and `CoVector.contract`, we want to define metrics and units as intertwining maps of representations. This should copy (and eventually replace) the definitions e.g. `./Units/Pre.lean`."

The intertwining map defining the contraction of a contravariant Lorentz vector with a covariant Lorentz vector.

def Vector.contract : (Vector.rep.tprod CoVector.rep).IntertwiningMap (Representation.trivial (LorentzGroup d) ) where toLinearMap := d:Vector d ⊗[] CoVector d →ₗ[] d: (m₁ m₂ : Vector d) (n : CoVector d), i, (m₁ + m₂) i * n i = i, m₁ i * n i + i, m₂ i * n id: (c : ) (m : Vector d) (n : CoVector d), i, (c m) i * n i = c i, m i * n id: (m : Vector d) (n₁ n₂ : CoVector d), i, m i * (n₁ + n₂) i = i, m i * n₁ i + i, m i * n₂ id: (c : ) (m : Vector d) (n : CoVector d), i, m i * (c n) i = c i, m i * n i d: (m₁ m₂ : Vector d) (n : CoVector d), i, (m₁ + m₂) i * n i = i, m₁ i * n i + i, m₂ i * n i All goals completed! 🐙 d: (c : ) (m : Vector d) (n : CoVector d), i, (c m) i * n i = c i, m i * n i All goals completed! 🐙 d: (m : Vector d) (n₁ n₂ : CoVector d), i, m i * (n₁ + n₂) i = i, m i * n₁ i + i, m i * n₂ i All goals completed! 🐙 d: (c : ) (m : Vector d) (n : CoVector d), i, m i * (c n) i = c i, m i * n i d:c✝:m✝:Vector dn✝:CoVector d i, m✝ i * (c✝ n✝) i = c✝ i, m✝ i * n✝ i simp_rw d:c✝:m✝:Vector dn✝:CoVector d i, m✝ i * (c✝ n✝) i = c✝ i, m✝ i * n✝ id:c✝:m✝:Vector dn✝:CoVector d x, m✝ x * (c✝ * n✝ x) = c✝ i, m✝ i * n✝ i d:c✝:m✝:Vector dn✝:CoVector d x, m✝ x * (c✝ * n✝ x) = c✝ * i, m✝ i * n✝ i d:c✝:m✝:Vector dn✝:CoVector d x, m✝ x * (c✝ * n✝ x) = i, c✝ * (m✝ i * n✝ i)] exact Finset.sum_congr rfl (fun _ _ d:c✝:m✝:Vector dn✝:CoVector dx✝¹:Fin 1 Fin dx✝:x✝¹ Finset.univm✝ x✝¹ * (c✝ * n✝ x✝¹) = c✝ * (m✝ x✝¹ * n✝ x✝¹) All goals completed! 🐙) isIntertwining' Λ := d:Λ:(LorentzGroup d)TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod CoVector.rep) Λ = (Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod CoVector.rep) Λ)) φ) ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod CoVector.rep) Λ)) φ) ψ = Λ *ᵥ φ ⬝ᵥ (LorentzGroup.transpose Λ⁻¹) *ᵥ ψd:Λ:(LorentzGroup d)φ:Vector dψ:CoVector dΛ *ᵥ φ ⬝ᵥ (LorentzGroup.transpose Λ⁻¹) *ᵥ ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod CoVector.rep) Λ)) φ) ψ = Λ *ᵥ φ ⬝ᵥ (LorentzGroup.transpose Λ⁻¹) *ᵥ ψ All goals completed! 🐙 d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector dΛ *ᵥ φ ⬝ᵥ (LorentzGroup.transpose Λ⁻¹) *ᵥ ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector dφ ⬝ᵥ ψ = i, φ i * ψ i All goals completed! 🐙

The intertwining map defining the contraction of a covariant Lorentz vector with a contravariant Lorentz vector.

def CoVector.contract : (CoVector.rep.tprod Vector.rep).IntertwiningMap (Representation.trivial (LorentzGroup d) ) where toLinearMap := d:CoVector d ⊗[] Vector d →ₗ[] d: (m₁ m₂ : CoVector d) (n : Vector d), i, (m₁ + m₂) i * n i = i, m₁ i * n i + i, m₂ i * n id: (c : ) (m : CoVector d) (n : Vector d), i, (c m) i * n i = c i, m i * n id: (m : CoVector d) (n₁ n₂ : Vector d), i, m i * (n₁ + n₂) i = i, m i * n₁ i + i, m i * n₂ id: (c : ) (m : CoVector d) (n : Vector d), i, m i * (c n) i = c i, m i * n i d: (m₁ m₂ : CoVector d) (n : Vector d), i, (m₁ + m₂) i * n i = i, m₁ i * n i + i, m₂ i * n i All goals completed! 🐙 d: (c : ) (m : CoVector d) (n : Vector d), i, (c m) i * n i = c i, m i * n i All goals completed! 🐙 d: (m : CoVector d) (n₁ n₂ : Vector d), i, m i * (n₁ + n₂) i = i, m i * n₁ i + i, m i * n₂ i All goals completed! 🐙 d: (c : ) (m : CoVector d) (n : Vector d), i, m i * (c n) i = c i, m i * n i d:c✝:m✝:CoVector dn✝:Vector d i, m✝ i * (c✝ n✝) i = c✝ i, m✝ i * n✝ i simp_rw d:c✝:m✝:CoVector dn✝:Vector d i, m✝ i * (c✝ n✝) i = c✝ i, m✝ i * n✝ id:c✝:m✝:CoVector dn✝:Vector d x, m✝ x * (c✝ * n✝ x) = c✝ i, m✝ i * n✝ i d:c✝:m✝:CoVector dn✝:Vector d x, m✝ x * (c✝ * n✝ x) = c✝ * i, m✝ i * n✝ i d:c✝:m✝:CoVector dn✝:Vector d x, m✝ x * (c✝ * n✝ x) = i, c✝ * (m✝ i * n✝ i)] exact Finset.sum_congr rfl (fun _ _ d:c✝:m✝:CoVector dn✝:Vector dx✝¹:Fin 1 Fin dx✝:x✝¹ Finset.univm✝ x✝¹ * (c✝ * n✝ x✝¹) = c✝ * (m✝ x✝¹ * n✝ x✝¹) All goals completed! 🐙) isIntertwining' Λ := d:Λ:(LorentzGroup d)TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod Vector.rep) Λ = (Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod Vector.rep) Λ)) φ) ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod Vector.rep) Λ)) φ) ψ = (LorentzGroup.transpose Λ⁻¹) *ᵥ φ ⬝ᵥ Λ *ᵥ ψd:Λ:(LorentzGroup d)φ:CoVector dψ:Vector d(LorentzGroup.transpose Λ⁻¹) *ᵥ φ ⬝ᵥ Λ *ᵥ ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector d((AlgebraTensorModule.curry (TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ) ∘ₗ (rep.tprod Vector.rep) Λ)) φ) ψ = (LorentzGroup.transpose Λ⁻¹) *ᵥ φ ⬝ᵥ Λ *ᵥ ψ All goals completed! 🐙 d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector d(LorentzGroup.transpose Λ⁻¹) *ᵥ φ ⬝ᵥ Λ *ᵥ ψ = ((AlgebraTensorModule.curry ((Representation.trivial (LorentzGroup d) ) Λ ∘ₗ TensorProduct.lift (LinearMap.mk₂ (fun φ ψ => i, φ i * ψ i) ))) φ) ψ d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector dφ ⬝ᵥ ψ = i, φ i * ψ i All goals completed! 🐙

B. Properties of the contractions

lemma Vector.contract_tmul (φ : Vector d) (ψ : CoVector d) : Vector.contract (φ ⊗ₜ ψ) = i, φ i * ψ i := rfllemma CoVector.contract_tmul (φ : CoVector d) (ψ : Vector d) : CoVector.contract (φ ⊗ₜ ψ) = i, φ i * ψ i := rfllemma Vector.contract_basis_left (μ : Fin 1 Fin d) (ψ : CoVector d) : Vector.contract (basis μ ⊗ₜ ψ) = ψ μ := d:μ:Fin 1 Fin dψ:CoVector dcontract (basis μ ⊗ₜ[] ψ) = ψ μ All goals completed! 🐙lemma CoVector.contract_basis_left (μ : Fin 1 Fin d) (φ : Vector d) : CoVector.contract (basis μ ⊗ₜ φ) = φ μ := d:μ:Fin 1 Fin dφ:Vector dcontract (basis μ ⊗ₜ[] φ) = φ μ All goals completed! 🐙lemma Vector.contract_basis_right (φ : Vector d) (μ : Fin 1 Fin d) : Vector.contract (φ ⊗ₜ basis μ) = φ μ := d:φ:Vector dμ:Fin 1 Fin dcontract (φ ⊗ₜ[] basis μ) = φ μ All goals completed! 🐙lemma CoVector.contract_basis_right (ψ : CoVector d) (μ : Fin 1 Fin d) : CoVector.contract (ψ ⊗ₜ basis μ) = ψ μ := d:ψ:CoVector dμ:Fin 1 Fin dcontract (ψ ⊗ₜ[] basis μ) = ψ μ All goals completed! 🐙lemma Vector.contract_eq_coVector_contract (φ : Vector d) (ψ : CoVector d) : Vector.contract (φ ⊗ₜ ψ) = CoVector.contract (ψ ⊗ₜ φ) := d:φ:Vector dψ:CoVector dcontract (φ ⊗ₜ[] ψ) = CoVector.contract (ψ ⊗ₜ[] φ) simp_rw d:φ:Vector dψ:CoVector dcontract (φ ⊗ₜ[] ψ) = CoVector.contract (ψ ⊗ₜ[] φ)d:φ:Vector dψ:CoVector d i, φ i * ψ i = CoVector.contract (ψ ⊗ₜ[] φ) d:φ:Vector dψ:CoVector d i, φ i * ψ i = i, ψ i * φ i All goals completed! 🐙]lemma Vector.contract_rep (Λ : LorentzGroup d) (φ : Vector d) (ψ : CoVector d) : Vector.contract ((Vector.rep Λ φ) ⊗ₜ (CoVector.rep Λ ψ)) = Vector.contract (φ ⊗ₜ ψ) := d:Λ:(LorentzGroup d)φ:Vector dψ:CoVector dcontract ((rep Λ) φ ⊗ₜ[] (CoVector.rep Λ) ψ) = contract (φ ⊗ₜ[] ψ) All goals completed! 🐙lemma CoVector.contract_rep (Λ : LorentzGroup d) (φ : CoVector d) (ψ : Vector d) : CoVector.contract ((CoVector.rep Λ φ) ⊗ₜ (Vector.rep Λ ψ)) = CoVector.contract (φ ⊗ₜ ψ) := d:Λ:(LorentzGroup d)φ:CoVector dψ:Vector dcontract ((rep Λ) φ ⊗ₜ[] (Vector.rep Λ) ψ) = contract (φ ⊗ₜ[] ψ) All goals completed! 🐙