Sherman's loop cancellations and product formula
DefinitionReversible turn matrix on a state space with directions#✓fully proved
The matrix q x y · turnW(dir y, dir x) on an abstract state space with directions.
noncomputable def ons_reversibleTurnMatrix
{E : Type*} (dir : E → Fin 4) (omega : ℂ)
(q : E → E → ℂ) : Matrix E E ℂ :=
fun x y ↦ q x y * ons_turnW omega (dir y) (dir x)
noncomputable def ons_turnW (ω : ℂ) (μ ν : Fin 4) : ℂ :=
if ν = μ then 1
else if ν = μ + 1 then ω
else if ν = μ + 2 then 0
else ω⁻¹
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:69
Uses 1
DefinitionState-weighted reversible turn matrix#✓fully proved
The reversible turn matrix with additional row and column weights on states.
noncomputable def ons_stateWeightedReversibleTurnMatrix
{E : Type*} (dir : E → Fin 4) (omega : ℂ)
(rowWeight colWeight : E → ℂ) (q : E → E → ℂ) :
Matrix E E ℂ :=
fun x y ↦ rowWeight x * colWeight y * q x y *
ons_turnW omega (dir y) (dir x)
noncomputable def ons_turnW (ω : ℂ) (μ ν : Fin 4) : ℂ :=
if ν = μ then 1
else if ν = μ + 1 then ω
else if ν = μ + 2 then 0
else ω⁻¹
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:69
Uses 1 · Used by 1
DefinitionReversal of a cyclic sequence of states#✓fully proved
Reversal of a cyclic sequence of states: position k carries rev of the state at position
-k.
def ons_involutiveLoopRev
{E : Type*} {n : ℕ} [NeZero n]
(rev : E → E) (loop : Fin n → E) : Fin n → E :=
fun k ↦ rev (loop (-k))
Used by 1
DefinitionMasked reversible factor#✓fully proved
The reversible factor with the rows and columns of forbidden set to zero.
noncomputable def ons_maskedReversibleFactor
{E : Type*} [DecidableEq E]
(forbidden : Finset E) (q : E → E → ℂ) : E → E → ℂ :=
fun x y ↦ if x ∈ forbidden ∨ y ∈ forbidden then 0 else q x y
DefinitionMajorant \(q^{|s|-1}\) for the weight of a walk#✓fully proved
The majorant q^{|s| - 1} for the weight of a walk s with at least two states, and 0 for
shorter lists.
def ons_factorMajorant (q : ℝ) (s : List E) : ℝ :=
if s.length < 2 then 0 else q ^ (s.length - 1)
Used by 1
DefinitionSherman's convergence radius for the torus Kac-Ward matrix#✓fully proved
The radius 1 / (2 (number of darts)²) below which Sherman's first-return series for the torus
Kac-Ward matrix converges with total weight below 1.
noncomputable def ons_ShermanRadius (L : ℕ) [NeZero L] : ℝ :=
(2 * (Fintype.card (ons_Dart L) : ℝ) ^ 2)⁻¹
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
LemmaProduct over a tuple equals the product over its list#✓fully proved
The product over a tuple equals the product over the list List.ofFn p; see also
List.prod_ofFn and List.map_ofFn.
Lemma\(1 - z \neq 0\) for \(|z| < 1\)#✓fully proved
1 - z ≠ 0 when ‖z‖ < 1.
lemma ons_one_sub_ne_zero_of_norm_lt_one {z : ℂ} (hz : ‖z‖ < 1) : (1 : ℂ) - z ≠ 0
Used by 1
DefinitionFirst-return loop at a directed edge#✓fully proved
A cyclic sequence v is a first-return loop at e (avoiding rev e) if it starts at e, does
not visit e again, and never uses the reverse edge rev e.
DefinitionCyclic sequences rooted at an edge avoiding its reverse#✓fully proved
The cyclic sequences of length n that start at e and never use rev e.
DefinitionTerm of the list series: product of weights over length#✓fully proved
The term (∏_{a ∈ l} wt a) / |l| of the list series, set to 0 on the empty list.
noncomputable def ons_listSeriesTerm {alpha : Type*} (wt : alpha → ℂ)
(l : List alpha) : ℂ :=
if _h : l = [] then 0 else (l.map wt).prod / (l.length : ℂ)
Used by 1
DefinitionWeight of a cyclic sequence#✓fully proved
The weight ∏ₖ Λ (v k) (v (k + 1)) of a cyclic sequence v : Fin n → E, indices taken modulo
n.
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
Used by 21
DefinitionRotation of a cyclic sequence by one step#✓fully proved
Rotation of a cyclic sequence by one step: (ons_cyclicShift v) k = v (k + 1).
def ons_cyclicShift {E : Type*} {n : ℕ} [NeZero n] (v : Fin n → E) : Fin n → E :=
fun k => v (k + 1)
Used by 2
DefinitionKac-Ward bucket: walks through a dart, not its reverse#✓fully proved
The total Kac-Ward weight of closed walks of length n + 1 that visit e but not its reverse.
noncomputable def ons_bucketE (L : ℕ) [NeZero L] (x ω : ℂ) (e : ons_Dart L) (n : ℕ) : ℂ :=
∑ v ∈ Finset.univ.filter (fun v : Fin (n + 1) → ons_Dart L =>
(∃ i, v i = e) ∧ ¬ (∃ j, v j = ons_dartRev L e)),
ons_loopWeight (ons_KWmat L x ω) v
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
noncomputable def ons_KWmat (L : ℕ) (x ω : ℂ) : Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d₂ d₁ => if d₂.1 = ons_dirStep L d₁.2 d₁.1 then x * ons_turnW ω d₁.2 d₂.2 else 0
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:77
Uses 4
DefinitionKac-Ward bucket: walks avoiding a dart and its reverse#✓fully proved
The total Kac-Ward weight of closed walks of length n + 1 that visit neither e nor its
reverse.
noncomputable def ons_bucketN (L : ℕ) [NeZero L] (x ω : ℂ) (e : ons_Dart L) (n : ℕ) : ℂ :=
∑ v ∈ Finset.univ.filter (fun v : Fin (n + 1) → ons_Dart L =>
¬ (∃ i, v i = e) ∧ ¬ (∃ j, v j = ons_dartRev L e)),
ons_loopWeight (ons_KWmat L x ω) v
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
noncomputable def ons_KWmat (L : ℕ) (x ω : ℂ) : Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d₂ d₁ => if d₂.1 = ons_dirStep L d₁.2 d₁.1 then x * ons_turnW ω d₁.2 d₂.2 else 0
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:77
Uses 4
LemmaLoop sum vanishes under a fixed-point-free sign-reversing involution#✓fully proved
A fixed-point-free involution of S that reverses the sign of the loop weight forces the loop
weights over S to sum to zero. See also Finset.sum_involution.
lemma ons_sum_zero_of_sign_involution {E} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (S : Finset (Fin n → E)) (g : (Fin n → E) → (Fin n → E))
(hmaps : ∀ v ∈ S, g v ∈ S)
(hsign : ∀ v ∈ S, ons_loopWeight Λ (g v) = - ons_loopWeight Λ v)
(hinv : ∀ v ∈ S, g (g v) = v) (hne : ∀ v ∈ S, g v ≠ v) :
∑ v ∈ S, ons_loopWeight Λ v = 0
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
Uses 1
DefinitionCyclic sequences visiting two given states#✓fully proved
The cyclic sequences of length n that visit both a and b.
noncomputable def ons_loopSetBoth {E} [Fintype E] [DecidableEq E] {n : ℕ}
(a b : E) : Finset (Fin n → E) :=
{v ∈ (Finset.univ : Finset (Fin n → E)) | (∃ i, v i = a) ∧ (∃ j, v j = b)}
Used by 2
DefinitionMirror position within a segment#✓fully proved
The mirror image l + m - k of a position k in the segment [l, m] (truncated to n - 1).
def ons_mir {n : ℕ} [NeZero n] (l m k : Fin n) : Fin n :=
⟨min (l.val + m.val - k.val) (n - 1), by have := NeZero.pos n; omega⟩
Used by 3
DefinitionReversal of a segment of a cyclic sequence#✓fully proved
Reversal of the segment [l, m] of v: positions inside are mirrored and their entries
replaced by their reverses; positions outside are unchanged.
def ons_revSeg {E} {n : ℕ} [NeZero n] (rev : E → E) (l m : Fin n) (v : Fin n → E) :
Fin n → E :=
fun k => if l ≤ k ∧ k ≤ m then rev (v (ons_mir l m k)) else v k
def ons_mir {n : ℕ} [NeZero n] (l m k : Fin n) : Fin n :=
⟨min (l.val + m.val - k.val) (n - 1), by have := NeZero.pos n; omega⟩
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:107
Uses 1 · Used by 3
DefinitionPositions where a sequence meets an edge or its reverse#✓fully proved
The positions where v meets e or rev e.
noncomputable def ons_hitSet {E} [DecidableEq E] {n : ℕ} (e : E) (rev : E → E)
(v : Fin n → E) : Finset (Fin n) :=
{k | v k = e ∨ v k = rev e}
Used by 3
DefinitionFirst position meeting an edge or its reverse#✓fully proved
The first position where v meets e or rev e (0 if there is none).
noncomputable def ons_l {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n :=
if h : (ons_hitSet e rev v).Nonempty then (ons_hitSet e rev v).min' h else 0
noncomputable def ons_hitSet {E} [DecidableEq E] {n : ℕ} (e : E) (rev : E → E)
(v : Fin n → E) : Finset (Fin n) :=
{k | v k = e ∨ v k = rev e}
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:180
Uses 1 · Used by 4
DefinitionPositions meeting the reverse of the first hit#✓fully proved
The positions where v meets the reverse of its entry at ons_l e rev v.
noncomputable def ons_mSet {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Finset (Fin n) :=
{j | v j = rev (v (ons_l e rev v))}
noncomputable def ons_l {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n :=
if h : (ons_hitSet e rev v).Nonempty then (ons_hitSet e rev v).min' h else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:190
Uses 1 · Used by 3
DefinitionLast position meeting the reverse of the first hit#✓fully proved
The last position where v meets the reverse of its entry at ons_l e rev v (0 if there is
none).
noncomputable def ons_m {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n :=
if h : (ons_mSet e rev v).Nonempty then (ons_mSet e rev v).max' h else 0
noncomputable def ons_mSet {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Finset (Fin n) :=
{j | v j = rev (v (ons_l e rev v))}
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:195
Uses 1 · Used by 3
DefinitionSherman's segment-reversal surgery#✓fully proved
Sherman's surgery: reverse the segment between ons_l and ons_m when v visits both e and
rev e; otherwise leave v unchanged.
noncomputable def ons_surgery {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n → E :=
if (∃ i, v i = e) ∧ (∃ j, v j = rev e) then
ons_revSeg rev (ons_l e rev v) (ons_m e rev v) v
else v
def ons_revSeg {E} {n : ℕ} [NeZero n] (rev : E → E) (l m : Fin n) (v : Fin n → E) :
Fin n → E :=
fun k => if l ≤ k ∧ k ≤ m then rev (v (ons_mir l m k)) else v k
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:152
noncomputable def ons_l {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n :=
if h : (ons_hitSet e rev v).Nonempty then (ons_hitSet e rev v).min' h else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:190
noncomputable def ons_m {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n :=
if h : (ons_mSet e rev v).Nonempty then (ons_mSet e rev v).max' h else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:206
Uses 3 · Used by 2
LemmaSherman's Lemma 5#✓fully proved
If the surgery reverses the sign of loop weights, the loops that visit
both e and rev e have total weight zero (S. Sherman, Combinatorial aspects of the Ising model
for ferromagnetism. I, 1960).
lemma ons_lemma5 {E} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (e : E) (rev : E → E) (hrev : Function.Involutive rev)
(hrne : rev e ≠ e)
(hsign : ∀ v ∈ ons_loopSetBoth (n := n) e (rev e),
ons_loopWeight Λ (ons_surgery e rev v) = - ons_loopWeight Λ v) :
∑ v ∈ ons_loopSetBoth (n := n) e (rev e), ons_loopWeight Λ v = 0
noncomputable def ons_loopSetBoth {E} [Fintype E] [DecidableEq E] {n : ℕ}
(a b : E) : Finset (Fin n → E) :=
{v ∈ (Finset.univ : Finset (Fin n → E)) | (∃ i, v i = a) ∧ (∃ j, v j = b)}
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:82
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
noncomputable def ons_surgery {E} [DecidableEq E] {n : ℕ} [NeZero n] (e : E) (rev : E → E)
(v : Fin n → E) : Fin n → E :=
if (∃ i, v i = e) ∧ (∃ j, v j = rev e) then
ons_revSeg rev (ons_l e rev v) (ons_m e rev v) v
else v
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLemma5.lean:212
Uses 9 · Used by 1
DefinitionReverse of a closed walk#✓fully proved
The reverse of a closed walk: position k carries the reverse of the dart at position -k.
def ons_loopRev (L : ℕ) {n : ℕ} [NeZero n] (v : Fin n → ons_Dart L) : Fin n → ons_Dart L :=
fun k => ons_dartRev L (v (-k))
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
Uses 2 · Used by 2
DefinitionRotation-orbit equivalence on cyclic sequences#✓fully proved
The rotation-orbit equivalence relation on cyclic sequences: v ∼ w when w is obtained from
v by an iterated rotation.
StatMech.Onsager.ons_orbitSetoid · 17 lines
def ons_orbitSetoid (E : Type*) [Fintype E] [DecidableEq E] (n : ℕ) [NeZero n] :
Setoid (Fin n → E) where
r v w := ∃ j : ℕ, ons_cyclicShift^[j] v = w
iseqv :=
{ refl := fun _ => ⟨0, rfl⟩
symm := by
rintro v w ⟨j, rfl⟩
refine ⟨(n - 1) * j, ?_⟩
have hmul : (n - 1) * j + j = n * j := by
have h1 : n - 1 + 1 = n := Nat.succ_pred_eq_of_pos (Nat.pos_of_neZero n)
calc (n - 1) * j + j = (n - 1) * j + 1 * j := by rw [one_mul]
_ = (n - 1 + 1) * j := by rw [add_mul]
_ = n * j := by rw [h1]
rw [← Function.iterate_add_apply, hmul, ons_cyclicShift_iterate_mul_self]
trans := by
rintro u v w ⟨i, rfl⟩ ⟨j, rfl⟩
exact ⟨j + i, by rw [Function.iterate_add_apply]⟩ }
def ons_cyclicShift {E : Type*} {n : ℕ} [NeZero n] (v : Fin n → E) : Fin n → E :=
fun k => v (k + 1)
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:60
Uses 1 · Used by 1
DefinitionChosen representative of a rotation orbit#✓fully proved
A chosen representative of the rotation orbit of v.
noncomputable def ons_rep (v : Fin n → E) : Fin n → E :=
(Quotient.mk (ons_orbitSetoid E n) v).out
def ons_orbitSetoid (E : Type*) [Fintype E] [DecidableEq E] (n : ℕ) [NeZero n] :
Setoid (Fin n → E) where
r v w := ∃ j : ℕ, ons_cyclicShift^[j] v = w
iseqv :=
{ refl := fun _ => ⟨0, rfl⟩
symm := by
rintro v w ⟨j, rfl⟩
refine ⟨(n - 1) * j, ?_⟩
have hmul : (n - 1) * j + j = n * j := by
have h1 : n - 1 + 1 = n := Nat.succ_pred_eq_of_pos (Nat.pos_of_neZero n)
calc (n - 1) * j + j = (n - 1) * j + 1 * j := by rw [one_mul]
_ = (n - 1 + 1) * j := by rw [add_mul]
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanOrbitSum.lean:109
Uses 1 · Used by 1
DefinitionNumber of sequences with a given orbit representative#✓fully proved
The number of sequences whose chosen orbit representative is r; for a representative r this
is the size of its rotation orbit, and 0 otherwise.
noncomputable def ons_orbitCard (r : Fin n → E) : ℕ :=
(Finset.univ.filter (fun v => ons_rep v = r)).card
noncomputable def ons_rep (v : Fin n → E) : Fin n → E :=
(Quotient.mk (ons_orbitSetoid E n) v).out
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanOrbitSum.lean:128
Uses 1
DefinitionRotation of a cyclic sequence by \(k\) steps#✓fully proved
Rotation of a cyclic sequence by k steps: (ons_rotate k v) j = v (j + k).
DefinitionRotation by \(k\) as an equivalence of sequences#✓fully proved
Rotation by k as an equivalence of Fin n → E, with inverse the rotation by -k.
def ons_rotateEquiv (k : Fin n) : (Fin n → E) ≃ (Fin n → E) where
toFun := ons_rotate k
invFun := ons_rotate (-k)
left_inv v := by
funext j
simp [ons_rotate, add_assoc]
right_inv v := by
funext j
simp [ons_rotate, add_assoc]
def ons_rotate (k : Fin n) (v : Fin n → E) : Fin n → E :=
fun j => v (j + k)
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanReroot.lean:61
Uses 1 · Used by 1
DefinitionNumber of visits of a sequence to a state#✓fully proved
The number of positions k with v k = e.
def ons_visitCount (e : E) (v : Fin n → E) : ℕ :=
Fintype.card {k : Fin n // v k = e}
Used by 1
DefinitionEdge weight of a walk#✓fully proved
The edge weight Λ e₀ e₁ * Λ e₁ e₂ * ⋯ * Λ eₖ₋₁ eₖ of a walk [e₀, …, eₖ]; walks with at most
one entry have weight 1.
DefinitionGluing of walk segments at a root#✓fully proved
Concatenation of walk segments sharing their end points at e: each segment except the last
loses its final entry, and the result ends in e.
Used by 2
DefinitionSplitting a list at the occurrences of a root#✓fully proved
Splitting of a list at the occurrences of e: each piece runs from one occurrence of e to the
next.
def ons_firstReturnSplit (e : E) : List E → List (List E)
| [] => []
| x :: r =>
match hpost : r.dropWhile (fun y => y ≠ e) with
| [] => [x :: r]
| e' :: post' =>
(x :: r.takeWhile (fun y => y ≠ e) ++ [e']) :: ons_firstReturnSplit e (e' :: post')
termination_by l => l.length
decreasing_by
have hle := List.length_dropWhile_le (fun y => decide (y ≠ e)) r
rw [hpost] at hle
simp only [List.length_cons] at hle ⊢
omega
DefinitionFirst-return segment at a state#✓fully proved
A first-return segment at e: a list e :: interior ++ [e] whose interior avoids e.
DefinitionFirst-return segments of a closed walk#✓fully proved
The first-return segments of a closed walk at e, without the trailing one-element piece [e].
def ons_firstReturnFactors (e : E) (w : List E) : List (List E) :=
(ons_firstReturnSplit e w).dropLast
def ons_firstReturnSplit (e : E) : List E → List (List E)
| [] => []
| x :: r =>
match hpost : r.dropWhile (fun y => y ≠ e) with
| [] => [x :: r]
| e' :: post' =>
(x :: r.takeWhile (fun y => y ≠ e) ++ [e']) :: ons_firstReturnSplit e (e' :: post')
termination_by l => l.length
decreasing_by
have hle := List.length_dropWhile_le (fun y => decide (y ≠ e)) r
rw [hpost] at hle
simp only [List.length_cons] at hle ⊢
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:168
Uses 1 · Used by 3
DefinitionRooted closed walk at a state avoiding another#✓fully proved
A rooted closed walk at e avoiding r: a list starting and ending at e that never contains
r.
def ons_validRootedList (e r : E) (w : List E) : Prop :=
w.head? = some e ∧ w.getLast? = some e ∧ ∀ x ∈ w, x ≠ r
Used by 2
DefinitionList of first-return segments avoiding a state#✓fully proved
A list of first-return segments at e, none of which contains r.
def ons_validFactorList (e r : E) (ss : List (List E)) : Prop :=
∀ s ∈ ss, ons_isFirstReturnSegment e s ∧ ∀ x ∈ s, x ≠ r
def ons_isFirstReturnSegment (e : E) (s : List E) : Prop :=
∃ interior : List E,
s = e :: interior ++ [e] ∧ ∀ x ∈ interior, x ≠ e
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:241
Uses 1 · Used by 2
DefinitionRooted closed walks as lists of first-return segments#✓fully proved
Rooted closed walks at e avoiding r are equivalent to lists of first-return segments
avoiding r, by splitting and gluing.
StatMech.Onsager.ons_rootedFactorEquiv · 28 lines
def ons_rootedFactorEquiv (e r : E) (her : e ≠ r) :
{w : List E // ons_validRootedList e r w} ≃
{ss : List (List E) // ons_validFactorList e r ss} where
toFun w := ⟨ons_firstReturnFactors e w.1,
firstReturnFactors_valid e r w.1 w.2⟩
invFun ss := ⟨ons_glue e ss.1, by
have hfirst : ∀ s ∈ ss.1, ons_isFirstReturnSegment e s :=
fun s hs => (ss.2 s hs).1
have hhead : ∀ s ∈ ss.1, s.head? = some e :=
fun s hs => ons_firstReturnSegment_head (hfirst s hs)
have hlast : ∀ s ∈ ss.1, s.getLast? = some e :=
fun s hs => ons_firstReturnSegment_last (hfirst s hs)
refine ⟨?_, ?_, avoids_glue e r her ss.1 ss.2⟩
· obtain ⟨tail, htail⟩ := ons_glue_head e ss.1 hhead
rw [htail]
simp
· exact glue_getLast e ss.1⟩
left_inv w := by
apply Subtype.ext
exact (ons_firstReturnFactors_spec e w.1 w.2.1 w.2.2.1).2.2
right_inv ss := by
apply Subtype.ext
have hfirst : ∀ s ∈ ss.1, ons_isFirstReturnSegment e s :=
fun s hs => (ss.2 s hs).1
change ons_firstReturnFactors e (ons_glue e ss.1) = ss.1
unfold ons_firstReturnFactors
rw [ons_firstReturnSplit_glue e ss.1 hfirst]
simp
def ons_validRootedList (e r : E) (w : List E) : Prop :=
w.head? = some e ∧ w.getLast? = some e ∧ ∀ x ∈ w, x ≠ r
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanGenericCancellation.lean:60
def ons_validFactorList (e r : E) (ss : List (List E)) : Prop :=
∀ s ∈ ss, ons_isFirstReturnSegment e s ∧ ∀ x ∈ s, x ≠ r
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanGenericCancellation.lean:64
def ons_firstReturnFactors (e : E) (w : List E) : List (List E) :=
(ons_firstReturnSplit e w).dropLast
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:461
lemma firstReturnFactors_valid (e r : E) (w : List E)
(hw : ons_validRootedList e r w) :
ons_validFactorList e r (ons_firstReturnFactors e w)
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanGenericCancellation.lean:135
def ons_glue (e : E) (ss : List (List E)) : List E :=
ss.foldr (fun s acc => s.dropLast ++ acc) [e]
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:111
Uses 6 · Used by 1
DefinitionWeight of a first-return segment avoiding a state#✓fully proved
The edge weight of s if s is a first-return segment at e avoiding r, and 0 otherwise.
DefinitionRooted term: walk weight over its number of first-return factors#✓fully proved
The rooted term of a walk: its edge weight divided by its number of first-return factors at e.
noncomputable def ons_rootedListTerm (Lambda : Matrix E E ℂ) (e : E)
(w : List E) : ℂ :=
ons_edgeWeight Lambda w / ((ons_firstReturnFactors e w).length : ℂ)
noncomputable def ons_edgeWeight (Λ : Matrix E E ℂ) : List E → ℂ
| [] => 1
| [_] => 1
| a :: b :: t => Λ a b * ons_edgeWeight Λ (b :: t)
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:67
def ons_firstReturnFactors (e : E) (w : List E) : List (List E) :=
(ons_firstReturnSplit e w).dropLast
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanSplit.lean:461
Uses 2 · Used by 1
DefinitionTwisted bucket: walks through a dart, not its reverse#✓fully proved
The total twisted Kac-Ward weight of closed walks of length n + 1 visiting e but not its
reverse.
noncomputable def ons_phaseBucketE
(L : ℕ) [NeZero L] (x omega : ℂ) (a b : Fin 2)
(e : ons_Dart L) (n : ℕ) : ℂ :=
∑ d ∈ Finset.univ.filter (fun d : Fin (n + 1) → ons_Dart L =>
(∃ i, d i = e) ∧ ¬ (∃ j, d j = ons_dartRev L e)),
ons_loopWeight (ons_KWmatPhase L x omega
(ons_spinPhase L a) (ons_spinPhase L b)) d
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
DefinitionTwisted bucket: walks avoiding a dart and its reverse#✓fully proved
The total twisted Kac-Ward weight of closed walks of length n + 1 visiting neither e nor its
reverse.
noncomputable def ons_phaseBucketN
(L : ℕ) [NeZero L] (x omega : ℂ) (a b : Fin 2)
(e : ons_Dart L) (n : ℕ) : ℂ :=
∑ d ∈ Finset.univ.filter (fun d : Fin (n + 1) → ons_Dart L =>
¬ (∃ i, d i = e) ∧ ¬ (∃ j, d j = ons_dartRev L e)),
ons_loopWeight (ons_KWmatPhase L x omega
(ons_spinPhase L a) (ons_spinPhase L b)) d
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
DefinitionMasked twisted bucket: walks through a dart, not its reverse#✓fully proved
As ons_phaseBucketE, for the twisted matrix with the darts of forbidden masked.
noncomputable def ons_maskPhaseBucketE
(L : ℕ) [NeZero L] (x omega : ℂ) (a b : Fin 2)
(forbidden : Finset (ons_Dart L)) (e : ons_Dart L) (n : ℕ) : ℂ :=
∑ d ∈ Finset.univ.filter (fun d : Fin (n + 1) → ons_Dart L =>
(∃ i, d i = e) ∧ ¬ (∃ j, d j = ons_dartRev L e)),
ons_loopWeight
(ons_maskMatrix forbidden (ons_KWmatPhase L x omega
(ons_spinPhase L a) (ons_spinPhase L b))) d
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
def ons_maskMatrix {E : Type*} [DecidableEq E]
(forbidden : Finset E) (Λ : Matrix E E ℂ) : Matrix E E ℂ :=
fun i j => if i ∈ forbidden ∨ j ∈ forbidden then 0 else Λ i j
PhyslibExt/CondensedMatter/IsingModel/Onsager/DetWalkExp.lean:69
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
DefinitionMasked twisted bucket: walks avoiding a dart and its reverse#✓fully proved
As ons_phaseBucketN, for the twisted matrix with the darts of forbidden masked.
noncomputable def ons_maskPhaseBucketN
(L : ℕ) [NeZero L] (x omega : ℂ) (a b : Fin 2)
(forbidden : Finset (ons_Dart L)) (e : ons_Dart L) (n : ℕ) : ℂ :=
∑ d ∈ Finset.univ.filter (fun d : Fin (n + 1) → ons_Dart L =>
¬ (∃ i, d i = e) ∧ ¬ (∃ j, d j = ons_dartRev L e)),
ons_loopWeight
(ons_maskMatrix forbidden (ons_KWmatPhase L x omega
(ons_spinPhase L a) (ons_spinPhase L b))) d
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
def ons_maskMatrix {E : Type*} [DecidableEq E]
(forbidden : Finset E) (Λ : Matrix E E ℂ) : Matrix E E ℂ :=
fun i j => if i ∈ forbidden ∨ j ∈ forbidden then 0 else Λ i j
PhyslibExt/CondensedMatter/IsingModel/Onsager/DetWalkExp.lean:69
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
DefinitionWalk-series square root of the twisted Kac-Ward determinant#✓fully proved
The walk-series square root of the twisted Kac-Ward determinant with boundary phases a, b at
activity x.
noncomputable def ons_spinWalkRoot
(L : ℕ) [NeZero L] (x : ℝ) (a b : Fin 2) : ℂ :=
ons_detWalkRoot (ons_KWmatPhase L (x : ℂ) ons_turnRoot
(ons_spinPhase L a) (ons_spinPhase L b))
noncomputable def ons_detWalkRoot {E : Type*} [Fintype E] [DecidableEq E]
(Λ : Matrix E E ℂ) : ℂ :=
Complex.exp (-(∑' n : ℕ,
(∑ v : Fin (n + 1) → E,
∏ k : Fin (n + 1), Λ (v k) (v (k + 1))) / (n + 1)) / 2)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DetWalkExp.lean:60
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_turnRoot : ℂ := Complex.exp (Complex.I * (Real.pi / 4))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWDetLimit.lean:59
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
DefinitionExponential of minus half the series avoiding a dart and its reverse#✓fully proved
The exponential of minus one half of the series of closed walks avoiding e and its reverse.
noncomputable def ons_phaseAvoidRoot
(L : ℕ) [NeZero L] (x : ℝ) (a b : Fin 2)
(e : ons_Dart L) : ℂ :=
Complex.exp (-(∑' n : ℕ,
ons_phaseBucketN L (x : ℂ) ons_turnRoot a b e n /
((n : ℂ) + 1)) / 2)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def ons_phaseBucketN
(L : ℕ) [NeZero L] (x omega : ℂ) (a b : Fin 2)
(e : ons_Dart L) (n : ℕ) : ℂ :=
∑ d ∈ Finset.univ.filter (fun d : Fin (n + 1) → ons_Dart L =>
¬ (∃ i, d i = e) ∧ ¬ (∃ j, d j = ons_dartRev L e)),
ons_loopWeight (ons_KWmatPhase L x omega
(ons_spinPhase L a) (ons_spinPhase L b)) d
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanProductFormula.lean:72
noncomputable def ons_turnRoot : ℂ := Complex.exp (Complex.I * (Real.pi / 4))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWDetLimit.lean:59
DefinitionAdding a dart and its reverse to the masked set#✓fully proved
Add a dart and its reverse to a set of masked darts.
def ons_addDartPair (L : ℕ) (forbidden : Finset (ons_Dart L))
(e : ons_Dart L) : Finset (ons_Dart L) :=
({e, ons_dartRev L e} : Finset (ons_Dart L)) ∪ forbidden
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
Uses 2 · Used by 2
DefinitionMasked darts after pairwise elimination along a list#✓fully proved
The set of masked darts after eliminating the darts of a list, pair by pair.
def ons_maskAfter (L : ℕ) (forbidden : Finset (ons_Dart L)) :
List (ons_Dart L) → Finset (ons_Dart L)
| [] => forbidden
| e :: es => ons_maskAfter L (ons_addDartPair L forbidden e) es
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_addDartPair (L : ℕ) (forbidden : Finset (ons_Dart L))
(e : ons_Dart L) : Finset (ons_Dart L) :=
({e, ons_dartRev L e} : Finset (ons_Dart L)) ∪ forbidden
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanProductFormula.lean:617
Uses 2
DefinitionProduct of first-return factors along a dart elimination#✓fully proved
The product of the factors 1 - λ_e along a list of darts, each first-return weight λ_e
computed with the previously eliminated darts masked.
noncomputable def ons_maskEliminationProduct
(L : ℕ) [NeZero L] (x : ℝ) (a b : Fin 2)
(forbidden : Finset (ons_Dart L)) : List (ons_Dart L) → ℂ
| [] => 1
| e :: es =>
(1 - ∑' s, ons_firstReturnWeight
(ons_maskMatrix forbidden
(ons_KWmatPhase L (x : ℂ) ons_turnRoot
(ons_spinPhase L a) (ons_spinPhase L b)))
e (ons_dartRev L e) s) *
ons_maskEliminationProduct L x a b
(ons_addDartPair L forbidden e) es
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def ons_firstReturnWeight (Lambda : Matrix E E ℂ) (e r : E)
(s : List E) : ℂ := by
classical
exact if ons_isFirstReturnSegment e s ∧ (∀ x ∈ s, x ≠ r) then
ons_edgeWeight Lambda s
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanGenericCancellation.lean:183
def ons_maskMatrix {E : Type*} [DecidableEq E]
(forbidden : Finset E) (Λ : Matrix E E ℂ) : Matrix E E ℂ :=
fun i j => if i ∈ forbidden ∨ j ∈ forbidden then 0 else Λ i j
PhyslibExt/CondensedMatter/IsingModel/Onsager/DetWalkExp.lean:69
noncomputable def ons_KWmatPhase (L : ℕ) (x omega u v : ℂ) :
Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d2 d1 => ons_dirPhase u v d1.2 * ons_KWmat L x omega d2 d1
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:111
noncomputable def ons_turnRoot : ℂ := Complex.exp (Complex.I * (Real.pi / 4))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWDetLimit.lean:59
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
def ons_dartRev (L : ℕ) (d : ons_Dart L) : ons_Dart L :=
(ons_dirStep L d.2 d.1, d.2 + 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TurningTelescope.lean:59
def ons_addDartPair (L : ℕ) (forbidden : Finset (ons_Dart L))
(e : ons_Dart L) : Finset (ons_Dart L) :=
({e, ons_dartRev L e} : Finset (ons_Dart L)) ∪ forbidden
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanProductFormula.lean:617
Uses 8
DefinitionMatrix bucket: walks through one state avoiding another#✓fully proved
The total weight of closed walks of length n + 1 of M that visit e but not r.
noncomputable def ons_matrixBucketE
{E : Type*} [Fintype E] [DecidableEq E]
(M : Matrix E E ℂ) (e r : E) (n : ℕ) : ℂ :=
∑ loop ∈ Finset.univ.filter
(fun loop : Fin (n + 1) → E ↦
(∃ i, loop i = e) ∧ ¬ ∃ j, loop j = r),
ons_loopWeight M loop
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
Uses 1 · Used by 1
DefinitionMatrix bucket: walks avoiding two given states#✓fully proved
The total weight of closed walks of length n + 1 of M that visit neither e nor r.
noncomputable def ons_matrixBucketN
{E : Type*} [Fintype E] [DecidableEq E]
(M : Matrix E E ℂ) (e r : E) (n : ℕ) : ℂ :=
∑ loop ∈ Finset.univ.filter
(fun loop : Fin (n + 1) → E ↦
¬ (∃ i, loop i = e) ∧ ¬ ∃ j, loop j = r),
ons_loopWeight M loop
noncomputable def ons_loopWeight {E : Type*} [Fintype E] [DecidableEq E] (Λ : Matrix E E ℂ)
{n : ℕ} [NeZero n] (v : Fin n → E) : ℂ := ∏ k : Fin n, Λ (v k) (v (k + 1))
PhyslibExt/CondensedMatter/IsingModel/Onsager/ShermanLoop.lean:56
Uses 1 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.