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
|