Documentation

TauCeti.MeasureTheory.OptimalTransport.Brenier

Brenier's theorem #

Let E be a finite-dimensional real inner product space, such as ℝⁿ, and consider the quadratic transport cost c (x, y) = ‖x - y‖ ^ 2 / 2. Brenier's theorem says that when the source law μ is absolutely continuous with respect to Lebesgue measure and the optimal cost is finite, the optimal transport plan is unique and is induced by the gradient of a convex function: there is a proper lower semicontinuous convex u : E → EReal, finite and differentiable μ-almost everywhere, such that x ↦ ∇ u (x) pushes μ to ν and is the unique optimal transport map.

The proof avoids Kantorovich duality. The support of an optimal plan of finite cost is c-cyclically monotone (TauCeti.IsOptimalCoupling.isCyclicallyMonotone_support), so by Rockafellar's theorem it lies in the subdifferential graph of a Legendre–Fenchel conjugate u (TauCeti.IsCyclicallyMonotone.exists_fenchelConjugate_innerₗ_subset_subdifferential). By Rademacher's theorem for convex functions (TauCeti.ae_eventually_ne_top_and_differentiableAt_toReal), u is differentiable at almost every point of its effective domain, which contains μ-almost every point because the plan has first marginal μ; there the subgradient is the gradient (TauCeti.gradient_toReal_eq_of_mem_subdifferential). So the plan is the graph plan of ∇ u. Uniqueness follows by applying this to the sum of two optimal plans, which is again optimal.

When the target ν is absolutely continuous as well, the same argument applies to the plan with exchanged coordinates, which lies in the subdifferential graph of the Legendre–Fenchel conjugate u⋆ by conjugate-subgradient reciprocity. So ∇ u⋆ is the optimal transport map from ν back to μ, and the two maps are inverse to each other almost everywhere: conjugate potentials give inverse maps.

Conversely, between finite measures with finite second moments on any real inner product space, every plan concentrated on the subdifferential graph of a function u : E → EReal is optimal, and so is every transport map selecting a subgradient of u almost everywhere, in particular the gradient of a convex function. Expanding the square, the quadratic cost of a plan is a fixed second-moment term minus its correlation ∫ ⟪x, y⟫, and on the subdifferential graph of a Legendre–Fenchel conjugate the Fenchel–Young inequality ⟪x, y⟫ ≤ u x + u⋆ y is an equality. The real representatives of u and u⋆ are integrable, being squeezed between affine functions and the correlation, so integrating Fenchel–Young against any other coupling bounds its correlation by that of the given plan. A general u is first replaced, through Rockafellar's theorem, by a conjugate whose subdifferential graph contains its own. With the forward direction this gives the Knott–Smith optimality criterion on separable spaces.

Absolute continuity is taken with respect to an arbitrary additive Haar measure ρ on E, which for E = ℝⁿ covers Lebesgue measure. The real representative x ↦ (u x).toReal is the function whose gradient is taken; where u is finite near x it agrees with u near x. The cost ‖x - y‖ ^ 2 / 2 is the normalisation of the convex-analysis bridges; its optimal plans and maps are those of ‖x - y‖ ^ 2, whose transport cost is twice as large (TauCeti.transportCost_const_mul).

Main statements #

References #

