Theorem 6.2 — Hall's marriage theorem
ProvedYogeshwaranDM.hall_iffTheorem 6.2 — Hall's marriage theorem. Let be a finite simple bipartite graph with disjoint vertex classes satisfying . For , put . Then
Empty vertex classes and the empty subset are allowed.
Formalization note. Graphs and subgraphs are native SimpleGraph objects. The covering equation is explicit because Mathlib's bipartition predicate alone need not cover isolated ambient vertices.
import Mathlib.Combinatorics.SimpleGraph.Hall import Mathlib.Tactic import Definitions.Def_YogeshwaranDM_CompleteMatching set_option autoImplicit false
namespace YogeshwaranDM
theorem hall_iff {V : Type*} [Fintype V] (G : SimpleGraph V)
[G.LocallyFinite] (L R : Set V) (hG : G.IsBipartiteWith L R)
(hcover : L ∪ R = Set.univ) :
(∃ M : G.Subgraph, CompleteMatching M L) ↔
∀ S ⊆ L, S.ncard ≤ (⋃ v ∈ S, G.neighborSet v).ncard := by sorry
end YogeshwaranDM
Read-back
What the Lean code literally says, in plain math · Codex (exact model identifier unavailable in auditor runtime)
For every finite type equipped with a finite enumeration, every simple undirected loopless graph on equipped with finite enumerations of all its neighbor sets, and every pair of sets , assume that and are disjoint, every edge of has one endpoint in and the other in , and . Then the following two assertions are equivalent: there exists a subgraph of such that every vertex of has exactly one neighbor in and is contained in the vertex set of ; and, for every set , , where is the union of the neighbor sets of the vertices of . A subgraph chooses a vertex set and some of the edges of , with both endpoints of every chosen edge in that vertex set. The existence assertion does not require uniqueness of or require to contain every vertex of . The neighbor union counts each vertex once, even when it is adjacent to several vertices of , and the assumptions imply that this union lies in . Both displayed cardinalities are natural-number set cardinalities: they are ordinary finite counts here because is finite; the general convention that an infinite set has natural-number cardinality zero never applies under these hypotheses. The universal condition includes , when the inequality is . Empty vertex types and empty parts are allowed. If , both assertions hold, with the empty subgraph as a witness. If and is nonempty, both assertions are false, since the graph has no edges and any singleton subset of violates the inequality. No infinite vertex type is covered by this theorem.
Confirmed by the mission captain (proposal self-audit).