Algorithm Search⌘K

Algorithmadvanced

AGV mechanism

Also called d'Aspremont-Gerard-Varet mechanism, expected externality mechanism.

Picks the efficient outcome and pays each agent the expected welfare of the others given its report. With independent types it is BIC and exactly budget balanced, but not always IR.

Time
O((m + n) n k^n) worst
Space
O(n k) extra
Where
k = the number of types of each agent; m = the number of outcomes; n = the number of agents
Properties
comparison baseddeterministiciterative
Origin
Claude d'Aspremont, Louis Andre Gerard Varet, Kenneth J. Arrow, 1979

The AGV mechanism, after d'Aspremont and Gerard-Varet, picks the outcome of largest reported welfare and pays each agent the expected welfare of the other agents, where the expectation is over the others' types and the agent's own report is held fixed. The money for these payments is raised from the other agents, so the payments add up to exactly zero at every profile. With independent types, truth telling is a Bayes-Nash equilibrium, so the mechanism is Bayesian incentive compatible (BIC). It differs from the VCG mechanism in what it gives up: VCG is truthful in dominant strategies and runs a surplus or a deficit, while AGV balances the budget but is truthful only in expectation and can leave an agent with negative expected utility.

In plain words

A group must make one shared decision, such as building a road, and each member privately knows what the road is worth to them. No money may come in from outside or go out. Each member states a value, and the mechanism picks the decision that is best for the stated values. It then pays each member the average benefit that the others would get, guessed from what the member said and from what is known about the others in general. Each member pays an equal share of the amounts given to the others. A member who is paid for the others' benefit wants the group to choose well, and so tells the truth, at least when the others do. The payments cancel out, but a member with a low value can end up worse off than if it had stayed out.

The problem

There are n≥2n \ge 2 agents and a finite set OO of mm outcomes. Agent ii has a private type tit_i from a finite set TiT_i, drawn from a prior fif_i, and the types of different agents are independent. The value of agent ii of type tit_i for outcome oo is vi(ti,o)v_i(t_i, o), which may be negative. Utility is quasilinear: if the outcome is oo and agent ii pays pip_i, its utility is vi(ti,o)−piv_i(t_i, o) - p_i. A negative pip_i is a transfer to the agent.

The goal is a direct mechanism that maps reports b=(b1,…,bn)b = (b_1, \ldots, b_n) to an outcome and payments such that:

  • the outcome maximizes the reported welfare W(b,o)=∑jvj(bj,o)W(b, o) = \sum_j v_j(b_j, o) (efficiency),
  • ∑ipi(b)=0\sum_i p_i(b) = 0 at every profile bb (strong budget balance),
  • truth telling is a Bayes-Nash equilibrium (BIC).

By the Green-Laffont theorem, no mechanism has all three properties with dominant-strategy truthfulness on a rich domain of valuations, so BIC is the price paid for the balanced budget.

The algorithm

  1. AGV(T, f, O, v, b)
  2. 1h_i(t) ← 0 for each agent i and each type t in T_i
  3. 2for each type profile t in T_1 × ... × T_n:
  4. 3o ← the first outcome in O that maximizes Σ_j v_j(t_j, o)
  5. 4for each agent i:
  6. 5h_i(t_i) ← h_i(t_i) + Pr[t_-i] · Σ_{j ≠ i} v_j(t_j, o)
  7. 6o* ← the first outcome in O that maximizes Σ_j v_j(b_j, o)
  8. 7for each agent i:
  9. 8p_i ← (1 / (n - 1)) Σ_{j ≠ i} h_j(b_j) - h_i(b_i)
  10. 9return o*, p

Here Pr⁡[t−i]=∏j≠ifj(tj)\Pr[t_{-i}] = \prod_{j \ne i} f_j(t_j). Lines L1 to L5 depend only on the prior and the valuations, not on the reports, so they can run once before any agent reports. After the loop, hi(s)h_i(s) is the expected externality term

hi(s)=Et−i[∑j≠ivj(tj,x∗(s,t−i))],h_i(s) = \mathbb{E}_{t_{-i}}\Big[\sum_{j \ne i} v_j\big(t_j, x^*(s, t_{-i})\big)\Big],

