math / data /lean /OAI /Probability /CriticalZ3 /Model.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.97 kB
import Mathlib
namespace OAI
open MeasureTheory ProbabilityTheory
namespace CriticalZ3
abbrev Vertex := Fin 3 β†’ β„€
abbrev Bond := Vertex Γ— Fin 3
abbrev BondConfig := Bond β†’ Bool
abbrev SiteConfig := Vertex β†’ Bool
def step (x : Vertex) (i : Fin 3) : Vertex := fun j => x j + if i = j then 1 else 0
def NearestNeighbor (x y : Vertex) : Prop :=
βˆƒ i : Fin 3, y = step x i ∨ x = step y i
def BondOpen (Ο‰ : BondConfig) (x y : Vertex) : Prop :=
(βˆƒ i : Fin 3, y = step x i ∧ Ο‰ (x, i) = true) ∨
(βˆƒ i : Fin 3, x = step y i ∧ Ο‰ (y, i) = true)
def SiteOpen (Ο‰ : SiteConfig) (x y : Vertex) : Prop :=
NearestNeighbor x y ∧ Ο‰ x = true ∧ Ο‰ y = true
def BondConnected (Ο‰ : BondConfig) (x y : Vertex) : Prop :=
Relation.ReflTransGen (BondOpen Ο‰) x y
def SiteConnected (Ο‰ : SiteConfig) (x y : Vertex) : Prop :=
Ο‰ x = true ∧ Relation.ReflTransGen (SiteOpen Ο‰) x y
def bondCluster (Ο‰ : BondConfig) (x : Vertex) : Set Vertex :=
{y | BondConnected Ο‰ x y}
def siteCluster (Ο‰ : SiteConfig) (x : Vertex) : Set Vertex :=
{y | SiteConnected Ο‰ x y}
def bondInfiniteAt (x : Vertex) : Set BondConfig := {Ο‰ | (bondCluster Ο‰ x).Infinite}
def siteInfiniteAt (x : Vertex) : Set SiteConfig := {Ο‰ | (siteCluster Ο‰ x).Infinite}
noncomputable def parameter (p : ℝ) : Set.Icc (0 : ℝ) 1 :=
⟨max 0 (min 1 p), le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
noncomputable def bondLaw (p : ℝ) : Measure BondConfig :=
Measure.infinitePi (fun _ : Bond => bernoulliMeasure true false (parameter p))
noncomputable def siteLaw (p : ℝ) : Measure SiteConfig :=
Measure.infinitePi (fun _ : Vertex => bernoulliMeasure true false (parameter p))
noncomputable def bondCritical : ℝ :=
sInf {p : ℝ | p ∈ Set.Icc (0 : ℝ) 1 ∧ 0 < bondLaw p (bondInfiniteAt 0)}
noncomputable def siteCritical : ℝ :=
sInf {p : ℝ | p ∈ Set.Icc (0 : ℝ) 1 ∧ 0 < siteLaw p (siteInfiniteAt 0)}
end CriticalZ3
end OAI