Finite transport plans as matrices #
On finite spaces, a probability mass function on a product is the same data as a nonnegative matrix of total mass one. Prescribing its two marginals says exactly that the row and column sums of this matrix are the prescribed probability vectors.
This file packages that correspondence. TauCeti.TransportMatrix μ ν is the type of
ℝ≥0∞-valued matrices with row sums μ and column sums ν, and
TauCeti.transportMatrixEquiv identifies it with the subtype of product PMFs whose two
pushforwards are μ and ν. The codomain ℝ≥0∞ makes nonnegativity intrinsic, rather than
a separate side condition.
The entries are also read as a real-valued function TauCeti.TransportMatrix.toRealFun on the
product, whose row and column sums are the real marginal masses, and the total
TauCeti.TransportMatrix.cost of a matrix against a real cost function is recorded here. Both
are basic transportation-matrix API rather than duality results, and the cost is allowed to be
negative because the finite transport problem is a linear program.
This is the finite transportation-matrix acceptance case of Layer 0 of the optimal-transport roadmap. It is also the representation used by later finite primal and dual problems.
A finite transportation matrix with prescribed row distribution μ and column distribution
ν. Nonnegativity is built into the ℝ≥0∞-valued matrix.
The mass assigned to each source-target pair.
Every row has the mass prescribed by the source distribution.
Every column has the mass prescribed by the target distribution.
Instances For
Coerce a transportation matrix to its entries, allowing the notation A i j.
The independent transportation matrix, whose entries are products of marginal masses.
Equations
- TauCeti.TransportMatrix.independent μ ν = { matrix := fun (i : ι) (j : κ) => μ i * ν j, row_sum := ⋯, col_sum := ⋯ }
Instances For
A transportation matrix gives a probability mass function on the product by reading its entries as point masses.
Equations
- A.toPMF = PMF.ofFintype (fun (p : ι × κ) => A.matrix p.1 p.2) ⋯
Instances For
The entries of a transportation matrix, read as a real-valued function on the product.
Instances For
Convert a nonnegative real plan with prescribed marginals to a transportation matrix.
Equations
- TauCeti.TransportMatrix.ofRealFun hf = { matrix := fun (i : ι) (j : κ) => ENNReal.ofReal (f (i, j)), row_sum := ⋯, col_sum := ⋯ }
Instances For
The total cost of a finite transportation matrix. The cost function is real-valued, so negative costs are allowed.
Equations
- TauCeti.TransportMatrix.cost c A = ∑ q : ι × κ, c q * A.toRealFun q
Instances For
The defining formula for the cost. The body of the definition is not exposed, so this is the lemma downstream modules should rewrite with.
The transportation matrix obtained by recording the point masses of a finite product PMF with prescribed marginals.
Equations
Instances For
Finite product PMFs with prescribed marginals are equivalent to nonnegative transportation matrices with the corresponding row and column sums.
Equations
- One or more equations did not get rendered due to their size.