Documentation

TauCeti.MeasureTheory.OptimalTransport.GromovWasserstein.Basic

The Gromov–Wasserstein distance of measured kernels #

A measured kernel is a triple (X, μ, ω): a measurable space X, a measure μ on it, and a kernel ω : X × X → Z with values in an extended metric space Z. A metric-measure space is the special case Z = ℝ and ω (x, x') = dist x x'. Two measured kernels living on different spaces cannot be compared pointwise; the Gromov–Wasserstein distance compares them through a coupling π of μ and ν, measuring how badly π distorts the two kernels. For an exponent p : ℝ≥0∞ the distortion of π is the L^p (π ⊗ π) seminorm

dis_p (π) = ‖(x, y), (x', y') ↦ edist (ωX (x, x')) (ωY (y, y'))‖_{L^p (π ⊗ π)},

and the p-Gromov–Wasserstein distance is its infimum over the couplings of μ and ν. This file defines both, with no factor 1 / 2, and proves the axioms of an extended pseudodistance under finiteness and measurability hypotheses: the distance vanishes from an almost-everywhere strongly measurable kernel on an s-finite measure to itself, it is symmetric for a sigma-finite measure on one side, and for 1 ≤ p and a finite middle measure it satisfies the triangle inequality whenever the two couplings glue along the middle carrier, in particular when the third carrier is standard Borel.

As for TauCeti.wassersteinEDist, the objective is an eLpNorm, so the exponent p = ∞ is a case of the definition: there the distortion is the π ⊗ π-essential supremum of the kernel discrepancy. For 0 < p < ∞ the p-th power of the distance is the infimum of the integrals ∫∫ edist (ωX (x, x')) (ωY (y, y')) ^ p d(π ⊗ π).

The kernels are only assumed almost-everywhere strongly measurable, AEStronglyMeasurable ωX (μ.prod μ): this gives the kernel an essentially separable range, so no separability, completeness or measurable structure is required of the target Z, and no topology is required of X. The measures are raw MeasureTheory.Measures, as for the Wasserstein distance; the theorems take the finiteness instances they use.

Main definitions #

Main statements #

Implementation notes #

The distance is an iterated ⨅ over plans and over proofs of TauCeti.IsCoupling, matching TauCeti.wassersteinEDist: two measures with no coupling, for instance finite measures of different total mass, are at distance ∞.

The distance is not a metric on measured kernels: a kernel and its pullback along a measure-preserving map are at distance 0 (TauCeti.gromovWassersteinEDist_comp_prodMap_eq_zero), and so are two kernels agreeing almost everywhere. Under the hypotheses above (finite measures, almost-everywhere strongly measurable kernels, 1 ≤ p and gluing carriers) it behaves as an extended pseudometric.

Some sources, among them Bauer, Mémoli, Needham and Nishino, put a factor 1 / 2 in front of the infimum; the distance here is twice theirs.

References #

noncomputable def TauCeti.gromovWassersteinDistortion {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] (p : ENNReal) (ωX : X × X → Z) (ωY : Y × Y → Z) (π : MeasureTheory.Measure (X × Y)) :

The p-distortion of a plan π on X × Y between the kernels ωX and ωY: the L^p (π ⊗ π) seminorm of the kernel discrepancy ((x, y), (x', y')) ↦ edist (ωX (x, x')) (ωY (y, y')).

Instances For
    theorem TauCeti.gromovWassersteinDistortion_def {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] (p : ENNReal) (ωX : X × X → Z) (ωY : Y × Y → Z) (π : MeasureTheory.Measure (X × Y)) :
    gromovWassersteinDistortion p ωX ωY π = MeasureTheory.eLpNorm (fun (q : (X × Y) × X × Y) => edist (ωX (q.1.1, q.2.1)) (ωY (q.1.2, q.2.2))) p (π.prod π)
    noncomputable def TauCeti.gromovWassersteinEDist {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] (p : ENNReal) (μ : MeasureTheory.Measure X) (ωX : X × X → Z) (ν : MeasureTheory.Measure Y) (ωY : Y × Y → Z) :

    The p-Gromov–Wasserstein distance of the measured kernels (X, μ, ωX) and (Y, ν, ωY): the infimum, over the couplings π of μ and ν, of the distortion TauCeti.gromovWassersteinDistortion p ωX ωY π.

    It is ∞ when μ and ν have no coupling at all. No factor 1 / 2 is included.

    Instances For
      theorem TauCeti.gromovWassersteinEDist_def {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] (p : ENNReal) (μ : MeasureTheory.Measure X) (ωX : X × X → Z) (ν : MeasureTheory.Measure Y) (ωY : Y × Y → Z) :
      gromovWassersteinEDist p μ ωX ν ωY = ⨅ (π : MeasureTheory.Measure (X × Y)), ⨅ (_ : IsCoupling π μ ν), gromovWassersteinDistortion p ωX ωY π
      theorem TauCeti.gromovWassersteinEDist_le {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {π : MeasureTheory.Measure (X × Y)} (hπ : IsCoupling π μ ν) (p : ENNReal) (ωX : X × X → Z) (ωY : Y × Y → Z) :

      Every coupling bounds the Gromov–Wasserstein distance from above by its distortion.

      theorem TauCeti.le_gromovWassersteinEDist {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] {p a : ENNReal} [EDist Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} (h : ∀ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν → a ≤ gromovWassersteinDistortion p ωX ωY π) :
      a ≤ gromovWassersteinEDist p μ ωX ν ωY

      A bound valid on the distortion of every coupling bounds the Gromov–Wasserstein distance from below.

      theorem TauCeti.gromovWassersteinEDist_lt_iff {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] {p a : ENNReal} [EDist Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} :
      gromovWassersteinEDist p μ ωX ν ωY < a ↔ ∃ (π : MeasureTheory.Measure (X × Y)), IsCoupling π μ ν ∧ gromovWassersteinDistortion p ωX ωY π < a

      The Gromov–Wasserstein distance is below a threshold exactly when the distortion of some coupling is.

      theorem TauCeti.gromovWassersteinDistortion_congr_ae {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX ωX' : X × X → Z} {ωY ωY' : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hπ : IsCoupling π μ ν) (hX : ωX =ᵐ[μ.prod μ] ωX') (hY : ωY =ᵐ[ν.prod ν] ωY') (p : ENNReal) :

      The distortion of a coupling does not see a modification of either kernel on a null set.

      theorem TauCeti.gromovWassersteinEDist_congr_ae {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX ωX' : X × X → Z} {ωY ωY' : Y × Y → Z} [MeasureTheory.SigmaFinite μ] (hX : ωX =ᵐ[μ.prod μ] ωX') (hY : ωY =ᵐ[ν.prod ν] ωY') (p : ENNReal) :
      gromovWassersteinEDist p μ ωX ν ωY = gromovWassersteinEDist p μ ωX' ν ωY'

      The Gromov–Wasserstein distance does not see a modification of either kernel on a null set.

      theorem TauCeti.gromovWassersteinDistortion_comp_swap {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] {ωX : X × X → Z} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (p : ENNReal) :

      Exchanging the two arguments of both kernels does not change the distortion of a plan.

      theorem TauCeti.gromovWassersteinEDist_comp_swap {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [EDist Z] (p : ENNReal) (μ : MeasureTheory.Measure X) [MeasureTheory.SigmaFinite μ] (ωX : X × X → Z) (ν : MeasureTheory.Measure Y) (ωY : Y × Y → Z) :

      Exchanging the two arguments of both kernels does not change their Gromov–Wasserstein distance. The outgoing and incoming views of a measured kernel are therefore compared by the same distance.

      theorem TauCeti.IsCoupling.aestronglyMeasurable_kernel_prodMk {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [TopologicalSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hπ : IsCoupling π μ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      MeasureTheory.AEStronglyMeasurable (fun (q : (X × Y) × X × Y) => (ωX (q.1.1, q.2.1), ωY (q.1.2, q.2.2))) (π.prod π)

      The pair of kernel values ((x, y), (x', y')) ↦ (ωX (x, x'), ωY (y, y')) is almost-everywhere strongly measurable for the square of a coupling.

      Exchanging the two coordinates of a plan exchanges the roles of the two kernels and does not change the distortion.

      theorem TauCeti.gromovWassersteinEDist_comm {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [TopologicalSpace Z] [WeakPseudoEMetricSpace Z] (p : ENNReal) (μ : MeasureTheory.Measure X) [MeasureTheory.SigmaFinite μ] (ωX : X × X → Z) (ν : MeasureTheory.Measure Y) (ωY : Y × Y → Z) :
      gromovWassersteinEDist p μ ωX ν ωY = gromovWassersteinEDist p ν ωY μ ωX

      Symmetry. Exchanging the two measured kernels does not change their Gromov–Wasserstein distance.

      theorem TauCeti.gromovWassersteinDistortion_eq_zero_iff {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] {p : ENNReal} [TopologicalSpace Z] {ωX : X × X → Z} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [WeakEMetricSpace Z] (hp : p ≠ 0) :
      gromovWassersteinDistortion p ωX ωY π = 0 ↔ (fun (q : (X × Y) × X × Y) => ωX (q.1.1, q.2.1)) =ᵐ[π.prod π] fun (q : (X × Y) × X × Y) => ωY (q.1.2, q.2.2)

      At a nonzero exponent, zero distortion means that the two pulled-back kernels agree almost everywhere. No integrability or finiteness hypothesis is needed.

      theorem TauCeti.aestronglyMeasurable_edist_comp_of_aemeasurable {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : AEMeasurable f γ) (hg : AEMeasurable g γ) (hfμ : MeasureTheory.Measure.map f γ = μ) (hgν : MeasureTheory.Measure.map g γ = ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      MeasureTheory.AEStronglyMeasurable (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) (γ.prod γ)

      Kernels reparametrized by two almost-everywhere measurable maps out of a common space (Ω, γ) pushing γ to μ and ν give an almost-everywhere strongly measurable discrepancy on γ ⊗ γ.

      theorem TauCeti.aestronglyMeasurable_edist_comp {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : MeasureTheory.MeasurePreserving f γ μ) (hg : MeasureTheory.MeasurePreserving g γ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      MeasureTheory.AEStronglyMeasurable (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) (γ.prod γ)

      Kernels reparametrized by two measure-preserving maps out of a common space (Ω, γ) give an almost-everywhere strongly measurable discrepancy on γ ⊗ γ.

      theorem TauCeti.IsCoupling.aestronglyMeasurable_edist {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hπ : IsCoupling π μ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      MeasureTheory.AEStronglyMeasurable (fun (q : (X × Y) × X × Y) => edist (ωX (q.1.1, q.2.1)) (ωY (q.1.2, q.2.2))) (π.prod π)

      The kernel discrepancy integrated in the distortion of a coupling is almost-everywhere strongly measurable for the square of the coupling.

      theorem TauCeti.gromovWassersteinDistortion_top_le_iff {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hπ : IsCoupling π μ ν) (c : ENNReal) :
      gromovWassersteinDistortion ⊤ ωX ωY π ≤ c ↔ ∫⁻ (q : (X × Y) × X × Y), (Set.Ioi c).indicator (fun (x : ENNReal) => 1) (edist (ωX (q.1.1, q.2.1)) (ωY (q.1.2, q.2.2))) ∂π.prod π = 0

      For a coupling, the ∞-distortion is at most c exactly when the indicator of the set where the kernel discrepancy exceeds c has zero integral against the square of the coupling.

      theorem TauCeti.gromovWassersteinDistortion_map_prodMk_of_aemeasurable {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : AEMeasurable f γ) (hg : AEMeasurable g γ) (hfμ : MeasureTheory.Measure.map f γ = μ) (hgν : MeasureTheory.Measure.map g γ = ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (p : ENNReal) :
      gromovWassersteinDistortion p ωX ωY (MeasureTheory.Measure.map (fun (w : Ω) => (f w, g w)) γ) = MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)

      Distortion of an a.e.-measurable parametrized plan. If almost-everywhere measurable maps f and g push an s-finite measure γ on Ω forward to μ and ν, the plan (f, g)_# γ couples them, and its distortion is the L^p (γ ⊗ γ) seminorm of the discrepancy of the two pulled-back kernels.

      theorem TauCeti.gromovWassersteinDistortion_map_prodMk {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : MeasureTheory.MeasurePreserving f γ μ) (hg : MeasureTheory.MeasurePreserving g γ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (p : ENNReal) :
      gromovWassersteinDistortion p ωX ωY (MeasureTheory.Measure.map (fun (w : Ω) => (f w, g w)) γ) = MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)

      Distortion of a parametrized plan. If f and g push a measure γ on Ω forward to μ and ν, the plan (f, g)_# γ couples them, and its distortion is the L^p (γ ⊗ γ) seminorm of the discrepancy of the two pulled-back kernels.

      theorem TauCeti.gromovWassersteinEDist_le_eLpNorm_of_aemeasurable {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : AEMeasurable f γ) (hg : AEMeasurable g γ) (hfμ : MeasureTheory.Measure.map f γ = μ) (hgν : MeasureTheory.Measure.map g γ = ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (p : ENNReal) :
      gromovWassersteinEDist p μ ωX ν ωY ≤ MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)

      The common-parametrization bound for almost-everywhere measurable parametrizations: if f and g push an s-finite measure γ on Ω forward to μ and ν, the Gromov–Wasserstein distance of (X, μ, ωX) and (Y, ν, ωY) is at most the L^p (γ ⊗ γ) seminorm of the discrepancy of the pulled-back kernels.

      theorem TauCeti.gromovWassersteinEDist_le_eLpNorm {X : Type u_1} {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Ω] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : Ω → X} {g : Ω → Y} (hf : MeasureTheory.MeasurePreserving f γ μ) (hg : MeasureTheory.MeasurePreserving g γ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (p : ENNReal) :
      gromovWassersteinEDist p μ ωX ν ωY ≤ MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ωX (f q.1, f q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)

      The common-parametrization bound. If f and g push a measure γ on Ω forward to μ and ν, the Gromov–Wasserstein distance of (X, μ, ωX) and (Y, ν, ωY) is at most the L^p (γ ⊗ γ) seminorm of the discrepancy of the pulled-back kernels.

      theorem TauCeti.tendsto_gromovWassersteinEDist_zero_of_tendsto_eLpNorm_of_aemeasurable {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace Y] [MeasurableSpace Ω] {p : ENNReal} [PseudoEMetricSpace Z] {ν : MeasureTheory.Measure Y} {ωY : Y × Y → Z} {ι : Type u_6} {l : Filter ι} {X' : ι → Type u_7} [(i : ι) → MeasurableSpace (X' i)] {μ' : (i : ι) → MeasureTheory.Measure (X' i)} {ω' : (i : ι) → X' i × X' i → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : (i : ι) → Ω → X' i} {g : Ω → Y} (hf : ∀ᶠ (i : ι) in l, AEMeasurable (f i) γ) (hg : AEMeasurable g γ) (hfμ : ∀ᶠ (i : ι) in l, MeasureTheory.Measure.map (f i) γ = μ' i) (hgν : MeasureTheory.Measure.map g γ = ν) (hω' : ∀ᶠ (i : ι) in l, MeasureTheory.AEStronglyMeasurable (ω' i) ((μ' i).prod (μ' i))) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hlim : Filter.Tendsto (fun (i : ι) => MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ω' i (f i q.1, f i q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)) l (nhds 0)) :
      Filter.Tendsto (fun (i : ι) => gromovWassersteinEDist p (μ' i) (ω' i) ν ωY) l (nhds 0)

      Gromov–Wasserstein convergence from a common a.e.-measurable parametrization. Along any filter l, if f i : Ω → X' i and g : Ω → Y push one s-finite measure γ forward to μ' i (eventually along l) and ν, and the L^p (γ ⊗ γ) discrepancy between the pulled-back kernels tends to zero, then gromovWassersteinEDist p (μ' i) (ω' i) ν ωY tends to zero.

      theorem TauCeti.tendsto_gromovWassersteinEDist_zero_of_tendsto_eLpNorm {Y : Type u_2} {Ω : Type u_4} {Z : Type u_5} [MeasurableSpace Y] [MeasurableSpace Ω] {p : ENNReal} [PseudoEMetricSpace Z] {ν : MeasureTheory.Measure Y} {ωY : Y × Y → Z} {ι : Type u_6} {l : Filter ι} {X' : ι → Type u_7} [(i : ι) → MeasurableSpace (X' i)] {μ' : (i : ι) → MeasureTheory.Measure (X' i)} {ω' : (i : ι) → X' i × X' i → Z} {γ : MeasureTheory.Measure Ω} [MeasureTheory.SFinite γ] {f : (i : ι) → Ω → X' i} {g : Ω → Y} (hf : ∀ᶠ (i : ι) in l, MeasureTheory.MeasurePreserving (f i) γ (μ' i)) (hg : MeasureTheory.MeasurePreserving g γ ν) (hω' : ∀ᶠ (i : ι) in l, MeasureTheory.AEStronglyMeasurable (ω' i) ((μ' i).prod (μ' i))) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hlim : Filter.Tendsto (fun (i : ι) => MeasureTheory.eLpNorm (fun (q : Ω × Ω) => edist (ω' i (f i q.1, f i q.2)) (ωY (g q.1, g q.2))) p (γ.prod γ)) l (nhds 0)) :
      Filter.Tendsto (fun (i : ι) => gromovWassersteinEDist p (μ' i) (ω' i) ν ωY) l (nhds 0)

      Gromov–Wasserstein convergence from a common parametrization. Along any filter l, if measure-preserving maps f i : Ω → X' i (eventually along l) and g : Ω → Y push one s-finite measure γ forward to μ' i and ν, and the L^p (γ ⊗ γ) discrepancy between the pulled-back kernels tends to zero, then gromovWassersteinEDist p (μ' i) (ω' i) ν ωY tends to zero.

      theorem TauCeti.gromovWassersteinEDist_rpow {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] {p : ENNReal} [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} (hp0 : p ≠ 0) (hp : p ≠ ⊤) [MeasureTheory.SigmaFinite μ] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      gromovWassersteinEDist p μ ωX ν ωY ^ p.toReal = ⨅ (π : MeasureTheory.Measure (X × Y)), ⨅ (_ : IsCoupling π μ ν), ∫⁻ (q : (X × Y) × X × Y), edist (ωX (q.1.1, q.2.1)) (ωY (q.1.2, q.2.2)) ^ p.toReal ∂π.prod π

      For 0 < p < ∞, the p-th power of the Gromov–Wasserstein distance is the infimum over couplings π of ∫∫ edist (ωX (x, x')) (ωY (y, y')) ^ p d(π ⊗ π).

      theorem TauCeti.gromovWassersteinEDist_top {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {ωY : Y × Y → Z} [MeasureTheory.SigmaFinite μ] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) :
      gromovWassersteinEDist ⊤ μ ωX ν ωY = ⨅ (π : MeasureTheory.Measure (X × Y)), ⨅ (_ : IsCoupling π μ ν), MeasureTheory.eLpNormEssSup (fun (q : (X × Y) × X × Y) => edist (ωX (q.1.1, q.2.1)) (ωY (q.1.2, q.2.2))) (π.prod π)

      At exponent ∞, the Gromov–Wasserstein distance is the infimum over couplings π of the π ⊗ π-essential supremum of the kernel discrepancy.

      @[simp]

      A measured kernel (Y, ν, ωY) and its pullback (X, μ, ωY ∘ (f × f)) along a measure-preserving map f are at Gromov–Wasserstein distance 0. In particular the Gromov–Wasserstein distance is only an extended pseudodistance on measured kernels.

      theorem TauCeti.gromovWassersteinEDist_eq_zero_of_ae_eq_comp_prodMap {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωY : Y × Y → Z} [MeasureTheory.SFinite μ] {f : X → Y} {ω : X × X → Z} (hf : MeasureTheory.MeasurePreserving f μ ν) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hω : ω =ᵐ[μ.prod μ] ωY ∘ Prod.map f f) (p : ENNReal) :
      gromovWassersteinEDist p μ ω ν ωY = 0

      A kernel agreeing almost everywhere with a pullback along a measure-preserving map is at Gromov–Wasserstein distance 0 from the original measured kernel.

      theorem TauCeti.gromovWassersteinEDist_eq_zero_of_ae_eq_comp_prodMap_fst {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωX : X × X → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hπ : IsCoupling π μ ν) (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) {ω : (X × Y) × X × Y → Z} (hω : ω =ᵐ[π.prod π] ωX ∘ Prod.map Prod.fst Prod.fst) (p : ENNReal) :
      gromovWassersteinEDist p π ω μ ωX = 0

      A kernel on a coupling that agrees almost everywhere with the pullback along the first projection is at Gromov–Wasserstein distance 0 from the first measured kernel.

      theorem TauCeti.gromovWassersteinEDist_eq_zero_of_ae_eq_comp_prodMap_snd {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ωY : Y × Y → Z} {π : MeasureTheory.Measure (X × Y)} [MeasureTheory.SFinite π] (hπ : IsCoupling π μ ν) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) {ω : (X × Y) × X × Y → Z} (hω : ω =ᵐ[π.prod π] ωY ∘ Prod.map Prod.snd Prod.snd) (p : ENNReal) :
      gromovWassersteinEDist p π ω ν ωY = 0

      A kernel on a coupling that agrees almost everywhere with the pullback along the second projection is at Gromov–Wasserstein distance 0 from the second measured kernel.

      @[simp]
      theorem TauCeti.gromovWassersteinEDist_self {X : Type u_1} {Z : Type u_5} [MeasurableSpace X] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ωX : X × X → Z} [MeasureTheory.SFinite μ] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (p : ENNReal) :
      gromovWassersteinEDist p μ ωX μ ωX = 0

      A measured kernel is at Gromov–Wasserstein distance 0 from itself.

      theorem TauCeti.gromovWassersteinEDist_triangle_of_exists_glue {X : Type u_1} {Y : Type u_2} {W : Type u_3} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace W] {p : ENNReal} [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ρ : MeasureTheory.Measure W} {ωX : X × X → Z} {ωY : Y × Y → Z} {ωW : W × W → Z} (hp : 1 ≤ p) [MeasureTheory.IsFiniteMeasure ν] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hωW : MeasureTheory.AEStronglyMeasurable ωW (ρ.prod ρ)) (hglue : ∀ (π : MeasureTheory.Measure (X × Y)) (σ : MeasureTheory.Measure (Y × W)), IsCoupling π μ ν → IsCoupling σ ν ρ → ∃ (γ : MeasureTheory.Measure (X × Y × W)), MeasureTheory.Measure.map (Prod.map id Prod.fst) γ = π ∧ γ.snd = σ) :
      gromovWassersteinEDist p μ ωX ρ ωW ≤ gromovWassersteinEDist p μ ωX ν ωY + gromovWassersteinEDist p ν ωY ρ ωW

      The triangle inequality, for carriers along which couplings glue. If every coupling of μ and ν and every coupling of ν and ρ are the two consecutive two-coordinate marginals of a single measure on X × Y × W, then for 1 ≤ p the Gromov–Wasserstein distance satisfies the triangle inequality through (Y, ν, ωY).

      theorem TauCeti.gromovWassersteinEDist_triangle {X : Type u_1} {Y : Type u_2} {W : Type u_3} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace W] {p : ENNReal} [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ν : MeasureTheory.Measure Y} {ρ : MeasureTheory.Measure W} {ωX : X × X → Z} {ωY : Y × Y → Z} {ωW : W × W → Z} [StandardBorelSpace W] (hp : 1 ≤ p) [MeasureTheory.IsFiniteMeasure ν] (hωX : MeasureTheory.AEStronglyMeasurable ωX (μ.prod μ)) (hωY : MeasureTheory.AEStronglyMeasurable ωY (ν.prod ν)) (hωW : MeasureTheory.AEStronglyMeasurable ωW (ρ.prod ρ)) :
      gromovWassersteinEDist p μ ωX ρ ωW ≤ gromovWassersteinEDist p μ ωX ν ωY + gromovWassersteinEDist p ν ωY ρ ωW

      The triangle inequality. For 1 ≤ p and a standard Borel third carrier, the Gromov–Wasserstein distance satisfies the triangle inequality: the two couplings are glued along the middle space by disintegrating the second one.

      theorem TauCeti.gromovWassersteinEDist_dirac_left {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ωX : X × X → Z} [MeasurableSingletonClass Y] (y : Y) (ωY : Y × Y → Z) [MeasureTheory.IsProbabilityMeasure μ] (p : ENNReal) :
      gromovWassersteinEDist p (MeasureTheory.Measure.dirac y) ωY μ ωX = MeasureTheory.eLpNorm (fun (q : X × X) => edist (ωY (y, y)) (ωX q)) p (μ.prod μ)

      Distance to a one-point measured kernel. A probability measure μ has exactly one coupling with the Dirac measure δ_y, so the Gromov–Wasserstein distance from ({y}, δ_y, ωY) to (X, μ, ωX) is the L^p (μ ⊗ μ) size of ωX about the point ωY (y, y).

      theorem TauCeti.gromovWassersteinEDist_dirac_right {X : Type u_1} {Y : Type u_2} {Z : Type u_5} [MeasurableSpace X] [MeasurableSpace Y] [PseudoEMetricSpace Z] {μ : MeasureTheory.Measure X} {ωX : X × X → Z} [MeasurableSingletonClass Y] (y : Y) (ωY : Y × Y → Z) [MeasureTheory.IsProbabilityMeasure μ] (p : ENNReal) :
      gromovWassersteinEDist p μ ωX (MeasureTheory.Measure.dirac y) ωY = MeasureTheory.eLpNorm (fun (q : X × X) => edist (ωX q) (ωY (y, y))) p (μ.prod μ)

      Distance to a one-point measured kernel, with the point on the right: the Gromov–Wasserstein distance from (X, μ, ωX) to ({y}, δ_y, ωY) is the L^p (μ ⊗ μ) size of ωX about the point ωY (y, y).