From 7fbf2284683d02beeb56fd76bdbdb9432ce5bb3e Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:18:02 +0000 Subject: [PATCH] feat: Wick contraction docs --- .../ProtoOperatorAlgebra/NormalOrder.lean | 9 ++ .../Algebras/StateAlgebra/TimeOrder.lean | 53 +++++++++++ .../FieldSpecification/Examples.lean | 13 ++- HepLean/PerturbationTheory/WicksTheorem.lean | 94 +++++++++---------- docs/CuratedNotes/PerturbationTheory.html | 3 +- scripts/MetaPrograms/notes.lean | 47 ++++++++-- 6 files changed, 154 insertions(+), 65 deletions(-) diff --git a/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean index 87905b6..de00e2a 100644 --- a/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean +++ b/HepLean/PerturbationTheory/Algebras/ProtoOperatorAlgebra/NormalOrder.lean @@ -356,6 +356,11 @@ noncomputable def contractStateAtIndex (Ο : π.States) (Οs : List π.State | some n => π’(π |>β Ο, π |>β (Οs.take n)) β’ π.crAnF (β¨anPart (StateAlgebra.ofState Ο), ofState Οs[n]β©βca) +/-- +Within a proto-operator algebra, +`Ο * N(ΟβΟββ¦Οβ) = N(ΟΟβΟββ¦Οβ) + β i, (sα΅’ β’ [anPart Ο, Οα΅’]β) * N(ΟβΟββ¦Οα΅’ββΟα΅’βββ¦Οβ)`, +where `sβ` is the exchange sign for `Ο` and `ΟβΟββ¦Οα΅’ββ`. +-/ lemma crAnF_ofState_mul_normalOrder_ofStatesList_eq_sum (Ο : π.States) (Οs : List π.States) : π.crAnF (ofState Ο * normalOrder (ofStateList Οs)) = @@ -374,6 +379,10 @@ lemma crAnF_ofState_mul_normalOrder_ofStatesList_eq_sum (Ο : π.States) -/ +/-- +Within a proto-operator algebra, `N(ΟΟβΟββ¦Οβ) = s β’ N(Οββ¦ΟβββΟΟββ¦Οβ)`, where +`s` is the exchange sign for `Ο` and `Οββ¦Οβββ`. +-/ lemma crAnF_ofState_normalOrder_insert (Ο : π.States) (Οs : List π.States) (k : Fin Οs.length.succ) : π.crAnF (normalOrder (ofStateList (Ο :: Οs))) = diff --git a/HepLean/PerturbationTheory/Algebras/StateAlgebra/TimeOrder.lean b/HepLean/PerturbationTheory/Algebras/StateAlgebra/TimeOrder.lean index 07740e3..7f349fb 100644 --- a/HepLean/PerturbationTheory/Algebras/StateAlgebra/TimeOrder.lean +++ b/HepLean/PerturbationTheory/Algebras/StateAlgebra/TimeOrder.lean @@ -18,6 +18,7 @@ noncomputable section namespace StateAlgebra open FieldStatistic +open HepLean.List /-- The linear map on the free state algebra defined as the map taking a list of states to the time-ordered list of states multiplied by @@ -64,6 +65,8 @@ lemma timeOrder_ofState_ofState_not_ordered_eq_timeOrder {Ο Ο : π.States} ( 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) : timeOrder (ofList (Ο :: Οs)) = π’(π |>β maxTimeField Ο Οs, π |>β (Ο :: Οs).take (maxTimeFieldPos Ο Οs)) β’ @@ -75,6 +78,56 @@ lemma timeOrder_eq_maxTimeField_mul (Ο : π.States) (Οs : List π.States) 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) : + timeOrder (ofList (Ο :: Οs)) = π’(π |>β maxTimeField Ο Οs, π |>β β¨(eraseMaxTimeField Ο Οs).get, + (Finset.filter (fun x => + (maxTimeFieldPosFin Ο Οs).succAbove x < maxTimeFieldPosFin Ο Οs) Finset.univ)β©) β’ + StateAlgebra.ofState (maxTimeField Ο Οs) * timeOrder (ofList (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) + end StateAlgebra end end FieldSpecification diff --git a/HepLean/PerturbationTheory/FieldSpecification/Examples.lean b/HepLean/PerturbationTheory/FieldSpecification/Examples.lean index c93cbbb..c1461dc 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/Examples.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/Examples.lean @@ -13,18 +13,23 @@ import HepLean.PerturbationTheory.FieldSpecification.Basic namespace FieldSpecification variable (π : FieldSpecification) -/-- The Field specification corresponding to a single bosonic field. -/ +/-- The Field specification corresponding to a single bosonic field. + The type of fields is the unit type, and the statistic of the unique element of the unit + type is bosonic. -/ def singleBoson : FieldSpecification where Fields := Unit statistics := fun _ => FieldStatistic.bosonic -/-- The Field specification corresponding to a single fermionic field. -/ +/-- The Field specification corresponding to a single fermionic field. + The type of fields is the unit type, and the statistic of the unique element of the unit + type is fermionic. -/ def singleFermion : FieldSpecification where Fields := Unit statistics := fun _ => FieldStatistic.fermionic -/-- The Field specification corresponding to a two bosonic field and - two fermionic fields. -/ +/-- The Field specification corresponding to two bosonic fields and two fermionic fields. + The type of fields is `Fin 2 β Fin 2`, and the statistic of the two `.inl` (left) elements + is bosonic and the statistic of the two `.inr` (right) elements is fermionic. -/ def doubleBosonDoubleFermion : FieldSpecification where Fields := Fin 2 β Fin 2 statistics := fun b => diff --git a/HepLean/PerturbationTheory/WicksTheorem.lean b/HepLean/PerturbationTheory/WicksTheorem.lean index 9f3f786..e02512f 100644 --- a/HepLean/PerturbationTheory/WicksTheorem.lean +++ b/HepLean/PerturbationTheory/WicksTheorem.lean @@ -25,6 +25,11 @@ open HepLean.List open WickContraction open FieldStatistic +/-- +Let `c` be a Wick Contraction for `ΟβΟββ¦Οβ`. +We have (roughly) `N(c.insertList Ο Οs i none).uncontractedList = s β’ N(Ο * c.uncontractedList)` +Where `s` is the exchange sign for `Ο` and the uncontracted fields in `ΟβΟββ¦Οα΅’`. +-/ lemma insertList_none_normalOrder (Ο : π.States) (Οs : List π.States) (i : Fin Οs.length.succ) (c : WickContraction Οs.length) : π.crAnF (normalOrder (ofStateList (List.map (Οs.insertIdx i Ο).get @@ -91,6 +96,12 @@ lemma insertList_none_normalOrder (Ο : π.States) (Οs : List π.States) simp only [Nat.succ_eq_add_one] rw [insertList_uncontractedList_none_map] +/-- +Let `c` be a Wick Contraction for `ΟβΟββ¦Οβ`. +We have (roughly) `N(c.insertList Ο Οs i k).uncontractedList` +is equal to `N((c.uncontractedList).eraseIdx k')` +where `k'` is the position in `c.uncontractedList` corresponding to `k`. +-/ lemma insertList_some_normalOrder (Ο : π.States) (Οs : List π.States) (i : Fin Οs.length.succ) (c : WickContraction Οs.length) (k : c.uncontracted) : π.crAnF (normalOrder (ofStateList (List.map (Οs.insertIdx i Ο).get @@ -107,6 +118,12 @@ lemma insertList_some_normalOrder (Ο : π.States) (Οs : List π.States) congr conv_rhs => rw [get_eq_insertIdx_succAbove Ο Οs i] +/-- +Let `c` be a Wick Contraction for `ΟβΟββ¦Οβ`. +This lemma states that `(c.sign β’ c.timeContract π) * N(c.uncontracted)` +for `c` equal to `c.insertList Ο Οs i none` is equal to that for just `c` +mulitiplied by the exchange sign of `Ο` and `ΟβΟββ¦Οα΅’ββ`. +-/ lemma sign_timeContract_normalOrder_insertList_none (Ο : π.States) (Οs : List π.States) (i : Fin Οs.length.succ) (c : WickContraction Οs.length) : (c.insertList Ο Οs i none).sign β’ (c.insertList Ο Οs i none).timeContract π @@ -150,6 +167,13 @@ lemma sign_timeContract_normalOrder_insertList_none (Ο : π.States) (Οs : Li simp only [ZeroMemClass.coe_zero, zero_mul, smul_zero] exact hg +/-- +Let `c` be a Wick Contraction for `ΟβΟββ¦Οβ`. +This lemma states that +`(c.sign β’ c.timeContract π) * N(c.uncontracted)` +for `c` equal to `c.insertList Ο Οs i (some k)` is equal to that for just `c` +mulitiplied by the exchange sign of `Ο` and `ΟβΟββ¦Οα΅’ββ`. +-/ lemma sign_timeContract_normalOrder_insertList_some (Ο : π.States) (Οs : List π.States) (i : Fin Οs.length.succ) (c : WickContraction Οs.length) (k : c.uncontracted) (hlt : β (k : Fin Οs.length), timeOrderRel Ο Οs[k]) @@ -214,6 +238,15 @@ lemma sign_timeContract_normalOrder_insertList_some (Ο : π.States) (Οs : Li zero_mul, instCommGroup.eq_1] exact hg' +/-- +Let `c` be a Wick Contraction for `ΟβΟββ¦Οβ`. +This lemma states that +`(c.sign β’ c.timeContract π) * N(c.uncontracted)` +is equal to the sum of +`(c'.sign β’ c'.timeContract π) * N(c'.uncontracted)` +for all `c' = (c.insertList Ο Οs i k)` for `k : Option (c.uncontracted)`, multiplied by +the exchange sign of `Ο` and `ΟβΟββ¦Οα΅’ββ`. +-/ lemma mul_sum_contractions (Ο : π.States) (Οs : List π.States) (i : Fin Οs.length.succ) (c : WickContraction Οs.length) (hlt : β (k : Fin Οs.length), timeOrderRel Ο Οs[k]) (hn : β (k : Fin Οs.length), i.succAbove k < i β Β¬timeOrderRel Οs[k] Ο) : @@ -226,8 +259,7 @@ lemma mul_sum_contractions (Ο : π.States) (Οs : List π.States) (i : Fin (ofStateList ((c.insertList Ο Οs i k).uncontractedList.map (Οs.insertIdx i Ο).get)))) := by rw [crAnF_ofState_mul_normalOrder_ofStatesList_eq_sum, Finset.mul_sum, uncontractedStatesEquiv_list_sum, Finset.smul_sum] - simp only [Finset.univ_eq_attach, instCommGroup.eq_1, - Nat.succ_eq_add_one, timeContract_insertList_none] + simp only [instCommGroup.eq_1, Nat.succ_eq_add_one] congr 1 funext n match n with @@ -261,54 +293,6 @@ lemma wicks_theorem_congr {Οs Οs' : List π.States} (h : Οs = Οs') : subst h simp -lemma timeOrder_eq_maxTimeField_mul_finset (Ο : π.States) (Οs : List π.States) : - timeOrder (ofList (Ο :: Οs)) = π’(π |>β maxTimeField Ο Οs, π |>β β¨(eraseMaxTimeField Ο Οs).get, - (Finset.filter (fun x => - (maxTimeFieldPosFin Ο Οs).succAbove x < maxTimeFieldPosFin Ο Οs) Finset.univ)β©) β’ - StateAlgebra.ofState (maxTimeField Ο Οs) * timeOrder (ofList (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) - - /-! ## Wick's theorem @@ -335,7 +319,15 @@ remark wicks_theorem_context := " the remaining fields. Wick's theorem is also the precursor to the diagrammatic approach to quantum field theory called Feynman diagrams." -/-- Wick's theorem for time-ordered products of bosonic and fermionic fields. -/ +/-- Wick's theorem for time-ordered products of bosonic and fermionic fields. + The time ordered product `T(ΟβΟββ¦Οβ)` is equal to the sum of terms, + for all possible Wick contractions `c` of the list of fields `Οs := ΟβΟββ¦Οβ`, given by + the multiple of: +- The sign corresponding to the number of fermionic-fermionic exchanges one must do + to put elements in contracted pairs of `c` next to each other. +- The product of time-contractions of the contracted pairs of `c`. +- The normal-ordering of the uncontracted fields in `c`. +-/ theorem wicks_theorem : (Οs : List π.States) β π.crAnF (ofStateAlgebra (timeOrder (ofList Οs))) = β (c : WickContraction Οs.length), (c.sign Οs β’ c.timeContract π) * π.crAnF (normalOrder (ofStateList (c.uncontractedList.map Οs.get))) diff --git a/docs/CuratedNotes/PerturbationTheory.html b/docs/CuratedNotes/PerturbationTheory.html index 8f65dad..1089d6e 100644 --- a/docs/CuratedNotes/PerturbationTheory.html +++ b/docs/CuratedNotes/PerturbationTheory.html @@ -54,12 +54,13 @@ layout: default {% if entry.type == "name" %}
{{ entry.name }}: {{ entry.docString }}
+{{ entry.name }}: {{ entry.docString | markdownify}}
{{ entry.declString }}