Trivalent decoration of the torus
DefinitionSpin boundary-phase gauge at a site#✓fully proved
The gauge u^{s₁} v^{s₂} at site s, with u, v the spin boundary phases.
noncomputable def ons_spinVertexGauge
(L : ℕ) (a b : Fin 2) (site : ZMod L × ZMod L) : ℂ :=
ons_spinPhase L a ^ (site.1.val : ℤ) *
ons_spinPhase L b ^ (site.2.val : ℤ)
noncomputable def ons_spinPhase (L : ℕ) (a : Fin 2) : ℂ :=
Complex.exp (Complex.I * ((Real.pi * a.val / L : ℝ) : ℂ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:268
Uses 1 · Used by 2
DefinitionSeam sign of a dart#✓fully proved
The seam sign
(-1)^{a · (signed vertical seam crossing) + b · (signed horizontal seam crossing)} of a dart.
noncomputable def ons_spinDartSeamSign
{L : ℕ} (a b : Fin 2) (d : ons_Dart L) : ℂ :=
(-1 : ℂ) ^ ((a.val : ℤ) * ons_xWrapSign d +
(b.val : ℤ) * ons_yWrapSign d)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_xWrapSign {L : ℕ} (d : ons_Dart L) : ℤ :=
if d.2 = 0 ∧ d.1.1 = -1 then 1
else if d.2 = 2 ∧ d.1.1 = 0 then -1 else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusLoopHomology.lean:80
def ons_yWrapSign {L : ℕ} (d : ons_Dart L) : ℤ :=
if d.2 = 1 ∧ d.1.2 = -1 then 1
else if d.2 = 3 ∧ d.1.2 = 0 then -1 else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusLoopHomology.lean:86
Uses 3 · Used by 2
DefinitionDecorated weights twisted by seam signs#✓fully proved
Decorated weights with every external edge multiplied by the seam sign of its dart.
noncomputable def ons_spinSeamDecWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(a b : Fin 2) (edge : ons_DecEdge L) : ℂ := by
classical
exact if h : ons_decIsExternal edge then
ons_spinDartSeamSign a b (Classical.choose h) * decWeight edge
else decWeight edge
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
Uses 5 · Used by 1
DefinitionDiagonal gauge conjugation of a matrix#✓fully proved
Diagonal conjugation gauge i * M i j * (gauge j)⁻¹.
noncomputable def ons_diagonalGaugeMatrix
{E : Type*} (gauge : E → ℂ) (M : Matrix E E ℂ) :
Matrix E E ℂ :=
fun i j ↦ gauge i * M i j * (gauge j)⁻¹
Used by 1
DefinitionGauge on the states of the augmented matrix#✓fully proved
The gauge on the states of the augmented matrix: the site gauge on darts, and the gauge of
site on the two side states.
noncomputable def ons_decMiddleStateGauge
(L : ℕ) (a b : Fin 2) (site : ZMod L × ZMod L) :
ons_Dart L ⊕ Fin 2 → ℂ
| .inl d => ons_spinVertexGauge L a b d.1
| .inr _ => ons_spinVertexGauge L a b site
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def ons_spinVertexGauge
(L : ℕ) (a b : Fin 2) (site : ZMod L × ZMod L) : ℂ :=
ons_spinPhase L a ^ (site.1.val : ℤ) *
ons_spinPhase L b ^ (site.2.val : ℤ)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationSpinGauge.lean:64
Uses 2
DefinitionInternal adjacency of the torus decoration#✓fully proved
Internal adjacency of the decoration: two darts at the same site whose directions are
consecutive in 0, 1, 2, 3.
def ons_decInternalAdj {L : ℕ} (d e : ons_Dart L) : Prop :=
d.1 = e.1 ∧ (d.2.val + 1 = e.2.val ∨ e.2.val + 1 = d.2.val)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 1 · Used by 22
DefinitionAdjacency of the decorated torus graph#✓fully proved
Adjacency of the decorated graph: a dart is joined to its reverse and to its internal neighbors.
def ons_decAdj (L : ℕ) (d e : ons_Dart L) : Prop :=
e = ons_dartRev L d ∨ ons_decInternalAdj d e
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
def ons_decInternalAdj {L : ℕ} (d e : ons_Dart L) : Prop :=
d.1 = e.1 ∧ (d.2.val + 1 = e.2.val ∨ e.2.val + 1 = d.2.val)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:73
Uses 3 · Used by 17
DefinitionDecorated graph of the torus#✓fully proved
The decorated graph of the torus: vertices are darts, external edges join each dart to its
reverse, and internal edges form the path (s, 0) - (s, 1) - (s, 2) - (s, 3) at each site s.
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decAdj (L : ℕ) (d e : ons_Dart L) : Prop :=
e = ons_dartRev L d ∨ ons_decInternalAdj d e
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:78
lemma ons_decAdj_symm (L : ℕ) : Symmetric (ons_decAdj L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:87
Uses 5 · Used by 39
DefinitionInternal neighbors of a dart in the decoration#✓fully proved
The internal neighbors of a dart in the path at its site.
def ons_decInternalNeighbors {L : ℕ} (d : ons_Dart L) : Finset (ons_Dart L) :=
match d.2 with
| 0 => {(d.1, 1)}
| 1 => {(d.1, 0), (d.1, 2)}
| 2 => {(d.1, 1), (d.1, 3)}
| 3 => {(d.1, 2)}
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
DefinitionInternal-edge bits completing port bits at a site#✓fully proved
The internal-edge bits (b₀, b₀ + b₁, b₀ + b₁ + b₂) that complete port bits b₀, …, b₃ at one
site to an even subgraph.
DefinitionParity condition of the decoration at one site#✓fully proved
Parity of the decorated subgraph at the four darts of one site, for port bits b₀, …, b₃ and
internal-edge bits y.
StructurePort pattern on the darts of the torus#✓fully proved
A port pattern: one bit per dart, equal on a dart and its reverse, with an even number of ones at each site. Port patterns encode even subgraphs of the torus.
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
bit : ons_Dart L → Fin 2
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:204
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 13
DefinitionInternal-edge bits at a site from a port pattern#✓fully proved
The internal-edge bits at a site determined by a port pattern.
def ons_portChainBit {L : ℕ} (P : ons_PortPattern L)
(s : ZMod L × ZMod L) : Fin 3 → Fin 2 :=
ons_decChainCompletion (P.bit (s, 0)) (P.bit (s, 1)) (P.bit (s, 2))
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
def ons_decChainCompletion (b0 b1 b2 : Fin 2) : Fin 3 → Fin 2 :=
![b0, b0 + b1, b0 + b1 + b2]
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:150
Uses 3 · Used by 3
DefinitionPort-pattern bit of the decorated edge between two darts#✓fully proved
The bit of the decorated edge between d and e determined by a port pattern.
def ons_decNeighborBit {L : ℕ} (P : ons_PortPattern L)
(d e : ons_Dart L) : Fin 2 :=
if e = ons_dartRev L d then P.bit d else
if d.1 = e.1 then
match d.2, e.2 with
| 0, 1 | 1, 0 => ons_portChainBit P d.1 0
| 1, 2 | 2, 1 => ons_portChainBit P d.1 1
| 2, 3 | 3, 2 => ons_portChainBit P d.1 2
| _, _ => 0
else 0
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
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
def ons_portChainBit {L : ℕ} (P : ons_PortPattern L)
(s : ZMod L × ZMod L) : Fin 3 → Fin 2 :=
ons_decChainCompletion (P.bit (s, 0)) (P.bit (s, 1)) (P.bit (s, 2))
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:217
DefinitionPort-pattern bit of an unordered decorated edge#✓fully proved
The bit of a decorated edge determined by a port pattern.
def ons_decEdgeBit {L : ℕ} (P : ons_PortPattern L) :
Sym2 (ons_Dart L) → Fin 2 :=
Sym2.lift ⟨ons_decNeighborBit P, ons_decNeighborBit_symm P⟩
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decNeighborBit {L : ℕ} (P : ons_PortPattern L)
(d e : ons_Dart L) : Fin 2 :=
if e = ons_dartRev L d then P.bit d else
if d.1 = e.1 then
match d.2, e.2 with
| 0, 1 | 1, 0 => ons_portChainBit P d.1 0
| 1, 2 | 2, 1 => ons_portChainBit P d.1 1
| 2, 3 | 3, 2 => ons_portChainBit P d.1 2
| _, _ => 0
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:222
lemma ons_decNeighborBit_symm {L : ℕ} (P : ons_PortPattern L)
(d e : ons_Dart L) :
ons_decNeighborBit P d e = ons_decNeighborBit P e d
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:233
DefinitionEven decorated subgraph determined by a port pattern#✓fully proved
The even subgraph of the decorated graph determined by a port pattern.
noncomputable def ons_decoratedEdges {L : ℕ} [NeZero L]
(P : ons_PortPattern L) : Finset (Sym2 (ons_Dart L)) :=
(ons_decGraph L).edgeFinset.filter (fun e => ons_decEdgeBit P e = 1)
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decEdgeBit {L : ℕ} (P : ons_PortPattern L) :
Sym2 (ons_Dart L) → Fin 2 :=
Sym2.lift ⟨ons_decNeighborBit P, ons_decNeighborBit_symm P⟩
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:257
DefinitionTorus edge underlying a dart#✓fully proved
The torus edge underlying a dart.
def ons_portEdge (L : ℕ) (d : ons_Dart L) : Sym2 (ZMod L × ZMod L) :=
s(d.1, ons_dirStep L d.2 d.1)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 2 · Used by 15
DefinitionPort bit of a dart for a torus edge set#✓fully proved
The bit of a dart in the port pattern of an edge set F: 1 if its underlying torus edge lies
in F.
def ons_portBit {L : ℕ} (F : Finset (Sym2 (ZMod L × ZMod L)))
(d : ons_Dart L) : Fin 2 :=
if ons_portEdge L d ∈ F then 1 else 0
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_portEdge (L : ℕ) (d : ons_Dart L) : Sym2 (ZMod L × ZMod L) :=
s(d.1, ons_dirStep L d.2 d.1)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:405
Uses 2 · Used by 1
DefinitionPort pattern of an even subgraph of the torus#✓fully proved
The port pattern of an even subgraph of the torus.
StatMech.Onsager.ons_evenSubgraphPortPattern · 29 lines
noncomputable def ons_evenSubgraphPortPattern (L : ℕ) [Fact (2 < L)]
(F : Finset (Sym2 (ZMod L × ZMod L)))
(hF : F ∈ evenSubgraphs (onsTorusGraph L)) : ons_PortPattern L where
bit := ons_portBit F
rev_bit := by
intro d
simp only [ons_portBit, ons_portEdge_rev]
site_even := by
intro v
have hdata := hF
rw [evenSubgraphs, Finset.mem_filter, Finset.mem_powerset] at hdata
have hFeq : F = (onsTorusGraph L).edgeFinset.filter (fun e => e ∈ F) := by
ext e
simp only [Finset.mem_filter]
constructor
· intro he
exact ⟨hdata.1 he, he⟩
· exact And.right
have hcast : ((incCount F v : ℕ) : ZMod 2) = 0 := by
apply (CharP.cast_eq_zero_iff (ZMod 2) 2 _).mpr
exact even_iff_two_dvd.mp (hdata.2 v)
have hsum := ons_cast_incCount_filter_eq_neighbor_sum
(onsTorusGraph L) (fun e => e ∈ F) v
rw [← hFeq, hcast] at hsum
rw [ons_torus_neighbor_sum_eq_direction_sum] at hsum
simp only [ons_portBit]
replace hsum := hsum.symm
simp only [ons_portEdge, Fin.sum_univ_four, add_assoc] at hsum ⊢
exact hsum
noncomputable def evenSubgraphs : Finset (Finset (Sym2 V)) :=
Gd.edgeFinset.powerset.filter IsEvenSubgraph
PhyslibExt/CondensedMatter/IsingModel/KramersWannierDuality.lean:65
def onsTorusGraph (L : ℕ) [Fact (2 < L)] : SimpleGraph (ZMod L × ZMod L) where
Adj := onsTorusAdj L
symm := by
refine ⟨?_⟩
rintro u v (⟨h1, h2 | h2⟩ | ⟨h1, h2 | h2⟩)
· exact Or.inl ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inl ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
loopless := by
have hne1 : (1 : ZMod L) ≠ 0 := by
have : Fact (1 < L) := ⟨by have := (Fact.out : 2 < L); omega⟩
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/Torus.lean:65
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
def ons_portBit {L : ℕ} (F : Finset (Sym2 (ZMod L × ZMod L)))
(d : ons_Dart L) : Fin 2 :=
if ons_portEdge L d ∈ F then 1 else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:494
Uses 11 · Used by 1
DefinitionPort bit of a dart in a decorated edge set#✓fully proved
The port bit of a dart in a decorated edge set: whether the external edge at the dart is present.
def ons_decoratedPortBit {L : ℕ}
(D : Finset (Sym2 (ons_Dart L))) (d : ons_Dart L) : Fin 2 :=
if s(d, ons_dartRev L d) ∈ D then 1 else 0
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 5
DefinitionInternal-edge bits of a decorated edge set at a site#✓fully proved
The three internal-edge bits of a decorated edge set at one site.
def ons_decoratedChainBits {L : ℕ}
(D : Finset (Sym2 (ons_Dart L))) (s : ZMod L × ZMod L) :
Fin 3 → Fin 2 :=
![if s((s, 0), (s, 1)) ∈ D then 1 else 0,
if s((s, 1), (s, 2)) ∈ D then 1 else 0,
if s((s, 2), (s, 3)) ∈ D then 1 else 0]
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 1 · Used by 2
DefinitionPort pattern of an even decorated subgraph#✓fully proved
The port pattern of an even subgraph of the decorated graph.
StatMech.Onsager.ons_portPatternOfDecorated · 16 lines
noncomputable def ons_portPatternOfDecorated (L : ℕ) [Fact (2 < L)]
(D : Finset (Sym2 (ons_Dart L)))
(hD : D ∈ evenSubgraphs (ons_decGraph L)) : ons_PortPattern L where
bit := ons_decoratedPortBit D
rev_bit := by
intro d
have hinv : ons_dartRev L (ons_dartRev L d) = d :=
ons_dartRev_involutive L d
have hedge : s(ons_dartRev L d, ons_dartRev L (ons_dartRev L d)) =
s(d, ons_dartRev L d) := by
rw [hinv]
exact Sym2.eq_swap
simp only [ons_decoratedPortBit, hedge]
site_even := by
intro s
exact ons_decChainEven_port_even (ons_decorated_local_even L D hD s)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def evenSubgraphs : Finset (Finset (Sym2 V)) :=
Gd.edgeFinset.powerset.filter IsEvenSubgraph
PhyslibExt/CondensedMatter/IsingModel/KramersWannierDuality.lean:65
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
def ons_decoratedPortBit {L : ℕ}
(D : Finset (Sym2 (ons_Dart L))) (d : ons_Dart L) : Fin 2 :=
if s(d, ons_dartRev L d) ∈ D then 1 else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:533
Uses 14 · Used by 4
DefinitionTorus edge set of a port pattern#✓fully proved
The torus edge set of a port pattern.
noncomputable def ons_portPatternEdges (L : ℕ) [NeZero L]
(P : ons_PortPattern L) :
Finset (Sym2 (ZMod L × ZMod L)) :=
(Finset.univ.filter (fun d : ons_Dart L => P.bit d = 1)).image
(ons_portEdge L)
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_portEdge (L : ℕ) (d : ons_Dart L) : Sym2 (ZMod L × ZMod L) :=
s(d.1, ons_dirStep L d.2 d.1)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:405
Uses 3 · Used by 4
DefinitionEquivalence between even torus subgraphs and port patterns#✓fully proved
Even subgraphs of the torus are equivalent to port patterns.
noncomputable def ons_evenSubgraphPortEquiv (L : ℕ) [Fact (2 < L)] :
{F : Finset (Sym2 (ZMod L × ZMod L)) //
F ∈ evenSubgraphs (onsTorusGraph L)} ≃ ons_PortPattern L where
toFun F := ons_evenSubgraphPortPattern L F.1 F.2
invFun P := ⟨ons_portPatternEdges L P, ons_portPatternEdges_even L P⟩
left_inv F := Subtype.ext (ons_portPatternEdges_evenSubgraphPortPattern L F.1 F.2)
right_inv P := ons_evenSubgraphPortPattern_portPatternEdges L P
noncomputable def evenSubgraphs : Finset (Finset (Sym2 V)) :=
Gd.edgeFinset.powerset.filter IsEvenSubgraph
PhyslibExt/CondensedMatter/IsingModel/KramersWannierDuality.lean:65
def onsTorusGraph (L : ℕ) [Fact (2 < L)] : SimpleGraph (ZMod L × ZMod L) where
Adj := onsTorusAdj L
symm := by
refine ⟨?_⟩
rintro u v (⟨h1, h2 | h2⟩ | ⟨h1, h2 | h2⟩)
· exact Or.inl ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inl ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
loopless := by
have hne1 : (1 : ZMod L) ≠ 0 := by
have : Fact (1 < L) := ⟨by have := (Fact.out : 2 < L); omega⟩
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/Torus.lean:65
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
noncomputable def ons_evenSubgraphPortPattern (L : ℕ) [Fact (2 < L)]
(F : Finset (Sym2 (ZMod L × ZMod L)))
(hF : F ∈ evenSubgraphs (onsTorusGraph L)) : ons_PortPattern L where
bit := ons_portBit F
rev_bit := by
intro d
simp only [ons_portBit, ons_portEdge_rev]
site_even := by
intro v
have hdata := hF
rw [evenSubgraphs, Finset.mem_filter, Finset.mem_powerset] at hdata
have hFeq : F = (onsTorusGraph L).edgeFinset.filter (fun e => e ∈ F) := by
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:499
noncomputable def ons_portPatternEdges (L : ℕ) [NeZero L]
(P : ons_PortPattern L) :
Finset (Sym2 (ZMod L × ZMod L)) :=
(Finset.univ.filter (fun d : ons_Dart L => P.bit d = 1)).image
(ons_portEdge L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:798
lemma ons_portPatternEdges_even (L : ℕ) [Fact (2 < L)]
(P : ons_PortPattern L) :
ons_portPatternEdges L P ∈ evenSubgraphs (onsTorusGraph L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:840
lemma ons_portPatternEdges_evenSubgraphPortPattern
(L : ℕ) [Fact (2 < L)]
(F : Finset (Sym2 (ZMod L × ZMod L)))
(hF : F ∈ evenSubgraphs (onsTorusGraph L)) :
ons_portPatternEdges L (ons_evenSubgraphPortPattern L F hF) = F
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:876
lemma ons_evenSubgraphPortPattern_portPatternEdges
(L : ℕ) [Fact (2 < L)] (P : ons_PortPattern L) :
ons_evenSubgraphPortPattern L (ons_portPatternEdges L P)
(ons_portPatternEdges_even L P) = P
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:900
Uses 12 · Used by 1
DefinitionEquivalence between even decorated subgraphs and port patterns#✓fully proved
Even subgraphs of the decorated graph are equivalent to port patterns.
noncomputable def ons_decoratedPortEquiv (L : ℕ) [Fact (2 < L)] :
{D : Finset (Sym2 (ons_Dart L)) //
D ∈ evenSubgraphs (ons_decGraph L)} ≃ ons_PortPattern L where
toFun D := ons_portPatternOfDecorated L D.1 D.2
invFun P := ⟨ons_decoratedEdges P, ons_decoratedEdges_even L P⟩
left_inv D := Subtype.ext (ons_decoratedEdges_portPatternOfDecorated L D.1 D.2)
right_inv P := ons_portPatternOfDecorated_decoratedEdges L P
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def evenSubgraphs : Finset (Finset (Sym2 V)) :=
Gd.edgeFinset.powerset.filter IsEvenSubgraph
PhyslibExt/CondensedMatter/IsingModel/KramersWannierDuality.lean:65
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
structure ons_PortPattern (L : ℕ) where
bit : ons_Dart L → Fin 2
rev_bit : ∀ d, bit (ons_dartRev L d) = bit d
site_even : ∀ s : ZMod L × ZMod L,
bit (s, 0) + bit (s, 1) + bit (s, 2) + bit (s, 3) = 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:203
noncomputable def ons_portPatternOfDecorated (L : ℕ) [Fact (2 < L)]
(D : Finset (Sym2 (ons_Dart L)))
(hD : D ∈ evenSubgraphs (ons_decGraph L)) : ons_PortPattern L where
bit := ons_decoratedPortBit D
rev_bit := by
intro d
have hinv : ons_dartRev L (ons_dartRev L d) = d :=
ons_dartRev_involutive L d
have hedge : s(ons_dartRev L d, ons_dartRev L (ons_dartRev L d)) =
s(d, ons_dartRev L d) := by
rw [hinv]
exact Sym2.eq_swap
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:601
noncomputable def ons_decoratedEdges {L : ℕ} [NeZero L]
(P : ons_PortPattern L) : Finset (Sym2 (ons_Dart L)) :=
(ons_decGraph L).edgeFinset.filter (fun e => ons_decEdgeBit P e = 1)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:266
lemma ons_decoratedEdges_even (L : ℕ) [Fact (2 < L)]
(P : ons_PortPattern L) :
ons_decoratedEdges P ∈ evenSubgraphs (ons_decGraph L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:729
lemma ons_decoratedEdges_portPatternOfDecorated (L : ℕ) [Fact (2 < L)]
(D : Finset (Sym2 (ons_Dart L)))
(hD : D ∈ evenSubgraphs (ons_decGraph L)) :
ons_decoratedEdges (ons_portPatternOfDecorated L D hD) = D
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:628
lemma ons_portPatternOfDecorated_decoratedEdges
(L : ℕ) [Fact (2 < L)] (P : ons_PortPattern L) :
ons_portPatternOfDecorated L (ons_decoratedEdges P)
(ons_decoratedEdges_even L P) = P
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:918
Uses 20 · Used by 1
DefinitionEquivalence between even subgraphs of the torus and its decoration#✓fully proved
Even subgraphs of the torus are equivalent to even subgraphs of the decorated graph.
noncomputable def ons_decorationEquiv (L : ℕ) [Fact (2 < L)] :
{F : Finset (Sym2 (ZMod L × ZMod L)) //
F ∈ evenSubgraphs (onsTorusGraph L)} ≃
{D : Finset (Sym2 (ons_Dart L)) //
D ∈ evenSubgraphs (ons_decGraph L)} :=
(ons_evenSubgraphPortEquiv L).trans (ons_decoratedPortEquiv L).symm
noncomputable def evenSubgraphs : Finset (Finset (Sym2 V)) :=
Gd.edgeFinset.powerset.filter IsEvenSubgraph
PhyslibExt/CondensedMatter/IsingModel/KramersWannierDuality.lean:65
def onsTorusGraph (L : ℕ) [Fact (2 < L)] : SimpleGraph (ZMod L × ZMod L) where
Adj := onsTorusAdj L
symm := by
refine ⟨?_⟩
rintro u v (⟨h1, h2 | h2⟩ | ⟨h1, h2 | h2⟩)
· exact Or.inl ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inl ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
loopless := by
have hne1 : (1 : ZMod L) ≠ 0 := by
have : Fact (1 < L) := ⟨by have := (Fact.out : 2 < L); omega⟩
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/Torus.lean:65
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
noncomputable def ons_evenSubgraphPortEquiv (L : ℕ) [Fact (2 < L)] :
{F : Finset (Sym2 (ZMod L × ZMod L)) //
F ∈ evenSubgraphs (onsTorusGraph L)} ≃ ons_PortPattern L where
toFun F := ons_evenSubgraphPortPattern L F.1 F.2
invFun P := ⟨ons_portPatternEdges L P, ons_portPatternEdges_even L P⟩
left_inv F := Subtype.ext (ons_portPatternEdges_evenSubgraphPortPattern L F.1 F.2)
right_inv P := ons_evenSubgraphPortPattern_portPatternEdges L P
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:910
noncomputable def ons_decoratedPortEquiv (L : ℕ) [Fact (2 < L)] :
{D : Finset (Sym2 (ons_Dart L)) //
D ∈ evenSubgraphs (ons_decGraph L)} ≃ ons_PortPattern L where
toFun D := ons_portPatternOfDecorated L D.1 D.2
invFun P := ⟨ons_decoratedEdges P, ons_decoratedEdges_even L P⟩
left_inv D := Subtype.ext (ons_decoratedEdges_portPatternOfDecorated L D.1 D.2)
right_inv P := ons_portPatternOfDecorated_decoratedEdges L P
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:932
Uses 11 · Used by 4
DefinitionOffset of a dart inside its 8 × 8 cell#✓fully proved
The offset of a dart in direction μ inside its 8 × 8 cell: east (6, 4), north (4, 6),
west (2, 4), south (4, 2).
def ons_decEmbedOffset (mu : Fin 4) : ℕ × ℕ :=
match mu with
| 0 => (6, 4)
| 1 => (4, 6)
| 2 => (2, 4)
| 3 => (4, 2)
DefinitionPosition of a dart in the 8L × 8L torus#✓fully proved
The position 8 s + offset(μ) of the dart (s, μ) in the 8L × 8L torus.
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decEmbedOffset (mu : Fin 4) : ℕ × ℕ :=
match mu with
| 0 => (6, 4)
| 1 => (4, 6)
| 2 => (2, 4)
| 3 => (4, 2)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:59
Uses 2 · Used by 7
DefinitionStep directions of the route of a decorated edge#✓fully proved
The four step directions of the route of the decorated edge from d to e: straight for an
external edge, an L-shaped turn for an internal edge.
def ons_decEdgeRouteDirs (L : ℕ) (d e : ons_Dart L) : Fin 4 → Fin 4 :=
if e = ons_dartRev L d then fun _ => d.2
else
match d.2, e.2 with
| 0, 1 => ![1, 1, 2, 2]
| 1, 0 => ![0, 0, 3, 3]
| 1, 2 => ![2, 2, 3, 3]
| 2, 1 => ![1, 1, 0, 0]
| 2, 3 => ![3, 3, 0, 0]
| 3, 2 => ![2, 2, 1, 1]
| _, _ => ![0, 0, 0, 0]
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
DefinitionEndpoint of four lattice steps#✓fully proved
The endpoint of four lattice steps in the given directions.
def ons_fourDirSteps (N : ℕ) (r : Fin 4 → Fin 4)
(p : ZMod N × ZMod N) : ZMod N × ZMod N :=
ons_dirStep N (r 3)
(ons_dirStep N (r 2)
(ons_dirStep N (r 1) (ons_dirStep N (r 0) p)))
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 1 · Used by 3
DefinitionTorus walk of four lattice steps#✓fully proved
The torus walk of four lattice steps in the given directions.
def ons_fourDirStepWalk (N : ℕ) [Fact (2 < N)]
(r : Fin 4 → Fin 4) (p : ZMod N × ZMod N) :
(onsTorusGraph N).Walk p (ons_fourDirSteps N r p) :=
.cons (ons_torusAdj_dirStep N p (r 0))
(.cons (ons_torusAdj_dirStep N (ons_dirStep N (r 0) p) (r 1))
(.cons (ons_torusAdj_dirStep N
(ons_dirStep N (r 1) (ons_dirStep N (r 0) p)) (r 2))
(.cons (ons_torusAdj_dirStep N
(ons_dirStep N (r 2)
(ons_dirStep N (r 1) (ons_dirStep N (r 0) p))) (r 3))
.nil)))
def onsTorusGraph (L : ℕ) [Fact (2 < L)] : SimpleGraph (ZMod L × ZMod L) where
Adj := onsTorusAdj L
symm := by
refine ⟨?_⟩
rintro u v (⟨h1, h2 | h2⟩ | ⟨h1, h2 | h2⟩)
· exact Or.inl ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inl ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inr (by rw [h2]; ring)⟩
· exact Or.inr ⟨h1.symm, Or.inl (by rw [h2]; ring)⟩
loopless := by
have hne1 : (1 : ZMod L) ≠ 0 := by
have : Fact (1 < L) := ⟨by have := (Fact.out : 2 < L); omega⟩
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/Torus.lean:65
def ons_fourDirSteps (N : ℕ) (r : Fin 4 → Fin 4)
(p : ZMod N × ZMod N) : ZMod N × ZMod N :=
ons_dirStep N (r 3)
(ons_dirStep N (r 2)
(ons_dirStep N (r 1) (ons_dirStep N (r 0) p)))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:138
lemma ons_torusAdj_dirStep (N : ℕ) [Fact (2 < N)]
(p : ZMod N × ZMod N) (mu : Fin 4) :
(onsTorusGraph N).Adj p (ons_dirStep N mu p)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:233
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 3 · Used by 2
DefinitionFiner 8L × 8L torus graph for the decorated graph#✓fully proved
The 8L × 8L torus graph in which the decorated graph is drawn.
def ons_decEmbedGraph (L : ℕ) [Fact (2 < L)] :
SimpleGraph (ZMod (8 * L) × ZMod (8 * L)) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
exact onsTorusGraph (8 * L)
DefinitionFour-step route of a decorated edge in the finer torus#✓fully proved
The four-step route of the decorated edge from d to e in the finer torus.
def ons_decEdgeRoute (L : ℕ) [Fact (2 < L)] (d e : ons_Dart L)
(hde : (ons_decGraph L).Adj d e) :
(ons_decEmbedGraph L).Walk
(ons_decEmbedVertex L d) (ons_decEmbedVertex L e) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
let w : (ons_decEmbedGraph L).Walk (ons_decEmbedVertex L d)
(ons_fourDirSteps (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)) := by
simpa [ons_decEmbedGraph] using
ons_fourDirStepWalk (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)
exact w.copy rfl (ons_decEdgeRoute_endpoint L d e hde)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decEmbedGraph (L : ℕ) [Fact (2 < L)] :
SimpleGraph (ZMod (8 * L) × ZMod (8 * L)) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
exact onsTorusGraph (8 * L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:253
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:67
Uses 12 · Used by 3
DefinitionFive points of the route of a decorated edge#✓fully proved
The five points of the route of the decorated edge from d to e.
def ons_decEdgeRouteVertices
(L : ℕ) (d e : ons_Dart L) : List (ZMod (8 * L) × ZMod (8 * L)) :=
let r := ons_decEdgeRouteDirs L d e
let p₀ := ons_decEmbedVertex L d
let p₁ := ons_dirStep (8 * L) (r 0) p₀
let p₂ := ons_dirStep (8 * L) (r 1) p₁
let p₃ := ons_dirStep (8 * L) (r 2) p₂
let p₄ := ons_dirStep (8 * L) (r 3) p₃
[p₀, p₁, p₂, p₃, p₄]
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decEdgeRouteDirs (L : ℕ) (d e : ons_Dart L) : Fin 4 → Fin 4 :=
if e = ons_dartRev L d then fun _ => d.2
else
match d.2, e.2 with
| 0, 1 => ![1, 1, 2, 2]
| 1, 0 => ![0, 0, 3, 3]
| 1, 2 => ![2, 2, 3, 3]
| 2, 1 => ![1, 1, 0, 0]
| 2, 3 => ![3, 3, 0, 0]
| 3, 2 => ![2, 2, 1, 1]
| _, _ => ![0, 0, 0, 0]
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:125
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:67
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 4 · Used by 1
StructureMicro point of the finer torus as a cell and an offset#✓fully proved
A point of the 8L × 8L torus given as a coarse cell and an offset in Fin 8 × Fin 8.
structure ons_DecMicroPoint (L : ℕ) where
cell : ZMod L × ZMod L
offsetX : Fin 8
offsetY : Fin 8
deriving DecidableEq
DefinitionPoint of the finer torus represented by a micro point#✓fully proved
The point of the finer torus represented by a micro point.
def ons_decMicroVertex (L : ℕ) (z : ons_DecMicroPoint L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * z.cell.1.val + z.offsetX.val : ℕ),
(8 * z.cell.2.val + z.offsetY.val : ℕ))
structure ons_DecMicroPoint (L : ℕ) where
cell : ZMod L × ZMod L
offsetX : Fin 8
offsetY : Fin 8
deriving DecidableEq
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:415
Uses 1 · Used by 1
DefinitionInterior points of the route of a decorated edge#✓fully proved
The three interior points of the route of the decorated edge from d to e, as micro points.
StatMech.Onsager.ons_decEdgeInteriorData · 21 lines
def ons_decEdgeInteriorData (L : ℕ) (d e : ons_Dart L) :
List (ons_DecMicroPoint L) :=
if e = ons_dartRev L d then
match d.2 with
| 0 => [⟨d.1, 7, 4⟩, ⟨ons_dirStep L 0 d.1, 0, 4⟩,
⟨ons_dirStep L 0 d.1, 1, 4⟩]
| 1 => [⟨d.1, 4, 7⟩, ⟨ons_dirStep L 1 d.1, 4, 0⟩,
⟨ons_dirStep L 1 d.1, 4, 1⟩]
| 2 => [⟨d.1, 1, 4⟩, ⟨d.1, 0, 4⟩,
⟨ons_dirStep L 2 d.1, 7, 4⟩]
| 3 => [⟨d.1, 4, 1⟩, ⟨d.1, 4, 0⟩,
⟨ons_dirStep L 3 d.1, 4, 7⟩]
else
match d.2, e.2 with
| 0, 1 => [⟨d.1, 6, 5⟩, ⟨d.1, 6, 6⟩, ⟨d.1, 5, 6⟩]
| 1, 0 => [⟨d.1, 5, 6⟩, ⟨d.1, 6, 6⟩, ⟨d.1, 6, 5⟩]
| 1, 2 => [⟨d.1, 3, 6⟩, ⟨d.1, 2, 6⟩, ⟨d.1, 2, 5⟩]
| 2, 1 => [⟨d.1, 2, 5⟩, ⟨d.1, 2, 6⟩, ⟨d.1, 3, 6⟩]
| 2, 3 => [⟨d.1, 2, 3⟩, ⟨d.1, 2, 2⟩, ⟨d.1, 3, 2⟩]
| 3, 2 => [⟨d.1, 3, 2⟩, ⟨d.1, 2, 2⟩, ⟨d.1, 2, 3⟩]
| _, _ => []
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
structure ons_DecMicroPoint (L : ℕ) where
cell : ZMod L × ZMod L
offsetX : Fin 8
offsetY : Fin 8
deriving DecidableEq
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:415
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_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 4 · Used by 1
DefinitionDecorated edge whose route passes through an interior micro point#✓fully proved
The decorated edge whose route passes through a given interior micro point.
StatMech.Onsager.ons_decMicroCorridorEdge · 19 lines
def ons_decMicroCorridorEdge (L : ℕ) (z : ons_DecMicroPoint L) :
Sym2 (ons_Dart L) :=
match z.offsetX.val, z.offsetY.val with
| 7, 4 => s((z.cell, 0), (ons_dirStep L 0 z.cell, 2))
| 0, 4 => s((ons_dirStep L 2 z.cell, 0), (z.cell, 2))
| 1, 4 => s((ons_dirStep L 2 z.cell, 0), (z.cell, 2))
| 4, 7 => s((z.cell, 1), (ons_dirStep L 1 z.cell, 3))
| 4, 0 => s((ons_dirStep L 3 z.cell, 1), (z.cell, 3))
| 4, 1 => s((ons_dirStep L 3 z.cell, 1), (z.cell, 3))
| 6, 5 => s((z.cell, 0), (z.cell, 1))
| 6, 6 => s((z.cell, 0), (z.cell, 1))
| 5, 6 => s((z.cell, 0), (z.cell, 1))
| 3, 6 => s((z.cell, 1), (z.cell, 2))
| 2, 6 => s((z.cell, 1), (z.cell, 2))
| 2, 5 => s((z.cell, 1), (z.cell, 2))
| 2, 3 => s((z.cell, 2), (z.cell, 3))
| 2, 2 => s((z.cell, 2), (z.cell, 3))
| 3, 2 => s((z.cell, 2), (z.cell, 3))
| _, _ => s((z.cell, 0), (z.cell, 1))
structure ons_DecMicroPoint (L : ℕ) where
cell : ZMod L × ZMod L
offsetX : Fin 8
offsetY : Fin 8
deriving DecidableEq
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:415
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 3 · Used by 1
DefinitionCell offsets used by interior route points#✓fully proved
The offsets inside a cell used by interior points of routes.
def ons_decInteriorOffsets : Finset (Fin 8 × Fin 8) :=
{(7, 4), (0, 4), (1, 4), (4, 7), (4, 0), (4, 1),
(6, 5), (6, 6), (5, 6), (3, 6), (2, 6), (2, 5),
(2, 3), (2, 2), (3, 2)}
Used by 1
DefinitionMicro point at which a dart is placed#✓fully proved
The micro point at which a dart is placed.
def ons_decPortMicroPoint (L : ℕ) (d : ons_Dart L) :
ons_DecMicroPoint L :=
match d.2 with
| 0 => ⟨d.1, 6, 4⟩
| 1 => ⟨d.1, 4, 6⟩
| 2 => ⟨d.1, 2, 4⟩
| 3 => ⟨d.1, 4, 2⟩
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
structure ons_DecMicroPoint (L : ℕ) where
cell : ZMod L × ZMod L
offsetX : Fin 8
offsetY : Fin 8
deriving DecidableEq
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:415
Uses 2 · Used by 1
DefinitionRoute points of a decorated edge after its start#✓fully proved
The points of the route of a decorated edge after its starting point.
def ons_decDartSegment (L : ℕ) [Fact (2 < L)]
(a : (ons_decGraph L).Dart) :
List (ZMod (8 * L) × ZMod (8 * L)) :=
(ons_decEdgeRoute L a.fst a.snd a.adj).support.tail
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decEdgeRoute (L : ℕ) [Fact (2 < L)] (d e : ons_Dart L)
(hde : (ons_decGraph L).Adj d e) :
(ons_decEmbedGraph L).Walk
(ons_decEmbedVertex L d) (ons_decEmbedVertex L e) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
let w : (ons_decEmbedGraph L).Walk (ons_decEmbedVertex L d)
(ons_fourDirSteps (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)) := by
simpa [ons_decEmbedGraph] using
ons_fourDirStepWalk (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)
exact w.copy rfl (ons_decEdgeRoute_endpoint L d e hde)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:265
DefinitionImage of a decorated walk in the finer torus#✓fully proved
The image of a decorated walk in the finer torus, obtained by concatenating the routes of its edges.
def ons_decEmbedWalk (L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) :
(ons_decEmbedGraph L).Walk
(ons_decEmbedVertex L u) (ons_decEmbedVertex L v) :=
match p with
| .nil => .nil
| .cons huw p =>
(ons_decEdgeRoute L u _ huw).append (ons_decEmbedWalk L p)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decEmbedGraph (L : ℕ) [Fact (2 < L)] :
SimpleGraph (ZMod (8 * L) × ZMod (8 * L)) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
exact onsTorusGraph (8 * L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:253
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:67
def ons_decEdgeRoute (L : ℕ) [Fact (2 < L)] (d e : ons_Dart L)
(hde : (ons_decGraph L).Adj d e) :
(ons_decEmbedGraph L).Walk
(ons_decEmbedVertex L d) (ons_decEmbedVertex L e) := by
letI : Fact (2 < 8 * L) := ⟨by have := (Fact.out : 2 < L); omega⟩
let w : (ons_decEmbedGraph L).Walk (ons_decEmbedVertex L d)
(ons_fourDirSteps (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)) := by
simpa [ons_decEmbedGraph] using
ons_fourDirStepWalk (8 * L) (ons_decEdgeRouteDirs L d e)
(ons_decEmbedVertex L d)
exact w.copy rfl (ons_decEdgeRoute_endpoint L d e hde)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:265
DefinitionFour finer-torus darts along the route of a decorated edge#✓fully proved
The four darts of the finer torus along the route of the decorated edge from d to e.
def ons_decEdgeMicroDarts (L : ℕ) (d e : ons_Dart L) :
List (ons_Dart (8 * L)) :=
let r := ons_decEdgeRouteDirs L d e
let p₀ := ons_decEmbedVertex L d
let p₁ := ons_dirStep (8 * L) (r 0) p₀
let p₂ := ons_dirStep (8 * L) (r 1) p₁
let p₃ := ons_dirStep (8 * L) (r 2) p₂
[(p₀, r 0), (p₁, r 1), (p₂, r 2), (p₃, r 3)]
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decEdgeRouteDirs (L : ℕ) (d e : ons_Dart L) : Fin 4 → Fin 4 :=
if e = ons_dartRev L d then fun _ => d.2
else
match d.2, e.2 with
| 0, 1 => ![1, 1, 2, 2]
| 1, 0 => ![0, 0, 3, 3]
| 1, 2 => ![2, 2, 3, 3]
| 2, 1 => ![1, 1, 0, 0]
| 2, 3 => ![3, 3, 0, 0]
| 3, 2 => ![2, 2, 1, 1]
| _, _ => ![0, 0, 0, 0]
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:125
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:67
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
DefinitionExpanded dart list of a decorated walk in the finer torus#✓fully proved
The darts of the finer torus along the image of a decorated walk.
def ons_decExpandedDartList
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart (8 * L)) :=
p.darts.flatMap (fun a => ons_decEdgeMicroDarts L a.fst a.snd)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decEdgeMicroDarts (L : ℕ) (d e : ons_Dart L) :
List (ons_Dart (8 * L)) :=
let r := ons_decEdgeRouteDirs L d e
let p₀ := ons_decEmbedVertex L d
let p₁ := ons_dirStep (8 * L) (r 0) p₀
let p₂ := ons_dirStep (8 * L) (r 1) p₁
let p₃ := ons_dirStep (8 * L) (r 2) p₂
[(p₀, r 0), (p₁, r 1), (p₂, r 2), (p₃, r 3)]
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbeddingTurns.lean:57
Uses 3 · Used by 5
DefinitionFirst dart of the expanded dart list of a decorated cycle#✓fully proved
The first dart of the expanded dart list of a decorated cycle.
def ons_decExpandedRoot
(L : ℕ) [Fact (2 < L)] {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) : ons_Dart (8 * L) :=
(ons_decExpandedDartList L q).headD (ons_decEmbedVertex L d, 0)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decExpandedDartList
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart (8 * L)) :=
p.darts.flatMap (fun a => ons_decEdgeMicroDarts L a.fst a.snd)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbeddingTurns.lean:162
def ons_decEmbedVertex (L : ℕ) (d : ons_Dart L) :
ZMod (8 * L) × ZMod (8 * L) :=
((8 * d.1.1.val + (ons_decEmbedOffset d.2).1 : ℕ),
(8 * d.1.2.val + (ons_decEmbedOffset d.2).2 : ℕ))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbedding.lean:67
Uses 4 · Used by 1
DefinitionExpanded loop of a decorated cycle in walking order#✓fully proved
The expanded dart list of a decorated cycle as a cyclic sequence, in walking order.
def ons_decExpandedGeometricLoop
(L : ℕ) [Fact (2 < L)] {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) :
Fin (ons_decExpandedDartList L q).length → ons_Dart (8 * L) :=
(ons_decExpandedDartList L q).get
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decExpandedDartList
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart (8 * L)) :=
p.darts.flatMap (fun a => ons_decEdgeMicroDarts L a.fst a.snd)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbeddingTurns.lean:162
Uses 3 · Used by 2
DefinitionExpanded loop of a decorated cycle in Kac-Ward order#✓fully proved
The expanded dart list of a decorated cycle as a cyclic sequence in Kac-Ward order (reversed indexing).
def ons_decExpandedKWLoop
(L : ℕ) [Fact (2 < L)] {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) (hq : q.IsCycle) :
Fin (ons_decExpandedDartList L q).length → ons_Dart (8 * L) := by
letI : NeZero (ons_decExpandedDartList L q).length :=
⟨Nat.ne_of_gt (ons_decExpandedDartList_length_pos L q hq)⟩
exact fun k => ons_decExpandedGeometricLoop L q (-k)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decExpandedDartList
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart (8 * L)) :=
p.darts.flatMap (fun a => ons_decEdgeMicroDarts L a.fst a.snd)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbeddingTurns.lean:162
Uses 4 · Used by 1
DefinitionInternal edge of the path at a site#✓fully proved
The i-th internal edge (s, i) - (s, i + 1) of the path at a site.
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 1 · Used by 19
DefinitionIndices of internal edges between two ports#✓fully proved
The indices of the internal edges on the path between ports a and b at one site.
def ons_decChainPathIndices (a b : Fin 4) : Finset (Fin 3) :=
Finset.univ.filter fun i ↦ (i.val < a.val) ≠ (i.val < b.val)
Used by 10
DefinitionInternal edges between two ports at a site#✓fully proved
The internal edges on the path between ports a and b at a site.
def ons_decChainPathEdges {L : ℕ}
(site : ZMod L × ZMod L) (a b : Fin 4) :
Finset (Sym2 (ons_Dart L)) :=
(ons_decChainPathIndices a b).image (ons_decChainEdge site)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decChainPathIndices (a b : Fin 4) : Finset (Fin 3) :=
Finset.univ.filter fun i ↦ (i.val < a.val) ≠ (i.val < b.val)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:66
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 3 · Used by 5
DefinitionDecorated weight of a Kac-Ward transition#✓fully proved
The decorated weight of the Kac-Ward transition from d₁ to d₂: the weight of the external
edge at d₁ times the weights of the internal edges from the port of d₁ + 2 to the port of d₂.
def ons_decTransitionWeight
(L : ℕ) (decWeight : Sym2 (ons_Dart L) → ℂ)
(d₂ d₁ : ons_Dart L) : ℂ :=
decWeight s(d₁, ons_dartRev L d₁) *
∏ i ∈ ons_decChainPathIndices (d₁.2 + 2) d₂.2,
decWeight (ons_decChainEdge d₂.1 i)
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
def ons_decChainPathIndices (a b : Fin 4) : Finset (Fin 3) :=
Finset.univ.filter fun i ↦ (i.val < a.val) ≠ (i.val < b.val)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:66
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 4 · Used by 4
DefinitionTwisted Kac-Ward matrix with decorated transition weights#✓fully proved
The twisted Kac-Ward matrix with decorated transition weights.
noncomputable def ons_KWmatDecorationWeightedPhase
(L : ℕ) (decWeight : Sym2 (ons_Dart L) → ℂ)
(omega u v : ℂ) : Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d₂ d₁ ↦
if d₂.1 = ons_dirStep L d₁.2 d₁.1 then
ons_dirPhase u v d₁.2 *
(ons_decTransitionWeight L decWeight d₂ d₁ *
ons_turnW omega d₁.2 d₂.2)
else 0
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
noncomputable def ons_dirPhase (u v : ℂ) (mu : Fin 4) : ℂ :=
match mu with
| 0 => u
| 1 => v
| 2 => u⁻¹
| 3 => v⁻¹
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:59
def ons_decTransitionWeight
(L : ℕ) (decWeight : Sym2 (ons_Dart L) → ℂ)
(d₂ d₁ : ons_Dart L) : ℂ :=
decWeight s(d₁, ons_dartRev L d₁) *
∏ i ∈ ons_decChainPathIndices (d₁.2 + 2) d₂.2,
decWeight (ons_decChainEdge d₂.1 i)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:80
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 5 · Used by 10
DefinitionDecorated weights induced by torus edge weights#✓fully proved
Decorated weights induced by torus edge weights: external edges get the weight of their torus
edge, internal edges get 1.
noncomputable def ons_decSpecializedWeight
{L : ℕ} (weight : Sym2 (ZMod L × ZMod L) → ℂ)
(edge : Sym2 (ons_Dart L)) : ℂ := by
classical
exact if ons_decIsExternal edge then
weight (ons_decEdgeProjection edge)
else 1
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 3 · Used by 3
DefinitionDecorated weights with internal edges weighted by t#✓fully proved
Decorated weights with external edges weighted by their torus edge and internal edges by t.
noncomputable def ons_decInterpolatedWeight
{L : ℕ} (weight : Sym2 (ZMod L × ZMod L) → ℂ) (t : ℂ)
(edge : Sym2 (ons_Dart L)) : ℂ := by
classical
exact if ons_decIsExternal edge then
weight (ons_decEdgeProjection edge)
else t
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 3
DefinitionDecorated character sum with weights on all edges#✓fully proved
The decorated character sum ∑_D χ_{a,b}(hom D) ∏_{e ∈ D} w_e with a weight on every decorated
edge.
noncomputable def ons_decoratedFullWeightedSpinSum
(L : ℕ) [Fact (2 < L)]
(decWeight : Sym2 (ons_Dart L) → ℂ) (a b : Fin 2) : ℂ :=
∑ D : ons_DecoratedEvenSubgraph L,
(ons_spinCharacter a b
(ons_evenHomology L (ons_originalEdgesOfDecorated L D)) : ℂ) *
∏ edge ∈ D.1, decWeight edge
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
abbrev ons_DecoratedEvenSubgraph (L : ℕ) [Fact (2 < L)] :=
{D : Finset (Sym2 (ons_Dart L)) //
D ∈ evenSubgraphs (ons_decGraph L)}
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationSum.lean:66
def ons_spinCharacter (a b : Fin 2) (h : Fin 2 × Fin 2) : ℝ :=
(-1 : ℝ) ^ ((1 + a.val) * h.1.val + (1 + b.val) * h.2.val +
h.1.val * h.2.val)
PhyslibExt/CondensedMatter/IsingModel/Onsager/SpinCharacter.lean:60
noncomputable def ons_evenHomology (L : ℕ)
(F : Finset (Sym2 (ZMod L × ZMod L))) : Fin 2 × Fin 2 :=
by
classical
exact (⟨(F.filter (ons_xSeamEdge L)).card % 2, Nat.mod_lt _ (by decide)⟩,
⟨(F.filter (ons_ySeamEdge L)).card % 2, Nat.mod_lt _ (by decide)⟩)
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusSpinSectors.lean:74
noncomputable def ons_originalEdgesOfDecorated
(L : ℕ) [Fact (2 < L)]
(D : ons_DecoratedEvenSubgraph L) :
Finset (Sym2 (ZMod L × ZMod L)) :=
((ons_decorationEquiv L).symm D).1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationSum.lean:72
Uses 10 · Used by 3
DefinitionSide of a direction at a site#✓fully proved
The side of a direction at a site: 0 for east and north, 1 for west and south.
DefinitionRepresentative direction of a side#✓fully proved
The representative direction of a side: east for side 0, west for side 1.
DefinitionDestination-side internal weight to a port#✓fully proved
The weight of the internal edges between the middle edge and the port of direction μ, on the
destination side.
noncomputable def ons_decMiddleDestFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => decWeight (ons_decChainEdge site 0)
| 1 => 1
| 2 => 1
| 3 => decWeight (ons_decChainEdge site 2)
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 2 · Used by 3
DefinitionSource-side internal weight from a port#✓fully proved
The weight of the internal edges between the port of direction μ and the middle edge, on the
source side.
noncomputable def ons_decMiddleSourceFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => 1
| 1 => decWeight (ons_decChainEdge site 2)
| 2 => decWeight (ons_decChainEdge site 0)
| 3 => 1
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 2 · Used by 3
DefinitionColumn factor of the rank-two middle-edge term#✓fully proved
The column factor of the rank-two term: from a side of site to the darts leaving site on
that side.
noncomputable def ons_decMiddleU
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega : ℂ) (site : ZMod L × ZMod L) :
Matrix (ons_Dart L) (Fin 2) ℂ :=
fun d side ↦
if d.1 = site ∧ ons_decMiddleSide d.2 = side then
ons_decMiddleDestFactor decWeight site d.2 *
ons_turnW omega (ons_decMiddleDir side) d.2
else 0
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decMiddleSide (mu : Fin 4) : Fin 2 :=
if mu.val < 2 then 0 else 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:59
noncomputable def ons_decMiddleDestFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => decWeight (ons_decChainEdge site 0)
| 1 => 1
| 2 => 1
| 3 => decWeight (ons_decChainEdge site 2)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:72
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
def ons_decMiddleDir (side : Fin 2) : Fin 4 :=
if side = 0 then 0 else 2
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:63
DefinitionRow factor of the rank-two middle-edge term#✓fully proved
The row factor of the rank-two term: from the darts entering site to the side on which they
arrive.
noncomputable def ons_decMiddleV
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega u v : ℂ) (site : ZMod L × ZMod L) :
Matrix (Fin 2) (ons_Dart L) ℂ :=
fun side d ↦
if site = ons_dirStep L d.2 d.1 ∧
ons_decMiddleSide d.2 = side then
decWeight (ons_decChainEdge site 1) *
ons_dirPhase u v d.2 *
decWeight s(d, ons_dartRev L d) *
ons_decMiddleSourceFactor decWeight site d.2 *
ons_turnW omega d.2 (ons_decMiddleDir side)
else 0
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
def ons_decMiddleSide (mu : Fin 4) : Fin 2 :=
if mu.val < 2 then 0 else 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:59
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
noncomputable def ons_dirPhase (u v : ℂ) (mu : Fin 4) : ℂ :=
match mu with
| 0 => u
| 1 => v
| 2 => u⁻¹
| 3 => v⁻¹
PhyslibExt/CondensedMatter/IsingModel/Onsager/KWSpinFourier.lean:59
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_decMiddleSourceFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => 1
| 1 => decWeight (ons_decChainEdge site 2)
| 2 => decWeight (ons_decChainEdge site 0)
| 3 => 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:83
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
def ons_decMiddleDir (side : Fin 2) : Fin 4 :=
if side = 0 then 0 else 2
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:63
Uses 10 · Used by 4
DefinitionAugmented Kac-Ward matrix with two side states#✓fully proved
The augmented Kac-Ward matrix on darts and the two sides of site, with blocks Λ₀, U, t V
and 0.
noncomputable def ons_decMiddleAugmented
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega u v t : ℂ) (site : ZMod L × ZMod L) :
Matrix (ons_Dart L ⊕ Fin 2) (ons_Dart L ⊕ Fin 2) ℂ :=
Matrix.fromBlocks
(ons_KWmatDecorationWeightedPhase L
(ons_scaleDecEdgeWeight decWeight
(ons_decChainEdge site 1) 0) omega u v)
(ons_decMiddleU L decWeight omega site)
(t • ons_decMiddleV L decWeight omega u v site)
0
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def ons_KWmatDecorationWeightedPhase
(L : ℕ) (decWeight : Sym2 (ons_Dart L) → ℂ)
(omega u v : ℂ) : Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d₂ d₁ ↦
if d₂.1 = ons_dirStep L d₁.2 d₁.1 then
ons_dirPhase u v d₁.2 *
(ons_decTransitionWeight L decWeight d₂ d₁ *
ons_turnW omega d₁.2 d₂.2)
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:88
def ons_scaleDecEdgeWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(edge : ons_DecEdge L) (t : ℂ) : ons_DecEdge L → ℂ :=
fun f => if f = edge then t * decWeight f else decWeight f
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationExternalDeletion.lean:113
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
noncomputable def ons_decMiddleU
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega : ℂ) (site : ZMod L × ZMod L) :
Matrix (ons_Dart L) (Fin 2) ℂ :=
fun d side ↦
if d.1 = site ∧ ons_decMiddleSide d.2 = side then
ons_decMiddleDestFactor decWeight site d.2 *
ons_turnW omega (ons_decMiddleDir side) d.2
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:94
noncomputable def ons_decMiddleV
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega u v : ℂ) (site : ZMod L × ZMod L) :
Matrix (Fin 2) (ons_Dart L) ℂ :=
fun side d ↦
if site = ons_dirStep L d.2 d.1 ∧
ons_decMiddleSide d.2 = side then
decWeight (ons_decChainEdge site 1) *
ons_dirPhase u v d.2 *
decWeight s(d, ons_dartRev L d) *
ons_decMiddleSourceFactor decWeight site d.2 *
ons_turnW omega d.2 (ons_decMiddleDir side)
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:106
Uses 7 · Used by 1
DefinitionBalanced augmented Kac-Ward matrix#✓fully proved
The augmented matrix with blocks Λ₀, (t λ) U, λ⁻¹ V and 0.
noncomputable def ons_decMiddleBalanced
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega t lambda : ℂ) (site : ZMod L × ZMod L) :
Matrix (ons_Dart L ⊕ Fin 2) (ons_Dart L ⊕ Fin 2) ℂ :=
Matrix.fromBlocks
(ons_KWmatDecorationWeightedPhase L
(ons_scaleDecEdgeWeight decWeight
(ons_decChainEdge site 1) 0) omega 1 1)
((t * lambda) • ons_decMiddleU L decWeight omega site)
(lambda⁻¹ • ons_decMiddleV L decWeight omega 1 1 site)
0
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
noncomputable def ons_KWmatDecorationWeightedPhase
(L : ℕ) (decWeight : Sym2 (ons_Dart L) → ℂ)
(omega u v : ℂ) : Matrix (ons_Dart L) (ons_Dart L) ℂ :=
fun d₂ d₁ ↦
if d₂.1 = ons_dirStep L d₁.2 d₁.1 then
ons_dirPhase u v d₁.2 *
(ons_decTransitionWeight L decWeight d₂ d₁ *
ons_turnW omega d₁.2 d₂.2)
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:88
def ons_scaleDecEdgeWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(edge : ons_DecEdge L) (t : ℂ) : ons_DecEdge L → ℂ :=
fun f => if f = edge then t * decWeight f else decWeight f
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationExternalDeletion.lean:113
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
noncomputable def ons_decMiddleU
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega : ℂ) (site : ZMod L × ZMod L) :
Matrix (ons_Dart L) (Fin 2) ℂ :=
fun d side ↦
if d.1 = site ∧ ons_decMiddleSide d.2 = side then
ons_decMiddleDestFactor decWeight site d.2 *
ons_turnW omega (ons_decMiddleDir side) d.2
else 0
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:94
noncomputable def ons_decMiddleV
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(omega u v : ℂ) (site : ZMod L × ZMod L) :
Matrix (Fin 2) (ons_Dart L) ℂ :=
fun side d ↦
if site = ons_dirStep L d.2 d.1 ∧
ons_decMiddleSide d.2 = side then
decWeight (ons_decChainEdge site 1) *
ons_dirPhase u v d.2 *
decWeight s(d, ons_dartRev L d) *
ons_decMiddleSourceFactor decWeight site d.2 *
ons_turnW omega d.2 (ons_decMiddleDir side)
⋯
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:106
Uses 7 · Used by 1
DefinitionRow weights of the balanced augmented matrix#✓fully proved
Row weights of the balanced augmented matrix.
noncomputable def ons_decMiddleBalancedRowWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ) (lambda : ℂ)
(site : ZMod L × ZMod L) : ons_Dart L ⊕ Fin 2 → ℂ
| .inl _ => 1
| .inr _ => lambda⁻¹ * decWeight (ons_decChainEdge site 1)
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 3 · Used by 1
DefinitionColumn weights of the balanced augmented matrix#✓fully proved
Column weights of the balanced augmented matrix.
noncomputable def ons_decMiddleBalancedColWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ) (t lambda : ℂ) :
ons_Dart L ⊕ Fin 2 → ℂ
| .inl d => decWeight s(d, ons_dartRev L d)
| .inr _ => t * lambda
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
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 3 · Used by 1
DefinitionReversal on augmented states#✓fully proved
Reversal on augmented states: reverse darts and swap the two sides.
def ons_decMiddleAugRev (L : ℕ) :
ons_Dart L ⊕ Fin 2 → ons_Dart L ⊕ Fin 2
| .inl d => .inl (ons_dartRev L d)
| .inr side => .inr (side + 1)
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 1
DefinitionDirections of augmented states#✓fully proved
Directions of augmented states: the direction of a dart, and east or west for the two sides.
def ons_decMiddleAugDir {L : ℕ} :
ons_Dart L ⊕ Fin 2 → Fin 4
| .inl d => d.2
| .inr side => ons_decMiddleDir side
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decMiddleDir (side : Fin 2) : Fin 4 :=
if side = 0 then 0 else 2
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:63
Uses 2 · Used by 1
DefinitionRow weights of the augmented Kac-Ward matrix#✓fully proved
Row weights of the augmented matrix: 1 on darts and t times the middle weight on side
states.
noncomputable def ons_decMiddleRowWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(t : ℂ) (site : ZMod L × ZMod L) :
ons_Dart L ⊕ Fin 2 → ℂ
| .inl _ => 1
| .inr _ => t * decWeight (ons_decChainEdge site 1)
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
Uses 3 · Used by 1
DefinitionColumn weights of the augmented Kac-Ward matrix#✓fully proved
Column weights of the augmented matrix: the external weight on darts and 1 on side states.
noncomputable def ons_decMiddleColWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ) :
ons_Dart L ⊕ Fin 2 → ℂ
| .inl d => decWeight s(d, ons_dartRev L d)
| .inr _ => 1
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
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 3 · Used by 1
DefinitionReversal-invariant internal factor of the augmented matrix#✓fully proved
The reversal-invariant internal factor of the augmented matrix.
StatMech.Onsager.ons_decMiddleInternalFactor · 20 lines
noncomputable def ons_decMiddleInternalFactor
(L : ℕ) (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) :
(ons_Dart L ⊕ Fin 2) → (ons_Dart L ⊕ Fin 2) → ℂ
| .inl d₂, .inl d₁ =>
if d₂.1 = ons_dirStep L d₁.2 d₁.1 then
∏ i ∈ ons_decChainPathIndices (d₁.2 + 2) d₂.2,
ons_scaleDecEdgeWeight decWeight
(ons_decChainEdge site 1) 0 (ons_decChainEdge d₂.1 i)
else 0
| .inl d₂, .inr side =>
if d₂.1 = site ∧ ons_decMiddleSide d₂.2 = side then
ons_decMiddleDestFactor decWeight site d₂.2
else 0
| .inr side, .inl d₁ =>
if site = ons_dirStep L d₁.2 d₁.1 ∧
ons_decMiddleSide d₁.2 = side then
ons_decMiddleSourceFactor decWeight site d₁.2
else 0
| .inr _, .inr _ => 0
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
def ons_decChainPathIndices (a b : Fin 4) : Finset (Fin 3) :=
Finset.univ.filter fun i ↦ (i.val < a.val) ≠ (i.val < b.val)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:66
def ons_scaleDecEdgeWeight
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(edge : ons_DecEdge L) (t : ℂ) : ons_DecEdge L → ℂ :=
fun f => if f = edge then t * decWeight f else decWeight f
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationExternalDeletion.lean:113
def ons_decChainEdge {L : ℕ}
(site : ZMod L × ZMod L) (i : Fin 3) : Sym2 (ons_Dart L) :=
s((site, ⟨i.val, by omega⟩), (site, ⟨i.val + 1, by omega⟩))
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWeights.lean:61
def ons_decMiddleSide (mu : Fin 4) : Fin 2 :=
if mu.val < 2 then 0 else 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:59
noncomputable def ons_decMiddleDestFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => decWeight (ons_decChainEdge site 0)
| 1 => 1
| 2 => 1
| 3 => decWeight (ons_decChainEdge site 2)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:72
noncomputable def ons_decMiddleSourceFactor
{L : ℕ} (decWeight : ons_DecEdge L → ℂ)
(site : ZMod L × ZMod L) (mu : Fin 4) : ℂ :=
match mu with
| 0 => 1
| 1 => decWeight (ons_decChainEdge site 2)
| 2 => decWeight (ons_decChainEdge site 0)
| 3 => 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationInternalMiddle.lean:83
Uses 9 · Used by 1
DefinitionTest for a dart traversing an external edge#✓fully proved
Whether a dart of the decorated graph traverses an external edge (from a torus dart to its reverse).
def ons_decDartIsExternal {L : ℕ} (a : (ons_decGraph L).Dart) : Bool :=
decide (a.snd = ons_dartRev L a.fst)
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
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 3 · Used by 2
DefinitionExternal darts of a decorated walk in order#✓fully proved
The torus darts at which a decorated walk traverses an external edge, in order.
def ons_decWalkExternalDarts {L : ℕ} {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart L) :=
(p.darts.filter ons_decDartIsExternal).map (fun a => a.fst)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decDartIsExternal {L : ℕ} (a : (ons_decGraph L).Dart) : Bool :=
decide (a.snd = ons_dartRev L a.fst)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationWalkExtract.lean:56
DefinitionFirst-return loop of a rooted decorated cycle#✓fully proved
The first-return loop at d read off from a decorated cycle rooted at d: the root, the
remaining external darts in reverse order, and the root again.
def ons_decCycleFirstReturn {L : ℕ} {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) : List (ons_Dart L) :=
d :: (ons_decWalkExternalDarts q).tail.reverse ++ [d]
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decWalkExternalDarts {L : ℕ} {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart L) :=
(p.darts.filter ons_decDartIsExternal).map (fun a => a.fst)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationWalkExtract.lean:60
Uses 3 · Used by 3
DefinitionAdjacency of directions along the port line#✓fully proved
Two directions are adjacent in the order 0, 1, 2, 3 of the internal path at a site.
def ons_portLineAdj (a b : Fin 4) : Prop :=
a.val + 1 = b.val ∨ b.val + 1 = a.val
DefinitionMicro directions along internal decorated edges at a site#✓fully proved
The micro directions of the routes along a sequence of internal decorated edges at one site.
def ons_internalMicroDirections : List (Fin 4) → List (Fin 4)
| a :: b :: rest =>
[b, b, a + 2, a + 2] ++ ons_internalMicroDirections (b :: rest)
| _ => []
Used by 1
DefinitionDirections of the expanded dart list of a decorated walk#✓fully proved
The directions of the expanded dart list of a decorated walk.
def ons_walkExpandedDirections
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (Fin 4) :=
(ons_decExpandedDartList L p).map (fun a ↦ a.2)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decExpandedDartList
(L : ℕ) [Fact (2 < L)] {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart (8 * L)) :=
p.darts.flatMap (fun a => ons_decEdgeMicroDarts L a.fst a.snd)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationEmbeddingTurns.lean:162
Uses 3 · Used by 1
DefinitionDirections of the external darts of a decorated walk#✓fully proved
The directions of the external darts of a decorated walk.
def ons_walkExternalDirections
{L : ℕ} {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (Fin 4) :=
(ons_decWalkExternalDarts p).map (fun a ↦ a.2)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decWalkExternalDarts {L : ℕ} {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : List (ons_Dart L) :=
(p.darts.filter ons_decDartIsExternal).map (fun a => a.fst)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationWalkExtract.lean:60
Uses 3 · Used by 1
DefinitionInternal walk between two ports at a site#✓fully proved
A walk along the internal path from port a to port b at a site.
noncomputable def ons_decPortChainWalk
(L : ℕ) (site : ZMod L × ZMod L) (a b : Fin 4) :
(ons_decGraph L).Walk (site, a) (site, b) :=
Classical.choose (ons_exists_decPortChainWalk L site a b)
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
lemma ons_exists_decPortChainWalk
(L : ℕ) (site : ZMod L × ZMod L) (a b : Fin 4) :
∃ p : (ons_decGraph L).Walk (site, a) (site, b),
p.edges.toFinset = ons_decChainPathEdges site a b
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWalk.lean:121
Uses 8
DefinitionInternal path between two ports at a site#✓fully proved
The internal path from port a to port b at a site, as a path in the decorated graph.
noncomputable def ons_decPortChainPath
(L : ℕ) (site : ZMod L × ZMod L) (a b : Fin 4) :
(ons_decGraph L).Walk (site, a) (site, b) :=
Classical.choose (ons_exists_decPortChainPath L site a b)
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
lemma ons_exists_decPortChainPath
(L : ℕ) (site : ZMod L × ZMod L) (a b : Fin 4) :
∃ p : (ons_decGraph L).Walk (site, a) (site, b),
p.IsPath ∧ p.edges.toFinset = ons_decChainPathEdges site a b
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationTransitionWalk.lean:202
Uses 8 · Used by 4
DefinitionDecorated walk of a Kac-Ward transition#✓fully proved
The decorated walk of the Kac-Ward transition from d₁ to d₂: the external edge at d₁
followed by the internal path to d₂.
noncomputable def ons_decTransitionWalk
(L : ℕ) (d₂ d₁ : ons_Dart L)
(hstep : d₂.1 = ons_dirStep L d₁.2 d₁.1) :
(ons_decGraph L).Walk d₁ d₂ := by
let ext : (ons_decGraph L).Walk d₁ (ons_dartRev L d₁) :=
.cons (@id ((ons_decGraph L).Adj d₁ (ons_dartRev L d₁)) (Or.inl rfl)) .nil
let chain₀ := ons_decPortChainPath L d₂.1 (d₁.2 + 2) d₂.2
have hstart : (d₂.1, d₁.2 + 2) = ons_dartRev L d₁ := by
apply Prod.ext
· exact hstep.trans (ons_dartRev_fst_eq_step L d₁).symm
· simp [ons_dartRev]
let chain : (ons_decGraph L).Walk (ons_dartRev L d₁) d₂ :=
chain₀.copy hstart rfl
exact ext.append chain
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
DefinitionHead-to-tail relation between darts#✓fully proved
Dart target starts at the head of dart source.
def ons_decGeometricStep (L : ℕ) (source target : ons_Dart L) : Prop :=
target.1 = ons_dirStep L source.2 source.1
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
Uses 2 · Used by 3
DefinitionEdge multiset of a decorated walk as an exponent#✓fully proved
The multiset of edges of a decorated walk, as an exponent.
noncomputable def ons_decWalkEdgeCount
{L : ℕ} {u v : ons_Dart L}
(p : (ons_decGraph L).Walk u v) : ons_DecEdge L →₀ ℕ := by
classical
exact Multiset.toFinsupp (p.edges : Multiset (ons_DecEdge L))
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
Uses 3 · Used by 1
DefinitionTransition exponent sum along a dart chain#✓fully proved
The sum of the transition exponents along a chain of darts starting at start.
noncomputable def ons_decKWChainExponent
(L : ℕ) (start : ons_Dart L) :
List (ons_Dart L) → ons_DecEdge L →₀ ℕ
| [] => 0
| target :: rest =>
ons_decTransitionExponent L target start +
ons_decKWChainExponent L target rest
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
abbrev ons_DecEdge (L : ℕ) := Sym2 (ons_Dart L)
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:68
noncomputable def ons_decTransitionExponent
(L : ℕ) (d₂ d₁ : ons_Dart L) : ons_DecEdge L →₀ ℕ := by
classical
exact Finsupp.single s(d₁, ons_dartRev L d₁) 1 +
∑ i ∈ ons_decChainPathIndices (d₁.2 + 2) d₂.2,
Finsupp.single (ons_decChainEdge d₂.1 i) 1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationFormalSeries.lean:72
Uses 3 · Used by 1
DefinitionLast dart of a dart chain#✓fully proved
The last dart of a chain starting at start.
def ons_decKWChainLast {L : ℕ} (start : ons_Dart L) :
List (ons_Dart L) → ons_Dart L
| [] => start
| target :: rest => ons_decKWChainLast target rest
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 1 · Used by 3
DefinitionDecorated walk of a chain of darts#✓fully proved
The decorated walk obtained by concatenating the trails of the transitions along a chain of darts.
noncomputable def ons_decWalkOfKWChain
(L : ℕ) (start : ons_Dart L) :
(tail : List (ons_Dart L)) →
List.IsChain (ons_decGeometricStep L) (start :: tail) →
(ons_decGraph L).Walk start (ons_decKWChainLast start tail)
| [], _ => .nil
| target :: rest, hchain => by
have hstep : target.1 = ons_dirStep L start.2 start.1 :=
hchain.rel
let first := ons_decTransitionWalk L target start hstep
let remaining :=
@id ((ons_decGraph L).Walk target (ons_decKWChainLast start (target :: rest)))
(ons_decWalkOfKWChain L target rest hchain.tail)
exact first.append remaining
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGeometricStep (L : ℕ) (source target : ons_Dart L) : Prop :=
target.1 = ons_dirStep L source.2 source.1
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationLoopWalk.lean:202
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decKWChainLast {L : ℕ} (start : ons_Dart L) :
List (ons_Dart L) → ons_Dart L
| [] => start
| target :: rest => ons_decKWChainLast target rest
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationLoopWalk.lean:287
DefinitionDarts of a Kac-Ward loop in walking order#✓fully proved
The darts of a Kac-Ward loop in walking order (reversed indexing).
def ons_decGeometricLoopStates
{L n : ℕ} (d : Fin n → ons_Dart L) : Fin n → ons_Dart L :=
fun k ↦ d (-k)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
Uses 1 · Used by 2
DefinitionClosed decorated walk of a valid Kac-Ward loop#✓fully proved
The closed decorated walk of a valid closed Kac-Ward walk, rooted at its first dart.
StatMech.Onsager.ons_decLoopWalk · 28 lines
noncomputable def ons_decLoopWalk
(L : ℕ) {n : ℕ} [NeZero n] (d : Fin n → ons_Dart L)
(hvalid : ∀ k : Fin n,
(d k).1 = ons_dirStep L (d (k + 1)).2 (d (k + 1)).1) :
(ons_decGraph L).Walk (d 0) (d 0) := by
let states := List.ofFn (ons_decGeometricLoopStates d)
have hstatesNonempty : states ≠ [] := by
rw [List.ne_nil_iff_length_pos, List.length_ofFn]
exact NeZero.pos n
have hhead : states.head? = some (d 0) := by
rw [List.head?_eq_some_head hstatesNonempty,
List.head_ofFn hstatesNonempty]
simp [ons_decGeometricLoopStates]
have hstates : states = d 0 :: states.tail := by
apply List.eq_cons_of_mem_head?
simp [hhead]
have hchain : List.IsChain (ons_decGeometricStep L)
(states ++ [d 0]) := by
simpa [states, ons_decGeometricLoopStates] using
ons_isChain_closed_ofFn_mk (ons_decGeometricLoopStates d)
(ons_decGeometricLoopStates_valid d hvalid)
have hchain' : List.IsChain (ons_decGeometricStep L)
(d 0 :: (states.tail ++ [d 0])) := by
rw [← List.cons_append, ← hstates]
exact hchain
let walk := ons_decWalkOfKWChain L (d 0)
(states.tail ++ [d 0]) hchain'
exact walk.copy rfl (ons_decKWChainLast_append_singleton _ _ _)
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_dirStep (L : ℕ) (μ : Fin 4) (s : ZMod L × ZMod L) : ZMod L × ZMod L :=
match μ with
| 0 => (s.1 + 1, s.2)
| 1 => (s.1, s.2 + 1)
| 2 => (s.1 - 1, s.2)
| 3 => (s.1, s.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:55
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
Uses 7 · Used by 1
DefinitionDart list of a rooted decorated cycle#✓fully proved
The first-return loop of a rooted decorated cycle without its final repeated dart.
def ons_decCycleDartList {L : ℕ} {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) : List (ons_Dart L) :=
(ons_decCycleFirstReturn q).dropLast
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decCycleFirstReturn {L : ℕ} {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) : List (ons_Dart L) :=
d :: (ons_decWalkExternalDarts q).tail.reverse ++ [d]
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationWalkExtract.lean:232
Uses 3 · Used by 2
DefinitionClosed dart walk of a rooted decorated cycle#✓fully proved
The closed walk of darts of a rooted decorated cycle, indexed by Fin of its length.
def ons_decCycleDartLoop {L : ℕ} {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) :
Fin (ons_decCycleDartList q).length → ons_Dart L :=
(ons_decCycleDartList q).get
abbrev ons_Dart (L : ℕ) := (ZMod L × ZMod L) × Fin 4
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/KacWardMatrix.lean:63
def ons_decGraph (L : ℕ) : SimpleGraph (ons_Dart L) where
Adj := ons_decAdj L
symm := ⟨fun _ _ h => ons_decAdj_symm L h⟩
loopless := by
refine ⟨?_⟩
intro d hd
rcases hd with hrev | hint
· exact ons_dartRev_ne_self L d hrev.symm
· rcases hint.2 with h | h <;> omega
PhyslibExt/CondensedMatter/IsingModel/Onsager/TorusDecoration.lean:105
def ons_decCycleDartList {L : ℕ} {d : ons_Dart L}
(q : (ons_decGraph L).Walk d d) : List (ons_Dart L) :=
(ons_decCycleFirstReturn q).dropLast
PhyslibExt/CondensedMatter/IsingModel/Onsager/DecorationWalkHomology.lean:57
Uses 3 · Used by 1
DefinitionSimple graph spanned by an edge set#✓fully proved
The simple graph on V whose edges are the non-loop elements of F; this is
SimpleGraph.fromEdgeSet F.
def ons_edgeSubgraph (F : Finset (Sym2 V)) : SimpleGraph V :=
SimpleGraph.fromEdgeSet (F : Set (Sym2 V))
Used by 2
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.