Supply–demand theorem (fractional Hall): a bipartite transport meeting real demands and capacities exactly
ProvedAGT.fractional_hallThe supply–demand theorem (Gale 1957; Ford–Fulkerson 1962), in its bipartite, real-valued form. Let be a finite set of buyers and a finite set of goods. Buyer has a demand and may be served only by the goods in a prescribed set ; good has a capacity . For a set of buyers write for the goods they can reach. Suppose
- total demand equals total capacity, , and
- (Hall's condition) every set of buyers can be served: for every .
Then there is a transport with
This is the fractional (or weighted) version of Hall's marriage theorem: with unit demands and capacities and an integral transport it is Hall's theorem, and for general nonnegative reals it is the feasibility criterion for a bipartite transportation problem, usually derived from the max-flow min-cut theorem. It is the combinatorial engine behind the existence of market-clearing prices in the linear 0/1 market of Algorithmic Game Theory, Section 1.8.1 (milestone AGT.market_clearing_existence): once the equilibrium prices are known, the allocation of money to goods is exactly a transport of this kind for each price level.
A note on the hypotheses. Both conditions are necessary. The empty case is allowed: if then (1) forces every capacity to vanish and the zero transport works. Demands and capacities are real numbers, not integers; no divisibility or rationality is assumed.
Formalization Note. Buyers and goods are elements of arbitrary types B, A, and the instance is specified by finsets J : Finset B, S : Finset A, the adjacency adj : B → Finset A, and real-valued m, c. The reachable goods of J' are J'.biUnion adj ∩ S. The transport is a total function x : B → A → ℝ whose support is required to lie in the admissible pairs. Only DecidableEq A is assumed, for the finset operations in the statement.
import Mathlib.Data.Real.Basic import Mathlib.Algebra.BigOperators.Group.Finset.Basic
namespace AGT
/-- **Supply–demand theorem** (bipartite, real-valued; Gale 1957, Ford–Fulkerson
1962, Ch. II §3). Buyers `j ∈ J` carry demands `m j ≥ 0` and may be served by
the goods `adj j ∩ S`; goods `a ∈ S` carry capacities `c a ≥ 0`. If the total
demand equals the total capacity and every set `J'` of buyers has demand at
most the capacity of the goods it can reach, then there is a nonnegative
transport `x j a`, supported on the admissible pairs, meeting every demand
exactly and using every capacity exactly. -/
theorem fractional_hall {A B : Type*} [DecidableEq A]
(J : Finset B) (S : Finset A) (adj : B → Finset A) (m : B → ℝ) (c : A → ℝ)
(hm : ∀ j ∈ J, 0 ≤ m j) (hc : ∀ a ∈ S, 0 ≤ c a)
(hHall : ∀ J' ⊆ J, ∑ j ∈ J', m j ≤ ∑ a ∈ J'.biUnion adj ∩ S, c a)
(htot : ∑ j ∈ J, m j = ∑ a ∈ S, c a) :
∃ x : B → A → ℝ, (∀ j a, 0 ≤ x j a) ∧
(∀ j a, x j a ≠ 0 → j ∈ J ∧ a ∈ S ∧ a ∈ adj j) ∧
(∀ j ∈ J, ∑ a ∈ S, x j a = m j) ∧
(∀ a ∈ S, ∑ j ∈ J, x j a = c a) := by
sorry
end AGT