Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Proposition 3.4, p. 407 — for P ≥ 0 the edges of G(P) correspond to the nonzero entries of P

Proved
CompOT.Vertices.prop_3_4_edges_eq_nonzero

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

bipartite-graphoptimal-transportp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-bookp2o-v1transportation-polytope

Let P∈Rn×mP \in \mathbb R^{n\times m}P∈Rn×m have nonnegative entries (for instance P∈U(a,b)P \in U(a,b)P∈U(a,b)). Then the number of edges of the support graph G(P)=(V∪V′,S(P))G(P) = (V\cup V', S(P))G(P)=(V∪V′,S(P)) equals the number of nonzero entries of PPP:

∣S(P)∣=#{(i,j):Pij≠0}.|S(P)| = \#\{(i,j) : P_{ij} \ne 0\}.∣S(P)∣=#{(i,j):Pij​=0}.

Together with the forest edge bound this converts "G(P)G(P)G(P) has no cycles" into "PPP has at most n+m−1n+m-1n+m−1 nonzero entries".

Formalization Note Edges of G(P)G(P)G(P) are undirected pairs {i,j′}\{i, j'\}{i,j′} of the simple graph on Fin n ⊕ Fin m; the nonnegativity hypothesis is what makes Pij>0P_{ij} > 0Pij​>0 and Pij≠0P_{ij} \ne 0Pij​=0 the same condition.

Preamble
import Mathlib
import Definitions.Def_CompOT_Vertices_Defs
Formal statement
namespace CompOT.Vertices

/-- End of the proof of Proposition 3.4, p. 407: for a matrix `P` with nonnegative entries
(in particular for `P ∈ U(a, b)`), the edges of the support graph `G(P)` are in bijection
with the nonzero entries of `P`, so `|S(P)|` equals the number of nonzero entries. -/
theorem prop_3_4_edges_eq_nonzero {n m : ℕ} (P : Matrix (Fin n) (Fin m) ℝ)
    (hP : ∀ i j, 0 ≤ P i j) :
    Nat.card (supportGraph P).edgeSet = (nonzeroEntries P).card := by sorry

end CompOT.Vertices
Source
Peyré & Cuturi, Computational Optimal Transport (FnT ML 2019), §3.4.1, end of the proof of Proposition 3.4, p. 407
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me