Documentation

TauCeti.MeasureTheory.OptimalTransport.Cost.Basic

The transport cost of two measures #

Given a cost c : X × Y → ℝ≥0∞, the transport cost of μ and ν is the infimum of ∫⁻ z, c z ∂π over the couplings π of μ and ν. This is the value of the primal Kantorovich problem, and it is the root definition of optimal transport: every later notion — Wasserstein distance, Kantorovich duality, transport maps — is a statement about this number or about the plans that attain it.

The definition is made for arbitrary measures on arbitrary measurable spaces, with an extended-nonnegative cost integrated by lintegral. Nothing is assumed about topology, finiteness, or normalisation, and no compactness is built in. An empty feasible set — for instance measures of different total mass — gives the value ∞, as does a cost that is too large on every plan; the two are separated by TauCeti.exists_isCoupling_of_transportCost_ne_top.

Main definitions #

Main statements #

Implementation notes #

The infimum is written as an iterated ⨅ over plans and over proofs of TauCeti.IsCoupling, so that it is ∞ on an empty feasible set with no case split, and so that TauCeti.transportCost_le_lintegral is iInf₂_le.

Invariance of the transport cost under a change of the cost function needs the two costs to agree a.e. for every feasible plan, not merely μ.prod ν-a.e.: a coupling can be singular with respect to the product measure — the diagonal plan of μ with itself on a diffuse μ is — so a μ.prod ν-null set can carry all the mass of some competitor. This is why TauCeti.transportCost_congr quantifies over plans.

Measurability of the cost is assumed only where it is used, namely in the theorems that move an integral along a pushforward (TauCeti.transportCost_comp_swap, TauCeti.transportCost_comp_prodMap and the Dirac formulas). The order-theoretic API needs none.

The Monge-to-Kantorovich inequality is a statement about the transport cost, so it is stated here; the graph plan that witnesses it and the change of variables it uses come from TauCeti/MeasureTheory/OptimalTransport/GraphPlan/Basic.lean, which is below this module. Its inequality half needs no measurability of the cost at all, since only one half of the change of variables, MeasureTheory.lintegral_map_le, is used.

This supplies the nonnegative-cost interface from Layer 1, item 1 of the optimal-transport roadmap. The parallel signed EReal interface for costs bounded below by an integrable split function is a separate definition family and is not part of this module.

References #

noncomputable def TauCeti.transportCost {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] (c : X × Y → ENNReal) (μ : MeasureTheory.Measure X) (ν : MeasureTheory.Measure Y) :

The transport cost of μ and ν for the cost function c: the infimum of ∫⁻ z, c z ∂π over the couplings π of μ and ν. It is ∞ when μ and ν have no coupling at all.

