Skip to content

Commit

Permalink
fix: Correct tensor evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoobysmith committed Oct 21, 2024
1 parent 7fc850c commit baf5169
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 17 additions & 2 deletions HepLean/Tensors/ComplexLorentz/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ lemma contr_rank_2_symm {T1 : (Lorentz.complexContr ⊗ Lorentz.complexContr).V}
rw [perm_perm]
rw [perm_eq_id]
· rfl
· rfl
· apply OverColor.Hom.ext
rfl
· apply OverColor.Hom.ext
ext x
exact Fin.elim0 x
Expand All @@ -104,6 +105,7 @@ lemma contr_rank_2_symm' {T1 : (Lorentz.complexCo ⊗ Lorentz.complexCo).V}
ext x
exact Fin.elim0 x

set_option maxRecDepth 20000 in
/-- Contracting a rank-2 anti-symmetric tensor with a rank-2 symmetric tensor gives zero. -/
lemma antiSymm_contr_symm {A : (Lorentz.complexContr ⊗ Lorentz.complexContr).V}
{S : (Lorentz.complexCo ⊗ Lorentz.complexCo).V}
Expand All @@ -120,7 +122,20 @@ lemma antiSymm_contr_symm {A : (Lorentz.complexContr ⊗ Lorentz.complexContr).V
rw [contr_tensor_eq (contr_tensor_eq (neg_fst_prod _ _))]
rw [contr_tensor_eq (neg_contr _)]
rw [neg_contr]
rfl
rw [neg_tensor]
apply congrArg
rw [contr_tensor_eq (contr_tensor_eq (prod_perm_left _ _ _ _))]
rw [contr_tensor_eq (perm_contr _ _)]
rw [perm_contr]
rw [perm_tensor_eq (contr_tensor_eq (contr_tensor_eq (prod_perm_right _ _ _ _)))]
rw [perm_tensor_eq (contr_tensor_eq (perm_contr _ _))]
rw [perm_tensor_eq (perm_contr _ _)]
rw [perm_perm]
nth_rewrite 1 [perm_tensor_eq (contr_contr _ _ _)]
rw [perm_perm]
rw [perm_eq_id]
· rfl
· rfl

lemma symm_contr_antiSymm {S : (Lorentz.complexCo ⊗ Lorentz.complexCo).V}
{A : (Lorentz.complexContr ⊗ Lorentz.complexContr).V}
Expand Down
1 change: 1 addition & 0 deletions HepLean/Tensors/Tree/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ noncomputable section
Note: This function is not fully defined yet. -/
def tensor : ∀ {n : ℕ} {c : Fin n → S.C}, TensorTree S c → S.F.obj (OverColor.mk c) := fun
| tensorNode t => t
| twoNode t => (OverColor.Discrete.pairIsoSep S.FDiscrete).hom.hom t
| constTwoNode t => (OverColor.Discrete.pairIsoSep S.FDiscrete).hom.hom (t.hom (1 : S.k))
| add t1 t2 => t1.tensor + t2.tensor
| perm σ t => (S.F.map σ).hom t.tensor
Expand Down

0 comments on commit baf5169

Please sign in to comment.