From 8b2c853fd83b3a044c157ad02e961449d371dd67 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Wed, 31 Jul 2024 07:29:59 -0400 Subject: [PATCH] feat: equivariance of rising and lowering indices --- .../SpaceTime/LorentzTensor/Contraction.lean | 4 +- .../LorentzTensor/MulActionTensor.lean | 66 +++++++++++++++---- .../LorentzTensor/RisingLowering.lean | 62 ++++++++++++++++- 3 files changed, 115 insertions(+), 17 deletions(-) diff --git a/HepLean/SpaceTime/LorentzTensor/Contraction.lean b/HepLean/SpaceTime/LorentzTensor/Contraction.lean index fed8eab..e08da05 100644 --- a/HepLean/SpaceTime/LorentzTensor/Contraction.lean +++ b/HepLean/SpaceTime/LorentzTensor/Contraction.lean @@ -287,9 +287,9 @@ lemma contrAll_rep {c : X โ†’ ๐“ฃ.Color} {d : Y โ†’ ๐“ฃ.Color} (e : X โ‰ƒ Y) ( simp only [mk_apply] apply congrArg funext x - rw [โ† repColorModule_colorModuleCast_apply] + rw [โ† colorModuleCast_equivariant_apply] nth_rewrite 2 [โ† contrDual_inv (c x) g] - rfl + simp @[simp] lemma contrAll_rep_apply {c : X โ†’ ๐“ฃ.Color} {d : Y โ†’ ๐“ฃ.Color} (e : X โ‰ƒ Y) (h : c = ๐“ฃ.ฯ„ โˆ˜ d โˆ˜ e) diff --git a/HepLean/SpaceTime/LorentzTensor/MulActionTensor.lean b/HepLean/SpaceTime/LorentzTensor/MulActionTensor.lean index 46e9f14..c5de9da 100644 --- a/HepLean/SpaceTime/LorentzTensor/MulActionTensor.lean +++ b/HepLean/SpaceTime/LorentzTensor/MulActionTensor.lean @@ -27,6 +27,9 @@ class MulActionTensor (G : Type) [Monoid G] (๐“ฃ : TensorStructure R) where /-- The contraction of a vector with its dual is invariant under the group action. -/ contrDual_inv : โˆ€ ฮผ g, ๐“ฃ.contrDual ฮผ โˆ˜โ‚— TensorProduct.map (repColorModule ฮผ g) (repColorModule (๐“ฃ.ฯ„ ฮผ) g) = ๐“ฃ.contrDual ฮผ + /-- The invariance of the metric under the group action. -/ + metric_inv : โˆ€ ฮผ g, (TensorProduct.map (repColorModule ฮผ g) (repColorModule ฮผ g)) (๐“ฃ.metric ฮผ) = + ๐“ฃ.metric ฮผ namespace MulActionTensor @@ -50,6 +53,9 @@ def compHom (f : H โ†’* G) : MulActionTensor H ๐“ฃ where contrDual_inv ฮผ h := by simp only [MonoidHom.coe_comp, Function.comp_apply] rw [contrDual_inv] + metric_inv ฮผ h := by + simp only [MonoidHom.coe_comp, Function.comp_apply] + rw [metric_inv] /-- The trivial `MulActionTensor` defined via trivial representations. -/ def trivial : MulActionTensor G ๐“ฃ where @@ -57,6 +63,9 @@ def trivial : MulActionTensor G ๐“ฃ where contrDual_inv ฮผ g := by simp only [Representation.trivial, MonoidHom.one_apply, TensorProduct.map_one] rfl + metric_inv ฮผ g := by + simp only [Representation.trivial, MonoidHom.one_apply, TensorProduct.map_one] + rfl end MulActionTensor @@ -74,6 +83,40 @@ variable {d : โ„•} {X Y Y' Z : Type} [Fintype X] [DecidableEq X] [Fintype Y] [De /-! +# Equivariance properties involving modules + +-/ + +@[simp] +lemma contrDual_equivariant_tmul (g : G) (x : ๐“ฃ.ColorModule ฮผ) (y : ๐“ฃ.ColorModule (๐“ฃ.ฯ„ ฮผ)) : + (๐“ฃ.contrDual ฮผ ((repColorModule ฮผ g x) โŠ—โ‚œ[R] (repColorModule (๐“ฃ.ฯ„ ฮผ) g y))) = + ๐“ฃ.contrDual ฮผ (x โŠ—โ‚œ[R] y) := by + trans (๐“ฃ.contrDual ฮผ โˆ˜โ‚— + TensorProduct.map (repColorModule ฮผ g) (repColorModule (๐“ฃ.ฯ„ ฮผ) g)) (x โŠ—โ‚œ[R] y) + rfl + rw [contrDual_inv] + +@[simp] +lemma colorModuleCast_equivariant_apply (h : ฮผ = ฮฝ) (g : G) (x : ๐“ฃ.ColorModule ฮผ) : + (๐“ฃ.colorModuleCast h) (repColorModule ฮผ g x) = + (repColorModule ฮฝ g) (๐“ฃ.colorModuleCast h x) := by + subst h + simp [colorModuleCast] + +@[simp] +lemma contrRightAux_contrDual_equivariant_tmul (g : G) (m : ๐“ฃ.ColorModule ฮฝ โŠ—[R] ๐“ฃ.ColorModule ฮผ) + (x : ๐“ฃ.ColorModule (๐“ฃ.ฯ„ ฮผ)) : (contrRightAux (๐“ฃ.contrDual ฮผ)) + ((TensorProduct.map (repColorModule ฮฝ g) (repColorModule ฮผ g) m) โŠ—โ‚œ[R] + (repColorModule (๐“ฃ.ฯ„ ฮผ) g x)) = + repColorModule ฮฝ g ((contrRightAux (๐“ฃ.contrDual ฮผ)) (m โŠ—โ‚œ[R] x)) := by + refine TensorProduct.induction_on m (by simp) ?_ ?_ + ยท intro y z + simp [contrRightAux] + ยท intro x z h1 h2 + simp [add_tmul, LinearMap.map_add, h1, h2] + +/-! + ## Representation of tensor products -/ @@ -89,19 +132,13 @@ def rep : Representation R G (๐“ฃ.Tensor cX) where local infixl:101 " โ€ข " => ๐“ฃ.rep -lemma repColorModule_colorModuleCast_apply (h : ฮผ = ฮฝ) (g : G) (x : ๐“ฃ.ColorModule ฮผ) : - (repColorModule ฮฝ g) (๐“ฃ.colorModuleCast h x) = - (๐“ฃ.colorModuleCast h) (repColorModule ฮผ g x) := by - subst h - simp [colorModuleCast] - @[simp] lemma repColorModule_colorModuleCast (h : ฮผ = ฮฝ) (g : G) : (repColorModule ฮฝ g) โˆ˜โ‚— (๐“ฃ.colorModuleCast h).toLinearMap = (๐“ฃ.colorModuleCast h).toLinearMap โˆ˜โ‚— (repColorModule ฮผ g) := by apply LinearMap.ext intro x - simp [repColorModule_colorModuleCast_apply] + simp [colorModuleCast_equivariant_apply] @[simp] lemma rep_mapIso (e : X โ‰ƒ Y) (h : cX = cY โˆ˜ e) (g : G) : @@ -112,7 +149,7 @@ lemma rep_mapIso (e : X โ‰ƒ Y) (h : cX = cY โˆ˜ e) (g : G) : simp only [LinearMap.compMultilinearMap_apply, LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply] erw [mapIso_tprod] - simp [rep, repColorModule_colorModuleCast_apply] + simp [rep, colorModuleCast_equivariant_apply] change (PiTensorProduct.map fun x => (repColorModule (cY x)) g) ((PiTensorProduct.tprod R) fun i => (๐“ฃ.colorModuleCast _) (x (e.symm i))) = (๐“ฃ.mapIso e h) ((PiTensorProduct.map _) ((PiTensorProduct.tprod R) x)) @@ -120,7 +157,7 @@ lemma rep_mapIso (e : X โ‰ƒ Y) (h : cX = cY โˆ˜ e) (g : G) : apply congrArg funext i subst h - simp [repColorModule_colorModuleCast_apply] + simp [colorModuleCast_equivariant_apply] @[simp] lemma rep_mapIso_apply (e : X โ‰ƒ Y) (h : cX = cY โˆ˜ e) (g : G) (x : ๐“ฃ.Tensor cX) : @@ -143,7 +180,7 @@ lemma rep_tprod (g : G) (f : (i : X) โ†’ ๐“ฃ.ColorModule (cX i)) : -/ -lemma rep_tensoratorEquiv (g : G) : +lemma tensoratorEquiv_equivariant (g : G) : (๐“ฃ.tensoratorEquiv cX cY) โˆ˜โ‚— (TensorProduct.map (๐“ฃ.rep g) (๐“ฃ.rep g)) = ๐“ฃ.rep g โˆ˜โ‚— (๐“ฃ.tensoratorEquiv cX cY).toLinearMap := by apply tensorProd_piTensorProd_ext @@ -156,18 +193,19 @@ lemma rep_tensoratorEquiv (g : G) : | Sum.inl x => rfl | Sum.inr x => rfl -lemma rep_tensoratorEquiv_apply (g : G) (x : ๐“ฃ.Tensor cX โŠ—[R] ๐“ฃ.Tensor cY) : +@[simp] +lemma tensoratorEquiv_equivariant_apply (g : G) (x : ๐“ฃ.Tensor cX โŠ—[R] ๐“ฃ.Tensor cY) : (๐“ฃ.tensoratorEquiv cX cY) ((TensorProduct.map (๐“ฃ.rep g) (๐“ฃ.rep g)) x) = (๐“ฃ.rep g) ((๐“ฃ.tensoratorEquiv cX cY) x) := by trans ((๐“ฃ.tensoratorEquiv cX cY) โˆ˜โ‚— (TensorProduct.map (๐“ฃ.rep g) (๐“ฃ.rep g))) x rfl - rw [rep_tensoratorEquiv] + rw [tensoratorEquiv_equivariant] rfl lemma rep_tensoratorEquiv_tmul (g : G) (x : ๐“ฃ.Tensor cX) (y : ๐“ฃ.Tensor cY) : (๐“ฃ.tensoratorEquiv cX cY) ((g โ€ข x) โŠ—โ‚œ[R] (g โ€ข y)) = g โ€ข ((๐“ฃ.tensoratorEquiv cX cY) (x โŠ—โ‚œ[R] y)) := by - nth_rewrite 1 [โ† rep_tensoratorEquiv_apply] + nth_rewrite 1 [โ† tensoratorEquiv_equivariant_apply] rfl lemma rep_tensoratorEquiv_symm (g : G) : @@ -175,7 +213,7 @@ lemma rep_tensoratorEquiv_symm (g : G) : (๐“ฃ.tensoratorEquiv cX cY).symm.toLinearMap := by rw [LinearEquiv.eq_comp_toLinearMap_symm, LinearMap.comp_assoc, LinearEquiv.toLinearMap_symm_comp_eq] - exact Eq.symm (rep_tensoratorEquiv ๐“ฃ g) + exact Eq.symm (tensoratorEquiv_equivariant ๐“ฃ g) @[simp] lemma rep_tensoratorEquiv_symm_apply (g : G) (x : ๐“ฃ.Tensor (Sum.elim cX cY)) : diff --git a/HepLean/SpaceTime/LorentzTensor/RisingLowering.lean b/HepLean/SpaceTime/LorentzTensor/RisingLowering.lean index 450b099..ed869d9 100644 --- a/HepLean/SpaceTime/LorentzTensor/RisingLowering.lean +++ b/HepLean/SpaceTime/LorentzTensor/RisingLowering.lean @@ -3,7 +3,7 @@ Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ -import HepLean.SpaceTime.LorentzTensor.Basic +import HepLean.SpaceTime.LorentzTensor.MulActionTensor /-! # Rising and Lowering of indices @@ -31,6 +31,9 @@ variable {d : โ„•} {X Y Y' Z W C P : Type} [Fintype X] [DecidableEq X] [Fintype {cX cX2 : X โ†’ ๐“ฃ.Color} {cY : Y โ†’ ๐“ฃ.Color} {cZ : Z โ†’ ๐“ฃ.Color} {cW : W โ†’ ๐“ฃ.Color} {cY' : Y' โ†’ ๐“ฃ.Color} {ฮผ ฮฝ: ๐“ฃ.Color} +variable {G H : Type} [Group G] [Group H] [MulActionTensor G ๐“ฃ] +local infixl:101 " โ€ข " => ๐“ฃ.rep + /-! ## Properties of the unit @@ -120,6 +123,27 @@ def dualizeModule (ฮผ : ๐“ฃ.Color) : ๐“ฃ.ColorModule ฮผ โ‰ƒโ‚—[R] ๐“ฃ.ColorMo Function.comp_apply, lTensorHomToHomLTensor_apply, LinearMap.id_coe, id_eq, metric_contrRight_unit] +@[simp] +lemma dualizeModule_equivariant (g : G) : + (๐“ฃ.dualizeModule ฮผ) โˆ˜โ‚— ((MulActionTensor.repColorModule ฮผ) g) = + (MulActionTensor.repColorModule (๐“ฃ.ฯ„ ฮผ) g) โˆ˜โ‚— (๐“ฃ.dualizeModule ฮผ) := by + apply LinearMap.ext + intro x + simp only [dualizeModule, dualizeFun, dualizeSymm, LinearEquiv.ofLinear_toLinearMap, + LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, colorModuleCast_equivariant_apply, + lTensorHomToHomLTensor_apply, LinearMap.id_coe, id_eq] + nth_rewrite 1 [โ† MulActionTensor.metric_inv (๐“ฃ.ฯ„ ฮผ) g] + simp + +@[simp] +lemma dualizeModule_equivariant_apply (g : G) (x : ๐“ฃ.ColorModule ฮผ) : + (๐“ฃ.dualizeModule ฮผ) ((MulActionTensor.repColorModule ฮผ) g x) = + (MulActionTensor.repColorModule (๐“ฃ.ฯ„ ฮผ) g) (๐“ฃ.dualizeModule ฮผ x) := by + trans ((๐“ฃ.dualizeModule ฮผ) โˆ˜โ‚— ((MulActionTensor.repColorModule ฮผ) g)) x + rfl + rw [dualizeModule_equivariant] + rfl + /-- Dualizes the color of all indicies of a tensor by contraction with the metric. -/ def dualizeAll : ๐“ฃ.Tensor cX โ‰ƒโ‚—[R] ๐“ฃ.Tensor (๐“ฃ.ฯ„ โˆ˜ cX) := by refine LinearEquiv.ofLinear @@ -141,6 +165,24 @@ def dualizeAll : ๐“ฃ.Tensor cX โ‰ƒโ‚—[R] ๐“ฃ.Tensor (๐“ฃ.ฯ„ โˆ˜ cX) := by apply congrArg simp +@[simp] +lemma dualizeAll_equivariant (g : G) : (๐“ฃ.dualizeAll.toLinearMap) โˆ˜โ‚— (@rep R _ G _ ๐“ฃ _ X cX g) + = ๐“ฃ.rep g โˆ˜โ‚— (๐“ฃ.dualizeAll.toLinearMap) := by + apply LinearMap.ext + intro x + simp [dualizeAll] + refine PiTensorProduct.induction_on' x ?_ (by + intro a b hx a + simp [map_add, add_tmul, hx] + simp_all only [Function.comp_apply, LinearMap.coe_comp, LinearMap.id_coe, id_eq]) + intro rx fx + simp + apply congrArg + change (PiTensorProduct.map _) ((PiTensorProduct.tprod R) _) = + (๐“ฃ.rep g) ((PiTensorProduct.map _) ((PiTensorProduct.tprod R) fx)) + rw [PiTensorProduct.map_tprod, PiTensorProduct.map_tprod] + simp + lemma dualize_cond (e : C โŠ• P โ‰ƒ X) : cX = Sum.elim (cX โˆ˜ e โˆ˜ Sum.inl) (cX โˆ˜ e โˆ˜ Sum.inr) โˆ˜ e.symm := by rw [Equiv.eq_comp_symm] @@ -169,6 +211,24 @@ def dualize (e : C โŠ• P โ‰ƒ X) : ๐“ฃ.Tensor cX โ‰ƒโ‚—[R] (๐“ฃ.tensoratorEquiv _ _) โ‰ชโ‰ซโ‚— ๐“ฃ.mapIso e (๐“ฃ.dualize_cond' e) +/-- Dualizing indices is equivariant with respect to the group action. This is the + applied version of this statement. -/ +@[simp] +lemma dualize_equivariant_apply (e : C โŠ• P โ‰ƒ X) (g : G) (x : ๐“ฃ.Tensor cX) : + ๐“ฃ.dualize e (g โ€ข x) = g โ€ข (๐“ฃ.dualize e x) := by + simp only [dualize, TensorProduct.congr, LinearEquiv.refl_toLinearMap, LinearEquiv.refl_symm, + LinearEquiv.trans_apply, rep_mapIso_apply, rep_tensoratorEquiv_symm_apply, + LinearEquiv.ofLinear_apply] + rw [โ† LinearMap.comp_apply (TensorProduct.map _ _), โ† TensorProduct.map_comp] + simp only [dualizeAll_equivariant, LinearMap.id_comp] + have h1 {M N A B C : Type} [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid A] + [AddCommMonoid B] [AddCommMonoid C] [Module R M] [Module R N] [Module R A] [Module R B] + [Module R C] (f : M โ†’โ‚—[R] N) (g : A โ†’โ‚—[R] B) (h : B โ†’โ‚—[R] C) : TensorProduct.map (h โˆ˜โ‚— g) f + = TensorProduct.map h f โˆ˜โ‚— TensorProduct.map g (LinearMap.id) := + ext rfl + rw [h1, LinearMap.coe_comp, Function.comp_apply] + simp only [tensoratorEquiv_equivariant_apply, rep_mapIso_apply] + end TensorStructure end