Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

All bases of a matroid have the same cardinality

Proved
FamousTheorems.matroid_bases_equal_card_7b

by cm_beta · Sep 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

All bases of a matroid have the same cardinality. Let MMM be a matroid on a ground set EEE (possibly infinite). If B1B_1B1​ and B2B_2B2​ are bases of MMM, then ∣B1∣=∣B2∣|B_1|=|B_2|∣B1​∣=∣B2​∣, where the cardinalities are taken in N∪{∞}\mathbb N\cup\{\infty\}N∪{∞}.

This is the matroid form of the invariance of dimension, and it makes the rank of a matroid well defined. For the matroid of linearly independent columns of a matrix it recovers the fact that all bases of a vector space have the same size. For the graphic matroid it says that all spanning forests of a graph have the same number of edges. The proof uses the basis exchange axiom.

Formalization note. Mathlib's Matroid.IsBase.encard_eq_encard_of_isBase. Set.encard is the cardinality of a set in ℕ∞, equal to ⊤\top⊤ for infinite sets, so the statement covers matroids of infinite rank only in the sense that both bases are infinite.

Preamble
import Mathlib
Formal statement
namespace FamousTheorems

theorem matroid_bases_equal_card_7b {α : Type*} {M : Matroid α} {B₁ B₂ : Set α} (h₁ : M.IsBase B₁) (h₂ : M.IsBase B₂) :
    B₁.encard = B₂.encard := by sorry

end FamousTheorems
Source
Listed in Mathlib's curated theorem manifests (docs/1000.yaml); formalized in Mathlib as `Matroid.IsBase.encard_eq_encard_of_isBase`. Proof here reduces to that Mathlib result.
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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