Exercise 6.5 — Hall's criterion with prescribed left degrees
ProvedYogeshwaranDM.capacitated_hall_iffExercise 6.5 — Hall's criterion with prescribed left degrees. Let be a finite simple bipartite graph with vertex partition . For every , prescribe a demand , allowing zero. Then
Formalization note. The witness is an actual native subgraph, not a fractional allocation or an assumed matching. A vertex's degree is the cardinality of its neighbor set in that subgraph, with degree zero outside the subgraph's vertex set. All finite cardinalities and all demands are natural numbers.
import Mathlib.Combinatorics.Hall.Finite import Mathlib.Combinatorics.SimpleGraph.Hall import Mathlib.Tactic set_option autoImplicit false open scoped BigOperators
namespace YogeshwaranDM
theorem capacitated_hall_iff {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)
[G.LocallyFinite] (L R : Set V) (hG : G.IsBipartiteWith L R)
(hcover : L ∪ R = Set.univ) (d : L → ℕ) :
(∃ H : G.Subgraph, (∀ x : L, (H.neighborSet x).ncard = d x) ∧
∀ y ∈ R, (H.neighborSet y).ncard ≤ 1) ↔
∀ S : Finset L, ∑ x ∈ S, d x ≤ (S.biUnion (fun x => G.neighborFinset x)).card := 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 and decidable equality, every simple undirected loopless graph on equipped with finite enumerations of all its neighbor sets, every pair of sets , and every function , assume that and are disjoint, every edge of has one endpoint in each part, and . Then the following assertions are equivalent: there exists a subgraph of such that, for every vertex , the set of neighbors of in has cardinality exactly , and, for every vertex , the set of neighbors of in has cardinality at most one; and, for every finite set of elements of , , where is the finite union of the sets of neighbors in of the vertices of . A subgraph consists of a chosen vertex set and some edges of , with both endpoints of each chosen edge in the chosen vertex set. The neighbor sets in the first assertion are defined for every vertex of , including a vertex omitted from , which then has no neighbors in . Consequently a vertex with positive must belong to , but a vertex with zero demand and a vertex of with no chosen incident edge may be omitted or included as an isolated vertex. The assertion does not require to be spanning, does not require every vertex of to have exactly one neighbor, and does not require a unique witness. There is no positivity hypothesis on . The sum counts each element of once, the union counts each distinct neighbor once, and the assumptions place that union in . All cardinalities are ordinary finite counts: the natural-number cardinalities used for the neighbor sets cannot take their general infinite-set value of zero because is finite. The sum over the empty set and its neighbor-union cardinality are both zero. Empty and empty parts are included; if is empty, both assertions hold using the empty subgraph, and if is empty, both assertions hold exactly when every demand is zero. More generally, when is identically zero, the empty subgraph witnesses the first assertion and every inequality in the second holds. Infinite vertex types are not included.
Confirmed by the mission captain (proposal self-audit).