File size: 2,141 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
import Mathlib

namespace OAI

noncomputable section

open MeasureTheory
open scoped BigOperators ENNReal

namespace Problem358

abbrev E (d : β„•) := EuclideanSpace ℝ (Fin d)

def uniformMeasure {d : β„•} (K : Set (E d)) : Measure (E d) :=
  (volume K)⁻¹ β€’ volume.restrict K

def IsSupported {d : β„•} (ΞΌ : Measure (E d)) (Y : Set (E d)) : Prop :=
  μ (Yᢜ) = 0

def IsCoupling {d : β„•} (ΞΌ Ξ½ : Measure (E d))
    (Ο€ : Measure (E d Γ— E d)) : Prop :=
  IsProbabilityMeasure Ο€ ∧
    Measure.map Prod.fst Ο€ = ΞΌ ∧
    Measure.map Prod.snd Ο€ = Ξ½

def quadraticPlanCost {d : β„•} (Ο€ : Measure (E d Γ— E d)) : ℝβ‰₯0∞ :=
  ∫⁻ p, ENNReal.ofReal (β€–p.1 - p.2β€– ^ 2) βˆ‚Ο€

def wasserstein2 {d : β„•} (ΞΌ Ξ½ : Measure (E d)) : ℝ :=
  Real.sqrt
    (ENNReal.toReal
      (sInf {r : ℝβ‰₯0∞ |
        βˆƒ Ο€ : Measure (E d Γ— E d),
          IsCoupling ΞΌ Ξ½ Ο€ ∧ quadraticPlanCost Ο€ = r}))

def graphPlan {d : β„•} (ρ : Measure (E d)) (T : E d β†’ E d) :
    Measure (E d Γ— E d) :=
  Measure.map (fun x => (x, T x)) ρ

def IsQuadraticOptimalMap {d : β„•} (ρ ΞΌ : Measure (E d))
    (T : E d β†’ E d) : Prop :=
  Measurable T ∧
    Measure.map T ρ = μ ∧
    βˆ€ Ο€ : Measure (E d Γ— E d),
      IsCoupling ρ ΞΌ Ο€ β†’
        quadraticPlanCost (graphPlan ρ T) ≀ quadraticPlanCost Ο€

def IsUniqueQuadraticOptimalMap {d : β„•} (ρ ΞΌ : Measure (E d))
    (T : E d β†’ E d) : Prop :=
  IsQuadraticOptimalMap ρ μ T ∧
    βˆ€ Ο€ : Measure (E d Γ— E d),
      IsCoupling ρ ΞΌ Ο€ β†’
        quadraticPlanCost Ο€ ≀ quadraticPlanCost (graphPlan ρ T) β†’
          Ο€ = graphPlan ρ T

def mapL2Dist {d : β„•} (ρ : Measure (E d))
    (T S : E d β†’ E d) : ℝ :=
  Real.sqrt (∫ x, β€–T x - S xβ€– ^ 2 βˆ‚Ο)

def cube (d : β„•) : Set (E d) :=
  {x | βˆ€ i, |x i| ≀ 1}

def HasExactlyThreeAtoms {d : β„•} (ΞΌ : Measure (E d))
    (Y : Set (E d)) : Prop :=
  βˆƒ y : Fin 3 β†’ E d, Function.Injective y ∧
    (βˆ€ i, y i ∈ Y) ∧
    βˆƒ w : Fin 3 β†’ ℝβ‰₯0∞, (βˆ€ i, 0 < w i) ∧
      (βˆ‘ i, w i) = 1 ∧
      ΞΌ = βˆ‘ i, (w i) β€’ Measure.dirac (y i)

end Problem358

end

end OAI