From c86974a617f4190a42d72bfd0206466619d88a20 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Wed, 22 Jan 2025 08:53:08 +0000 Subject: [PATCH] refactor: Rename OperatorAlgebra --- HepLean.lean | 6 +- .../Basic.lean | 8 +- .../NormalOrder.lean | 6 +- .../TimeContraction.lean | 8 +- .../FieldSpecification/Filters.lean | 2 +- .../FieldSpecification/NormalOrder.lean | 2 +- .../WickContraction/Basic.lean | 2 +- .../WickContraction/Involutions.lean | 2 +- .../WickContraction/IsFull.lean | 3 +- .../WickContraction/Sign.lean | 85 +++++++------------ .../WickContraction/TimeContract.lean | 20 ++--- .../WickContraction/UncontractedList.lean | 27 +++--- HepLean/PerturbationTheory/WicksTheorem.lean | 4 +- 13 files changed, 76 insertions(+), 99 deletions(-) rename HepLean/PerturbationTheory/Algebras/{OperatorAlgebra => ProtoOperatorAlgebra}/Basic.lean (97%) rename HepLean/PerturbationTheory/Algebras/{OperatorAlgebra => ProtoOperatorAlgebra}/NormalOrder.lean (99%) rename HepLean/PerturbationTheory/Algebras/{OperatorAlgebra => ProtoOperatorAlgebra}/TimeContraction.lean (95%) diff --git a/HepLean.lean b/HepLean.lean index e6509a7..393c675 100644 --- a/HepLean.lean +++ b/HepLean.lean @@ -121,9 +121,9 @@ import HepLean.Meta.TransverseTactics import HepLean.PerturbationTheory.Algebras.CrAnAlgebra.Basic import HepLean.PerturbationTheory.Algebras.CrAnAlgebra.NormalOrder import HepLean.PerturbationTheory.Algebras.CrAnAlgebra.SuperCommute -import HepLean.PerturbationTheory.Algebras.OperatorAlgebra.Basic -import HepLean.PerturbationTheory.Algebras.OperatorAlgebra.NormalOrder -import HepLean.PerturbationTheory.Algebras.OperatorAlgebra.TimeContraction +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.Basic +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.NormalOrder +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.TimeContraction import HepLean.PerturbationTheory.Algebras.StateAlgebra.Basic import HepLean.PerturbationTheory.Algebras.StateAlgebra.TimeOrder import HepLean.PerturbationTheory.CreateAnnihilate diff --git a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/Basic.lean b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/Basic.lean similarity index 97% rename from HepLean/PerturbationTheory/Algebras/OperatorAlgebra/Basic.lean rename to HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/Basic.lean index 47aada6..db2709d 100644 --- a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/Basic.lean +++ b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/Basic.lean @@ -18,7 +18,7 @@ open CrAnAlgebra to be isomorphic to the actual operator algebra of a field theory. These properties are sufficent to prove certain theorems about the Operator algebra in particular Wick's theorem. -/ -structure OperatorAlgebra where +structure ProtoOperatorAlgebra where /-- The algebra representing the operator algebra. -/ A : Type /-- The instance of the type `A` as a semi-ring. -/ @@ -43,9 +43,9 @@ structure OperatorAlgebra where (_ : ยฌ (๐“• |>โ‚› ฯ†) = (๐“• |>โ‚› ฯ†')), crAnF (superCommute (ofCrAnState ฯ†) (ofCrAnState ฯ†')) = 0 -namespace OperatorAlgebra +namespace ProtoOperatorAlgebra open FieldStatistic -variable {๐“• : FieldSpecification} (๐“ž : ๐“•.OperatorAlgebra) +variable {๐“• : FieldSpecification} (๐“ž : ๐“•.ProtoOperatorAlgebra) /-- The algebra `๐“ž.A` carries the instance of a semi-ring induced via `A_seimRing`. -/ instance : Semiring ๐“ž.A := ๐“ž.A_semiRing @@ -198,5 +198,5 @@ lemma crAnF_superCommute_ofCrAnState_ofStateList_eq_sum (ฯ† : ๐“•.CrAnStates) ( ยท congr rw [โ† map_mul, โ† ofStateList_append, โ† List.eraseIdx_eq_take_drop_succ] -end OperatorAlgebra +end ProtoOperatorAlgebra end FieldSpecification diff --git a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/NormalOrder.lean b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean similarity index 99% rename from HepLean/PerturbationTheory/Algebras/OperatorAlgebra/NormalOrder.lean rename to HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean index 2f2501d..0c5a538 100644 --- a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/NormalOrder.lean +++ b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean @@ -14,8 +14,8 @@ import HepLean.PerturbationTheory.Koszul.KoszulSign namespace FieldSpecification variable {๐“• : FieldSpecification} -namespace OperatorAlgebra -variable {๐“ž : OperatorAlgebra ๐“•} +namespace ProtoOperatorAlgebra +variable {๐“ž : ProtoOperatorAlgebra ๐“•} open CrAnAlgebra open FieldStatistic @@ -390,6 +390,6 @@ lemma crAnF_ofState_normalOrder_insert (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.State rw [โ† ofStateList_append, โ† ofStateList_append] simp -end OperatorAlgebra +end ProtoOperatorAlgebra end FieldSpecification diff --git a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/TimeContraction.lean b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/TimeContraction.lean similarity index 95% rename from HepLean/PerturbationTheory/Algebras/OperatorAlgebra/TimeContraction.lean rename to HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/TimeContraction.lean index 7c9be94..b854bd8 100644 --- a/HepLean/PerturbationTheory/Algebras/OperatorAlgebra/TimeContraction.lean +++ b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/TimeContraction.lean @@ -3,7 +3,7 @@ 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.Algebras.OperatorAlgebra.NormalOrder +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.NormalOrder import HepLean.PerturbationTheory.Algebras.StateAlgebra.TimeOrder /-! @@ -19,9 +19,9 @@ variable {๐“• : FieldSpecification} open CrAnAlgebra noncomputable section -namespace OperatorAlgebra +namespace ProtoOperatorAlgebra -variable (๐“ž : ๐“•.OperatorAlgebra) +variable (๐“ž : ๐“•.ProtoOperatorAlgebra) open FieldStatistic /-- The time contraction of two States as an element of `๐“ž.A` defined @@ -86,7 +86,7 @@ lemma timeContract_zero_of_diff_grade (ฯ† ฯˆ : ๐“•.States) (h : (๐“• |>โ‚› ฯ†) have ht := IsTotal.total (r := ๐“•.timeOrderRel) ฯ† ฯˆ simp_all -end OperatorAlgebra +end ProtoOperatorAlgebra end end FieldSpecification diff --git a/HepLean/PerturbationTheory/FieldSpecification/Filters.lean b/HepLean/PerturbationTheory/FieldSpecification/Filters.lean index 4ce9bff..b4316c8 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/Filters.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/Filters.lean @@ -3,7 +3,7 @@ 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.Algebras.OperatorAlgebra.Basic +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.Basic import HepLean.PerturbationTheory.Koszul.KoszulSign /-! diff --git a/HepLean/PerturbationTheory/FieldSpecification/NormalOrder.lean b/HepLean/PerturbationTheory/FieldSpecification/NormalOrder.lean index 4d63127..c7bfac4 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/NormalOrder.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/NormalOrder.lean @@ -3,7 +3,7 @@ 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.Algebras.OperatorAlgebra.Basic +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.Basic import HepLean.PerturbationTheory.Koszul.KoszulSign import HepLean.PerturbationTheory.FieldSpecification.Filters /-! diff --git a/HepLean/PerturbationTheory/WickContraction/Basic.lean b/HepLean/PerturbationTheory/WickContraction/Basic.lean index 52ceed0..c6eec58 100644 --- a/HepLean/PerturbationTheory/WickContraction/Basic.lean +++ b/HepLean/PerturbationTheory/WickContraction/Basic.lean @@ -3,7 +3,7 @@ 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.Algebras.OperatorAlgebra.NormalOrder +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.NormalOrder import HepLean.Mathematics.List.InsertIdx /-! diff --git a/HepLean/PerturbationTheory/WickContraction/Involutions.lean b/HepLean/PerturbationTheory/WickContraction/Involutions.lean index 96343aa..e5961ee 100644 --- a/HepLean/PerturbationTheory/WickContraction/Involutions.lean +++ b/HepLean/PerturbationTheory/WickContraction/Involutions.lean @@ -5,7 +5,7 @@ Authors: Joseph Tooby-Smith -/ import HepLean.PerturbationTheory.WickContraction.Uncontracted import HepLean.PerturbationTheory.Algebras.StateAlgebra.TimeOrder -import HepLean.PerturbationTheory.Algebras.OperatorAlgebra.TimeContraction +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.TimeContraction import HepLean.PerturbationTheory.WickContraction.InsertList /-! diff --git a/HepLean/PerturbationTheory/WickContraction/IsFull.lean b/HepLean/PerturbationTheory/WickContraction/IsFull.lean index 7a3d8a0..8eb6a9d 100644 --- a/HepLean/PerturbationTheory/WickContraction/IsFull.lean +++ b/HepLean/PerturbationTheory/WickContraction/IsFull.lean @@ -19,6 +19,7 @@ namespace WickContraction variable {n : โ„•} (c : WickContraction n) open HepLean.List open FieldStatistic +open Nat /-- A contraction is full if there are no uncontracted fields, i.e. the finite set of uncontracted fields is empty. -/ @@ -46,8 +47,6 @@ def isFullInvolutionEquiv : {c : WickContraction n // IsFull c} โ‰ƒ left_inv c := by simp right_inv f := by simp -open Nat - /-- If `n` is even then the number of full contractions is `(n-1)!!`. -/ theorem card_of_isfull_even (he : Even n) : Fintype.card {c : WickContraction n // IsFull c} = (n - 1)โ€ผ := by diff --git a/HepLean/PerturbationTheory/WickContraction/Sign.lean b/HepLean/PerturbationTheory/WickContraction/Sign.lean index 8840615..7804cfc 100644 --- a/HepLean/PerturbationTheory/WickContraction/Sign.lean +++ b/HepLean/PerturbationTheory/WickContraction/Sign.lean @@ -85,8 +85,7 @@ lemma signFinset_insertList_none (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) lemma stat_ofFinset_of_insertListLiftFinset (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (i : Fin ฯ†s.length.succ) (a : Finset (Fin ฯ†s.length)) : - (๐“• |>โ‚› โŸจ(ฯ†s.insertIdx i ฯ†).get, insertListLiftFinset ฯ† i aโŸฉ) = - ๐“• |>โ‚› โŸจฯ†s.get, aโŸฉ := by + (๐“• |>โ‚› โŸจ(ฯ†s.insertIdx i ฯ†).get, insertListLiftFinset ฯ† i aโŸฉ) = ๐“• |>โ‚› โŸจฯ†s.get, aโŸฉ := by simp only [ofFinset, Nat.succ_eq_add_one] congr 1 rw [get_eq_insertIdx_succAbove ฯ† _ i] @@ -823,8 +822,7 @@ lemma stat_signFinset_insert_some_self_fst simpa [Option.get_map] using hy2 lemma stat_signFinset_insert_some_self_snd (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) - (c : WickContraction ฯ†s.length) - (i : Fin ฯ†s.length.succ) (j : c.uncontracted) : + (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (j : c.uncontracted) : (๐“• |>โ‚› โŸจ(ฯ†s.insertIdx i ฯ†).get, (signFinset (c.insertList ฯ† ฯ†s i (some j)) (finCongr (insertIdx_length_fin ฯ† ฯ†s i).symm (i.succAbove j)) @@ -832,8 +830,7 @@ lemma stat_signFinset_insert_some_self_snd (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.S ๐“• |>โ‚› โŸจฯ†s.get, (Finset.univ.filter (fun x => j < x โˆง i.succAbove x < i โˆง ((c.getDual? x = none) โˆจ โˆ€ (h : (c.getDual? x).isSome), j < ((c.getDual? x).get h))))โŸฉ := by - rw [get_eq_insertIdx_succAbove ฯ† _ i] - rw [ofFinset_finset_map] + rw [get_eq_insertIdx_succAbove ฯ† _ i, ofFinset_finset_map] swap refine (Equiv.comp_injective i.succAbove (finCongr (Eq.symm (insertIdx_length_fin ฯ† ฯ†s i)))).mpr ?hi.a @@ -905,55 +902,43 @@ lemma stat_signFinset_insert_some_self_snd (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.S exact Fin.succAbove_lt_succAbove_iff.mpr hy2 lemma signInsertSomeCoef_eq_finset (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) - (c : WickContraction ฯ†s.length) - (i : Fin ฯ†s.length.succ) (j : c.uncontracted) (hฯ†j : (๐“• |>โ‚› ฯ†) = (๐“• |>โ‚› ฯ†s[j.1])) : - c.signInsertSomeCoef ฯ† ฯ†s i j = + (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (j : c.uncontracted) + (hฯ†j : (๐“• |>โ‚› ฯ†) = (๐“• |>โ‚› ฯ†s[j.1])) : c.signInsertSomeCoef ฯ† ฯ†s i j = if i < i.succAbove j then - ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, - (Finset.univ.filter (fun x => i < i.succAbove x โˆง x < j โˆง ((c.getDual? x = none) โˆจ - โˆ€ (h : (c.getDual? x).isSome), i < i.succAbove ((c.getDual? x).get h))))โŸฉ) else - ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, - (Finset.univ.filter (fun x => j < x โˆง i.succAbove x < i โˆง ((c.getDual? x = none) โˆจ - โˆ€ (h : (c.getDual? x).isSome), j < ((c.getDual? x).get h))))โŸฉ) := by - rw [signInsertSomeCoef_if] - rw [stat_signFinset_insert_some_self_snd] - rw [stat_signFinset_insert_some_self_fst] + ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, + (Finset.univ.filter (fun x => i < i.succAbove x โˆง x < j โˆง ((c.getDual? x = none) โˆจ + โˆ€ (h : (c.getDual? x).isSome), i < i.succAbove ((c.getDual? x).get h))))โŸฉ) + else + ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, + (Finset.univ.filter (fun x => j < x โˆง i.succAbove x < i โˆง ((c.getDual? x = none) โˆจ + โˆ€ (h : (c.getDual? x).isSome), j < ((c.getDual? x).get h))))โŸฉ) := by + rw [signInsertSomeCoef_if, stat_signFinset_insert_some_self_snd, + stat_signFinset_insert_some_self_fst] simp [hฯ†j] lemma signInsertSome_mul_filter_contracted_of_lt (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (k : c.uncontracted) - (hk : i.succAbove k < i) - (hg : GradingCompliant ฯ†s c โˆง ๐“•.statesStatistic ฯ† = ๐“•.statesStatistic ฯ†s[k.1]) : + (hk : i.succAbove k < i) (hg : GradingCompliant ฯ†s c โˆง (๐“• |>โ‚› ฯ†) = ๐“• |>โ‚› ฯ†s[k.1]) : signInsertSome ฯ† ฯ†s c i k * ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, c.uncontracted.filter (fun x => x โ‰ค โ†‘k)โŸฉ) = ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, Finset.univ.filter (fun x => i.succAbove x < i)โŸฉ) := by - rw [signInsertSome, signInsertSomeProd_eq_finset, signInsertSomeCoef_eq_finset] - rw [if_neg (by omega), โ† map_mul, โ† map_mul] + rw [signInsertSome, signInsertSomeProd_eq_finset (hฯ†j := hg.2) (hg := hg.1), + signInsertSomeCoef_eq_finset (hฯ†j := hg.2), if_neg (by omega), โ† map_mul, โ† map_mul] congr 1 rw [mul_eq_iff_eq_mul, ofFinset_union_disjoint] swap - ยท rw [Finset.disjoint_filter] + ยท /- Disjointness needed for `ofFinset_union_disjoint`. -/ + rw [Finset.disjoint_filter] intro j _ h simp only [Nat.succ_eq_add_one, not_lt, not_and, not_forall, not_or, not_le] intro h1 use h1 omega - trans ๐“• |>โ‚› โŸจฯ†s.get, (Finset.filter (fun x => - (โ†‘k < x โˆง i.succAbove x < i โˆง (c.getDual? x = none โˆจ - โˆ€ (h : (c.getDual? x).isSome = true), โ†‘k < (c.getDual? x).get h)) - โˆจ ((c.getDual? x).isSome = true โˆง - โˆ€ (h : (c.getDual? x).isSome = true), x < โ†‘k โˆง - (i.succAbove x < i โˆง i < i.succAbove ((c.getDual? x).get h) โˆจ - โ†‘k < (c.getDual? x).get h โˆง ยฌi.succAbove x < i))) Finset.univ)โŸฉ - ยท congr - ext j - simp rw [ofFinset_union, โ† mul_eq_one_iff, ofFinset_union] simp only [Nat.succ_eq_add_one, not_lt] - apply stat_ofFinset_eq_one_of_gradingCompliant - ยท exact hg.1 - /- the getDual? is none case-/ - ยท intro j hn + apply stat_ofFinset_eq_one_of_gradingCompliant _ _ _ hg.1 + ยท /- The `c.getDual? i = none` case for `stat_ofFinset_eq_one_of_gradingCompliant`. -/ + intro j hn simp only [uncontracted, Finset.mem_sdiff, Finset.mem_union, Finset.mem_filter, Finset.mem_univ, hn, Option.isSome_none, Bool.false_eq_true, IsEmpty.forall_iff, or_self, and_true, or_false, true_and, and_self, Finset.mem_inter, not_and, not_lt, Classical.not_imp, not_le, and_imp] @@ -978,8 +963,8 @@ lemma signInsertSome_mul_filter_contracted_of_lt (ฯ† : ๐“•.States) (ฯ†s : List apply Fin.ne_succAbove i j omega ยท exact h1' - /- the getDual? is some case-/ - ยท intro j hj + ยท /- The `(c.getDual? i).isSome` case for `stat_ofFinset_eq_one_of_gradingCompliant`. -/ + intro j hj have hn : ยฌ c.getDual? j = none := by exact Option.isSome_iff_ne_none.mp hj simp only [uncontracted, Finset.mem_sdiff, Finset.mem_union, Finset.mem_filter, Finset.mem_univ, hn, hj, forall_true_left, false_or, true_and, and_false, false_and, Finset.mem_inter, @@ -1033,28 +1018,24 @@ lemma signInsertSome_mul_filter_contracted_of_lt (ฯ† : ๐“•.States) (ฯ†s : List ยท simp_all only [Fin.getElem_fin, ne_eq, not_lt, false_and, false_or, or_false, and_self, or_true, imp_self] omega - ยท exact hg.2 - ยท exact hg.2 - ยท exact hg.1 lemma signInsertSome_mul_filter_contracted_of_not_lt (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (k : c.uncontracted) - (hk : ยฌ i.succAbove k < i) - (hg : GradingCompliant ฯ†s c โˆง ๐“•.statesStatistic ฯ† = ๐“•.statesStatistic ฯ†s[k.1]) : + (hk : ยฌ i.succAbove k < i) (hg : GradingCompliant ฯ†s c โˆง (๐“• |>โ‚› ฯ†) = ๐“• |>โ‚› ฯ†s[k.1]) : signInsertSome ฯ† ฯ†s c i k * ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, c.uncontracted.filter (fun x => x < โ†‘k)โŸฉ) = ๐“ข(๐“• |>โ‚› ฯ†, ๐“• |>โ‚› โŸจฯ†s.get, Finset.univ.filter (fun x => i.succAbove x < i)โŸฉ) := by have hik : i.succAbove โ†‘k โ‰  i := by exact Fin.succAbove_ne i โ†‘k - rw [signInsertSome, signInsertSomeProd_eq_finset, signInsertSomeCoef_eq_finset] - rw [if_pos (by omega), โ† map_mul, โ† map_mul] + rw [signInsertSome, signInsertSomeProd_eq_finset (hฯ†j := hg.2) (hg := hg.1), + signInsertSomeCoef_eq_finset (hฯ†j := hg.2), if_pos (by omega), โ† map_mul, โ† map_mul] congr 1 rw [mul_eq_iff_eq_mul, ofFinset_union, ofFinset_union] apply (mul_eq_one_iff _ _).mp rw [ofFinset_union] simp only [Nat.succ_eq_add_one, not_lt] - apply stat_ofFinset_eq_one_of_gradingCompliant - ยท exact hg.1 - ยท intro j hj + apply stat_ofFinset_eq_one_of_gradingCompliant _ _ _ hg.1 + ยท /- The `c.getDual? i = none` case for `stat_ofFinset_eq_one_of_gradingCompliant`. -/ + intro j hj have hijsucc : i.succAbove j โ‰  i := by exact Fin.succAbove_ne i j simp only [uncontracted, Finset.mem_sdiff, Finset.mem_union, Finset.mem_filter, Finset.mem_univ, hj, Option.isSome_none, Bool.false_eq_true, IsEmpty.forall_iff, or_self, and_true, true_and, @@ -1072,7 +1053,8 @@ lemma signInsertSome_mul_filter_contracted_of_not_lt (ฯ† : ๐“•.States) (ฯ†s : L omega simp only [hij, true_and] at h โŠข omega - ยท intro j hj + ยท /- The `(c.getDual? i).isSome` case for `stat_ofFinset_eq_one_of_gradingCompliant`. -/ + intro j hj have hn : ยฌ c.getDual? j = none := by exact Option.isSome_iff_ne_none.mp hj have hijSuc : i.succAbove j โ‰  i := by exact Fin.succAbove_ne i j have hkneqj : โ†‘k โ‰  j := by @@ -1136,8 +1118,5 @@ lemma signInsertSome_mul_filter_contracted_of_not_lt (ฯ† : ๐“•.States) (ฯ†s : L simp only [hijn, true_and, hijn', and_false, or_false, or_true, imp_false, not_lt, forall_const] exact fun h => lt_of_le_of_ne h (Fin.succAbove_ne i ((c.getDual? j).get hj)) - ยท exact hg.2 - ยท exact hg.2 - ยท exact hg.1 end WickContraction diff --git a/HepLean/PerturbationTheory/WickContraction/TimeContract.lean b/HepLean/PerturbationTheory/WickContraction/TimeContract.lean index fef33ad..260eeb3 100644 --- a/HepLean/PerturbationTheory/WickContraction/TimeContract.lean +++ b/HepLean/PerturbationTheory/WickContraction/TimeContract.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ import HepLean.PerturbationTheory.WickContraction.Sign -import HepLean.PerturbationTheory.Algebras.OperatorAlgebra.TimeContraction +import HepLean.PerturbationTheory.Algebras.ProtoOperatorAlgebra.TimeContraction /-! # Time contractions @@ -27,14 +27,14 @@ open HepLean.List /-- Given a Wick contraction `c` associated with a list `ฯ†s`, the product of all time-contractions of pairs of contracted elements in `ฯ†s`, as a member of the center of `๐“ž.A`. -/ -noncomputable def timeContract (๐“ž : ๐“•.OperatorAlgebra) {ฯ†s : List ๐“•.States} +noncomputable def timeContract (๐“ž : ๐“•.ProtoOperatorAlgebra) {ฯ†s : List ๐“•.States} (c : WickContraction ฯ†s.length) : Subalgebra.center โ„‚ ๐“ž.A := โˆ (a : c.1), โŸจ๐“ž.timeContract (ฯ†s.get (c.fstFieldOfContract a)) (ฯ†s.get (c.sndFieldOfContract a)), ๐“ž.timeContract_mem_center _ _โŸฉ @[simp] -lemma timeContract_insertList_none (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) +lemma timeContract_insertList_none (๐“ž : ๐“•.ProtoOperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) : (c.insertList ฯ† ฯ†s i none).timeContract ๐“ž = c.timeContract ๐“ž := by rw [timeContract, insertList_none_prod_contractions] @@ -42,7 +42,7 @@ lemma timeContract_insertList_none (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.Stat ext a simp -lemma timeConract_insertList_some (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) +lemma timeConract_insertList_some (๐“ž : ๐“•.ProtoOperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (j : c.uncontracted) : (c.insertList ฯ† ฯ†s i (some j)).timeContract ๐“ž = (if i < i.succAbove j then @@ -62,7 +62,7 @@ lemma timeConract_insertList_some (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.State open FieldStatistic lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_lt - (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) + (๐“ž : ๐“•.ProtoOperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (k : c.uncontracted) (ht : ๐“•.timeOrderRel ฯ† ฯ†s[k.1]) (hik : i < i.succAbove k) : (c.insertList ฯ† ฯ†s i (some k)).timeContract ๐“ž = @@ -71,7 +71,7 @@ lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_lt ((uncontractedStatesEquiv ฯ†s c) (some k)) * c.timeContract ๐“ž) := by rw [timeConract_insertList_some] simp only [Nat.succ_eq_add_one, Fin.getElem_fin, ite_mul, instCommGroup.eq_1, - OperatorAlgebra.contractStateAtIndex, uncontractedStatesEquiv, Equiv.optionCongr_apply, + ProtoOperatorAlgebra.contractStateAtIndex, uncontractedStatesEquiv, Equiv.optionCongr_apply, Equiv.coe_trans, Option.map_some', Function.comp_apply, finCongr_apply, Fin.coe_cast, List.getElem_map, uncontractedList_getElem_uncontractedIndexEquiv_symm, List.get_eq_getElem, Algebra.smul_mul_assoc] @@ -97,7 +97,7 @@ lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_lt ยท exact ht lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_not_lt - (๐“ž : ๐“•.OperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) + (๐“ž : ๐“•.ProtoOperatorAlgebra) (ฯ† : ๐“•.States) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (i : Fin ฯ†s.length.succ) (k : c.uncontracted) (ht : ยฌ ๐“•.timeOrderRel ฯ†s[k.1] ฯ†) (hik : ยฌ i < i.succAbove k) : (c.insertList ฯ† ฯ†s i (some k)).timeContract ๐“ž = @@ -106,7 +106,7 @@ lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_not_lt ((uncontractedStatesEquiv ฯ†s c) (some k)) * c.timeContract ๐“ž) := by rw [timeConract_insertList_some] simp only [Nat.succ_eq_add_one, Fin.getElem_fin, ite_mul, instCommGroup.eq_1, - OperatorAlgebra.contractStateAtIndex, uncontractedStatesEquiv, Equiv.optionCongr_apply, + ProtoOperatorAlgebra.contractStateAtIndex, uncontractedStatesEquiv, Equiv.optionCongr_apply, Equiv.coe_trans, Option.map_some', Function.comp_apply, finCongr_apply, Fin.coe_cast, List.getElem_map, uncontractedList_getElem_uncontractedIndexEquiv_symm, List.get_eq_getElem, Algebra.smul_mul_assoc] @@ -148,7 +148,7 @@ lemma timeConract_insertList_some_eq_mul_contractStateAtIndex_not_lt simp_all only [Fin.getElem_fin, Nat.succ_eq_add_one, not_lt, false_or] exact ht -lemma timeContract_of_not_gradingCompliant (๐“ž : ๐“•.OperatorAlgebra) (ฯ†s : List ๐“•.States) +lemma timeContract_of_not_gradingCompliant (๐“ž : ๐“•.ProtoOperatorAlgebra) (ฯ†s : List ๐“•.States) (c : WickContraction ฯ†s.length) (h : ยฌ GradingCompliant ฯ†s c) : c.timeContract ๐“ž = 0 := by rw [timeContract] @@ -159,7 +159,7 @@ lemma timeContract_of_not_gradingCompliant (๐“ž : ๐“•.OperatorAlgebra) (ฯ†s : simp only [Finset.univ_eq_attach, Finset.mem_attach] apply Subtype.eq simp only [List.get_eq_getElem, ZeroMemClass.coe_zero] - rw [OperatorAlgebra.timeContract_zero_of_diff_grade] + rw [ProtoOperatorAlgebra.timeContract_zero_of_diff_grade] simp [ha2] end WickContraction diff --git a/HepLean/PerturbationTheory/WickContraction/UncontractedList.lean b/HepLean/PerturbationTheory/WickContraction/UncontractedList.lean index bd2b4a0..fafc8c3 100644 --- a/HepLean/PerturbationTheory/WickContraction/UncontractedList.lean +++ b/HepLean/PerturbationTheory/WickContraction/UncontractedList.lean @@ -497,19 +497,18 @@ lemma orderedInsert_succAboveEmb_uncontractedList_eq_insertIdx (c : WickContract (List.orderedInsert (ยท โ‰ค ยท) i (List.map i.succAboveEmb c.uncontractedList)) = (List.map i.succAboveEmb c.uncontractedList).insertIdx (uncontractedListOrderPos c i) i := by rw [orderedInsert_eq_insertIdx_of_fin_list_sorted] - swap - exact uncontractedList_succAboveEmb_sorted c i - congr 1 - simp only [Nat.succ_eq_add_one, Fin.val_fin_lt, Fin.coe_succAboveEmb, uncontractedListOrderPos] - rw [List.filter_map] - simp only [List.length_map] - congr - funext x - simp only [Function.comp_apply, Fin.succAbove, decide_eq_decide] - split - simp only [Fin.lt_def, Fin.coe_castSucc] - rename_i h - simp_all only [Fin.lt_def, Fin.coe_castSucc, not_lt, Fin.val_succ] - omega + ยท congr 1 + simp only [Nat.succ_eq_add_one, Fin.val_fin_lt, Fin.coe_succAboveEmb, uncontractedListOrderPos] + rw [List.filter_map] + simp only [List.length_map] + congr + funext x + simp only [Function.comp_apply, Fin.succAbove, decide_eq_decide] + split + ยท simp only [Fin.lt_def, Fin.coe_castSucc] + ยท rename_i h + simp_all only [Fin.lt_def, Fin.coe_castSucc, not_lt, Fin.val_succ] + omega + ยท exact uncontractedList_succAboveEmb_sorted c i end WickContraction diff --git a/HepLean/PerturbationTheory/WicksTheorem.lean b/HepLean/PerturbationTheory/WicksTheorem.lean index 9c43e9f..cdb4a11 100644 --- a/HepLean/PerturbationTheory/WicksTheorem.lean +++ b/HepLean/PerturbationTheory/WicksTheorem.lean @@ -16,10 +16,10 @@ Wick's theorem is related to Isserlis' theorem in mathematics. -/ namespace FieldSpecification -variable {๐“• : FieldSpecification} {๐“ž : ๐“•.OperatorAlgebra} +variable {๐“• : FieldSpecification} {๐“ž : ๐“•.ProtoOperatorAlgebra} open CrAnAlgebra open StateAlgebra -open OperatorAlgebra +open ProtoOperatorAlgebra open HepLean.List open WickContraction open FieldStatistic