theorem TauCeti.IsOptimalCoupling.exists_support_subset_subdifferential {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [MeasurableSpace E] [OpensMeasurableSpace (E × E)] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} [MeasureTheory.IsFiniteMeasure μ] (h : IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ (∃ (x : E), u x ≠ ⊤) ∧ π.support ⊆ {p : E × E | p.2 ∈ subdifferential (innerₗ E) u p.1}

The support of an optimal quadratic plan lies in a subdifferential graph. On a real inner product space, if π is an optimal plan of finite cost for ‖x - y‖ ^ 2 / 2 between finite measures, there is a proper (never ⊥, and finite somewhere) convex, lower semicontinuous u : E → EReal such that every (x, y) in the support of π has y ∈ ∂u(x).

Optimal quadratic Wasserstein plans have cyclically monotone support. If π is a coupling of a finite measure μ and a measure ν, both with finite second moments, whose quadratic cost realizes the quadratic Wasserstein distance, then its support is cyclically monotone for the cost ‖x - y‖ ^ 2 / 2.

Reciprocity along a plan. If y ∈ ∂u(x) for π-almost every (x, y), then x ∈ ∂u⋆(y) for almost every (y, x) of the plan with exchanged coordinates, where u⋆ is the Legendre–Fenchel conjugate of u for the inner product.

theorem TauCeti.IsCoupling.isOptimalCoupling_of_isCyclicallyMonotone_norm_sub_sq_div_two {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [MeasurableSpace E] [OpensMeasurableSpace (E × E)] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} [MeasureTheory.IsFiniteMeasure μ] (hπ : IsCoupling π μ ν) (hμ : MeasureTheory.MemLp id 2 μ) (hν : MeasureTheory.MemLp id 2 ν) {S : Set (E × E)} (hS : IsCyclicallyMonotone (fun (p : E × E) => ‖p.1 - p.2‖ ^ 2 / 2) S) (h : ∀ᵐ (z : E × E) ∂π, z ∈ S) :
IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν

Plans on cyclically monotone sets are optimal for the quadratic cost. Let μ and ν be finite measures with finite second moments on a real inner product space. A coupling π of μ and ν concentrated on a c-cyclically monotone set for the cost ‖x - y‖ ^ 2 / 2 is an optimal plan for that cost.

Plans on subdifferential graphs are optimal for the quadratic cost. Let μ and ν be finite measures with finite second moments on a real inner product space, and u : E → EReal any function. A coupling π of μ and ν such that y ∈ ∂u(x) for π-almost every (x, y) is an optimal plan for the cost ‖x - y‖ ^ 2 / 2.

Subgradient selections are optimal transport maps for the quadratic cost. Let μ and ν be finite measures with finite second moments on a real inner product space, u : E → EReal any function, and T a transport map from μ to ν with T x ∈ ∂u(x) for μ-almost every x. Then T is an optimal transport map for the cost ‖x - y‖ ^ 2 / 2, attaining the Kantorovich value.

theorem TauCeti.isKantorovichOptimalTransportMap_gradient {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [MeasurableSpace E] [OpensMeasurableSpace (E × E)] {μ ν : MeasureTheory.Measure E} [CompleteSpace E] [MeasureTheory.IsFiniteMeasure μ] (hμ : MeasureTheory.MemLp id 2 μ) (hν : MeasureTheory.MemLp id 2 ν) {u : E → EReal} (hconv : Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2}) (hbot : ∀ (x : E), u x ≠ ⊥) (hdiff : ∀ᵐ (x : E) ∂μ, u x ≠ ⊤ ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) (hT : ProbabilityTheory.HasLaw (gradient fun (x : E) => (u x).toReal) ν μ) :
IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal)

Gradients of convex functions are optimal transport maps for the quadratic cost. Let μ and ν be finite measures with finite second moments on a real Hilbert space, and let u : E → EReal be convex, never ⊥, and finite with differentiable real representative at μ-almost every point. If the gradient ∇ u pushes μ to ν, it is an optimal transport map for the cost ‖x - y‖ ^ 2 / 2, attaining the Kantorovich value. This is the converse of Brenier's theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient.

theorem TauCeti.IsCoupling.isOptimalCoupling_iff_exists_ae_mem_subdifferential {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [MeasurableSpace E] [OpensMeasurableSpace (E × E)] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} [SecondCountableTopology E] [MeasureTheory.IsFiniteMeasure μ] (hπ : IsCoupling π μ ν) (hμ : MeasureTheory.MemLp id 2 μ) (hν : MeasureTheory.MemLp id 2 ν) :
IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν ↔ ∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ (∃ (x : E), u x ≠ ⊤) ∧ ∀ᵐ (z : E × E) ∂π, z.2 ∈ subdifferential (innerₗ E) u z.1

The Knott–Smith optimality criterion. On a separable real inner product space, a coupling π of finite measures μ and ν with finite second moments is an optimal plan for the cost ‖x - y‖ ^ 2 / 2 exactly when there is a proper (never ⊥, and finite somewhere) convex, lower semicontinuous u : E → EReal such that y ∈ ∂u(x) for π-almost every (x, y).