the expected welfare of the others when agent ii reports ss and the others tell the truth, where x∗x^* is the rule of line L3. Line L8 gives agent ii the amount hi(bi)h_i(b_i) and charges it a 1/(n−1)1/(n-1) share of what the others get. Lines L3 and L6 must break ties in the same way, here by the order of OO; the proof below needs hh to be computed with the rule that is actually applied.

Example

Three agents decide whether to build a project that costs 60. Each pays a share of 20 if it is built, so the value of agent ii is vi(ti,build)=ti−20v_i(t_i, \text{build}) = t_i - 20 and vi(ti,no)=0v_i(t_i, \text{no}) = 0. Each type is 10 or 35 with probability 1/2, independently. The project has positive welfare exactly when at least two agents have type 35, because 35+35+10=80>6035 + 35 + 10 = 80 > 60 and 35+10+10=55<6035 + 10 + 10 = 55 < 60.

Lines L1 to L5 give the same table for every agent. For type 10, the others' welfare is positive only when both others have type 35: then it is 15+15=3015 + 15 = 30, so h(10)=30/4=15/2h(10) = 30/4 = 15/2. For type 35, the project is built when at least one other has type 35, and the others' welfare is 15−10=515 - 10 = 5, 55 or 3030, so h(35)=(0+5+5+30)/4=10h(35) = (0 + 5 + 5 + 30)/4 = 10.

reports bb outcome p1,p2,p3p_1, p_2, p_3 utilities
10, 10, 10 no 0, 0, 0 0, 0, 0
10, 10, 35 no 5/4, 5/4, -5/2 -5/4, -5/4, 5/2
10, 35, 35 build 5/2, -5/4, -5/4 -25/2, 65/4, 65/4
35, 35, 35 build 0, 0, 0 15, 15, 15

For b=(10,35,35)b = (10, 35, 35), line L8 gives agent 1 the payment 12(10+10)−15/2=5/2\frac{1}{2}(10 + 10) - 15/2 = 5/2, and agents 2 and 3 each 12(15/2+10)−10=−5/4\frac{1}{2}(15/2 + 10) - 10 = -5/4. The three payments add up to 0, as in every row. The other four profiles are permutations of these rows.

Averaged over the others' types, an agent of type 35 who tells the truth expects 25/225/2, and 5/25/2 if it reports 10. An agent of type 10 expects −15/4-15/4 from the truth and −25/4-25/4 from the report 35. So truth is the best report for both types, but the low type expects a loss. The total of the expected utilities, 3⋅12(25/2−15/4)=105/83 \cdot \frac{1}{2}(25/2 - 15/4) = 105/8, equals the expected welfare of the efficient decision, as budget balance requires. The tests check all these numbers in exact arithmetic.

Correctness

The full proof is in proofs/correctness.md. Efficiency holds because line L6 maximizes the reported welfare. Budget balance holds because in ∑i1n−1∑j≠ihj(bj)\sum_i \frac{1}{n-1}\sum_{j \ne i} h_j(b_j) each hj(bj)h_j(b_j) appears n−1n - 1 times, so the sum is ∑jhj(bj)\sum_j h_j(b_j) and cancels the second term.

For BIC, fix agent ii with true type tit_i and let the others tell the truth. Report rr gives the expected utility

Et−i[vi(ti,x∗(r,t−i))]+hi(r)−Ci=Et−i[∑jvj(tj,x∗(r,t−i))]−Ci,\mathbb{E}_{t_{-i}}\big[v_i(t_i, x^*(r, t_{-i}))\big] + h_i(r) - C_i = \mathbb{E}_{t_{-i}}\Big[\sum_j v_j\big(t_j, x^*(r, t_{-i})\big)\Big] - C_i,

where Ci=1n−1∑j≠iE[hj(tj)]C_i = \frac{1}{n-1}\sum_{j \ne i}\mathbb{E}[h_j(t_j)] does not depend on rr. Independence is used here: the distribution of t−it_{-i} is the same whatever tit_i is, so the hi(r)h_i(r) computed from the prior is the expectation that agent ii itself forms. For each t−it_{-i} the true efficient outcome x∗(ti,t−i)x^*(t_i, t_{-i}) gives the largest true welfare, so r=tir = t_i maximizes the expectation. This is the Groves idea of paying each agent the others' welfare, applied in expectation; because hih_i depends only on agent ii's own report, the payments can be recycled among the agents.

