Download data/lean/OAI/Probability/LogConcave/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.38 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LogConcave/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Model.lean
3.38 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open MeasureTheory Filter | |
| open scoped ENNReal NNReal Topology | |
| namespace LogConcaveSampling | |
| abbrev Point (d : β) := EuclideanSpace β (Fin d) | |
| abbrev Reply (d : β) := β Γ Point d | |
| abbrev Transcript (d q : β) := Fin q β Reply d | |
| /-- Normalized twice continuously differentiable potentials with Hessian between the identity and twice the identity. -/ | |
| structure Admissible {d : β} (V : Point d β β) : Prop where | |
| smooth : ContDiff β 2 V | |
| value_zero : V 0 = 0 | |
| gradient_zero : gradient V 0 = 0 | |
| hessian_bounds : β x v : Point d, | |
| βvβ ^ 2 β€ inner β v (fderiv β (gradient V) x v) β§ | |
| inner β v (fderiv β (gradient V) x v) β€ 2 * βvβ ^ 2 | |
| /-- The unnormalized Gibbs density relative to Euclidean volume. -/ | |
| def gibbsDensity {d : β} (V : Point d β β) (x : Point d) : ββ₯0β := | |
| ENNReal.ofReal (Real.exp (-V x)) | |
| def partition {d : β} (V : Point d β β) : ββ₯0β := | |
| β«β» x, gibbsDensity V x βvolume | |
| /-- The Gibbs probability law, normalized by its partition function. -/ | |
| def gibbs {d : β} (V : Point d β β) : Measure (Point d) := | |
| (partition V)β»ΒΉ β’ volume.withDensity (gibbsDensity V) | |
| def TVAtMost {E : Type*} [MeasurableSpace E] | |
| (ΞΌ Ξ½ : Measure E) (Ξ΅ : β) : Prop := | |
| β s : Set E, MeasurableSet s β |ΞΌ.real s - Ξ½.real s| β€ Ξ΅ | |
| def firstOrderReply {d : β} (V : Point d β β) (x : Point d) : Reply d := | |
| (V x, gradient V x) | |
| /-- Measurable adaptive queries and output, parametrized by private randomness. -/ | |
| structure OracleAlgorithm (Ξ© : Type*) [MeasurableSpace Ξ©] (d q : β) where | |
| query : Fin q β Ξ© Γ Transcript d q β Point d | |
| query_measurable : β i, Measurable (query i) | |
| output : Ξ© Γ Transcript d q β Point d | |
| output_measurable : Measurable output | |
| def OracleAlgorithm.history {Ξ© : Type*} [MeasurableSpace Ξ©] {d q : β} | |
| (A : OracleAlgorithm Ξ© d q) (V : Point d β β) (Ο : Ξ©) : β β Transcript d q | |
| | 0 => 0 | |
| | n + 1 => | |
| let h := A.history V Ο n | |
| if hn : n < q then | |
| Function.update h β¨n, hnβ© (firstOrderReply V (A.query β¨n, hnβ© (Ο, h))) | |
| else h | |
| def OracleAlgorithm.run {Ξ© : Type*} [MeasurableSpace Ξ©] {d q : β} | |
| (A : OracleAlgorithm Ξ© d q) (V : Point d β β) (Ο : Ξ©) : Point d := | |
| A.output (Ο, A.history V Ο q) | |
| /-- A uniform sampler with a deterministic query budget on every execution and total-variation error at most one tenth. -/ | |
| def CanSample (d q : β) : Prop := | |
| β (Ξ© : Type) (_ : MeasurableSpace Ξ©) (ΞΌ : Measure Ξ©) | |
| (_ : IsProbabilityMeasure ΞΌ) (A : OracleAlgorithm Ξ© d q), | |
| β V : Point d β β, Admissible V β | |
| Measurable (A.run V) β§ TVAtMost (ΞΌ.map (A.run V)) (gibbs V) (1 / 10) | |
| /-- The smallest feasible integer query budget, or infinity when no budget is feasible. -/ | |
| def queryComplexity (d : β) : ββ := | |
| sInf ((fun q : β => (q : ββ)) '' {q | CanSample d q}) | |
| /-- The quantified dimension-exponent upper bound with every positive exponent slack. -/ | |
| def ExponentBound (Ξ³ : β) : Prop := | |
| 0 β€ Ξ³ β§ β Ξ΅ : β, 0 < Ξ΅ β β dβ : β, β d : β, dβ β€ d β | |
| (queryComplexity d).toENNReal β€ ENNReal.ofReal ((d : β) ^ (Ξ³ + Ξ΅)) | |
| def gammaStar : β := sInf {Ξ³ : β | ExponentBound Ξ³} | |
| end LogConcaveSampling | |
| end | |
| end | |
| end | |
| end OAI | |