AFTD Auto-Formalizing Theoretical Domains

empirical_expected_transport_cost

def

The expected Wasserstein-1 distance f_t between the empirical distribution of t independent uniform samples from a sequence of n servers s : Fin n → X in a pseudo metric space X (each sample index chosen uniformly from Fin n) and the uniform distribution on all n servers, for t, n ≥ 1, and 0 if t = 0 or n = 0.

Statement

noncomputable def empirical_expected_transport_cost {X : Type*} [PseudoMetricSpace X]
    (n : ℕ) (s : Fin n → X) (t : ℕ) : ℝ
Defined in
arXiv:2611.04275, Section 2.2, eq. (2.4)
Verified
07 Nov 2026
Axioms
none listed
Built on 1
  • discrete_wasserstein_distThe discrete Wasserstein-1 distance between two probability distributions on a pseudo metric space X with finite index sets I and J,…

Read back from the Lean

A definition of empirical_expected_transport_cost, which takes a pseudometric space X, a natural number n, a sequence s : Fin n → X (representing an n-point sample in X), and a natural number t, and returns a real number. If t = 0 or n = 0, the value is 0. Otherwise, it is defined as: $$\frac{1}{n^t} \sum_{I : \text{Fin } t \to \text{Fin } n} \text{discrete\_wasserstein\_dist}\left(\left(\lambda \_ \mapsto \frac{1}{t}\right), s \circ I, \left(\lambda \_ \mapsto \frac{1}{n}\right), s\right)$$ which represents the average (expected value) of the discrete Wasserstein-1 distance between the uniform distribution on a sample of size $t$ drawn with replacement from $s$ (indexed by $I : \text{Fin } t \to \text{Fin } n$) and the uniform distribution on the original sample $s$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Expected Wasserstein-1 distance f_t between empirical distribution of t i.i.d. uniform server samples and the full server distribution. -/
noncomputable def empirical_expected_transport_cost {X : Type*} [PseudoMetricSpace X]
    (n : ℕ) (s : Fin n → X) (t : ℕ) : ℝ :=
  if t = 0 ∨ n = 0 then 0
  else
    ((n : ℝ) ^ t)⁻¹ *
      ∑ I : Fin t → Fin n,
        discrete_wasserstein_dist
          (fun _ : Fin t => 1 / (t : ℝ)) (s ∘ I)
          (fun _ : Fin n => 1 / (n : ℝ)) s
See it in the graphDiscuss this resultChallenge it