Proof: The AGV mechanism is efficient, strongly budget balanced and Bayesian incentive compatiblefull

The setting has n≥2n \ge 2 agents and a finite set OO of outcomes. Agent ii has a type tit_i in a finite set TiT_i, drawn from a prior fif_i, and the types of different agents are independent. The value of agent ii of type tit_i for outcome oo is vi(ti,o)v_i(t_i, o). The utility is quasilinear: an agent who gets outcome oo and pays pip_i has utility vi(ti,o)−piv_i(t_i, o) - p_i. For a profile tt, write W(t,o)=∑jvj(tj,o)W(t, o) = \sum_j v_j(t_j, o).

What the code computes

Let x∗(t)x^*(t) be the first outcome in the list OO that maximizes W(t,o)W(t, o). Line L3 and line L6 both use this rule. Line L5 adds, for each profile tt and each agent ii, the term Pr⁡[t−i]∑j≠ivj(tj,x∗(t))\Pr[t_{-i}] \sum_{j \ne i} v_j(t_j, x^*(t)) to hi(ti)h_i(t_i), where Pr⁡[t−i]=∏j≠ifj(tj)\Pr[t_{-i}] = \prod_{j \ne i} f_j(t_j). Each profile tt with ti=st_i = s is visited once by line L2, so after the loop

hi(s)=∑t−iPr⁡[t−i]∑j≠ivj(tj,x∗(s,t−i))=Et−i[∑j≠ivj(tj,x∗(s,t−i))].h_i(s) = \sum_{t_{-i}} \Pr[t_{-i}] \sum_{j \ne i} v_j\big(t_j, x^*(s, t_{-i})\big) = \mathbb{E}_{t_{-i}}\Big[\sum_{j \ne i} v_j\big(t_j, x^*(s, t_{-i})\big)\Big].

So hi(s)h_i(s) is the expected welfare of the other agents when agent ii reports ss and the others report their true types. Line L8 sets, for the reports bb,

pi(b)=1n−1∑j≠ihj(bj)−hi(bi).p_i(b) = \frac{1}{n - 1} \sum_{j \ne i} h_j(b_j) - h_i(b_i).

Efficiency

Line L6 returns x∗(b)x^*(b), which maximizes W(b,o)W(b, o) over OO by definition. When all agents report their true types, the outcome maximizes the true welfare. This holds at every profile, not only in expectation.

Strong budget balance

At every profile bb,

∑ipi(b)=1n−1∑i∑j≠ihj(bj)−∑ihi(bi).\sum_{i} p_i(b) = \frac{1}{n - 1} \sum_{i} \sum_{j \ne i} h_j(b_j) - \sum_i h_i(b_i).

In the double sum each index jj appears once for each i≠ji \ne j, that is n−1n - 1 times. So the first term is ∑jhj(bj)\sum_j h_j(b_j), and the total is 00. The mechanism pays out exactly what it collects, at every profile and for any reports, true or not.

Bayesian incentive compatibility

Fix an agent ii with true type tit_i, and let the others report their true types t−it_{-i}, drawn from the prior. If agent ii reports rr, its expected utility is

Ui(r∣ti)=Et−i[vi(ti,x∗(r,t−i))]+hi(r)−1n−1∑j≠iEtj[hj(tj)].U_i(r \mid t_i) = \mathbb{E}_{t_{-i}}\big[v_i(t_i, x^*(r, t_{-i}))\big] + h_i(r) - \frac{1}{n - 1} \sum_{j \ne i} \mathbb{E}_{t_j}\big[h_j(t_j)\big].

The expectation over t−it_{-i} does not depend on tit_i, because the types are independent. This is where independence is used. The last term does not depend on rr. Call it CiC_i. Put in the formula for hi(r)h_i(r):

Ui(r∣ti)=Et−i[vi(ti,x∗(r,t−i))+∑j≠ivj(tj,x∗(r,t−i))]−Ci=Et−i[W((ti,t−i),x∗(r,t−i))]−Ci.U_i(r \mid t_i) = \mathbb{E}_{t_{-i}}\Big[v_i(t_i, x^*(r, t_{-i})) + \sum_{j \ne i} v_j(t_j, x^*(r, t_{-i}))\Big] - C_i = \mathbb{E}_{t_{-i}}\big[W((t_i, t_{-i}), x^*(r, t_{-i}))\big] - C_i.

