Download data/lean/OAI/Probability/SKBarriers/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.69 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKBarriers/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKBarriers/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKBarriers/Model.lean
2.69 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open scoped BigOperators Topology | |
| open MeasureTheory ProbabilityTheory Filter | |
| namespace SK | |
| abbrev Config (n : β) := Fin n β Bool | |
| abbrev Edge (n : β) := {p : Fin n Γ Fin n // p.1 < p.2} | |
| abbrev Disorder (n : β) := Edge n β β | |
| def spin (b : Bool) : β := if b then 1 else -1 | |
| def hamiltonian {n : β} (J : Disorder n) (x : Config n) : β := | |
| (β e : Edge n, J e * spin (x e.val.1) * spin (x e.val.2)) / Real.sqrt n | |
| def partition {n : β} (Ξ² : β) (J : Disorder n) : β := | |
| β x : Config n, Real.exp (Ξ² * hamiltonian J x) | |
| def gibbs {n : β} (Ξ² : β) (J : Disorder n) (x : Config n) : β := | |
| Real.exp (Ξ² * hamiltonian J x) / partition Ξ² J | |
| def coupling {n : β} (J : Disorder n) (i j : Fin n) : β := | |
| if h : i < j then J β¨(i, j), hβ© else | |
| if h : j < i then J β¨(j, i), hβ© else 0 | |
| def localField {n : β} (J : Disorder n) (x : Config n) (i : Fin n) : β := | |
| (β j : Fin n, coupling J i j * spin (x j)) / Real.sqrt n | |
| def heatBath {n : β} (Ξ² : β) (J : Disorder n) (x y : Config n) : β := | |
| (β i : Fin n, if Function.update x i (y i) = y then | |
| Real.exp (Ξ² * spin (y i) * localField J x i) / | |
| (2 * Real.cosh (Ξ² * localField J x i)) else 0) / n | |
| def discreteKernel {n : β} (Ξ² : β) (J : Disorder n) : β β Config n β Config n β β | |
| | 0, x, y => if x = y then 1 else 0 | |
| | k + 1, x, y => β z : Config n, heatBath Ξ² J x z * discreteKernel Ξ² J k z y | |
| def continuousKernel {n : β} (Ξ² : β) (J : Disorder n) (t : β) | |
| (x y : Config n) : β := | |
| β' k : β, (Real.exp (-(n : β) * t) * ((n : β) * t) ^ k / | |
| (Nat.factorial k : β)) * discreteKernel Ξ² J k x y | |
| def discreteDistance {n : β} (Ξ² : β) (J : Disorder n) | |
| (x : Config n) (k : β) : β := | |
| (1 / 2 : β) * β y : Config n, |discreteKernel Ξ² J k x y - gibbs Ξ² J y| | |
| def continuousDistance {n : β} (Ξ² : β) (J : Disorder n) | |
| (x : Config n) (t : β) : β := | |
| (1 / 2 : β) * β y : Config n, |continuousKernel Ξ² J t x y - gibbs Ξ² J y| | |
| def disorderLaw (n : β) : Measure (Disorder n) := | |
| Measure.pi (fun _ : Edge n => gaussianReal 0 1) | |
| def kappa : β := 1 / 10000 | |
| def timeScale (n : β) : β := Real.exp ((n : β) ^ kappa) | |
| def continuousBadMass (Ξ² : β) (n : β) : β := | |
| β« J : Disorder n, (β x : Config n, if 1 / 4 < continuousDistance Ξ² J x (timeScale n) | |
| then gibbs Ξ² J x else 0) βdisorderLaw n | |
| def discreteBadMass (Ξ² : β) (n : β) : β := | |
| β« J : Disorder n, (β x : Config n, if 1 / 4 < discreteDistance Ξ² J x βtimeScale nββ | |
| then gibbs Ξ² J x else 0) βdisorderLaw n | |
| end SK | |
| end | |
| end | |
| end | |
| end OAI | |