refactor: Lorentz Group etc.

This commit is contained in:
jstoobysmith 2024-07-02 10:13:52 -04:00
parent 675b9a989a
commit c64d926e7c
15 changed files with 488 additions and 891 deletions

View file

@ -4,7 +4,7 @@ Released under Apache 2.0 license.
Authors: Joseph Tooby-Smith
-/
import HepLean.SpaceTime.Basic
import HepLean.SpaceTime.Metric
import HepLean.SpaceTime.MinkowskiMetric
import Mathlib.Algebra.Lie.Classical
/-!
# The Lorentz Algebra
@ -12,7 +12,7 @@ import Mathlib.Algebra.Lie.Classical
We define
- Define `lorentzAlgebra` via `LieAlgebra.Orthogonal.so'` as a subalgebra of
`Matrix (Fin 4) (Fin 4) `.
`Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) `.
- In `mem_iff` prove that a matrix is in the Lorentz algebra if and only if it satisfies the
condition `Aᵀ * η = - η * A`.
@ -23,80 +23,71 @@ namespace SpaceTime
open Matrix
open TensorProduct
/-- The Lorentz algebra as a subalgebra of `Matrix (Fin 4) (Fin 4) `. -/
def lorentzAlgebra : LieSubalgebra (Matrix (Fin 4) (Fin 4) ) :=
LieSubalgebra.map (Matrix.reindexLieEquiv (@finSumFinEquiv 1 3)).toLieHom
/-- The Lorentz algebra as a subalgebra of `Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) `. -/
def lorentzAlgebra : LieSubalgebra (Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) ) :=
(LieAlgebra.Orthogonal.so' (Fin 1) (Fin 3) )
namespace lorentzAlgebra
open minkowskiMatrix
lemma transpose_eta (A : lorentzAlgebra) : A.1ᵀ * η = - η * A.1 := by
obtain ⟨B, hB1, hB2⟩ := A.2
apply (Equiv.apply_eq_iff_eq
(Matrix.reindexAlgEquiv (@finSumFinEquiv 1 3).symm).toEquiv).mp
simp only [Nat.reduceAdd, AlgEquiv.toEquiv_eq_coe, EquivLike.coe_coe, _root_.map_mul,
reindexAlgEquiv_apply, ← transpose_reindex, map_neg]
rw [(Equiv.apply_eq_iff_eq_symm_apply (reindex finSumFinEquiv.symm finSumFinEquiv.symm)).mpr
hB2.symm]
erw [η_reindex]
simpa [LieAlgebra.Orthogonal.so', IsSkewAdjoint, IsAdjointPair] using hB1
have h1 := A.2
erw [mem_skewAdjointMatricesLieSubalgebra] at h1
simpa [LieAlgebra.Orthogonal.so', IsSkewAdjoint, IsAdjointPair] using h1
lemma mem_of_transpose_eta_eq_eta_mul_self {A : Matrix (Fin 4) (Fin 4) }
lemma mem_of_transpose_eta_eq_eta_mul_self {A : Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) }
(h : Aᵀ * η = - η * A) : A ∈ lorentzAlgebra := by
simp only [lorentzAlgebra, Nat.reduceAdd, LieSubalgebra.mem_map]
use (Matrix.reindexLieEquiv (@finSumFinEquiv 1 3)).symm A
apply And.intro
· have h1 := (Equiv.apply_eq_iff_eq
(Matrix.reindexAlgEquiv (@finSumFinEquiv 1 3).symm).toEquiv).mpr h
erw [Matrix.reindexAlgEquiv_mul] at h1
simp only [Nat.reduceAdd, reindexAlgEquiv_apply, Equiv.symm_symm, AlgEquiv.toEquiv_eq_coe,
EquivLike.coe_coe, map_neg, _root_.map_mul] at h1
erw [η_reindex] at h1
simpa [Nat.reduceAdd, reindexLieEquiv_symm, reindexLieEquiv_apply,
LieAlgebra.Orthogonal.so', mem_skewAdjointMatricesLieSubalgebra,
mem_skewAdjointMatricesSubmodule, IsSkewAdjoint, IsAdjointPair, mul_neg] using h1
· exact LieEquiv.apply_symm_apply (reindexLieEquiv finSumFinEquiv) _
erw [mem_skewAdjointMatricesLieSubalgebra]
simpa [LieAlgebra.Orthogonal.so', IsSkewAdjoint, IsAdjointPair] using h
lemma mem_iff {A : Matrix (Fin 4) (Fin 4) } : A ∈ lorentzAlgebra ↔ Aᵀ * η = - η * A :=
lemma mem_iff {A : Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) } :
A ∈ lorentzAlgebra ↔ Aᵀ * η = - η * A :=
Iff.intro (fun h => transpose_eta ⟨A, h⟩) (fun h => mem_of_transpose_eta_eq_eta_mul_self h)
lemma mem_iff' (A : Matrix (Fin 4) (Fin 4) ) : A ∈ lorentzAlgebra ↔ A = - η * Aᵀ * η := by
apply Iff.intro
intro h
simp_rw [mul_assoc, mem_iff.mp h, neg_mul, mul_neg, ← mul_assoc, η_sq, one_mul, neg_neg]
intro h
lemma mem_iff' (A : Matrix (Fin 1 ⊕ Fin 3) (Fin 1 ⊕ Fin 3) ) :
A ∈ lorentzAlgebra ↔ A = - η * Aᵀ * η := by
rw [mem_iff]
nth_rewrite 2 [h]
simp [← mul_assoc, η_sq]
refine Iff.intro (fun h => ?_) (fun h => ?_)
· trans -η * (Aᵀ * η)
rw [h]
trans (η * η) * A
rw [minkowskiMatrix.sq]
all_goals noncomm_ring
· nth_rewrite 2 [h]
trans (η * η) * Aᵀ * η
rw [minkowskiMatrix.sq]
all_goals noncomm_ring
lemma diag_comp (Λ : lorentzAlgebra) (μ : Fin 4) : Λ.1 μ μ = 0 := by
lemma diag_comp (Λ : lorentzAlgebra) (μ : Fin 1 ⊕ Fin 3) : Λ.1 μ μ = 0 := by
have h := congrArg (fun M ↦ M μ μ) $ mem_iff.mp Λ.2
simp at h
fin_cases μ <;>
rw [η_mul, mul_η, η_explicit] at h
<;> simpa using h
simp only [minkowskiMatrix, LieAlgebra.Orthogonal.indefiniteDiagonal, mul_diagonal,
transpose_apply, diagonal_neg, diagonal_mul, neg_mul] at h
rcases μ with μ | μ
simpa using h
simpa using h
lemma time_comps (Λ : lorentzAlgebra) (i : Fin 3) :
Λ.1 (Sum.inr i) (Sum.inl 0) = Λ.1 (Sum.inl 0) (Sum.inr i) := by
simpa only [Fin.isValue, minkowskiMatrix, LieAlgebra.Orthogonal.indefiniteDiagonal, mul_diagonal,
transpose_apply, Sum.elim_inr, mul_neg, mul_one, diagonal_neg, diagonal_mul, Sum.elim_inl,
neg_mul, one_mul, neg_inj] using congrArg (fun M ↦ M (Sum.inl 0) (Sum.inr i)) $ mem_iff.mp Λ.2
lemma time_comps (Λ : lorentzAlgebra) (i : Fin 3) : Λ.1 i.succ 0 = Λ.1 0 i.succ := by
have h := congrArg (fun M ↦ M 0 i.succ) $ mem_iff.mp Λ.2
simp at h
fin_cases i <;>
rw [η_mul, mul_η, η_explicit] at h <;>
simpa using h
lemma space_comps (Λ : lorentzAlgebra) (i j : Fin 3) :
Λ.1 i.succ j.succ = - Λ.1 j.succ i.succ := by
have h := congrArg (fun M ↦ M i.succ j.succ) $ mem_iff.mp Λ.2
simp at h
fin_cases i <;> fin_cases j <;>
rw [η_mul, mul_η, η_explicit] at h <;>
simpa using h.symm
Λ.1 (Sum.inr i) (Sum.inr j) = - Λ.1 (Sum.inr j) (Sum.inr i) := by
simpa only [minkowskiMatrix, LieAlgebra.Orthogonal.indefiniteDiagonal, diagonal_neg, diagonal_mul,
Sum.elim_inr, neg_neg, one_mul, mul_diagonal, transpose_apply, mul_neg, mul_one] using
(congrArg (fun M ↦ M (Sum.inr i) (Sum.inr j)) $ mem_iff.mp Λ.2).symm
end lorentzAlgebra
@[simps!]
instance spaceTimeAsLieRingModule : LieRingModule lorentzAlgebra SpaceTime where
instance lorentzVectorAsLieRingModule : LieRingModule lorentzAlgebra (LorentzVector 3) where
bracket Λ x := Λ.1.mulVec x
add_lie Λ1 Λ2 x := by
simp [add_mulVec]
@ -107,7 +98,7 @@ instance spaceTimeAsLieRingModule : LieRingModule lorentzAlgebra SpaceTime where
simp [mulVec_add, Bracket.bracket, sub_mulVec]
@[simps!]
instance spaceTimeAsLieModule : LieModule lorentzAlgebra SpaceTime where
instance spaceTimeAsLieModule : LieModule lorentzAlgebra (LorentzVector 3) where
smul_lie r Λ x := by
simp [Bracket.bracket, smul_mulVec_assoc]
lie_smul r Λ x := by

View file

@ -7,142 +7,11 @@ import HepLean.SpaceTime.LorentzAlgebra.Basic
/-!
# Basis of the Lorentz Algebra
We define the standard basis of the Lorentz group.
This file is currently a stub.
Old commits contained code here, however this has not being ported forward.
This file is waiting for Lorentz Tensors to be done formally, before
it can be completed.
-/
namespace SpaceTime
namespace lorentzAlgebra
open Matrix
/-- The matrices which form the basis of the Lorentz algebra. -/
@[simp]
def σMat (μ ν : Fin 4) : Matrix (Fin 4) (Fin 4) := fun ρ δ ↦
η_[μ]_[δ] * η^[ρ]_[ν] - η^[ρ]_[μ] * η_[ν]_[δ]
lemma σMat_in_lorentzAlgebra (μ ν : Fin 4) : σMat μ ν ∈ lorentzAlgebra := by
rw [mem_iff]
funext ρ δ
rw [Matrix.neg_mul, Matrix.neg_apply, η_mul, mul_η, transpose_apply]
apply Eq.trans ?_ (by ring :
((η^[ρ]_[μ] * η_[ρ]_[ρ]) * η_[ν]_[δ] - η_[μ]_[δ] * (η^[ρ]_[ν] * η_[ρ]_[ρ])) =
-(η_[ρ]_[ρ] * (η_[μ]_[δ] * η^[ρ]_[ν] - η^[ρ]_[μ] * η_[ν]_[δ] )))
apply Eq.trans (by ring : (η_[μ]_[ρ] * η^[δ]_[ν] - η^[δ]_[μ] * η_[ν]_[ρ]) * η_[δ]_[δ]
= (- (η^[δ]_[μ] * η_[δ]_[δ]) * η_[ν]_[ρ] + η_[μ]_[ρ] * (η^[δ]_[ν] * η_[δ]_[δ])))
rw [η_mul_self, η_mul_self, η_mul_self, η_mul_self]
ring
/-- Elements of the Lorentz algebra which form a basis thereof. -/
@[simps!]
def σν : Fin 4) : lorentzAlgebra := ⟨σMat μ ν, σMat_in_lorentzAlgebra μ ν⟩
lemma σ_anti_symm (μ ν : Fin 4) : σ μ ν = - σ ν μ := by
refine SetCoe.ext ?_
funext ρ δ
simp only [σ_coe, σMat, NegMemClass.coe_neg, neg_apply, neg_sub]
ring
lemma σMat_mul (α β γ δ a b: Fin 4) :
(σMat α β * σMat γ δ) a b =
η^[a]_[α] * (η_[δ]_[b] * η_[β]_[γ] - η_[γ]_[b] * η_[β]_[δ])
- η^[a]_[β] * (η_[δ]_[b] * η_[α]_[γ]- η_[γ]_[b] * η_[α]_[δ]) := by
rw [Matrix.mul_apply]
simp only [σMat]
trans (η^[a]_[α] * η_[δ]_[b]) * ∑ x, η^[x]_[γ] * η_[β]_[x]
- (η^[a]_[α] * η_[γ]_[b]) * ∑ x, η^[x]_[δ] * η_[β]_[x]
- (η^[a]_[β] * η_[δ]_[b]) * ∑ x, η^[x]_[γ] * η_[α]_[x]
+ (η^[a]_[β] * η_[γ]_[b]) * ∑ x, η^[x]_[δ] * η_[α]_[x]
repeat rw [Fin.sum_univ_four]
ring
rw [η_contract_self', η_contract_self', η_contract_self', η_contract_self']
ring
lemma σ_comm (α β γ δ : Fin 4) :
⁅σ α β , σ γ δ⁆ =
η_[α]_[δ] • σ γ β + η_[α]_[γ] • σ β δ + η_[β]_[δ] • σ α γ + η_[β]_[γ] • σ δ α := by
refine SetCoe.ext ?_
change σMat α β * σ γ δ - σ γ δ * σ α β = _
funext a b
simp only [σ_coe, sub_apply, AddSubmonoid.coe_add, Submodule.coe_toAddSubmonoid,
Submodule.coe_smul_of_tower, Matrix.add_apply, Matrix.smul_apply, σMat, smul_eq_mul]
rw [σMat_mul, σMat_mul, η_symmetric α γ, η_symmetric α δ, η_symmetric β γ, η_symmetric β δ]
ring
lemma eq_span_σ (Λ : lorentzAlgebra) :
Λ = Λ.1 0 1 • σ 0 1 + Λ.1 0 2 • σ 0 2 + Λ.1 0 3 • σ 0 3 +
Λ.1 1 2 • σ 1 2 + Λ.1 1 3 • σ 1 3 + Λ.1 2 3 • σ 2 3 := by
apply SetCoe.ext ?_
funext a b
fin_cases a <;> fin_cases b <;>
simp only [Fin.zero_eta, Fin.isValue, Fin.mk_one, Fin.reduceFinMk, AddSubmonoid.coe_add,
Submodule.coe_smul_of_tower, σ_coe,
Matrix.add_apply, Matrix.smul_apply, σMat, ηUpDown, ne_eq, zero_ne_one, not_false_eq_true,
one_apply_ne, η_explicit, of_apply, cons_val_zero,
mul_zero, one_apply_eq, mul_one, sub_neg_eq_add,
zero_add, smul_eq_mul, Fin.reduceEq, cons_val_one, vecHead, vecTail,
Nat.reduceAdd, Function.comp_apply, Fin.succ_zero_eq_one, sub_self, add_zero, cons_val_two,
cons_val_three, Fin.succ_one_eq_two, mul_neg, neg_zero, sub_zero]
· exact diag_comp Λ 0
· exact time_comps Λ 0
· exact diag_comp Λ 1
· exact time_comps Λ 1
· exact space_comps Λ 1 0
· exact diag_comp Λ 2
· exact time_comps Λ 2
· exact space_comps Λ 2 0
· exact space_comps Λ 2 1
· exact diag_comp Λ 3
/-- The coordinate map for the basis formed by the matrices `σ`. -/
@[simps!]
noncomputable def σCoordinateMap : lorentzAlgebra ≃ₗ[] Fin 6 →₀ where
toFun Λ := Finsupp.equivFunOnFinite.invFun
fun i => match i with
| 0 => Λ.1 0 1
| 1 => Λ.1 0 2
| 2 => Λ.1 0 3
| 3 => Λ.1 1 2
| 4 => Λ.1 1 3
| 5 => Λ.1 2 3
map_add' S T := by
ext i
fin_cases i <;> rfl
map_smul' c S := by
ext i
fin_cases i <;> rfl
invFun c := c 0 • σ 0 1 + c 1 • σ 0 2 + c 2 • σ 0 3 +
c 3 • σ 1 2 + c 4 • σ 1 3 + c 5 • σ 2 3
left_inv Λ := by
simp only [Fin.isValue, Equiv.invFun_as_coe, Finsupp.equivFunOnFinite_symm_apply_toFun]
exact (eq_span_σ Λ).symm
right_inv c := by
ext i
fin_cases i <;> simp only [Fin.isValue, Set.Finite.toFinset_setOf, ne_eq, Finsupp.coe_mk,
Fin.zero_eta, Fin.isValue, Fin.mk_one, Fin.reduceFinMk, AddSubmonoid.coe_add,
Submodule.coe_toAddSubmonoid, Submodule.coe_smul_of_tower, σ_coe,
Matrix.add_apply, Matrix.smul_apply, σMat, ηUpDown, ne_eq, zero_ne_one, not_false_eq_true,
one_apply_ne, η_explicit, of_apply, cons_val', cons_val_zero, empty_val',
cons_val_fin_one, vecCons_const, mul_zero, one_apply_eq, mul_one, sub_neg_eq_add,
zero_add, smul_eq_mul, Fin.reduceEq, cons_val_one, vecHead, vecTail, Nat.succ_eq_add_one,
Nat.reduceAdd, Function.comp_apply, Fin.succ_zero_eq_one, sub_self, add_zero, cons_val_two,
cons_val_three, Fin.succ_one_eq_two, mul_neg, neg_zero, sub_zero, Finsupp.equivFunOnFinite]
/-- The basis formed by the matrices `σ`. -/
@[simps! repr_apply_support_val repr_apply_toFun]
noncomputable def σBasis : Basis (Fin 6) lorentzAlgebra where
repr := σCoordinateMap
instance : Module.Finite lorentzAlgebra :=
Module.Finite.of_basis σBasis
/-- The Lorentz algebra is 6-dimensional. -/
theorem finrank_eq_six : FiniteDimensional.finrank lorentzAlgebra = 6 := by
have h := Module.mk_finrank_eq_card_basis σBasis
simp only [finrank_eq_rank, Cardinal.mk_fintype, Fintype.card_fin, Nat.cast_ofNat] at h
exact FiniteDimensional.finrank_eq_of_rank_eq h
end lorentzAlgebra
end SpaceTime