For each fixed t−it_{-i}, the outcome x∗(ti,t−i)x^*(t_i, t_{-i}) maximizes W((ti,t−i),⋅)W((t_i, t_{-i}), \cdot) over all of OO, and x∗(r,t−i)x^*(r, t_{-i}) is one element of OO. So the term inside the expectation is at least as large for r=tir = t_i as for any other rr, pointwise in t−it_{-i}. Taking expectations, Ui(ti∣ti)≥Ui(r∣ti)U_i(t_i \mid t_i) \ge U_i(r \mid t_i) for every rr. Truth telling is a Bayes-Nash equilibrium, which is the definition of BIC.

The argument uses that hih_i was computed with the same outcome rule x∗x^*, tie rule included, that the mechanism applies. If line L3 and line L6 broke ties in different ways, the identity above would fail at the tie profiles.

What is not claimed

The proof gives a Bayes-Nash equilibrium, not a dominant strategy. If the others lie, hj(bj)h_j(b_j) is not the expectation that the formula needs, and a lie of agent ii can pay. The node page shows a profile of the public project example where a lie gains 5/25/2 ex post. The mechanism is also not individually rational in general. In the same example the low type has interim utility −15/4-15/4 under truth telling. Adding constants KiK_i to the payments keeps BIC, and keeps budget balance only if ∑iKi=0\sum_i K_i = 0, so constants cannot always repair interim IR; the Myerson-Satterthwaite theorem shows that in bilateral trade no BIC, budget balanced and efficient mechanism is interim IR.

Cost

Line L2 visits ∏i∣Ti∣\prod_i |T_i| profiles, which is knk^n when each agent has kk types. For each profile line L3 scans m=∣O∣m = |O| outcomes at O(n)O(n) each, and lines L4 and L5 take O(n)O(n) more work if the probability Pr⁡[t−i]\Pr[t_{-i}] is obtained as Pr⁡[t]/fi(ti)\Pr[t] / f_i(t_i) (for positive fif_i) or as a product of prefix and suffix products. The table hh costs O(nmkn)O(n m k^n) time and O(nk)O(n k) space. After that, one run of lines L6 to L9 costs O(nm+n)O(n m + n).

Complexity

The table hh needs one pass over the knk^n type profiles when each agent has kk types. Each profile costs O(nm)O(n m) for line L3 and O(n)O(n) per agent for lines L4 and L5 when Pr⁡[t−i]\Pr[t_{-i}] is a plain product, which is what the code does; the total is O((m+n)nkn)O((m + n) n k^n) time and O(nk)O(n k) extra space for the table. Prefix and suffix products of the probabilities bring lines L4 and L5 to O(n)O(n) per profile. After the table is built, each run of lines L6 to L9 costs O(nm)O(n m). The exponential term is the size of the type space, which the input in this form already lists through the prior; for a continuous prior, hih_i is an integral that must be computed or approximated for the given model. All arithmetic is exact in rationals.

Properties

  • Efficient at every profile of reports.
  • Strongly budget balanced at every profile: no money comes in or goes out, even when agents lie.
  • BIC with independent types. Truth is a Bayes-Nash equilibrium. It is not a dominant strategy: at (10,35,35)(10, 35, 35) in the example, agent 1 of type 10 gets −25/2-25/2 from the truth and −10-10 from the report 35, so the lie gains 5/25/2 ex post.
  • Not individually rational in general. In the example the type 10 agent expects −15/4-15/4, so interim IR fails, and ex post it can lose 25/225/2. Shifting the payments by constants KiK_i keeps BIC and keeps budget balance only when ∑iKi=0\sum_i K_i = 0. Here each agent would need Ki≤−15/4K_i \le -15/4 (a transfer of at least 15/415/4 to it), which does not sum to zero, so no shift of AGV is interim IR on this instance.
  • Payments depend only on single reports. pip_i is a sum of functions of one report each, which is why the budget can balance.

