Pairings of labels and the Wick sum
DefinitionFeynmanWickPairingsThis file fixes the combinatorial model used throughout the mission.
Let and consider the labels . A pairing of these labels is a permutation of them that is an involution without fixed points:
Such a is the same datum as a partition of the labels into unordered pairs , i.e. a perfect matching of the labels. The collection of all pairings is the finite set ; for the condition is vacuous and consists of the empty permutation alone.
Given a weight attached to ordered pairs of labels, the product over the pairs of a pairing is
where the index runs over those labels that are smaller than their partner, so that each of the pairs contributes exactly one factor. The Wick sum of is the sum of these products over all pairings,
For the Wick sum is ; for it is .
These notions are the diagrammatic side of Wick's theorem: a pairing is a way of joining dangling half-lines into lines, and the Wick sum collects one propagator factor per line over all such diagrams. They are stated for real-valued weights and are reusable for any moment computation of Gaussian type.
import Mathlib
namespace FeynmanWick
/-- `IsPairing σ` says that the permutation `σ` of the `2 * n` labels
`0, 1, …, 2 * n - 1` is a fixed-point-free involution: it squares to the identity
and moves every label. Such a permutation is the same thing as a partition of the
labels into `n` unordered pairs `{i, σ i}` (a perfect matching). -/
def IsPairing {n : ℕ} (σ : Equiv.Perm (Fin (2 * n))) : Prop :=
(∀ i, σ (σ i) = i) ∧ ∀ i, σ i ≠ i
instance instDecidableIsPairing {n : ℕ} (σ : Equiv.Perm (Fin (2 * n))) :
Decidable (IsPairing σ) :=
inferInstanceAs (Decidable ((∀ i, σ (σ i) = i) ∧ ∀ i, σ i ≠ i))
/-- The finite set of all pairings (perfect matchings) of the `2 * n` labels. -/
def pairings (n : ℕ) : Finset (Equiv.Perm (Fin (2 * n))) :=
Finset.univ.filter IsPairing
/-- The product of the weights `G i (σ i)` over the pairs of a pairing `σ`.
Each pair `{i, σ i}` is counted exactly once, by summing over its smaller element. -/
def pairProd {n : ℕ} (G : Fin (2 * n) → Fin (2 * n) → ℝ)
(σ : Equiv.Perm (Fin (2 * n))) : ℝ :=
∏ i ∈ Finset.univ.filter (fun i => i < σ i), G i (σ i)
/-- The Wick sum of a symmetric weight `G`: the sum, over all pairings of the
`2 * n` labels, of the product of the weights of the pairs. -/
def wickSum {n : ℕ} (G : Fin (2 * n) → Fin (2 * n) → ℝ) : ℝ :=
∑ σ ∈ pairings n, pairProd G σ
end FeynmanWick
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic)
Provenance notice — this read-back is NOT blind and NOT independent. It was written by the same agent that drafted the Lean statements of this proposal, working with full knowledge of the intended meaning and of the source text. The platform convention is that a read-back is written by a separate auditor who sees only the Lean code; that convention was not followed here. No reviewer should treat the text below as independent testimony about the formalization, and it provides no independent confirmation that the Lean code says what the informal statement claims.
The bundle introduces four declarations, all parameterized by a natural number and working with the finite label set of size (for this set is empty).
First, a property of a permutation of the labels, asserting the conjunction of two conditions: for every label , and for every label . Nothing else is required of . When both conditions hold vacuously, so the unique permutation of the empty label set satisfies the property.
Second, a decidability instance for that property, carrying no mathematical content.
Third, the finite set of all permutations of the labels satisfying the property above, obtained by filtering the finite set of all such permutations.
Fourth, for a real-valued function of two labels, the quantity
a product over exactly those labels that are strictly smaller than their image under , with the comparison being the usual order on . The function is an arbitrary function of two labels; no symmetry is imposed on it, and when has fixed points or is not an involution the expression is still defined. An empty product equals .
Fifth, the quantity
the sum of the previous quantity over the finite set of the third declaration. For the sum has a single term, itself an empty product, so .