Download data/lean/OAI/Probability/SKGap/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.73 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKGap/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKGap/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKGap/Model.lean
2.73 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| open MeasureTheory ProbabilityTheory Filter | |
| namespace SKGap | |
| abbrev Spin (n : β) := Fin n β Bool | |
| abbrev Edge (n : β) := {p : Fin n Γ Fin n // p.1 < p.2} | |
| abbrev Disorder (n : β) := Edge n β β | |
| def spinValue (b : Bool) : β := if b then 1 else -1 | |
| def coupling {n : β} (g : Disorder n) (i k : Fin n) : β := | |
| if h : i < k then g β¨(i, k), hβ© else | |
| if h : k < i then g β¨(k, i), hβ© else 0 | |
| def hamiltonian {n : β} (g : Disorder n) (h : Fin n β β) (x : Spin n) : β := | |
| (1 / 2 : β) * β i, β k, spinValue (x i) * coupling g i k * spinValue (x k) + | |
| β i, h i * spinValue (x i) | |
| def weight {n : β} (g : Disorder n) (h : Fin n β β) (x : Spin n) : β := | |
| Real.exp (hamiltonian g h x) | |
| def partition {n : β} (g : Disorder n) (h : Fin n β β) : β := | |
| β x, weight g h x | |
| def mass {n : β} (g : Disorder n) (h : Fin n β β) (x : Spin n) : β := | |
| weight g h x / partition g h | |
| def expectation {n : β} (g : Disorder n) (h : Fin n β β) (f : Spin n β β) : β := | |
| β x, mass g h x * f x | |
| def variance {n : β} (g : Disorder n) (h : Fin n β β) (f : Spin n β β) : β := | |
| expectation g h (fun x => (f x - expectation g h f) ^ 2) | |
| def flip {n : β} (i : Fin n) (x : Spin n) : Spin n := | |
| Function.update x i (!(x i)) | |
| /-- Conditional expectation under the actual Gibbs law given all other spins. -/ | |
| def conditionalExpectation {n : β} (g : Disorder n) (h : Fin n β β) | |
| (i : Fin n) (f : Spin n β β) (x : Spin n) : β := | |
| (weight g h x * f x + weight g h (flip i x) * f (flip i x)) / | |
| (weight g h x + weight g h (flip i x)) | |
| /-- Unscaled form: each site has a rate-one clock. -/ | |
| def dirichlet {n : β} (g : Disorder n) (h : Fin n β β) (f : Spin n β β) : β := | |
| β i, expectation g h (fun x => (f x - conditionalExpectation g h i f x) ^ 2) | |
| def disorderLaw (Ξ² : β) (n : β) : Measure (Disorder n) := | |
| Measure.pi (fun _ : Edge n => gaussianReal 0 (Real.toNNReal (Ξ² ^ 2 / n))) | |
| def poincareEvent (n : β) (C : β) : Set (Disorder n) := | |
| {g | β f : Spin n β β, variance g 0 f β€ C * dirichlet g 0 f} | |
| /-- Rayleigh quotient definition of the uniform-site discrete heat-bath gap. -/ | |
| def discreteGap {n : β} (g : Disorder n) : β := | |
| sInf {r : β | β f : Spin n β β, 0 < variance g 0 f β§ | |
| r = dirichlet g 0 f / ((n : β) * variance g 0 f)} | |
| def MainStatement (Ξ² : β) : Prop := | |
| β C : β, 0 < C β§ | |
| Tendsto (fun n : β => disorderLaw Ξ² n (poincareEvent n C)) atTop (nhds 1) β§ | |
| Tendsto (fun n : β => disorderLaw Ξ² n {g | 1 / (C * (n : β)) β€ discreteGap g}) | |
| atTop (nhds 1) | |
| end SKGap | |
| end | |
| end OAI | |