Variants and improvements

  • Arrow's version. Arrow found the same transfers independently in 1979 for public decisions; textbooks call both the expected externality mechanism.
  • Two agents. With n=2n = 2, line L8 reads p1=h2(b2)−h1(b1)p_1 = h_2(b_2) - h_1(b_1): each agent pays the other's expected externality term and receives its own.
  • Unequal sharing. Any rule that collects the amounts hj(bj)h_j(b_j) from agents other than jj in fixed shares works. The 1/(n−1)1/(n-1) split is the symmetric choice.
  • Participation. To get interim IR as well, one can shift the payments by constants when the expected welfare is large enough, or accept a subsidy. In bilateral trade no efficient BIC mechanism is both budget balanced and interim IR, so some loss is unavoidable there; automated mechanism design can find the best compromise for a given prior by linear programming.
  • Correlated types. If the types are correlated, hih_i computed from the prior is not the agent's own conditional expectation and BIC can fail. Correlation also helps, though: side bets on the others' reports, as in the Cremer-McLean theorem, can give efficiency and balance with weaker trade-offs.

When to use it

Use AGV when the decision must be efficient, no outside money is available, the prior is common knowledge and independent, and agents cannot opt out after they learn their types (or the expected gains are large enough that no type wants to). Examples are internal allocation within a firm and committee decisions with compulsory participation. If agents can walk away, check interim IR first. If the prior is not trusted, use a dominant-strategy mechanism such as VCG and accept the budget imbalance.

Pitfalls

  • Treating BIC as DSIC. The equilibrium depends on everyone else reporting truthfully and on the prior being right. With a wrong prior the payments hih_i are computed for the wrong distribution and truth need not be optimal.
  • Ignoring participation. A low type expects a loss, as the example shows. In bilateral trade with seller cost in {0,2}\{0, 2\} and buyer value in {1,3}\{1, 3\}, each with probability 1/2, AGV gives the buyer of value 1 an expected utility of −5/4-5/4.
  • Different tie rules. If the table hh uses one tie rule and the outcome another, BIC can fail at tie profiles. Use one rule in both lines L3 and L6.
  • Correlated priors. The proof needs independence; with correlation, recompute the incentives before you use the mechanism.
  • One agent. The formula divides by n−1n - 1. With one agent there is no one to balance against, and the code raises an error.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

agv_mechanism.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/agv-mechanism/. The authors are listed in prov/KNJ3AG.jsonl.

"""The AGV (d'Aspremont-Gerard-Varet) expected externality mechanism.

An instance has n >= 2 agents. Agent i has a finite list of types types[i] and an
independent prior probs[i], a dict from type to Fraction. There is a finite list of
outcomes. value[i][t][o] is the value of agent i of type t for outcome o. The
payment p_i is paid by agent i; a negative payment is a transfer to the agent.
"""

from fractions import Fraction
from itertools import product


def efficient_outcome(outcomes, value, profile):
    """Return the first outcome, in list order, that maximizes the reported welfare."""
    best, best_w = None, None
    for o in outcomes:
        w = sum(Fraction(value[i][t][o]) for i, t in enumerate(profile))
        if best_w is None or w > best_w:
            best, best_w = o, w
    return best


def expected_externalities(types, probs, outcomes, value):
    """Return h, with h[i][t] the expected welfare of the others when agent i reports t.

    The others report their true types, drawn from the prior, and the outcome is the
    efficient one. One pass over all type profiles fills every h[i][t].
    """
    n = len(types)
    h = [{t: Fraction(0) for t in types[i]} for i in range(n)]  # @line L1
    for t in product(*types):  # @line L2
        o = efficient_outcome(outcomes, value, t)  # @line L3
        vals = [Fraction(value[j][t[j]][o]) for j in range(n)]
        total = sum(vals)
        for i in range(n):  # @line L4
            pr = Fraction(1)
            for j in range(n):
                if j != i:
                    pr *= Fraction(probs[j][t[j]])
            h[i][t[i]] += pr * (total - vals[i])  # @line L5
    return h


def agv_payments(h, bids):
    """Return the AGV payments for the reported profile, given the table h."""
    n = len(bids)
    if n < 2:
        raise ValueError("the AGV mechanism needs at least two agents")
    payments = []
    for i in range(n):  # @line L7
        others = sum(h[j][bids[j]] for j in range(n) if j != i)
        payments.append(others / (n - 1) - h[i][bids[i]])  # @line L8
    return payments


