Documentation

TauCeti.MeasureTheory.OptimalTransport.Entropic.Basic

Entropic optimal transport and the static Schrödinger problem #

Two entropy-based transport problems share the coupling constraint of Kantorovich's problem.

The two are the same problem. For probability measures μ, ν, a cost that is finite μ.prod ν-almost everywhere, and a positive temperature ε, let Z = ∫ e^{-c/ε} d(μ ⊗ ν) be the partition function and R = Z⁻¹ e^{-c/ε} (μ ⊗ ν) the Gibbs measure, which is Mathlib's tilted measure (μ.prod ν).tilted fun z ↦ -((c z).toReal / ε). Then for every probability measure π on X × Y ∫ c dπ + ε * klDiv π (μ ⊗ ν) = ε * klDiv π R - ε * log Z, so the regularised value is ε times the Schrödinger value with reference R, shifted by the free energy -ε log Z ≥ 0, and the two problems have the same optimal couplings.

Main definitions #

Main statements #

Implementation notes #

As for TauCeti.transportCost, both values are defined for arbitrary measures, with an extended-nonnegative cost, as an iterated infimum over plans and proofs of TauCeti.IsCoupling, so that an empty feasible set gives ∞. The temperature ε is a nonnegative real number; the value at ε = 0 is the unregularised transport cost.

The Gibbs identity needs the cost to be finite μ.prod ν-almost everywhere, since otherwise the Gibbs measure is not equivalent to μ.prod ν; a cost that is infinite on a set of positive product measure constrains the support of every plan of finite entropy and is a separate, degenerate regime. The identity holds for every probability measure π on X × Y, not only for couplings, and in ℝ≥0∞ with no integrability hypothesis: when π is not absolutely continuous with respect to μ.prod ν, or has infinite cost, both sides are ∞.

Existence of the Schrödinger minimizer holds in the same generality as its uniqueness: for a finite source measure μ and a finite reference measure R, a finite Schrödinger value is attained on arbitrary measurable spaces X and Y. No topology, separability, or normalization of R to a probability measure is assumed. Together with uniqueness, the minimizing coupling is then well defined whenever the Schrödinger value is finite.

The potentials φ and ψ are the dual side of the problem. A coupling whose density against the reference factorises as exp (φ(x) + ψ(y)), with φ ∈ L¹(μ) and ψ ∈ L¹(ν), is the minimizer: log (dπ/dR) then integrates to the same value ∫ φ dμ + ∫ ψ dν against every coupling, which is the hypothesis of Csiszár's Pythagorean identity TauCeti.klDiv_eq_klDiv_add_klDiv. This is the sufficiency half of the characterisation of the Schrödinger minimizer by its density; the converse, that the minimizer has such a density, needs further hypotheses and is not part of this file. For a reference measure with bounded log-density against μ.prod ν it is proved in TauCeti/MeasureTheory/OptimalTransport/Entropic/SchroedingerSystem.lean. The potentials are measurable functions rather than almost everywhere defined ones, since the density is taken against R and not against the marginals.

References #

The static Schrödinger problem #

The value of the static Schrödinger problem with reference measure R: the infimum of the relative entropy klDiv π R over the couplings π of μ and ν. It is ∞ when μ and ν have no coupling, or no coupling of finite relative entropy.

