PhysLean/HepLean/PerturbationTheory/Wick/Contract.lean

663 lines
29 KiB
Text
Raw Normal View History

2024-11-22 15:12:06 +00:00
/-
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
-/
2024-12-02 16:26:19 +00:00
import HepLean.PerturbationTheory.Wick.String
2024-12-03 09:51:09 +00:00
import Mathlib.Algebra.Order.Ring.Nat
import Mathlib.Data.Fintype.Sum
import Mathlib.Logic.Equiv.Fin
2024-12-04 13:37:23 +00:00
import HepLean.Meta.Notes.Basic
2024-11-22 15:12:06 +00:00
/-!
# Wick Contract
## Further reading
- https://www.imperial.ac.uk/media/imperial-college/research-centres-and-groups/theoretical-physics/msc/current/qft/handouts/qftwickstheorem.pdf
-/
2024-12-03 15:17:52 +00:00
namespace Wick
variable {S : Species}
2024-11-22 16:02:26 +00:00
/-- A Wick contraction for a Wick string is a series of pairs `i` and `j` of indices
to be contracted, subject to ordering and subject to the condition that they can
be contracted. -/
2024-12-03 15:17:52 +00:00
inductive WickContract : {ni : } → {i : Fin ni → S.𝓯} → {n : } → {c : Fin n → S.𝓯} →
{no : } → {o : Fin no → S.𝓯} →
(str : WickString i c o final) →
2024-11-22 15:12:06 +00:00
{k : } → (b1 : Fin k → Fin n) → (b2 : Fin k → Fin n) → Type where
2024-12-03 15:17:52 +00:00
| string {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
2024-12-03 15:26:06 +00:00
{no : } {o : Fin no → S.𝓯}
{str : WickString i c o final} : WickContract str Fin.elim0 Fin.elim0
2024-12-03 15:17:52 +00:00
| contr {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final} {k : }
{b1 : Fin k → Fin n} {b2 : Fin k → Fin n} : (i : Fin n) →
2024-12-03 15:17:52 +00:00
(j : Fin n) → (h : c j = S.ξ (c i)) →
2024-11-22 15:12:06 +00:00
(hilej : i < j) → (hb1 : ∀ r, b1 r < i) → (hb2i : ∀ r, b2 r ≠ i) → (hb2j : ∀ r, b2 r ≠ j) →
(w : WickContract str b1 b2) →
WickContract str (Fin.snoc b1 i) (Fin.snoc b2 j)
namespace WickContract
/-- The number of nodes of a Wick contraction. -/
2024-12-04 13:37:23 +00:00
@[note_attr]
2024-12-03 15:17:52 +00:00
def size {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final} {k : } {b1 b2 : Fin k → Fin n} :
2024-11-22 15:12:06 +00:00
WickContract str b1 b2 → := fun
| string => 0
| contr _ _ _ _ _ _ _ w => w.size + 1
/-- The number of nodes in a wick contraction tree is the same as `k`. -/
2024-12-03 15:17:52 +00:00
lemma size_eq_k {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final} {k : } {b1 b2 : Fin k → Fin n} :
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) → w.size = k := fun
| string => rfl
| contr _ _ _ _ _ _ _ w => by
simpa [size] using w.size_eq_k
2024-11-22 15:36:34 +00:00
/-- The map giving the vertices on the left-hand-side of a contraction. -/
2024-11-22 16:02:26 +00:00
@[nolint unusedArguments]
2024-12-03 15:17:52 +00:00
def boundFst {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} :
2024-11-22 15:12:06 +00:00
WickContract str b1 b2 → Fin k → Fin n := fun _ => b1
@[simp]
2024-12-03 15:17:52 +00:00
lemma boundFst_contr_castSucc {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (i j : Fin n)
2024-12-03 15:17:52 +00:00
(h : c j = S.ξ (c i))
2024-11-22 15:12:06 +00:00
(hilej : i < j)
(hb1 : ∀ r, b1 r < i)
(hb2i : ∀ r, b2 r ≠ i)
(hb2j : ∀ r, b2 r ≠ j)
(w : WickContract str b1 b2) (r : Fin k) :
(contr i j h hilej hb1 hb2i hb2j w).boundFst r.castSucc = w.boundFst r := by
simp only [boundFst, Fin.snoc_castSucc]
@[simp]
2024-12-03 15:17:52 +00:00
lemma boundFst_contr_last {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (i j : Fin n)
2024-12-03 15:17:52 +00:00
(h : c j = S.ξ (c i))
2024-11-22 15:12:06 +00:00
(hilej : i < j)
(hb1 : ∀ r, b1 r < i)
(hb2i : ∀ r, b2 r ≠ i)
(hb2j : ∀ r, b2 r ≠ j)
(w : WickContract str b1 b2) :
(contr i j h hilej hb1 hb2i hb2j w).boundFst (Fin.last k) = i := by
simp only [boundFst, Fin.snoc_last]
2024-12-03 15:17:52 +00:00
lemma boundFst_strictMono {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} : (w : WickContract str b1 b2) → StrictMono w.boundFst := fun
2024-11-22 15:12:06 +00:00
| string => fun k => Fin.elim0 k
2024-11-22 15:36:34 +00:00
| contr i j _ _ hb1 _ _ w => by
2024-11-22 15:12:06 +00:00
intro r s hrs
rcases Fin.eq_castSucc_or_eq_last r with hr | hr
· obtain ⟨r, hr⟩ := hr
subst hr
rcases Fin.eq_castSucc_or_eq_last s with hs | hs
· obtain ⟨s, hs⟩ := hs
subst hs
2024-11-22 15:36:34 +00:00
simp only [boundFst_contr_castSucc]
2024-11-22 15:12:06 +00:00
apply w.boundFst_strictMono _
simpa using hrs
· subst hs
2024-11-22 15:36:34 +00:00
simp only [boundFst_contr_castSucc, boundFst_contr_last]
2024-11-22 15:12:06 +00:00
exact hb1 r
· subst hr
rcases Fin.eq_castSucc_or_eq_last s with hs | hs
· obtain ⟨s, hs⟩ := hs
subst hs
rw [Fin.lt_def] at hrs
2024-11-22 15:36:34 +00:00
simp only [Fin.val_last, Fin.coe_castSucc] at hrs
2024-11-22 15:12:06 +00:00
omega
· subst hs
simp at hrs
2024-11-22 15:36:34 +00:00
/-- The map giving the vertices on the right-hand-side of a contraction. -/
2024-11-22 16:02:26 +00:00
@[nolint unusedArguments]
2024-12-03 15:17:52 +00:00
def boundSnd {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} :
2024-11-22 15:12:06 +00:00
WickContract str b1 b2 → Fin k → Fin n := fun _ => b2
@[simp]
2024-12-03 15:17:52 +00:00
lemma boundSnd_contr_castSucc {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (i j : Fin n)
2024-12-03 15:17:52 +00:00
(h : c j = S.ξ (c i))
2024-11-22 15:12:06 +00:00
(hilej : i < j)
(hb1 : ∀ r, b1 r < i)
(hb2i : ∀ r, b2 r ≠ i)
(hb2j : ∀ r, b2 r ≠ j)
(w : WickContract str b1 b2) (r : Fin k) :
(contr i j h hilej hb1 hb2i hb2j w).boundSnd r.castSucc = w.boundSnd r := by
simp only [boundSnd, Fin.snoc_castSucc]
@[simp]
2024-12-03 15:17:52 +00:00
lemma boundSnd_contr_last {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (i j : Fin n)
2024-12-03 15:17:52 +00:00
(h : c j = S.ξ (c i))
2024-11-22 15:12:06 +00:00
(hilej : i < j)
(hb1 : ∀ r, b1 r < i)
(hb2i : ∀ r, b2 r ≠ i)
(hb2j : ∀ r, b2 r ≠ j)
(w : WickContract str b1 b2) :
(contr i j h hilej hb1 hb2i hb2j w).boundSnd (Fin.last k) = j := by
simp only [boundSnd, Fin.snoc_last]
2024-12-03 15:17:52 +00:00
lemma boundSnd_injective {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} :
(w : WickContract str b1 b2) → Function.Injective w.boundSnd := fun
2024-11-22 15:12:06 +00:00
| string => by
intro i j _
exact Fin.elim0 i
| contr i j hij hilej hi h2i h2j w => by
intro r s hrs
rcases Fin.eq_castSucc_or_eq_last r with hr | hr
· obtain ⟨r, hr⟩ := hr
subst hr
rcases Fin.eq_castSucc_or_eq_last s with hs | hs
· obtain ⟨s, hs⟩ := hs
subst hs
2024-11-22 15:36:34 +00:00
simp only [boundSnd_contr_castSucc] at hrs
2024-11-22 15:12:06 +00:00
simpa using w.boundSnd_injective hrs
· subst hs
2024-11-22 15:36:34 +00:00
simp only [boundSnd_contr_castSucc, boundSnd_contr_last] at hrs
2024-11-22 15:12:06 +00:00
exact False.elim (h2j r hrs)
· subst hr
rcases Fin.eq_castSucc_or_eq_last s with hs | hs
· obtain ⟨s, hs⟩ := hs
subst hs
2024-11-22 15:36:34 +00:00
simp only [boundSnd_contr_last, boundSnd_contr_castSucc] at hrs
2024-11-22 15:12:06 +00:00
exact False.elim (h2j s hrs.symm)
· subst hs
rfl
2024-12-03 15:17:52 +00:00
lemma color_boundSnd_eq_dual_boundFst {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} :
2024-12-03 15:17:52 +00:00
(w : WickContract str b1 b2) → (i : Fin k) → c (w.boundSnd i) = S.ξ (c (w.boundFst i)) := fun
2024-11-22 15:12:06 +00:00
| string => fun i => Fin.elim0 i
| contr i j hij hilej hi _ _ w => fun r => by
rcases Fin.eq_castSucc_or_eq_last r with hr | hr
· obtain ⟨r, hr⟩ := hr
subst hr
simpa using w.color_boundSnd_eq_dual_boundFst r
· subst hr
simpa using hij
2024-12-03 15:17:52 +00:00
lemma boundFst_lt_boundSnd {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} : (w : WickContract str b1 b2) → (i : Fin k) →
2024-11-22 15:36:34 +00:00
w.boundFst i < w.boundSnd i := fun
2024-11-22 15:12:06 +00:00
| string => fun i => Fin.elim0 i
| contr i j hij hilej hi _ _ w => fun r => by
rcases Fin.eq_castSucc_or_eq_last r with hr | hr
· obtain ⟨r, hr⟩ := hr
subst hr
simpa using w.boundFst_lt_boundSnd r
· subst hr
2024-11-22 15:36:34 +00:00
simp only [boundFst_contr_last, boundSnd_contr_last]
2024-11-22 15:12:06 +00:00
exact hilej
2024-12-03 15:17:52 +00:00
lemma boundFst_neq_boundSnd {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} :
(w : WickContract str b1 b2) → (r1 r2 : Fin k) → b1 r1 ≠ b2 r2 := fun
2024-11-22 15:12:06 +00:00
| string => fun i => Fin.elim0 i
| contr i j _ hilej h1 h2i h2j w => fun r s => by
rcases Fin.eq_castSucc_or_eq_last r with hr | hr
<;> rcases Fin.eq_castSucc_or_eq_last s with hs | hs
· obtain ⟨r, hr⟩ := hr
obtain ⟨s, hs⟩ := hs
subst hr hs
simpa using w.boundFst_neq_boundSnd r s
· obtain ⟨r, hr⟩ := hr
subst hr hs
2024-11-22 15:36:34 +00:00
simp only [Fin.snoc_castSucc, Fin.snoc_last, ne_eq]
2024-11-22 15:12:06 +00:00
have hn := h1 r
omega
· obtain ⟨s, hs⟩ := hs
subst hr hs
2024-11-22 15:36:34 +00:00
simp only [Fin.snoc_last, Fin.snoc_castSucc, ne_eq]
2024-11-22 15:12:06 +00:00
exact (h2i s).symm
· subst hr hs
2024-11-22 15:36:34 +00:00
simp only [Fin.snoc_last, ne_eq]
2024-11-22 15:12:06 +00:00
omega
2024-11-22 15:36:34 +00:00
/-- Casts a Wick contraction from `WickContract str b1 b2` to `WickContract str b1' b2'` with a
proof that `b1 = b1'` and `b2 = b2'`, and that they are defined from the same `k = k'`. -/
2024-12-03 15:17:52 +00:00
def castMaps {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
2024-11-29 06:38:52 +00:00
{k k' : } {b1 b2 : Fin k → Fin n} {b1' b2' : Fin k' → Fin n}
2024-11-22 15:12:06 +00:00
(hk : k = k')
(hb1 : b1 = b1' ∘ Fin.cast hk) (hb2 : b2 = b2' ∘ Fin.cast hk) (w : WickContract str b1 b2) :
WickContract str b1' b2' :=
cast (by subst hk; rfl) (hb2 ▸ hb1 ▸ w)
@[simp]
2024-12-03 15:17:52 +00:00
lemma castMaps_rfl {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (w : WickContract str b1 b2) :
2024-11-22 15:12:06 +00:00
castMaps rfl rfl rfl w = w := rfl
2024-12-03 15:17:52 +00:00
lemma mem_snoc' {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1' b2' : Fin k → Fin n} :
2024-11-22 15:12:06 +00:00
(w : WickContract str b1' b2') →
2024-11-22 15:36:34 +00:00
{k' : } → (hk' : k'.succ = k) →
2024-12-03 15:17:52 +00:00
(b1 b2 : Fin k' → Fin n) → (i j : Fin n) → (h : c j = S.ξ (c i)) →
2024-11-22 15:12:06 +00:00
(hilej : i < j) → (hb1 : ∀ r, b1 r < i) → (hb2i : ∀ r, b2 r ≠ i) → (hb2j : ∀ r, b2 r ≠ j) →
2024-11-22 15:36:34 +00:00
(hb1' : Fin.snoc b1 i = b1' ∘ Fin.cast hk') →
(hb2' : Fin.snoc b2 j = b2' ∘ Fin.cast hk') →
2024-12-03 09:52:11 +00:00
∃ (w' : WickContract str b1 b2), w = castMaps hk' hb1' hb2'
(contr i j h hilej hb1 hb2i hb2j w') := fun
2024-11-22 15:36:34 +00:00
| string => fun hk' => by
2024-11-22 15:12:06 +00:00
simp at hk'
| contr i' j' h' hilej' hb1' hb2i' hb2j' w' => by
intro hk b1 b2 i j h hilej hb1 hb2i hb2j hb1' hb2'
rename_i k' k b1' b2' f
have hk2 : k' = k := Nat.succ_inj'.mp hk
subst hk2
simp_all
have hb2'' : b2 = b2' := by
funext k
trans (@Fin.snoc k' (fun _ => Fin n) b2 j) (Fin.castSucc k)
· simp
· rw [hb2']
simp
have hb1'' : b1 = b1' := by
funext k
trans (@Fin.snoc k' (fun _ => Fin n) b1 i) (Fin.castSucc k)
· simp
· rw [hb1']
simp
have hi : i = i' := by
2024-11-22 15:36:34 +00:00
trans (@Fin.snoc k' (fun _ => Fin n) b1 i) (Fin.last k')
2024-11-22 15:12:06 +00:00
· simp
· rw [hb1']
simp
have hj : j = j' := by
2024-11-22 15:36:34 +00:00
trans (@Fin.snoc k' (fun _ => Fin n) b2 j) (Fin.last k')
2024-11-22 15:12:06 +00:00
· simp
· rw [hb2']
simp
subst hb1'' hb2'' hi hj
simp
2024-12-03 15:17:52 +00:00
lemma mem_snoc {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-12-03 15:17:52 +00:00
(i j : Fin n) (h : c j = S.ξ (c i)) (hilej : i < j) (hb1 : ∀ r, b1 r < i)
2024-11-22 15:36:34 +00:00
(hb2i : ∀ r, b2 r ≠ i) (hb2j : ∀ r, b2 r ≠ j)
2024-11-22 15:12:06 +00:00
(w : WickContract str (Fin.snoc b1 i) (Fin.snoc b2 j)) :
∃ (w' : WickContract str b1 b2), w = contr i j h hilej hb1 hb2i hb2j w' := by
exact mem_snoc' w rfl b1 b2 i j h hilej hb1 hb2i hb2j rfl rfl
2024-12-03 15:17:52 +00:00
lemma is_subsingleton {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
2024-11-29 06:38:52 +00:00
{k : } {b1 b2 : Fin k → Fin n} :
2024-11-22 15:36:34 +00:00
Subsingleton (WickContract str b1 b2) := Subsingleton.intro fun w1 w2 => by
2024-11-22 15:12:06 +00:00
induction k with
| zero =>
have hb1 : b1 = Fin.elim0 := Subsingleton.elim _ _
have hb2 : b2 = Fin.elim0 := Subsingleton.elim _ _
subst hb1 hb2
match w1, w2 with
| string, string => rfl
| succ k hI =>
match w1, w2 with
| contr i j h hilej hb1 hb2i hb2j w, w2 =>
let ⟨w', hw'⟩ := mem_snoc i j h hilej hb1 hb2i hb2j w2
rw [hw']
apply congrArg (contr i j _ _ _ _ _) (hI w w')
lemma eq_snoc_castSucc {k n : } (b1 : Fin k.succ → Fin n) :
2024-11-22 15:36:34 +00:00
b1 = Fin.snoc (b1 ∘ Fin.castSucc) (b1 (Fin.last k)) := by
2024-11-22 15:12:06 +00:00
funext i
rcases Fin.eq_castSucc_or_eq_last i with h1 | h1
· obtain ⟨i, rfl⟩ := h1
simp
· subst h1
simp
2024-11-22 15:36:34 +00:00
/-- The construction of a Wick contraction from maps `b1 b2 : Fin k → Fin n`, with the former
giving the first index to be contracted, and the latter the second index. These
maps must satisfy a series of conditions. -/
2024-12-03 15:17:52 +00:00
def fromMaps {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } (b1 b2 : Fin k → Fin n)
2024-12-03 15:17:52 +00:00
(hi : ∀ i, c (b2 i) = S.ξ (c (b1 i)))
2024-11-22 15:12:06 +00:00
(hb1ltb2 : ∀ i, b1 i < b2 i)
(hb1 : StrictMono b1)
(hb1neb2 : ∀ r1 r2, b1 r1 ≠ b2 r2)
(hb2 : Function.Injective b2) :
WickContract str b1 b2 := by
match k with
| 0 =>
refine castMaps ?_ ?_ ?_ string
· rfl
· exact funext (fun i => Fin.elim0 i)
· exact funext (fun i => Fin.elim0 i)
| Nat.succ k =>
refine castMaps rfl (eq_snoc_castSucc b1).symm (eq_snoc_castSucc b2).symm
(contr (b1 (Fin.last k)) (b2 (Fin.last k))
(hi (Fin.last k))
(hb1ltb2 (Fin.last k))
(fun r => hb1 (Fin.castSucc_lt_last r))
(fun r a => hb1neb2 (Fin.last k) r.castSucc a.symm)
2024-11-22 15:36:34 +00:00
(fun r => hb2.eq_iff.mp.mt (Fin.ne_last_of_lt (Fin.castSucc_lt_last r)))
2024-11-22 15:12:06 +00:00
(fromMaps (b1 ∘ Fin.castSucc) (b2 ∘ Fin.castSucc) (fun i => hi (Fin.castSucc i))
(fun i => hb1ltb2 (Fin.castSucc i)) (StrictMono.comp hb1 Fin.strictMono_castSucc)
?_ ?_))
· exact fun r1 r2 => hb1neb2 r1.castSucc r2.castSucc
· exact Function.Injective.comp hb2 (Fin.castSucc_injective k)
2024-11-22 15:36:34 +00:00
/-- Given a Wick contraction with `k.succ` contractions, returns the Wick contraction with
`k` contractions by dropping the last contraction (defined by the first index contracted). -/
2024-12-03 15:17:52 +00:00
def dropLast {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
2024-11-29 06:38:52 +00:00
{k : } {b1 b2 : Fin k.succ → Fin n}
2024-11-22 15:36:34 +00:00
(w : WickContract str b1 b2) : WickContract str (b1 ∘ Fin.castSucc) (b2 ∘ Fin.castSucc) :=
fromMaps (b1 ∘ Fin.castSucc) (b2 ∘ Fin.castSucc)
2024-11-22 15:12:06 +00:00
(fun i => color_boundSnd_eq_dual_boundFst w i.castSucc)
(fun i => boundFst_lt_boundSnd w i.castSucc)
(StrictMono.comp w.boundFst_strictMono Fin.strictMono_castSucc)
(fun r1 r2 => boundFst_neq_boundSnd w r1.castSucc r2.castSucc)
(Function.Injective.comp w.boundSnd_injective (Fin.castSucc_injective k))
2024-12-03 15:17:52 +00:00
lemma eq_from_maps {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
2024-11-29 06:38:52 +00:00
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) :
w = fromMaps w.boundFst w.boundSnd w.color_boundSnd_eq_dual_boundFst
2024-11-22 15:36:34 +00:00
w.boundFst_lt_boundSnd w.boundFst_strictMono w.boundFst_neq_boundSnd
w.boundSnd_injective := is_subsingleton.allEq w _
2024-11-22 15:12:06 +00:00
2024-12-03 15:17:52 +00:00
lemma eq_dropLast_contr {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k.succ → Fin n} (w : WickContract str b1 b2) :
2024-11-22 15:12:06 +00:00
w = castMaps rfl (eq_snoc_castSucc b1).symm (eq_snoc_castSucc b2).symm
(contr (b1 (Fin.last k)) (b2 (Fin.last k))
(w.color_boundSnd_eq_dual_boundFst (Fin.last k))
(w.boundFst_lt_boundSnd (Fin.last k))
(fun r => w.boundFst_strictMono (Fin.castSucc_lt_last r))
(fun r a => w.boundFst_neq_boundSnd (Fin.last k) r.castSucc a.symm)
2024-11-22 15:36:34 +00:00
(fun r => w.boundSnd_injective.eq_iff.mp.mt (Fin.ne_last_of_lt (Fin.castSucc_lt_last r)))
2024-11-22 15:12:06 +00:00
(dropLast w)) := by
rw [eq_from_maps w]
rfl
2024-11-22 15:36:34 +00:00
/-- Wick contractions of a given Wick string with `k` different contractions. -/
2024-12-03 15:17:52 +00:00
def Level {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} (str : WickString i c o final) (k : ) : Type :=
2024-11-22 15:12:06 +00:00
Σ (b1 : Fin k → Fin n) (b2 : Fin k → Fin n), WickContract str b1 b2
2024-11-22 15:36:34 +00:00
/-- There is a finite number of Wick contractions with no contractions. In particular,
2024-11-22 15:37:01 +00:00
this is just the original Wick string. -/
2024-12-03 15:17:52 +00:00
instance levelZeroFintype {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} (str : WickString i c o final) :
2024-11-22 15:36:34 +00:00
Fintype (Level str 0) where
2024-11-22 15:12:06 +00:00
elems := {⟨Fin.elim0, Fin.elim0, WickContract.string⟩}
complete := by
intro x
match x with
| ⟨b1, b2, w⟩ =>
have hb1 : b1 = Fin.elim0 := Subsingleton.elim _ _
have hb2 : b2 = Fin.elim0 := Subsingleton.elim _ _
subst hb1 hb2
simp only [Finset.mem_singleton]
rw [is_subsingleton.allEq w string]
2024-11-22 15:36:34 +00:00
/-- The pairs of additional indices which can be contracted given a Wick contraction. -/
2024-12-03 15:17:52 +00:00
structure ContrPair {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:36:34 +00:00
(w : WickContract str b1 b2) where
/-- The first index in the contraction pair. -/
2024-11-22 15:12:06 +00:00
i : Fin n
2024-11-22 15:36:34 +00:00
/-- The second index in the contraction pair. -/
2024-11-22 15:12:06 +00:00
j : Fin n
2024-12-03 15:17:52 +00:00
h : c j = S.ξ (c i)
2024-11-22 15:12:06 +00:00
hilej : i < j
hb1 : ∀ r, b1 r < i
hb2i : ∀ r, b2 r ≠ i
hb2j : ∀ r, b2 r ≠ j
2024-11-22 15:36:34 +00:00
/-- The pairs of additional indices which can be contracted, given an existing wick contraction,
is equivalent to the a subtype of `Fin n × Fin n` defined by certain conditions equivalent
to the conditions appearing in `ContrPair`. -/
2024-12-03 15:17:52 +00:00
def contrPairEquivSubtype {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (w : WickContract str b1 b2) :
2024-12-03 15:17:52 +00:00
ContrPair w ≃ {x : Fin n × Fin n // c x.2 = S.ξ (c x.1) ∧ x.1 < x.2 ∧
2024-11-22 15:36:34 +00:00
(∀ r, b1 r < x.1) ∧ (∀ r, b2 r ≠ x.1) ∧ (∀ r, b2 r ≠ x.2)} where
2024-11-22 15:12:06 +00:00
toFun cp := ⟨⟨cp.i, cp.j⟩, ⟨cp.h, cp.hilej, cp.hb1, cp.hb2i, cp.hb2j⟩⟩
invFun x :=
match x with
| ⟨⟨i, j⟩, ⟨h, hilej, hb1, hb2i, hb2j⟩⟩ => ⟨i, j, h, hilej, hb1, hb2i, hb2j⟩
left_inv x := by rfl
right_inv x := by
simp_all only [ne_eq]
obtain ⟨val, property⟩ := x
obtain ⟨fst, snd⟩ := val
obtain ⟨left, right⟩ := property
obtain ⟨left_1, right⟩ := right
obtain ⟨left_2, right⟩ := right
obtain ⟨left_3, right⟩ := right
simp_all only [ne_eq]
2024-12-03 15:17:52 +00:00
lemma heq_eq {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 b1' b2' : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2)
(w' : WickContract str b1' b2') (h1 : b1 = b1') (h2 : b2 = b2') : HEq w w':= by
subst h1 h2
2024-11-22 15:36:34 +00:00
simp only [heq_eq_eq]
2024-11-22 15:12:06 +00:00
exact is_subsingleton.allEq w w'
2024-11-22 15:36:34 +00:00
/-- The equivalence between Wick contractions consisting of `k.succ` contractions and
those with `k` contractions paired with a suitable contraction pair. -/
2024-12-03 15:17:52 +00:00
def levelSuccEquiv {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} (str : WickString i c o final) (k : ) :
2024-11-22 15:12:06 +00:00
Level str k.succ ≃ (w : Level str k) × ContrPair w.2.2 where
toFun w :=
match w with
| ⟨b1, b2, w⟩ =>
⟨⟨b1 ∘ Fin.castSucc, b2 ∘ Fin.castSucc, dropLast w⟩,
2024-11-22 15:36:34 +00:00
⟨b1 (Fin.last k), b2 (Fin.last k),
2024-11-22 15:12:06 +00:00
w.color_boundSnd_eq_dual_boundFst (Fin.last k),
w.boundFst_lt_boundSnd (Fin.last k),
fun r => w.boundFst_strictMono (Fin.castSucc_lt_last r),
fun r a => w.boundFst_neq_boundSnd (Fin.last k) r.castSucc a.symm,
fun r => w.boundSnd_injective.eq_iff.mp.mt (Fin.ne_last_of_lt (Fin.castSucc_lt_last r))⟩⟩
invFun w :=
match w with
| ⟨⟨b1, b2, w⟩, cp⟩ => ⟨Fin.snoc b1 cp.i, Fin.snoc b2 cp.j,
contr cp.i cp.j cp.h cp.hilej cp.hb1 cp.hb2i cp.hb2j w⟩
left_inv w := by
match w with
| ⟨b1, b2, w⟩ =>
2024-11-22 15:36:34 +00:00
simp only [Nat.succ_eq_add_one, Function.comp_apply]
2024-11-22 15:12:06 +00:00
congr
· exact Eq.symm (eq_snoc_castSucc b1)
· funext b2
congr
exact Eq.symm (eq_snoc_castSucc b1)
· exact Eq.symm (eq_snoc_castSucc b2)
· rw [eq_dropLast_contr w]
simp only [castMaps, Nat.succ_eq_add_one, cast_eq, heq_eqRec_iff_heq, heq_eq_eq,
contr.injEq]
rfl
right_inv w := by
match w with
| ⟨⟨b1, b2, w⟩, cp⟩ =>
2024-11-22 15:36:34 +00:00
simp only [Nat.succ_eq_add_one, Fin.snoc_last, Sigma.mk.inj_iff]
2024-11-22 15:12:06 +00:00
apply And.intro
· congr
· exact Fin.snoc_comp_castSucc
· funext b2
congr
exact Fin.snoc_comp_castSucc
· exact Fin.snoc_comp_castSucc
· exact heq_eq _ _ Fin.snoc_comp_castSucc Fin.snoc_comp_castSucc
· congr
· exact Fin.snoc_comp_castSucc
· exact Fin.snoc_comp_castSucc
· exact heq_eq _ _ Fin.snoc_comp_castSucc Fin.snoc_comp_castSucc
· simp
· simp
· simp
2024-11-22 15:36:34 +00:00
/-- The sum of `boundFst` and `boundSnd`, giving on `Sum.inl k` the first index
in the `k`th contraction, and on `Sum.inr k` the second index in the `k`th contraction. -/
2024-12-03 15:17:52 +00:00
def bound {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:36:34 +00:00
(w : WickContract str b1 b2) : Fin k ⊕ Fin k → Fin n :=
2024-11-22 15:12:06 +00:00
Sum.elim w.boundFst w.boundSnd
2024-11-22 15:36:34 +00:00
/-- On `Sum.inl k` the map `bound` acts via `boundFst`. -/
2024-11-22 15:12:06 +00:00
@[simp]
2024-12-03 15:17:52 +00:00
lemma bound_inl {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) (i : Fin k) : w.bound (Sum.inl i) = w.boundFst i := rfl
2024-11-22 15:36:34 +00:00
/-- On `Sum.inr k` the map `bound` acts via `boundSnd`. -/
2024-11-22 15:12:06 +00:00
@[simp]
2024-12-03 15:17:52 +00:00
lemma bound_inr {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) (i : Fin k) : w.bound (Sum.inr i) = w.boundSnd i := rfl
2024-12-03 15:17:52 +00:00
lemma bound_injection {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) : Function.Injective w.bound := by
intro x y h
match x, y with
| Sum.inl x, Sum.inl y =>
2024-11-22 15:36:34 +00:00
simp only [bound_inl] at h
2024-11-22 15:12:06 +00:00
simpa using (StrictMono.injective w.boundFst_strictMono).eq_iff.mp h
| Sum.inr x, Sum.inr y =>
2024-11-22 15:36:34 +00:00
simp only [bound_inr] at h
2024-11-22 15:12:06 +00:00
simpa using w.boundSnd_injective h
| Sum.inl x, Sum.inr y =>
2024-11-22 15:36:34 +00:00
simp only [bound_inl, bound_inr] at h
2024-11-22 15:12:06 +00:00
exact False.elim (w.boundFst_neq_boundSnd x y h)
| Sum.inr x, Sum.inl y =>
2024-11-22 15:36:34 +00:00
simp only [bound_inr, bound_inl] at h
2024-11-22 15:12:06 +00:00
exact False.elim (w.boundFst_neq_boundSnd y x h.symm)
2024-12-03 15:17:52 +00:00
lemma bound_le_total {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) : 2 * k ≤ n := by
refine Fin.nonempty_embedding_iff.mp ⟨w.bound ∘ finSumFinEquiv.symm ∘ Fin.cast (Nat.two_mul k),
?_⟩
apply Function.Injective.comp (Function.Injective.comp _ finSumFinEquiv.symm.injective)
· exact Fin.cast_injective (Nat.two_mul k)
· exact bound_injection w
2024-11-22 15:36:34 +00:00
/-- The list of fields (indexed by `Fin n`) in a Wick contraction which are not bound,
i.e. which do not appear in any contraction. -/
2024-12-03 15:17:52 +00:00
def unboundList {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:12:06 +00:00
(w : WickContract str b1 b2) : List (Fin n) :=
List.filter (fun i => decide (∀ r, w.bound r ≠ i)) (List.finRange n)
/-- THe list of field positions which are not contracted has no duplicates. -/
2024-12-03 15:17:52 +00:00
lemma unboundList_nodup {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
2024-11-22 15:36:34 +00:00
(w : WickContract str b1 b2) : (w.unboundList).Nodup :=
List.Nodup.filter _ (List.nodup_finRange n)
2024-11-22 15:12:06 +00:00
/-- The length of the `unboundList` is equal to `n - 2 * k`. That is
the total number of fields minus the number of contracted fields. -/
2024-12-03 15:17:52 +00:00
lemma unboundList_length {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (w : WickContract str b1 b2) :
2024-11-22 15:36:34 +00:00
w.unboundList.length = n - 2 * k := by
2024-11-22 15:12:06 +00:00
rw [← List.Nodup.dedup w.unboundList_nodup]
rw [← List.card_toFinset, unboundList]
rw [List.toFinset_filter, List.toFinset_finRange]
2024-11-22 15:36:34 +00:00
have hn := Finset.filter_card_add_filter_neg_card_eq_card (s := Finset.univ)
(fun (i : Fin n) => i ∈ Finset.image w.bound Finset.univ)
2024-11-22 15:12:06 +00:00
have hn' :(Finset.filter (fun i => i ∈ Finset.image w.bound Finset.univ) Finset.univ).card =
(Finset.image w.bound Finset.univ).card := by
refine Finset.card_equiv (Equiv.refl _) fun i => ?_
simp
rw [hn'] at hn
rw [Finset.card_image_of_injective] at hn
2024-11-22 15:36:34 +00:00
simp only [Finset.card_univ, Fintype.card_sum, Fintype.card_fin,
2024-11-22 15:12:06 +00:00
Finset.mem_univ, true_and, Sum.exists, bound_inl, bound_inr, not_or, not_exists] at hn
2024-11-22 15:36:34 +00:00
have hn'' : (Finset.filter (fun a => a ∉ Finset.image w.bound Finset.univ) Finset.univ).card =
n - 2 * k := by
2024-11-22 15:12:06 +00:00
omega
rw [← hn'']
congr
funext x
2024-11-22 15:36:34 +00:00
simp only [ne_eq, Sum.forall, bound_inl, bound_inr, Bool.decide_and, Bool.and_eq_true,
decide_eq_true_eq, Finset.mem_image, Finset.mem_univ, true_and, Sum.exists, not_or, not_exists]
2024-11-22 15:12:06 +00:00
exact bound_injection w
2024-12-03 15:17:52 +00:00
lemma unboundList_sorted {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n} (w : WickContract str b1 b2) :
2024-11-22 15:36:34 +00:00
List.Sorted (fun i j => i < j) w.unboundList :=
2024-11-22 15:12:06 +00:00
List.Pairwise.sublist (List.filter_sublist (List.finRange n)) (List.pairwise_lt_finRange n)
/-- The ordered embedding giving the fields which are not bound in a contraction. These
2024-11-22 15:36:34 +00:00
are the fields that will appear in a normal operator in Wick's theorem. -/
2024-12-03 15:17:52 +00:00
def unbound {ni : } {i : Fin ni → S.𝓯} {n : } {c : Fin n → S.𝓯}
{no : } {o : Fin no → S.𝓯} {str : WickString i c o final}
{k : } {b1 b2 : Fin k → Fin n}
(w : WickContract str b1 b2) : Fin (n - 2 * k) ↪o Fin n where
toFun := w.unboundList.get ∘ Fin.cast w.unboundList_length.symm
inj' := by
apply Function.Injective.comp
· rw [← List.nodup_iff_injective_get]
exact w.unboundList_nodup
· exact Fin.cast_injective _
map_rel_iff' := by
refine fun {a b} => StrictMono.le_iff_le ?_
rw [Function.Embedding.coeFn_mk]
apply StrictMono.comp
· exact List.Sorted.get_strictMono w.unboundList_sorted
· exact fun ⦃a b⦄ a => a
2024-11-22 15:12:06 +00:00
2024-12-02 10:47:31 +00:00
informal_lemma level_fintype where
math :≈ "Level is a finite type, as there are only finitely many ways to contract a Wick string."
deps :≈ [``Level]
2024-11-29 16:20:54 +00:00
informal_definition HasEqualTimeContractions where
math :≈ "The condition for a Wick contraction to have two fields contracted
which are of equal time, i.e. come from the same vertex."
deps :≈ [``WickContract]
informal_definition IsConnected where
math :≈ "The condition for a full Wick contraction that for any two vertices
(including external vertices) are connected by contractions."
deps :≈ [``WickContract]
informal_definition HasVacuumContributions where
math :≈ "The condition for a full Wick contraction to have a vacuum contribution."
deps :≈ [``WickContract]
informal_definition IsOneParticleIrreducible where
math :≈ "The condition for a full Wick contraction to be one-particle irreducible."
deps :≈ [``WickContract]
2024-11-22 15:12:06 +00:00
end WickContract
2024-12-03 15:17:52 +00:00
end Wick