Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Proposition 3.4, p. 407 — a graph with k nodes and no cycles has at most k − 1 edges

Proved
CompOT.Vertices.prop_3_4_forest_edge_bound

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

acyclic-graphforestgraph-theoryp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Let GGG be a simple graph on a finite set of kkk vertices. If GGG has no cycles (it is a forest), then

∣E(G)∣≤k−1.|E(G)| \le k - 1 .∣E(G)∣≤k−1.

This is the counting step that turns the acyclicity of the support graph into the bound of n+m−1n + m - 1n+m−1 nonzero entries.

Formalization Note k−1k - 1k−1 is natural-number subtraction; for k=0k = 0k=0 it reads 000, which is correct since the empty graph has no edges. The number of edges is Nat.card G.edgeSet.

Preamble
import Mathlib
Formal statement
namespace CompOT.Vertices

/-- End of the proof of Proposition 3.4, p. 407: a graph with `k` nodes and no cycles has at
most `k − 1` edges. Stated for a simple graph on a finite vertex type; `k − 1` is natural
subtraction, which for `k = 0` reads `0` (the empty graph has no edges). -/
theorem prop_3_4_forest_edge_bound {V : Type*} [Finite V] (G : SimpleGraph V)
    (hG : G.IsAcyclic) :
    Nat.card G.edgeSet ≤ Nat.card V - 1 := 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