File size: 1,968 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 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
|