theorem TauCeti.eq_graphPlan_gradient_of_ae_mem_subdifferential {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} (hπ : π.fst = μ) (hμ : μ.AbsolutelyContinuous ρ) {u : E → EReal} (hconv : Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2}) (hlsc : LowerSemicontinuous u) (hsub : ∀ᵐ (z : E × E) ∂π, z.2 ∈ subdifferential (innerₗ E) u z.1) :
(∀ᵐ (x : E) ∂μ, (∀ᶠ (x' : E) in nhds x, u x' ≠ ⊤) ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) ∧ π = graphPlan (gradient fun (x : E) => (u x).toReal) μ

A plan on a subdifferential graph is the graph plan of the gradient. Let π be a plan with first marginal μ on a finite-dimensional real inner product space, with μ absolutely continuous with respect to an additive Haar measure, and let u : E → EReal be convex, lower semicontinuous. If y ∈ ∂u(x) for π-almost every (x, y), then u is finite near μ-almost every point with differentiable real representative there, and π is the graph plan of the gradient of that real representative.

theorem TauCeti.IsOptimalCoupling.exists_eq_graphPlan_gradient {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} [MeasureTheory.IsFiniteMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) (h : IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ (∀ᵐ (x : E) ∂μ, (∀ᶠ (x' : E) in nhds x, u x' ≠ ⊤) ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) ∧ π = graphPlan (gradient fun (x : E) => (u x).toReal) μ

An optimal quadratic plan is induced by the gradient of a convex function. Let π be an optimal plan of finite cost for ‖x - y‖ ^ 2 / 2 between finite measures μ and ν on a finite-dimensional real inner product space, with μ absolutely continuous with respect to an additive Haar measure. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥, is finite near μ-almost every point and has differentiable real representative there, such that π is the graph plan of the gradient of that real representative.

The exchanged plan is the graph plan of the gradient of the conjugate. Let π be a plan with second marginal ν on a finite-dimensional real inner product space, with ν absolutely continuous with respect to an additive Haar measure, and let u : E → EReal be any function such that y ∈ ∂u(x) for π-almost every (x, y). Then the Legendre–Fenchel conjugate u⋆ of u for the inner product is finite near ν-almost every point with differentiable real representative there, and the plan with exchanged coordinates is the graph plan over ν of the gradient of that real representative.

theorem TauCeti.IsCoupling.gradient_fenchelConjugate_comp_gradient_ae_eq_id {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} (hπ : IsCoupling π μ ν) (hμ : μ.AbsolutelyContinuous ρ) (hν : ν.AbsolutelyContinuous ρ) {u : E → EReal} (hconv : Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2}) (hlsc : LowerSemicontinuous u) (hsub : ∀ᵐ (z : E × E) ∂π, z.2 ∈ subdifferential (innerₗ E) u z.1) :
((gradient fun (y : E) => (fenchelConjugate (innerₗ E) u y).toReal) ∘ gradient fun (x : E) => (u x).toReal) =ᵐ[μ] id

Conjugate potentials give inverse maps. Let π couple μ and ν, both absolutely continuous with respect to an additive Haar measure on a finite-dimensional real inner product space, and let u : E → EReal be convex and lower semicontinuous, with y ∈ ∂u(x) for π-almost every (x, y). Then the gradient of the conjugate u⋆ is a left inverse of the gradient of u, μ-almost everywhere.

theorem TauCeti.IsCoupling.gradient_comp_gradient_fenchelConjugate_ae_eq_id {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} (hπ : IsCoupling π μ ν) (hμ : μ.AbsolutelyContinuous ρ) (hν : ν.AbsolutelyContinuous ρ) {u : E → EReal} (hconv : Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2}) (hlsc : LowerSemicontinuous u) (hsub : ∀ᵐ (z : E × E) ∂π, z.2 ∈ subdifferential (innerₗ E) u z.1) :
((gradient fun (x : E) => (u x).toReal) ∘ gradient fun (y : E) => (fenchelConjugate (innerₗ E) u y).toReal) =ᵐ[ν] id

Conjugate potentials give inverse maps. Let π couple μ and ν, both absolutely continuous with respect to an additive Haar measure on a finite-dimensional real inner product space, and let u : E → EReal be convex and lower semicontinuous, with y ∈ ∂u(x) for π-almost every (x, y). Then the gradient of u is a left inverse of the gradient of the conjugate u⋆, ν-almost everywhere.

theorem TauCeti.IsOptimalCoupling.unique {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} {π : MeasureTheory.Measure (E × E)} [MeasureTheory.IsFiniteMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) {π' : MeasureTheory.Measure (E × E)} (h : IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν) (h' : IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π' μ ν) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
π = π'

Uniqueness of the optimal quadratic plan. Between finite measures on a finite-dimensional real inner product space, if the source μ is absolutely continuous with respect to an additive Haar measure and the optimal cost for ‖x - y‖ ^ 2 / 2 is finite, any two optimal plans are equal.

theorem TauCeti.gradient_ae_eq_gradient_of_hasLaw {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsFiniteMeasure μ] (hμ2 : MeasureTheory.MemLp id 2 μ) (hν2 : MeasureTheory.MemLp id 2 ν) (hμ : μ.AbsolutelyContinuous ρ) {u v : E → EReal} (hu : Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2}) (hubot : ∀ (x : E), u x ≠ ⊥) (hudiff : ∀ᵐ (x : E) ∂μ, u x ≠ ⊤ ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) (huν : ProbabilityTheory.HasLaw (gradient fun (x : E) => (u x).toReal) ν μ) (hv : Convex ℝ {p : E × ℝ | v p.1 ≤ ↑p.2}) (hvbot : ∀ (x : E), v x ≠ ⊥) (hvdiff : ∀ᵐ (x : E) ∂μ, v x ≠ ⊤ ∧ DifferentiableAt ℝ (fun (x' : E) => (v x').toReal) x) (hvν : ProbabilityTheory.HasLaw (gradient fun (x : E) => (v x).toReal) ν μ) :
(gradient fun (x : E) => (u x).toReal) =ᵐ[μ] gradient fun (x : E) => (v x).toReal

Uniqueness of the monotone rearrangement. Let μ and ν be finite measures with finite second moments on a finite-dimensional real inner product space, with μ absolutely continuous with respect to an additive Haar measure. If u and v : E → EReal are convex and never ⊥, finite with differentiable real representatives at μ-almost every point, and both gradients push μ to ν, then ∇u = ∇v μ-almost everywhere.

theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsProbabilityMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ (∀ᵐ (x : E) ∂μ, (∀ᶠ (x' : E) in nhds x, u x' ≠ ⊤) ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal) ∧ (∀ (π : MeasureTheory.Measure (E × E)), IsOptimalCoupling (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) π μ ν ↔ π = graphPlan (gradient fun (x : E) => (u x).toReal) μ) ∧ ∀ (S : E → E), IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν S → S =ᵐ[μ] gradient fun (x : E) => (u x).toReal

Brenier's theorem. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, with μ absolutely continuous with respect to an additive Haar measure, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite, as it is for laws with finite second moment (TauCeti.transportCost_norm_sub_sq_div_two_ne_top); then ν is a probability measure too. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥, is finite near μ-almost every point and has differentiable real representative there, such that the gradient T = ∇ (fun x => (u x).toReal):

  • is an optimal transport map from μ to ν, attaining the Kantorovich value;
  • induces the unique optimal plan: a plan is optimal exactly when it is the graph plan of T;
  • is the unique optimal transport map up to μ-almost everywhere equality.
theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient_and_gradient_fenchelConjugate {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsProbabilityMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) (hν : ν.AbsolutelyContinuous ρ) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ (∀ᵐ (x : E) ∂μ, (∀ᶠ (x' : E) in nhds x, u x' ≠ ⊤) ∧ DifferentiableAt ℝ (fun (x' : E) => (u x').toReal) x) ∧ (∀ᵐ (y : E) ∂ν, (∀ᶠ (y' : E) in nhds y, fenchelConjugate (innerₗ E) u y' ≠ ⊤) ∧ DifferentiableAt ℝ (fun (y' : E) => (fenchelConjugate (innerₗ E) u y').toReal) y) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) ν μ (gradient fun (y : E) => (fenchelConjugate (innerₗ E) u y).toReal) ∧ ((gradient fun (y : E) => (fenchelConjugate (innerₗ E) u y).toReal) ∘ gradient fun (x : E) => (u x).toReal) =ᵐ[μ] id ∧ ((gradient fun (x : E) => (u x).toReal) ∘ gradient fun (y : E) => (fenchelConjugate (innerₗ E) u y).toReal) =ᵐ[ν] id

Brenier's theorem with the inverse map. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, both absolutely continuous with respect to an additive Haar measure, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite (so ν is a probability measure too). Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥ such that u is finite near μ-almost every point and its Legendre–Fenchel conjugate u⋆ is finite near ν-almost every point, both with differentiable real representatives there, and:

  • the gradient ∇ u is an optimal transport map from μ to ν;
  • the gradient ∇ u⋆ is an optimal transport map from ν to μ;
  • the two maps are inverse to each other, ∇ u⋆ ∘ ∇ u = id μ-almost everywhere and ∇ u ∘ ∇ u⋆ = id ν-almost everywhere.

The almost everywhere uniqueness of the optimal maps and plans in each direction is recorded separately, in TauCeti.exists_isKantorovichOptimalTransportMap_gradient and TauCeti.IsOptimalCoupling.unique.

The Brenier potential is a weak solution of its transport equation. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, both absolutely continuous with respect to an additive Haar measure, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥, with D the interior of its effective domain, such that:

  • the gradient ∇ u is an optimal transport map from μ to ν;
  • the Monge–Ampère measure of u weighted by ν is μ, that is, ν(∂u(s ∩ D)) = μ(s) for every measurable s; for μ = g₀ dx and ν = g₁ dy this is ∫_{∂u(s ∩ D)} g₁ = ∫_s g₀;
  • ν-almost every point is a subgradient of u at a point of D.
theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient_and_mongeAmpereMeasure_eq_withDensity {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsProbabilityMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) {g : E → ENNReal} (hg : Measurable g) (hνg : ν = ρ.withDensity g) {K : Set E} (hKc : Convex ℝ K) (hKcl : IsClosed K) (hνK : ν Kᶜ = 0) (hgK : ∀ᵐ (y : E) ∂ρ, y ∈ K → g y ≠ 0) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal) ∧ (∀ (x : E), subdifferential (innerₗ E) u x ⊆ K) ∧ mongeAmpereMeasure ρ u = μ.withDensity fun (x : E) => (g (gradient (fun (x : E) => (u x).toReal) x))⁻¹

Brenier solutions with a convex target are Aleksandrov solutions. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, with μ absolutely continuous with respect to an additive Haar measure ρ and ν = g ρ, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite. Let K be a closed convex set carrying ν on which g is ρ-almost everywhere positive. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥ such that:

  • the gradient ∇ u is an optimal transport map from μ to ν;
  • every subgradient of u, at every point, lies in K;
  • u is an Aleksandrov solution of the Monge–Ampère equation det D²u = g₀ / g(∇u), where μ = g₀ ρ: its Aleksandrov measure is MA_u = (g ∘ ∇u)⁻¹ μ.

For a general transporting potential, TauCeti.mongeAmpereMeasure_eq_withDensity_inv_iff identifies the obstruction: the zero-density remainder, the subgradient mass falling where g vanishes, which the weighted transport equation MA_{u, g ρ} = μ does not see.

Brenier's theorem for the cost edist ^ 2. On a finite-dimensional real inner product space, an optimal plan for the cost edist ^ 2 out of a finite measure μ that is absolutely continuous with respect to an additive Haar measure, to a law at finite W₂ distance from μ, is the graph plan of a measurable map.

theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient_and_rnDeriv_ae_eq {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsProbabilityMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) (hν : ν.AbsolutelyContinuous ρ) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal) ∧ ∃ (H : E → E →L[ℝ] E), (∀ᵐ (x : E) ∂ρ, u x ≠ ⊤ → (H x).IsPositive ∧ ∀ ε > 0, ∀ᶠ (x' : E) in nhds x, ∀ y' ∈ subdifferential (innerₗ E) u x', ‖y' - gradient (fun (x : E) => (u x).toReal) x - (H x) (x' - x)‖ ≤ ε * ‖x' - x‖) ∧ μ.rnDeriv ρ =ᵐ[ρ] (interior {x : E | u x ≠ ⊤}).indicator fun (x : E) => ENNReal.ofReal (H x).det * ν.rnDeriv ρ (gradient (fun (x : E) => (u x).toReal) x)

The Brenier potential solves the Monge–Ampère equation almost everywhere. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, both absolutely continuous with respect to an additive Haar measure ρ, with densities g₀ = dμ/dρ and g₁ = dν/dρ, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥, with D the interior of its effective domain, such that:

  • the gradient ∇ u is an optimal transport map from μ to ν;
  • at ρ-almost every point x of the effective domain, the subdifferential of u has a positive derivative H x, the Alexandrov Hessian of u: every subgradient y' at a point x' near x satisfies y' = ∇ u x + H x (x' - x) + o(‖x' - x‖);
  • the Jacobian equation g₀ x = g₁ (∇ u x) det (H x) holds for ρ-almost every x ∈ D, and g₀ = 0 almost everywhere off D.
theorem TauCeti.exists_isKantorovichOptimalTransportMap_gradient_and_rnDeriv_ae_eq_map_smul_add_smul_gradient {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ρ : MeasureTheory.Measure E} [ρ.IsAddHaarMeasure] {μ ν : MeasureTheory.Measure E} [MeasureTheory.IsProbabilityMeasure μ] (hμ : μ.AbsolutelyContinuous ρ) (hfin : transportCost (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν ≠ ⊤) :
∃ (u : E → EReal), Convex ℝ {p : E × ℝ | u p.1 ≤ ↑p.2} ∧ LowerSemicontinuous u ∧ (∀ (x : E), u x ≠ ⊥) ∧ IsKantorovichOptimalTransportMap (fun (z : E × E) => ENNReal.ofReal (‖z.1 - z.2‖ ^ 2 / 2)) μ ν (gradient fun (x : E) => (u x).toReal) ∧ ∃ (H : E → E →L[ℝ] E), (∀ᵐ (x : E) ∂ρ, u x ≠ ⊤ → (H x).IsPositive ∧ ∀ ε > 0, ∀ᶠ (x' : E) in nhds x, ∀ y' ∈ subdifferential (innerₗ E) u x', ‖y' - gradient (fun (x : E) => (u x).toReal) x - (H x) (x' - x)‖ ≤ ε * ‖x' - x‖) ∧ ∀ (t : ℝ), 0 ≤ t → t < 1 → (MeasureTheory.Measure.map (fun (x : E) => (1 - t) • x + t • gradient (fun (x' : E) => (u x').toReal) x) μ).AbsolutelyContinuous ρ ∧ μ.rnDeriv ρ =ᵐ[ρ] (interior {x : E | u x ≠ ⊤}).indicator fun (x : E) => ENNReal.ofReal ((1 - t) • ContinuousLinearMap.id ℝ E + t • H x).det * (MeasureTheory.Measure.map (fun (x : E) => (1 - t) • x + t • gradient (fun (x' : E) => (u x').toReal) x) μ).rnDeriv ρ ((1 - t) • x + t • gradient (fun (x' : E) => (u x').toReal) x)

Displacement interpolants of an absolutely continuous law are absolutely continuous. Let μ be a probability measure and ν a measure on a finite-dimensional real inner product space E, with μ absolutely continuous with respect to an additive Haar measure ρ, and suppose the optimal cost for ‖x - y‖ ^ 2 / 2 is finite. Then there is a convex, lower semicontinuous u : E → EReal that never takes the value ⊥, with D the interior of its effective domain, such that:

  • the gradient ∇ u is an optimal transport map from μ to ν;
  • at ρ-almost every point x of the effective domain, the subdifferential of u has a positive derivative H x, the Alexandrov Hessian of u;
  • for every 0 ≤ t < 1, the displacement interpolant μₜ, the pushforward of μ by Tₜ x = (1 - t) • x + t • ∇ u x, is absolutely continuous with respect to ρ, and the densities satisfy the Jacobian equation dμ/dρ (x) = det ((1 - t) • 1 + t • H x) * dμₜ/dρ (Tₜ x) for ρ-almost every x ∈ D, with dμ/dρ = 0 almost everywhere off D.

The target ν = μ₁ need not be absolutely continuous.