Instances For

    The Schrödinger value as the infimum of the relative entropies of all feasible plans.

    Every coupling bounds the Schrödinger value from above.

    A bound valid on every coupling bounds the Schrödinger value from below.

    The Schrödinger value is below a threshold exactly when some coupling is.

    @[simp]

    With the product of the marginals as reference, the Schrödinger value is 0: the product coupling has zero relative entropy. By InformationTheory.klDiv_eq_zero_iff it is the only coupling attaining this value.

    Uniqueness of a finite-entropy Schrödinger minimizer. For a finite reference and finite source measure, any two couplings attaining a finite Schrödinger value agree. This applies on arbitrary measurable spaces; existence is TauCeti.exists_isCoupling_klDiv_eq_schroedingerValue.

    Existence of the Schrödinger minimizer. For a finite reference measure and a finite source measure, a finite Schrödinger value is attained by a coupling. No topology, separability or normalization is needed: the measurable spaces are arbitrary, and R need not be a probability measure. Together with TauCeti.IsCoupling.eq_of_klDiv_eq_schroedingerValue, the minimizer is unique; see TauCeti.existsUnique_isCoupling_klDiv_eq_schroedingerValue.

    Existence and uniqueness of the Schrödinger minimizer. For a finite reference measure and a finite source measure, a finite Schrödinger value is attained by exactly one coupling.

    Schrödinger potentials #

    theorem TauCeti.IsCoupling.klDiv_eq_klDiv_add_klDiv_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {π R : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsFiniteMeasure μ] [MeasureTheory.IsFiniteMeasure R] {γ : MeasureTheory.Measure (X × Y)} (hγ : IsCoupling γ μ ν) (hπ : IsCoupling π μ ν) (hπR : π = R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ z.1 + ψ z.2))) (hφ : Measurable φ) (hψ : Measurable ψ) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :

    The Pythagorean identity of the Schrödinger problem. Let π be a coupling of μ and ν whose density against the finite reference R is exp (φ(x) + ψ(y)), for measurable potentials φ ∈ L¹(μ) and ψ ∈ L¹(ν). Then every coupling γ of μ and ν satisfies klDiv γ R = klDiv γ π + klDiv π R.

    theorem TauCeti.IsCoupling.klDiv_eq_ofReal_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {π R : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsFiniteMeasure μ] (hπ : IsCoupling π μ ν) (hπR : π = R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ z.1 + ψ z.2))) (hφ : Measurable φ) (hψ : Measurable ψ) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :

    The relative entropy of a coupling with density exp (φ(x) + ψ(y)) against R is the dual value ∫ φ dμ + ∫ ψ dν of its potentials, corrected by the difference of the masses of R and μ.

    theorem TauCeti.IsCoupling.klDiv_eq_schroedingerValue_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {π R : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsFiniteMeasure μ] [MeasureTheory.IsFiniteMeasure R] (hπ : IsCoupling π μ ν) (hπR : π = R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ z.1 + ψ z.2))) (hφ : Measurable φ) (hψ : Measurable ψ) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :

    A product density certifies the Schrödinger minimizer. A coupling π of μ and ν whose density against the finite reference R is exp (φ(x) + ψ(y)), for measurable potentials φ ∈ L¹(μ) and ψ ∈ L¹(ν), attains the Schrödinger value. By TauCeti.IsCoupling.eq_of_klDiv_eq_schroedingerValue it is the only coupling to do so.

    theorem TauCeti.schroedingerValue_eq_ofReal_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {π R : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsFiniteMeasure μ] [MeasureTheory.IsFiniteMeasure R] (hπ : IsCoupling π μ ν) (hπR : π = R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ z.1 + ψ z.2))) (hφ : Measurable φ) (hψ : Measurable ψ) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :

    The value of the Schrödinger problem from its potentials. If some coupling of μ and ν has density exp (φ(x) + ψ(y)) against the finite reference R, for measurable potentials φ ∈ L¹(μ) and ψ ∈ L¹(ν), then the Schrödinger value is the dual value ∫ φ dμ + ∫ ψ dν of the potentials, corrected by the difference of the masses of R and μ. For probability measures μ and R the correction vanishes.

    theorem TauCeti.exists_ae_eq_add_const_of_withDensity_exp_eq {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {R : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ φ' : X → ℝ} {ψ ψ' : Y → ℝ} [MeasureTheory.SFinite ν] [MeasureTheory.SigmaFinite R] (hμ : μ ≠ 0) (hν : ν ≠ 0) (hR : (μ.prod ν).AbsolutelyContinuous R) (hφ : Measurable φ) (hψ : Measurable ψ) (hφ' : Measurable φ') (hψ' : Measurable ψ') (h : (R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ z.1 + ψ z.2))) = R.withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp (φ' z.1 + ψ' z.2))) :
    ∃ (a : ℝ), (φ =ᵐ[μ] fun (x : X) => φ' x + a) ∧ ψ =ᵐ[ν] fun (y : Y) => ψ' y - a

    Uniqueness of the Schrödinger potentials. If a reference measure R dominates the product of the nonzero marginals, two pairs of potentials that give the same density exp (φ(x) + ψ(y)) against R differ by one additive constant, μ- and ν-almost everywhere: φ = φ' + a and ψ = ψ' - a.

    Entropically regularised transport #

    noncomputable def TauCeti.entropicTransportCost {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] (c : X × Y → ENNReal) (ε : NNReal) (μ : MeasureTheory.Measure X) (ν : MeasureTheory.Measure Y) :

    The entropically regularised transport cost of μ and ν for the cost c at temperature ε: the infimum of ∫⁻ z, c z ∂π + ε * klDiv π (μ.prod ν) over the couplings π of μ and ν. It is ∞ when μ and ν have no coupling.

    Instances For
      theorem TauCeti.entropicTransportCost_def {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} :
      entropicTransportCost c ε μ ν = ⨅ (π : MeasureTheory.Measure (X × Y)), ⨅ (_ : IsCoupling π μ ν), ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν)

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

      theorem TauCeti.entropicTransportCost_le {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (hπ : IsCoupling π μ ν) (c : X × Y → ENNReal) (ε : NNReal) :
      entropicTransportCost c ε μ ν ≤ ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν)

      Every coupling bounds the regularised transport cost from above.

      theorem TauCeti.le_entropicTransportCost {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {a : ENNReal} (h : ∀ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν → a ≤ ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν)) :

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

      theorem TauCeti.entropicTransportCost_lt_iff {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {a : ENNReal} :
      entropicTransportCost c ε μ ν < a ↔ ∃ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν ∧ ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν) < a

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

      theorem TauCeti.entropicTransportCost_mono {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c c' : X × Y → ENNReal} {ε ε' : NNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} (hc : c ≤ c') (hε : ε ≤ ε') :

      The regularised transport cost is monotone in the cost and in the temperature.

      @[simp]

      At zero temperature the regularised transport cost is the transport cost.

      The regularised transport cost dominates the transport cost.

      The regularised transport cost of two probability measures is at most the cost of their product coupling, whose relative entropy against μ.prod ν vanishes.

      For a cost of finite integral against μ.prod ν, the regularised transport cost of two probability measures is finite, by the product-coupling bound.

      For a cost bounded by B almost everywhere against μ.prod ν, the regularised transport cost of two probability measures is finite, by the product-coupling bound.

      @[simp]

      For a constant cost a, the regularised transport cost of two probability measures is a, attained by the product coupling. Since a coupling π pays a + ε * klDiv π (μ.prod ν), at positive temperature and for finite a the product coupling is the only optimal plan, by InformationTheory.klDiv_eq_zero_iff.

      The Gibbs reformulation #

      theorem TauCeti.lintegral_add_mul_klDiv_eq_mul_klDiv_tilted {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} [MeasureTheory.IsProbabilityMeasure μ] [MeasureTheory.IsProbabilityMeasure ν] [MeasureTheory.IsProbabilityMeasure π] (hc : AEMeasurable c (μ.prod ν)) (hc_top : ∀ᵐ (z : X × Y) ∂μ.prod ν, c z ≠ ⊤) (hε : ε ≠ 0) :
      ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν) = ↑ε * InformationTheory.klDiv π ((μ.prod ν).tilted fun (z : X × Y) => -((c z).toReal / ↑ε)) + ↑ε * ENNReal.ofReal (-Real.log (∫ (z : X × Y), Real.exp (-((c z).toReal / ↑ε)) ∂μ.prod ν))

      The Gibbs identity. For probability measures μ and ν, a cost c finite μ.prod ν-almost everywhere, and a positive temperature ε, every probability measure π on X × Y satisfies ∫ c dπ + ε * klDiv π (μ ⊗ ν) = ε * klDiv π R - ε * log Z, where Z = ∫ e^{-c/ε} d(μ ⊗ ν) and R = Z⁻¹ e^{-c/ε} (μ ⊗ ν) is the Gibbs measure, written as the tilted measure (μ.prod ν).tilted fun z ↦ -((c z).toReal / ε). Both sides may be ∞.

      theorem TauCeti.entropicTransportCost_eq_mul_schroedingerValue_add {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} [MeasureTheory.IsProbabilityMeasure μ] (hc : AEMeasurable c (μ.prod ν)) (hc_top : ∀ᵐ (z : X × Y) ∂μ.prod ν, c z ≠ ⊤) (hε : ε ≠ 0) :
      entropicTransportCost c ε μ ν = ↑ε * schroedingerValue ((μ.prod ν).tilted fun (z : X × Y) => -((c z).toReal / ↑ε)) μ ν + ↑ε * ENNReal.ofReal (-Real.log (∫ (z : X × Y), Real.exp (-((c z).toReal / ↑ε)) ∂μ.prod ν))

      The Gibbs reformulation of entropic transport. For probability measures μ and ν, a cost c finite μ.prod ν-almost everywhere, and a positive temperature ε, the regularised transport cost is ε times the value of the Schrödinger problem with the Gibbs reference measure R = Z⁻¹ e^{-c/ε} (μ ⊗ ν), plus the free energy -ε log Z.

      theorem TauCeti.lintegral_add_mul_klDiv_eq_entropicTransportCost_iff {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} [MeasureTheory.IsProbabilityMeasure μ] (hπ : IsCoupling π μ ν) (hc : AEMeasurable c (μ.prod ν)) (hc_top : ∀ᵐ (z : X × Y) ∂μ.prod ν, c z ≠ ⊤) (hε : ε ≠ 0) :
      ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν) = entropicTransportCost c ε μ ν ↔ InformationTheory.klDiv π ((μ.prod ν).tilted fun (z : X × Y) => -((c z).toReal / ↑ε)) = schroedingerValue ((μ.prod ν).tilted fun (z : X × Y) => -((c z).toReal / ↑ε)) μ ν

      A coupling is optimal for the regularised transport problem at positive temperature exactly when it is optimal for the Schrödinger problem with the Gibbs reference measure R = Z⁻¹ e^{-c/ε} (μ ⊗ ν), for a cost finite μ.prod ν-almost everywhere.

      Potentials of the regularised problem #

      theorem TauCeti.IsCoupling.lintegral_add_mul_klDiv_eq_entropicTransportCost_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsProbabilityMeasure μ] (hπ : IsCoupling π μ ν) (hc : AEMeasurable c (μ.prod ν)) (hc_top : ∀ᵐ (z : X × Y) ∂μ.prod ν, c z ≠ ⊤) (hε : ε ≠ 0) (hπc : π = (μ.prod ν).withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp ((φ z.1 + ψ z.2 - (c z).toReal) / ↑ε))) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :
      ∫⁻ (z : X × Y), c z ∂π + ↑ε * InformationTheory.klDiv π (μ.prod ν) = entropicTransportCost c ε μ ν

      A Gibbs density certifies the entropic optimal plan. For probability measures μ and ν, a cost c finite μ.prod ν-almost everywhere, and a positive temperature ε, a coupling π whose density against μ.prod ν is exp ((φ(x) + ψ(y) - c(x, y)) / ε), for potentials φ ∈ L¹(μ) and ψ ∈ L¹(ν), is optimal for the regularised transport problem.

      theorem TauCeti.entropicTransportCost_eq_ofReal_of_eq_withDensity {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] {c : X × Y → ENNReal} {ε : NNReal} {π : MeasureTheory.Measure (X × Y)} {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {φ : X → ℝ} {ψ : Y → ℝ} [MeasureTheory.IsProbabilityMeasure μ] (hπ : IsCoupling π μ ν) (hc : AEMeasurable c (μ.prod ν)) (hc_top : ∀ᵐ (z : X × Y) ∂μ.prod ν, c z ≠ ⊤) (hε : ε ≠ 0) (hπc : π = (μ.prod ν).withDensity fun (z : X × Y) => ENNReal.ofReal (Real.exp ((φ z.1 + ψ z.2 - (c z).toReal) / ↑ε))) (hφi : MeasureTheory.Integrable φ μ) (hψi : MeasureTheory.Integrable ψ ν) :

      The entropic transport cost from its potentials. For probability measures μ and ν, a cost c finite μ.prod ν-almost everywhere, and a positive temperature ε, if some coupling has density exp ((φ(x) + ψ(y) - c(x, y)) / ε) against μ.prod ν, for potentials φ ∈ L¹(μ) and ψ ∈ L¹(ν), then the regularised transport cost is the dual value ∫ φ dμ + ∫ ψ dν of the potentials.