cfahlgren1/math / lean /ComparatorChallenges /HoneycombFreeEnergy.lean
cfahlgren1's picture
download
raw
1.93 kB
import Mathlib
namespace OAI
/-! Existence of the fixed-length forced free energy of honeycomb walks. -/
noncomputable section
open scoped ENNReal Topology
open Filter
namespace HoneycombForce
structure Vertex where
col : ℤ
row : ℤ
up : Bool
deriving DecidableEq
def up (i j : ℤ) : Vertex := ⟨i, j, true⟩
def down (i j : ℤ) : Vertex := ⟨i, j, false⟩
def rowSpacing : ℝ := Real.sqrt 3 / 2
def position (v : Vertex) : ℂ :=
if v.up then
⟨(v.col : ℝ) + (v.row : ℝ) / 2 + 1/2,
rowSpacing * ((v.row : ℝ) + 1/3)⟩
else
⟨(v.col : ℝ) + (v.row : ℝ) / 2 + 1,
rowSpacing * ((v.row : ℝ) + 2/3)⟩
def rho : ℝ := (Real.sqrt (2 + Real.sqrt 2))⁻¹
def neighbors (v : Vertex) : Finset Vertex :=
if v.up then
{down v.col (v.row-1), down v.col v.row, down (v.col-1) v.row}
else
{up v.col (v.row+1), up v.col v.row, up (v.col+1) v.row}
def walkLists (o : Vertex) : ℕ → Finset (List Vertex)
| 0 => {[o]}
| n+1 => (neighbors o).biUnion (fun v => (walkLists v n).image (List.cons o))
def saws (o : Vertex) (n : ℕ) : Finset (List Vertex) :=
(walkLists o n).filter List.Nodup
def endpoint (o : Vertex) (γ : List Vertex) : Vertex := γ.getLastD o
def displacement (o : Vertex) (γ : List Vertex) : ℂ :=
position (endpoint o γ) - position o
def projection (e z : ℂ) : ℝ := (star e * z).re
def partition (o : Vertex) (e : ℂ) (s : ℝ) (n : ℕ) : ℝ :=
∑ γ ∈ saws o n, rho ^ n * Real.exp (s * projection e (displacement o γ))
def logPartition (o : Vertex) (e : ℂ) (s : ℝ) (n : ℕ) : ℝ :=
Real.log (partition o e s n) / (n : ℝ)
def freeEnergy (o : Vertex) (e : ℂ) (s : ℝ) : ℝ :=
Filter.limUnder atTop (logPartition o e s)
theorem logPartition_tendsto (o : Vertex) (e : ℂ) (s : ℝ) :
Tendsto (logPartition o e s) atTop (𝓝 (freeEnergy o e s)) := by
sorry
end HoneycombForce
end
end OAI

Xet Storage Details

Size:
1.93 kB
·
Xet hash:
e51eae8621d874a6486693f4d3700de385f7911e3217a74f85f48ad37b5ba0f6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.