The DPSV primal-dual algorithm for linear Fisher markets #
This module formalizes the main primal-dual algorithm of Devanur–Papadimitriou–Saberi–Vazirani
([Vaz07], Chapter 5, Sections 5.8 and 5.10, pp. 115–121) for computing exact market
equilibria in linear Fisher markets, building on the equality-network, balanced-flow, tight-set,
and rationality infrastructure of CslibFrontier.GameTheory.Market.BalancedFlow.
Main definitions #
Cslib.GameTheory.Market.LinearFisherMarket.dpsvInitPrice: initial price construction ([Vaz07], Section 5.8, p. 115) setting baseline prices to1 / nand lowering goods with no incident equality edge tomax_i (u i g / α i).Cslib.GameTheory.Market.LinearFisherMarket.scaleActivePrices,Cslib.GameTheory.Market.LinearFisherMarket.activeGoods,Cslib.GameTheory.Market.LinearFisherMarket.event2Ratio: active-subgraph scaling, active goods, and Event 2 new-edge ratio.Cslib.GameTheory.Market.LinearFisherMarket.DPSVPhaseResult,Cslib.GameTheory.Market.LinearFisherMarket.dpsvPhaseProgram: one full DPSV phase inCslib.FreeM (MaxFlowQuery I G)executing Event-2 iterations until Event 1 terminates the phase.Cslib.GameTheory.Market.LinearFisherMarket.DPSVResult,Cslib.GameTheory.Market.LinearFisherMarket.dpsvProgram: full DPSV algorithm inCslib.FreeM (MaxFlowQuery I G)returning equilibrium allocations, equilibrium prices, and the number of phases executed.
Main results #
Cslib.GameTheory.Market.LinearFisherMarket.dpsvInitPrice_spec: initialized prices are positive, bounded above by1 / n, give every good an equality edge, and satisfySatisfiesInvariant([Vaz07], Section 5.8, p. 115).Cslib.GameTheory.Market.LinearFisherMarket.price_sub_ge_inv_sq_of_isTightSet: Lemma 5.13 ([Vaz07], Section 5.10, p. 119; note the printed typor ≤ Δwheres ≤ Δis meant): a strict price increase of a good appearing in tight sets of two phases is at least1 / Δ ^ 2.Cslib.GameTheory.Market.LinearFisherMarket.sum_sq_drop_of_transfer(Lemma 5.16, p. 120) andCslib.GameTheory.Market.LinearFisherMarket.surplusSqNorm_le_sub_sq_of_isBalancedFlow(Lemma 5.15, p. 119): any feasible flow whose surplus on buyeridiffers from a balanced flow byδexceeds the balanced squaredℓ₂surplus norm by at leastδ ^ 2.Cslib.GameTheory.Market.LinearFisherMarket.mem_activeGoods,Cslib.GameTheory.Market.LinearFisherMarket.event2Ratio_eq_none_iff,Cslib.GameTheory.Market.LinearFisherMarket.one_lt_event2Ratio, andCslib.GameTheory.Market.LinearFisherMarket.le_event2Ratio_iff: membership and bound characterizations ofactiveGoodsandevent2Ratiofor applying Lemmas 5.17, 5.18, and 5.20.Cslib.GameTheory.Market.LinearFisherMarket.isEqualityFlow_scaleActivePrices(Lemma 5.17, p. 120),Cslib.GameTheory.Market.LinearFisherMarket.surplusSqNorm_scaleActivePrices_le(Corollary 5.18, p. 120),Cslib.GameTheory.Market.LinearFisherMarket.exists_surplus_drop_of_residual_expand(Lemma 5.19, p. 120), andCslib.GameTheory.Market.LinearFisherMarket.surplusSqNorm_drop_of_minSurplus_lt(Lemma 5.20, p. 120): per-iteration flow feasibility, monotone potential decrease, and quadratic drop when the active minimum surplus decreases.Cslib.GameTheory.Market.LinearFisherMarket.dpsvPhaseProgram_spec: Lemma 5.14 (at mostn = Fintype.card Giterations and2 * n ^ 2max-flow oracle calls per phase) and Lemma 5.21 (squaredℓ₂surplus norm drops by at leastδ ^ 2 / n, hence by a factor of1 - 1 / (m * n), specializing to1 - 1 / n ^ 2whenm ≤ n; [Vaz07], pp. 119, 121).Cslib.GameTheory.Market.LinearFisherMarket.dpsvProgram_spec: Theorem 5.22 ([Vaz07], Section 5.10, p. 121): for every non-degenerate unit-supply linear Fisher market with integer utilitiesu i g ≤ Uand integer budgetse i(M_tot = ∑ i, e i,Δ = n * U ^ n),dpsvProgramevaluated with any valid max-flow oracle outputs an exact market equilibrium in at mostm * n * (Nat.log 2 (m * Δ ^ 4 * M_tot ^ 2) + 1) + nphases and at mostn + 2 * n ^ 2 * phasesmax-flow oracle calls (O(m * n ^ 3 * (log m + log n + n log U + log M_tot)), matchingO(n ^ 4 * (log n + n log U + log M))whenm ≤ n). Note that this is a max-flow oracle query bound inCslib.FreeM, matching [Vaz07], Theorem 5.22's count of max-flow computations rather than a machine-level bit-complexity runtime.
Source notes #
Four minor slips in the printed text of [Vaz07], Sections 5.8 and 5.10 are addressed explicitly in this formalization:
- Section 5.8 (p. 116) states that equilibrium is reached when the Section 5.7.1 balanced-flow
subroutine terminates in Case 1; in fact Case 1 with positive uniform shift
X > 0can occur far from equilibrium, and the actual halting condition is that all buyer surpluses vanish (∀ i, M.surplus f i = 0, matching Section 5.5, p. 110 and Section 5.6, p. 111). - Section 5.8 (p. 116) claims that for all
x > 1, buyers inB \ Himmediately lose all equality edges toJ; this fails for zero-spending buyers inB \ Hwhose equality edges all lie inJ. Running Event 1 on(J, H)still preserves the Invariant and the full potential dropδ_{k-1} ^ 2at Event 1 unconditionally, and once total surplus falls below1(hence below every integral budgete i ≥ 1), every buyer spends positively so no such buyer exists and Event 1 yields a genuine tight set inN(p'). - Section 5.10, Lemma 5.13 (p. 119) prints
q ≤ Δ and r ≤ Δfor fractionsp/qandr/s, wheres ≤ Δis meant. - Section 5.10, Lemma 5.21 and Theorem 5.22 (p. 121) write
nfor both|A|and|B|(despite Section 5.2, p. 105 writing|A| = nand|B| = n'). All bounds here trackm = Fintype.card Iandn = Fintype.card Gexplicitly.
References #
Auxiliary bang-per-buck and equilibrium helpers #
Section 5.10: Lemmas 5.13, 5.15, and 5.16 #
Lemma 5.13 ([Vaz07], Section 5.10, p. 119): in a unit-supply linear Fisher market
with integer utilities u i g ≤ U and integer budgets e i, if good g belongs to tight sets at
two positive Invariant-preserving price vectors p₁ and p₂ with p₁ g < p₂ g, then
p₂ g - p₁ g ≥ 1 / Δ ^ 2, where Δ = Fintype.card G * U ^ Fintype.card G.
Note: [Vaz07], p. 119 prints q ≤ Δ and r ≤ Δ for fractions p/q and r/s, where
s ≤ Δ is intended.
Lemma 5.16 ([Vaz07], Section 5.10, p. 120): elementary quadratic potential-drop
inequality for shifting δ ≥ ∑ j ∈ s, δ_vec j from a + δ onto b j - δ_vec j with
0 ≤ b j ≤ a and 0 ≤ δ_vec j.
Lemma 5.15 ([Vaz07], Section 5.10, p. 119): for any feasible equality flow f and
balanced flow fStar in N(p) and any buyer i, the squared ℓ₂ surplus norm drops by at least
(M.surplus f i - M.surplus fStar i) ^ 2.
Proved directly via convexity of the feasible flow polytope: first-order optimality of fStar
gives ∑ j, γ*_j * (γ_j - γ*_j) ≥ 0, hence ‖γ‖² - ‖γ*‖² ≥ ‖γ - γ*‖² ≥ (γ_i - γ*_i)².
Section 5.8: Price initialization and the Invariant #
DPSV initial price vector ([Vaz07], Section 5.8, p. 115): starting from uniform
prices p₀ g = 1 / n with bang-per-buck α i = max_g (u i g / p₀ g), sets
p g = max_i (u i g / α i). Goods that already have an incident equality edge at p₀ keep price
1 / n, while goods with no incident equality edge are lowered to max_i (u i g / α i) < 1 / n.
Initialization correctness ([Vaz07], Section 5.8, p. 115): in a non-degenerate
unit-supply market where every buyer has budget at least 1, M.dpsvInitPrice is strictly
positive, bounded above by 1 / n, keeps price 1 / n on every good already having an incident
equality edge at uniform prices 1 / n, gives every good an incident equality edge, and satisfies
M.SatisfiesInvariant.
Section 5.8 & 5.10: Active subgraph, Event 1 / Event 2, and Lemmas 5.17–5.20 #
Scale prices of goods in J by x while leaving goods outside J unchanged
([Vaz07], Section 5.8, p. 116).
Active goods J = {g | ∃ i ∈ H, M.IsEqualityEdge p i g} desired by buyers in H
([Vaz07], Section 5.8, p. 116).
Membership in M.activeGoods p H: good g is active iff some buyer i ∈ H has an equality
edge to g at prices p.
Event-2 scale ratio ([Vaz07], Section 5.8, p. 116): the smallest x > 1 at which
an active buyer i ∈ H gains a new equality edge to an inactive good g ∉ J, or none when no
buyer in H derives positive utility from any good outside J.
M.event2Ratio p H J = none iff no buyer i ∈ H derives positive utility from any good
g ∉ J.
At positive prices p, every Event-2 scale ratio r returned by
M.event2Ratio p H (M.activeGoods p H) satisfies 1 < r.
Characterization of upper bounds on M.event2Ratio p H J at positive prices p: x does not
exceed the Event-2 ratio (vacuously when M.event2Ratio p H J = none) iff for every active buyer
i ∈ H and inactive good g ∉ J with 0 < M.utility i g, there exists a good g' such that
x * M.bangPerBuck p i g ≤ M.bangPerBuck p i g'.
Lemma 5.17 ([Vaz07], Section 5.10, p. 120): if f is a feasible equality flow in
N(p) and H is closed under incoming residual paths in R(p, f) - {s, t}, then f remains a
feasible equality flow in N(scaleActivePrices p J x) for every x ≥ 1 not exceeding event2Ratio
(where J = M.activeGoods p H).
Corollary 5.18 ([Vaz07], Section 5.10, p. 120): the squared ℓ₂ surplus norm is
monotonically nonincreasing across active price-scaling iterations.
Lemma 5.19 ([Vaz07], Section 5.10, p. 120): when H' = {u | ∃ v ∈ H, M.ResidualReachable p' f' u v} expands H in the residual graph of a balanced flow f' in
N(p'), the minimum surplus over H' is achieved by some buyer i ∈ H. Consequently, if
δ' < δ where δ = min_{i ∈ H} M.surplus f i and δ' = min_{u ∈ H'} M.surplus f' u, then there
exists i ∈ H with M.surplus f i - M.surplus f' i ≥ δ - δ'.
Lemma 5.20 ([Vaz07], Section 5.10, p. 120): if the minimum active surplus strictly
drops from δ to δ' across an iteration, the squared ℓ₂ surplus norm drops by at least
(δ - δ') ^ 2.
Phase execution, Event 1 / Event 2 invariants, and Lemmas 5.14 & 5.21 #
Output of one phase of the DPSV algorithm ([Vaz07], Section 5.8, p. 116).
One full phase of the DPSV algorithm ([Vaz07], Section 5.8, p. 116): given current
prices p and balanced flow f, returns immediately when all buyer surpluses vanish, and
otherwise initializes H₀ = {i | M.surplus f i = max_j M.surplus f j} and runs dpsvPhaseLoop
for at most Fintype.card G iterations.
Lemmas 5.14 and 5.21 ([Vaz07], Section 5.10, pp. 119, 121): when N(p) satisfies
the Invariant at positive prices p and balanced flow f has at least one buyer with positive
surplus, M.dpsvPhaseProgram p f executes between 1 and n = Fintype.card G iterations using
at most 2 * n * iters ≤ 2 * n ^ 2 max-flow oracle calls, preserves positivity and the Invariant,
never decreases prices, strictly raises prices on a nonempty set res.tightSet (which is a genuine
tight set in N(res.price) whenever total surplus is strictly smaller than every buyer's budget),
and reduces M.surplusSqNorm by at least δ ^ 2 / n and by a factor of 1 - 1 / (m * n)
(specializing to 1 - 1 / n ^ 2 when m = Fintype.card I ≤ n).
Section 5.10: Full DPSV algorithm and Theorem 5.22 #
Output of the full DPSV primal-dual algorithm ([Vaz07], Sections 5.8 and 5.10).
Upper bound T_max(m, n, U, M_tot) on the number of DPSV phases for a market with m buyers,
n goods, integer utilities ≤ U, and total integer budget M_tot.
The DPSV primal-dual algorithm ([Vaz07], Sections 5.8 and 5.10, pp. 115–121) in
Cslib.FreeM (MaxFlowQuery I G): initializes prices via M.dpsvInitPrice, computes an initial
balanced flow via M.balancedFlowProgram, and executes DPSV phases until all buyer surpluses
vanish (at most dpsvPhaseBound phases using the market's own maximum utility and total budget).
Theorem 5.22 ([Vaz07], Section 5.10, p. 121): for every non-degenerate unit-supply
linear Fisher market with integer utilities u i g ≤ U and integer budgets e i
(M_tot = ∑ i, e i, m = Fintype.card I, n = Fintype.card G, Δ = n * U ^ n), the DPSV
primal-dual algorithm M.dpsvProgram evaluated with any valid max-flow oracle computes an exact
market equilibrium (res.alloc, res.price) in at most
dpsvPhaseBound m n U M_tot = m * n * (Nat.log 2 (m * Δ ^ 4 * M_tot ^ 2) + 1) + n phases and at
most n + 2 * n ^ 2 * res.phases max-flow oracle calls — yielding
O(m * n ^ 3 * (log m + log n + n log U + log M_tot)) max-flow computations (and
O(n ^ 4 * (log n + n log U + log M_tot)) when m ≤ n).
Note: this states the max-flow oracle query complexity in Cslib.FreeM, matching [Vaz07],
Theorem 5.22's count of max-flow computations rather than a machine-level bit-complexity runtime.