File size: 3,377 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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