def agv(types, probs, outcomes, value, bids):
    """Run the AGV mechanism on the reports bids. Return (outcome, payments)."""
    h = expected_externalities(types, probs, outcomes, value)
    o = efficient_outcome(outcomes, value, bids)  # @line L6
    return o, agv_payments(h, bids)  # @line L9


def interim_utility(types, probs, outcomes, value, i, true_type, report):
    """Expected utility of agent i of type true_type who reports report, when the
    others report their true types drawn from the prior. Exact, in Fraction."""
    n = len(types)
    h = expected_externalities(types, probs, outcomes, value)
    total = Fraction(0)
    others = [types[j] for j in range(n) if j != i]
    for rest in product(*others):
        prof = list(rest[:i]) + [report] + list(rest[i:])
        pr = Fraction(1)
        for j in range(n):
            if j != i:
                pr *= Fraction(probs[j][prof[j]])
        o = efficient_outcome(outcomes, value, prof)
        pay = agv_payments(h, prof)[i]
        total += pr * (Fraction(value[i][true_type][o]) - pay)
    return total
test_agv_mechanism.py 166 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/agv-mechanism/. The authors are listed in prov/KNJ3AG.jsonl.

import random
from fractions import Fraction
from itertools import product

from agv_mechanism import (
    agv,
    agv_payments,
    efficient_outcome,
    expected_externalities,
    interim_utility,
)


def random_instance(rng, n, k, m):
    types = [list(range(k)) for _ in range(n)]
    probs = []
    for _ in range(n):
        w = [rng.randint(1, 5) for _ in range(k)]
        s = sum(w)
        probs.append({t: Fraction(w[t], s) for t in range(k)})
    outcomes = list(range(m))
    value = [
        {t: {o: rng.randint(-5, 10) for o in outcomes} for t in range(k)}
        for _ in range(n)
    ]
    return types, probs, outcomes, value


def instances():
    rng = random.Random(20251120)
    out = []
    for n in (2, 3):
        for k in (1, 2, 3):
            for m in (1, 2, 3, 4):
                for _ in range(3):
                    out.append(random_instance(rng, n, k, m))
    return out


def welfare(value, profile, o):
    return sum(Fraction(value[i][t][o]) for i, t in enumerate(profile))


def h_direct(types, probs, outcomes, value):
    # A second formula for h: for each agent and type, loop over the others only.
    n = len(types)
    h = []
    for i in range(n):
        hi = {}
        for t in types[i]:
            acc = Fraction(0)
            others = [types[j] for j in range(n) if j != i]
            for rest in product(*others):
                prof = list(rest[:i]) + [t] + list(rest[i:])
                pr = Fraction(1)
                for j in range(n):
                    if j != i:
                        pr *= probs[j][prof[j]]
                o = efficient_outcome(outcomes, value, prof)
                acc += pr * sum(Fraction(value[j][prof[j]][o]) for j in range(n) if j != i)
            hi[t] = acc
        h.append(hi)
    return h


def public_project():
    types = [[10, 35]] * 3
    probs = [{10: Fraction(1, 2), 35: Fraction(1, 2)}] * 3
    outcomes = ["no", "build"]
    value = [{t: {"no": 0, "build": t - 20} for t in (10, 35)} for _ in range(3)]
    return types, probs, outcomes, value


def test_efficient_against_brute_force():
    for types, probs, outcomes, value in instances():
        for prof in product(*types):
            o, _ = agv(types, probs, outcomes, value, prof)
            best = max(welfare(value, prof, q) for q in outcomes)
            assert welfare(value, prof, o) == best


def test_h_matches_second_formula():
    for types, probs, outcomes, value in instances():
        assert expected_externalities(types, probs, outcomes, value) == h_direct(
            types, probs, outcomes, value
        )


def test_strong_budget_balance_on_every_profile():
    for types, probs, outcomes, value in instances():
        for prof in product(*types):
            _, pay = agv(types, probs, outcomes, value, prof)
            assert sum(pay) == 0


def test_bayesian_incentive_compatible():
    for types, probs, outcomes, value in instances():
        for i in range(len(types)):
            for t in types[i]:
                truth = interim_utility(types, probs, outcomes, value, i, t, t)
                for r in types[i]:
                    assert truth >= interim_utility(types, probs, outcomes, value, i, t, r)


