/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ import HepLean.PerturbationTheory.FieldSpecification.TimeOrder import HepLean.PerturbationTheory.Algebras.CrAnAlgebra.SuperCommute import HepLean.PerturbationTheory.Koszul.KoszulSign /-! # Time Ordering in the CrAnAlgebra -/ namespace FieldSpecification variable {𝓕 : FieldSpecification} open FieldStatistic namespace CrAnAlgebra noncomputable section open HepLean.List /-! ## Time order -/ /-- Time ordering for the `CrAnAlgebra`. -/ def timeOrder : CrAnAlgebra 𝓕 β†’β‚—[β„‚] CrAnAlgebra 𝓕 := Basis.constr ofCrAnListBasis β„‚ fun Ο†s => crAnTimeOrderSign Ο†s β€’ ofCrAnList (crAnTimeOrderList Ο†s) @[inherit_doc timeOrder] scoped[FieldSpecification.CrAnAlgebra] notation "𝓣ᢠ(" a ")" => timeOrder a lemma timeOrder_ofCrAnList (Ο†s : List 𝓕.CrAnStates) : 𝓣ᢠ(ofCrAnList Ο†s) = crAnTimeOrderSign Ο†s β€’ ofCrAnList (crAnTimeOrderList Ο†s) := by rw [← ofListBasis_eq_ofList] simp only [timeOrder, Basis.constr_basis] lemma timeOrder_ofStateList (Ο†s : List 𝓕.States) : 𝓣ᢠ(ofStateList Ο†s) = timeOrderSign Ο†s β€’ ofStateList (timeOrderList Ο†s) := by conv_lhs => rw [ofStateList_sum, map_sum] enter [2, x] rw [timeOrder_ofCrAnList] simp only [crAnTimeOrderSign_crAnSection] rw [← Finset.smul_sum] congr rw [ofStateList_sum, sum_crAnSections_timeOrder] rfl lemma timeOrder_ofStateList_nil : timeOrder (𝓕 := 𝓕) (ofStateList []) = 1 := by rw [timeOrder_ofStateList] simp [timeOrderSign, Wick.koszulSign, timeOrderList] @[simp] lemma timeOrder_ofStateList_singleton (Ο† : 𝓕.States) : 𝓣ᢠ(ofStateList [Ο†]) = ofStateList [Ο†] := by simp [timeOrder_ofStateList, timeOrderSign, timeOrderList] lemma timeOrder_ofState_ofState_ordered {Ο† ψ : 𝓕.States} (h : timeOrderRel Ο† ψ) : 𝓣ᢠ(ofState Ο† * ofState ψ) = ofState Ο† * ofState ψ := by rw [← ofStateList_singleton, ← ofStateList_singleton, ← ofStateList_append, timeOrder_ofStateList] simp only [List.singleton_append] rw [timeOrderSign_pair_ordered h, timeOrderList_pair_ordered h] simp lemma timeOrder_ofState_ofState_not_ordered {Ο† ψ : 𝓕.States} (h : Β¬ timeOrderRel Ο† ψ) : 𝓣ᢠ(ofState Ο† * ofState ψ) = 𝓒(𝓕 |>β‚› Ο†, 𝓕 |>β‚› ψ) β€’ ofState ψ * ofState Ο† := by rw [← ofStateList_singleton, ← ofStateList_singleton, ← ofStateList_append, timeOrder_ofStateList] simp only [List.singleton_append, instCommGroup.eq_1, Algebra.smul_mul_assoc] rw [timeOrderSign_pair_not_ordered h, timeOrderList_pair_not_ordered h] simp [← ofStateList_append] lemma timeOrder_ofState_ofState_not_ordered_eq_timeOrder {Ο† ψ : 𝓕.States} (h : Β¬ timeOrderRel Ο† ψ) : 𝓣ᢠ(ofState Ο† * ofState ψ) = 𝓒(𝓕 |>β‚› Ο†, 𝓕 |>β‚› ψ) β€’ 𝓣ᢠ(ofState ψ * ofState Ο†) := by rw [timeOrder_ofState_ofState_not_ordered h] rw [timeOrder_ofState_ofState_ordered] simp only [instCommGroup.eq_1, Algebra.smul_mul_assoc] have hx := IsTotal.total (r := timeOrderRel) ψ Ο† simp_all /-- In the state algebra time, ordering obeys `T(φ₀φ₁…φₙ) = s * Ο†α΅’ * T(Ο†β‚€Ο†β‚β€¦Ο†α΅’β‚‹β‚Ο†α΅’β‚Šβ‚β€¦Ο†β‚™)` where `Ο†α΅’` is the state which has maximum time and `s` is the exchange sign of `Ο†α΅’` and `φ₀φ₁…φᡒ₋₁`. -/ lemma timeOrder_eq_maxTimeField_mul (Ο† : 𝓕.States) (Ο†s : List 𝓕.States) : 𝓣ᢠ(ofStateList (Ο† :: Ο†s)) = 𝓒(𝓕 |>β‚› maxTimeField Ο† Ο†s, 𝓕 |>β‚› (Ο† :: Ο†s).take (maxTimeFieldPos Ο† Ο†s)) β€’ ofState (maxTimeField Ο† Ο†s) * 𝓣ᢠ(ofStateList (eraseMaxTimeField Ο† Ο†s)) := by rw [timeOrder_ofStateList, timeOrderList_eq_maxTimeField_timeOrderList] rw [ofStateList_cons, timeOrder_ofStateList] simp only [instCommGroup.eq_1, Algebra.mul_smul_comm, Algebra.smul_mul_assoc, smul_smul] congr rw [timerOrderSign_of_eraseMaxTimeField, mul_assoc] simp /-- In the state algebra time, ordering obeys `T(φ₀φ₁…φₙ) = s * Ο†α΅’ * T(Ο†β‚€Ο†β‚β€¦Ο†α΅’β‚‹β‚Ο†α΅’β‚Šβ‚β€¦Ο†β‚™)` where `Ο†α΅’` is the state which has maximum time and `s` is the exchange sign of `Ο†α΅’` and `φ₀φ₁…φᡒ₋₁`. Here `s` is written using finite sets. -/ lemma timeOrder_eq_maxTimeField_mul_finset (Ο† : 𝓕.States) (Ο†s : List 𝓕.States) : 𝓣ᢠ(ofStateList (Ο† :: Ο†s)) = 𝓒(𝓕 |>β‚› maxTimeField Ο† Ο†s, 𝓕 |>β‚› ⟨(eraseMaxTimeField Ο† Ο†s).get, (Finset.filter (fun x => (maxTimeFieldPosFin Ο† Ο†s).succAbove x < maxTimeFieldPosFin Ο† Ο†s) Finset.univ)⟩) β€’ ofState (maxTimeField Ο† Ο†s) * 𝓣ᢠ(ofStateList (eraseMaxTimeField Ο† Ο†s)) := by rw [timeOrder_eq_maxTimeField_mul] congr 3 apply FieldStatistic.ofList_perm nth_rewrite 1 [← List.finRange_map_get (Ο† :: Ο†s)] simp only [List.length_cons, eraseMaxTimeField, insertionSortDropMinPos] rw [eraseIdx_get, ← List.map_take, ← List.map_map] refine List.Perm.map (Ο† :: Ο†s).get ?_ apply (List.perm_ext_iff_of_nodup _ _).mpr Β· intro i simp only [List.length_cons, maxTimeFieldPos, mem_take_finrange, Fin.val_fin_lt, List.mem_map, Finset.mem_sort, Finset.mem_filter, Finset.mem_univ, true_and, Function.comp_apply] refine Iff.intro (fun hi => ?_) (fun h => ?_) Β· have h2 := (maxTimeFieldPosFin Ο† Ο†s).2 simp only [eraseMaxTimeField, insertionSortDropMinPos, List.length_cons, Nat.succ_eq_add_one, maxTimeFieldPosFin, insertionSortMinPosFin] at h2 use ⟨i, by omega⟩ apply And.intro Β· simp only [Fin.succAbove, List.length_cons, Fin.castSucc_mk, maxTimeFieldPosFin, insertionSortMinPosFin, Nat.succ_eq_add_one, Fin.mk_lt_mk, Fin.val_fin_lt, Fin.succ_mk] rw [Fin.lt_def] split Β· simp only [Fin.val_fin_lt] omega Β· omega Β· simp only [Fin.succAbove, List.length_cons, Fin.castSucc_mk, Fin.succ_mk, Fin.ext_iff, Fin.coe_cast] split Β· simp Β· simp_all [Fin.lt_def] Β· obtain ⟨j, h1, h2⟩ := h subst h2 simp only [Fin.lt_def, Fin.coe_cast] exact h1 Β· exact List.Sublist.nodup (List.take_sublist _ _) <| List.nodup_finRange (Ο†s.length + 1) Β· refine List.Nodup.map ?_ ?_ Β· refine Function.Injective.comp ?hf.hg Fin.succAbove_right_injective exact Fin.cast_injective (eraseIdx_length (Ο† :: Ο†s) (insertionSortMinPos timeOrderRel Ο† Ο†s)) Β· exact Finset.sort_nodup (fun x1 x2 => x1 ≀ x2) (Finset.filter (fun x => (maxTimeFieldPosFin Ο† Ο†s).succAbove x < maxTimeFieldPosFin Ο† Ο†s) Finset.univ) /-! ## Norm-time order -/ /-- The normal-time ordering on `CrAnAlgebra`. -/ def normTimeOrder : CrAnAlgebra 𝓕 β†’β‚—[β„‚] CrAnAlgebra 𝓕 := Basis.constr ofCrAnListBasis β„‚ fun Ο†s => normTimeOrderSign Ο†s β€’ ofCrAnList (normTimeOrderList Ο†s) end end CrAnAlgebra end FieldSpecification