Skip to content

Commit

Permalink
Merge pull request #242 from HEPLean/LightLikeComplex
Browse files Browse the repository at this point in the history
feat: Pure tensors
  • Loading branch information
jstoobysmith authored Nov 19, 2024
2 parents 2c38c8c + 0e265d9 commit 8fb6265
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
1 change: 1 addition & 0 deletions HepLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ import HepLean.Tensors.TensorSpecies.Contractions.Categorical
import HepLean.Tensors.TensorSpecies.Contractions.ContrMap
import HepLean.Tensors.TensorSpecies.DualRepIso
import HepLean.Tensors.TensorSpecies.MetricTensor
import HepLean.Tensors.TensorSpecies.Pure
import HepLean.Tensors.TensorSpecies.UnitTensor
import HepLean.Tensors.Tree.Basic
import HepLean.Tensors.Tree.Dot
Expand Down
2 changes: 1 addition & 1 deletion HepLean/Tensors/TensorSpecies/Contractions/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ lemma smul_isNormZero_of_isNormZero {c : S.C} {ψ : S.FD.obj (Discrete.mk c)}

/-- If a vector is norm-zero, then any vector in the orbit of that vector is also norm-zero. -/
@[simp]
lemma action_isNormZero_of_isNormZero {c : S.C} {ψ : S.FD.obj (Discrete.mk c)} (g : S.G) :
lemma action_isNormZero_iff_isNormZero {c : S.C} {ψ : S.FD.obj (Discrete.mk c)} (g : S.G) :
S.IsNormZero ((S.FD.obj (Discrete.mk c)).ρ g ψ) ↔ S.IsNormZero ψ := by
simp only [IsNormZero, contractSelfField_equivariant]

Expand Down
85 changes: 85 additions & 0 deletions HepLean/Tensors/TensorSpecies/Pure.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/-
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.Tensors.TensorSpecies.DualRepIso
/-!
# Pure tensors
A pure tensor is one of the form `ψ1 ⊗ ψ2 ⊗ ... ⊗ ψn`.
We say a tensor is pure if it is of this form.
-/

open IndexNotation
open CategoryTheory
open MonoidalCategory

noncomputable section

namespace TensorSpecies
open TensorTree
variable (S : TensorSpecies)

/-- The type of tensors specified by a map to colors `c : OverColor S.C`. -/
def Pure (c : OverColor S.C) : Type := (i : c.left) → S.FD.obj (Discrete.mk (c.hom i))

namespace Pure

variable {S : TensorSpecies} {c : OverColor S.C}

/-- The group action on a pure tensor. -/
def ρ (g : S.G) (p : Pure S c) : Pure S c := fun i ↦ (S.FD.obj (Discrete.mk (c.hom i))).ρ g (p i)

/-- The underlying tensor of a pure tensor. -/
def tprod (p : Pure S c) : S.F.obj c := PiTensorProduct.tprod S.k p

/-- The map `tprod` is equivariant with respect to the group action. -/
lemma tprod_equivariant (g : S.G) (p : Pure S c) : (ρ g p).tprod = (S.F.obj c).ρ g p.tprod := by
simp only [F_def, OverColor.lift, OverColor.lift.obj', OverColor.lift.objObj',
OverColor.instMonoidalCategoryStruct_tensorUnit_left, Functor.id_obj,
OverColor.instMonoidalCategoryStruct_tensorUnit_hom,
OverColor.instMonoidalCategoryStruct_tensorObj_left,
OverColor.instMonoidalCategoryStruct_tensorObj_hom, Rep.coe_of, tprod, Rep.of_ρ,
MonoidHom.coe_mk, OneHom.coe_mk, PiTensorProduct.map_tprod]
rfl

end Pure

/-- We say a tensor is pure if it is `⨂[S.k] i, p i` for some `p : Pure c`. -/
def IsPure {c : OverColor S.C} (t : S.F.obj c) : Prop := ∃ p : Pure S c, t = p.tprod

/-- As long as we are dealing with tensors with at least one index, then the zero
tensor is pure. -/
lemma zero_isPure {c : OverColor S.C} [h : Nonempty c.left] : @IsPure S c 0 := by
refine ⟨fun i => 0, ?_⟩
simp only [Pure.tprod, Functor.id_obj]
change 0 = PiTensorProduct.tprodCoeff S.k 1 fun i => 0
symm
apply PiTensorProduct.zero_tprodCoeff' (1 : S.k)
rfl
exact (Classical.inhabited_of_nonempty h).default

@[simp]
lemma Pure.tprod_isPure {c : OverColor S.C} (p : Pure S c) : S.IsPure p.tprod := ⟨p, rfl⟩

@[simp]
lemma action_isPure_iff_isPure {c : OverColor S.C} {ψ : S.F.obj c} (g : S.G) :
S.IsPure ((S.F.obj c).ρ g ψ) ↔ S.IsPure ψ := by
refine Iff.intro (fun h => ?_) (fun h => ?_)
· obtain ⟨p, hp⟩ := h
have hp' := congrArg ((S.F.obj c).ρ g⁻¹) hp
simp only [Rep.ρ_inv_self_apply] at hp'
rw [← Pure.tprod_equivariant] at hp'
subst hp'
exact Pure.tprod_isPure S (Pure.ρ g⁻¹ p)
· obtain ⟨p, hp⟩ := h
subst hp
rw [← Pure.tprod_equivariant]
exact Pure.tprod_isPure S (Pure.ρ g p)

end TensorSpecies

end

0 comments on commit 8fb6265

Please sign in to comment.