def test_public_project_numbers():
    types, probs, outcomes, value = public_project()
    h = expected_externalities(types, probs, outcomes, value)
    assert h == [{10: Fraction(15, 2), 35: Fraction(10)}] * 3
    o, pay = agv(types, probs, outcomes, value, (10, 35, 35))
    assert o == "build"
    assert pay == [Fraction(5, 2), Fraction(-5, 4), Fraction(-5, 4)]
    assert interim_utility(types, probs, outcomes, value, 0, 10, 10) == Fraction(-15, 4)
    assert interim_utility(types, probs, outcomes, value, 0, 35, 35) == Fraction(25, 2)


def test_not_interim_individually_rational():
    # The low type of the public project expects a loss, so interim IR fails.
    types, probs, outcomes, value = public_project()
    assert interim_utility(types, probs, outcomes, value, 0, 10, 10) < 0
    # Bilateral trade: seller cost in {0, 2}, buyer value in {1, 3}.
    types = [[0, 2], [1, 3]]
    probs = [{0: Fraction(1, 2), 2: Fraction(1, 2)}, {1: Fraction(1, 2), 3: Fraction(1, 2)}]
    outcomes = ["no", "trade"]
    value = [{c: {"no": 0, "trade": -c} for c in (0, 2)}, {v: {"no": 0, "trade": v} for v in (1, 3)}]
    assert interim_utility(types, probs, outcomes, value, 1, 1, 1) == Fraction(-5, 4)


def test_not_dominant_strategy_incentive_compatible():
    types, probs, outcomes, value = public_project()
    h = expected_externalities(types, probs, outcomes, value)

    def ex_post(true_t, prof):
        o = efficient_outcome(outcomes, value, prof)
        return value[0][true_t][o] - agv_payments(h, prof)[0]

    assert ex_post(10, (10, 35, 35)) == Fraction(-25, 2)
    assert ex_post(10, (35, 35, 35)) == Fraction(-10)
    assert ex_post(10, (35, 35, 35)) > ex_post(10, (10, 35, 35))


def test_expected_welfare_is_shared_exactly():
    # Budget balance means the interim utilities add up to the expected welfare.
    for types, probs, outcomes, value in instances():
        n = len(types)
        exp_w = Fraction(0)
        for prof in product(*types):
            pr = Fraction(1)
            for j in range(n):
                pr *= probs[j][prof[j]]
            exp_w += pr * welfare(value, prof, efficient_outcome(outcomes, value, prof))
        total = Fraction(0)
        for i in range(n):
            for t in types[i]:
                total += probs[i][t] * interim_utility(types, probs, outcomes, value, i, t, t)
        assert total == exp_w


def test_needs_two_agents():
    try:
        agv_payments([{0: Fraction(0)}], (0,))
    except ValueError:
        return
    raise AssertionError("expected ValueError")

History

d'Aspremont and Gerard-Varet (1979) and Arrow (1979) found, independently, that the incentive problem of public decisions becomes easier when one asks only for truth telling in Bayes-Nash equilibrium. Groves and Clarke had shown earlier in the decade that dominant-strategy truthful efficient mechanisms exist, and Green and Laffont showed that such mechanisms cannot balance the budget. The expected externality payments get around this by paying each agent a function of its own report only. Myerson and Satterthwaite (1983) then showed that the remaining weakness, the lack of individual rationality, cannot be removed in bilateral trade.

References

  1. Claude d'Aspremont and Louis-Andre Gerard-Varet, Incentives and incomplete information, Journal of Public Economics 11(1) (1979), 25-45, the expected externality transfers for public decisions, with independent beliefs, and the proof that they balance the budget and make truth a Bayes-Nash equilibrium
  2. Kenneth J. Arrow, The property rights doctrine and demand revelation under incomplete information, in Michael J. Boskin (ed.), Economics and Human Welfare, Academic Press (1979), 23-39, the same balanced mechanism, found independently
  3. Andreu Mas-Colell, Michael D. Whinston and Jerry R. Green, Microeconomic Theory, Oxford University Press, 1995, Chapter 23, Section 23.D (Bayesian implementation and the expected externality mechanism) and Section 23.E (participation constraints)
  4. Vijay Krishna, Auction Theory, 2nd edition, Academic Press, 2010, Chapter 5 (mechanism design, efficient mechanisms and budget balance)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example