Equations
Instances For
    theorem TauCeti.transportCost_def {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} :
    transportCost c μ ν = ⨅ (π : MeasureTheory.Measure (X × Y)), ⨅ (_ : IsCoupling π μ ν), ∫⁻ (z : X × Y), c z ∂π

    The transport cost as the infimum of the costs of all feasible plans.

    theorem TauCeti.transportCost_le_lintegral {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (hπ : IsCoupling π μ ν) (c : X × Y → ENNReal) :
    transportCost c μ ν ≤ ∫⁻ (z : X × Y), c z ∂π

    Every coupling bounds the transport cost from above.

    theorem TauCeti.le_transportCost {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {a : ENNReal} (h : ∀ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν → a ≤ ∫⁻ (z : X × Y), c z ∂π) :
    a ≤ transportCost c μ ν

    A bound valid on every coupling bounds the transport cost from below.

    theorem TauCeti.transportCost_lt_iff {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {a : ENNReal} :
    transportCost c μ ν < a ↔ ∃ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν ∧ ∫⁻ (z : X × Y), c z ∂π < a

    The transport cost is below a threshold exactly when some coupling is.

    Measures with no coupling — for instance, by TauCeti.exists_isCoupling_iff, a finite measure and a measure of a different total mass — have transport cost ∞.

    A finite measure and a measure of a different total mass have transport cost ∞.

    A finite transport cost is witnessed by a coupling. The converse fails: a coupling of infinite cost leaves the transport cost ∞, which is why this is not stated as an iff with TauCeti.transportCost_eq_top_of_not_exists_isCoupling.

    theorem TauCeti.transportCost_mono {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c c' : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (h : c ≤ c') :

    The transport cost is monotone in the cost function.

    theorem TauCeti.transportCost_congr {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c c' : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (h : ∀ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν → c =ᵐ[π] c') :
    transportCost c μ ν = transportCost c' μ ν

    Two costs that agree almost everywhere for every feasible plan have the same transport cost. Agreeing μ.prod ν-almost everywhere is not enough: a coupling may be singular with respect to the product measure.

    theorem TauCeti.transportCost_const {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (h : ∃ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν) (a : ENNReal) :
    transportCost (fun (x : X × Y) => a) μ ν = a * μ Set.univ

    A constant cost has transport cost that constant times the total mass, as soon as some coupling exists.

    theorem TauCeti.transportCost_zero {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (h : ∃ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν) :
    transportCost (fun (x : X × Y) => 0) μ ν = 0

    The zero cost has zero transport cost, as soon as some coupling exists. Feasibility is needed: with no coupling the value is ∞. This is also why TauCeti.transportCost_const_mul excludes the scalar 0, for which its right-hand side would read 0 * ∞ = 0.

    theorem TauCeti.transportCost_const_mul {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {a : ENNReal} (ha₀ : a ≠ 0) (ha : a ≠ ⊤) :
    transportCost (fun (z : X × Y) => a * c z) μ ν = a * transportCost c μ ν

    Scaling the cost by a nonzero finite constant scales the transport cost.

    theorem TauCeti.IsCoupling.lintegral_add_split {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {f : X → ENNReal} {g : Y → ENNReal} (hπ : IsCoupling π μ ν) (hf : Measurable f) (hg : Measurable g) (c : X × Y → ENNReal) :
    ∫⁻ (z : X × Y), c z + f z.1 + g z.2 ∂π = ∫⁻ (z : X × Y), c z ∂π + ∫⁻ (x : X), f x ∂μ + ∫⁻ (y : Y), g y ∂ν

    The cost of a fixed plan splits off the terms depending on one variable each: those contribute the two marginal integrals, which do not depend on the plan.

    theorem TauCeti.transportCost_add_split {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {f : X → ENNReal} {g : Y → ENNReal} (hf : Measurable f) (hg : Measurable g) :
    transportCost (fun (z : X × Y) => c z + f z.1 + g z.2) μ ν = transportCost c μ ν + ∫⁻ (x : X), f x ∂μ + ∫⁻ (y : Y), g y ∂ν

    Adding to the cost a term in the first variable and a term in the second shifts the transport cost by the two marginal integrals. Both sides are ∞ when there is no coupling, so no feasibility hypothesis is needed.

    theorem TauCeti.transportCost_comp_swap {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} (hc : Measurable c) (μ : MeasureTheory.Measure X) (ν : MeasureTheory.Measure Y) :
    transportCost (fun (z : Y × X) => c z.swap) ν μ = transportCost c μ ν

    The transport cost is unchanged by exchanging the two factors, the cost being transported along the same exchange.

    theorem TauCeti.transportCost_comm {X : Type u} [MeasurableSpace X] {c : X × X → ENNReal} (hc : Measurable c) (hsymm : ∀ (x y : X), c (x, y) = c (y, x)) (μ ν : MeasureTheory.Measure X) :
    transportCost c μ ν = transportCost c ν μ

    A symmetric cost gives a symmetric transport cost.

    theorem TauCeti.transportCost_comp_prodMap {X : Type u} {Y : Type v} {X' : Type w} {Y' : Type u_1} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace X'] [MeasurableSpace Y'] (e : X ≃ᵐ X') (f : Y ≃ᵐ Y') {c : X' × Y' → ENNReal} (hc : Measurable c) (μ : MeasureTheory.Measure X) (ν : MeasureTheory.Measure Y) :
    transportCost (fun (z : X × Y) => c (e z.1, f z.2)) μ ν = transportCost c (MeasureTheory.Measure.map (⇑e) μ) (MeasureTheory.Measure.map (⇑f) ν)

    The transport cost is invariant under measurable equivalences of the two factors: pushing the marginals forward and transporting the cost back gives the same value.

    A Dirac source has exactly one coupling with each probability target, so its transport cost is an integral against the target.

    A Dirac target has exactly one coupling with each probability source, so its transport cost is an integral against the source.

    Two Dirac measures have exactly one coupling, so their transport cost is the value of the cost at the pair.

    structure TauCeti.IsOptimalCoupling {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] (c : X × Y → ENNReal) (π : MeasureTheory.Measure (X × Y)) (μ : MeasureTheory.Measure X) (ν : MeasureTheory.Measure Y) extends TauCeti.IsCoupling π μ ν :

    IsOptimalCoupling c π μ ν says that the plan π solves the primal transport problem: it couples μ and ν, and its cost is the transport cost of the pair. The optimal plans are the set cut out by this predicate.

    Instances For
      theorem TauCeti.IsOptimalCoupling.lintegral_le {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {π σ : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (h : IsOptimalCoupling c π μ ν) (hσ : IsCoupling σ μ ν) :
      ∫⁻ (z : X × Y), c z ∂π ≤ ∫⁻ (z : X × Y), c z ∂σ

      An optimal coupling costs no more than any other coupling of the same pair.

      theorem TauCeti.IsOptimalCoupling.map {X : Type u} {Y : Type v} {X' : Type w} {Y' : Type u_1} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace X'] [MeasurableSpace Y'] {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (e : X ≃ᵐ X') (f : Y ≃ᵐ Y') {c : X' × Y' → ENNReal} (hc : Measurable c) (h : IsOptimalCoupling (fun (z : X × Y) => c (e z.1, f z.2)) π μ ν) :

      Pushing an optimal coupling forward along measurable equivalences gives an optimal coupling for the pushed-forward marginals and the transported cost.

      theorem TauCeti.IsOptimalCoupling.swap {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (hc : Measurable c) (h : IsOptimalCoupling c π μ ν) :
      IsOptimalCoupling (fun (z : Y × X) => c z.swap) (MeasureTheory.Measure.map Prod.swap π) ν μ

      Exchanging the two coordinates of an optimal coupling gives an optimal coupling for the exchanged cost.

      theorem TauCeti.isOptimalCoupling_iff {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} :
      IsOptimalCoupling c π μ ν ↔ IsCoupling π μ ν ∧ ∀ (σ : MeasureTheory.Measure (X × Y)), IsCoupling σ μ ν → ∫⁻ (z : X × Y), c z ∂π ≤ ∫⁻ (z : X × Y), c z ∂σ

      Optimality is minimality among the feasible plans. This form of the definition avoids the value transportCost c μ ν, so it is the one to check when that value may be ∞.

      Every coupling out of a Dirac measure is optimal, because there is only one.

      Every coupling into a Dirac measure is optimal, because there is only one.

      theorem TauCeti.transportCost_le_lintegral_of_hasLaw {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {T : X → Y} (hT : ProbabilityTheory.HasLaw T ν μ) (c : X × Y → ENNReal) :
      transportCost c μ ν ≤ ∫⁻ (x : X), c (x, T x) ∂μ

      The Monge problem dominates the Kantorovich problem: the transport cost of μ and ν is at most the cost of any transport map from μ to ν, that is, of any map whose graph plan TauCeti.graphPlan is a coupling of the two. Only one half of the change of variables is needed, MeasureTheory.lintegral_map_le, so the cost needs no measurability.

      theorem TauCeti.isOptimalCoupling_graphPlan_iff {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {T : X → Y} (hT : ProbabilityTheory.HasLaw T ν μ) (hc : AEMeasurable c (graphPlan T μ)) :
      IsOptimalCoupling c (graphPlan T μ) μ ν ↔ transportCost c μ ν = ∫⁻ (x : X), c (x, T x) ∂μ

      The graph plan of a transport map is an optimal plan exactly when the transport cost equals the cost of the map: the equality case of TauCeti.transportCost_le_lintegral_of_hasLaw.