# Mechanism design

Mechanism design (sometimes implementation theory or institution design) is a branch of economics and game theory. It studies how to construct rules—called mechanisms or institutions—that produce good outcomes according to some predefined metric, even when the designer does not know the players' true preferences or what information they have. Mechanism design thus focuses on the study of solution concepts for a class of private-information games.
Mechanism design has broad applications, including traditional domains of economics such as market design, but also political science (through voting theory). It is a foundational component in the operation of the internet, being used in networked systems (such as inter-domain routing), e-commerce, and advertisement auctions by Facebook and Google.
Because it starts with the end of the game (a particular result), then works backwards to find a game that implements it, it is sometimes described as reverse game theory. Leonid Hurwicz explains that "in a design problem, the goal function is the main given, while the mechanism is the unknown. Therefore, the design problem is the inverse of traditional economic theory, which is typically devoted to the analysis of the performance of a given mechanism."
The 2007 Nobel Memorial Prize in Economic Sciences was awarded to Leonid Hurwicz, Eric Maskin, and Roger Myerson "for having laid the foundations of mechanism design theory." The related works of William Vickrey that established the field earned him the 1996 Nobel prize.

## Description

One person, called the "principal", would like to condition his behavior on information privately known to the players of a game. For example, the principal would like to know the true quality of a used car a salesman is pitching. He cannot learn anything simply by asking the salesman, because it is in the salesman's interest to distort the truth. However, in mechanism design, the principal does have one advantage: He may design a game whose rules influence others to act the way he would like.
Without mechanism design theory, the principal's problem would be difficult to solve. He would have to consider all the possible games and choose the one that best influences other players' tactics. In addition, the principal would have to draw conclusions from agents who may lie to him. Thanks to the revelation principle, the principal only needs to consider games in which agents truthfully report their private information.

## Foundations
### Mechanism

A game of mechanism design is a game of private information in which one of the agents, called the principal, chooses the payoff structure. Following Harsanyi (1967), the agents receive secret "messages" from nature containing information relevant to payoffs. For example, a message may contain information about their preferences or the quality of a good for sale. We call this information the agent's "type" (usually noted $\theta$ and accordingly the space of types $\Theta$). Agents then report a type to the principal (usually noted with a hat ${\hat {\theta }}$) that can be a strategic lie. After the report, the principal and the agents are paid according to the payoff structure the principal chose.
The timing of the game is:
* The principal commits to a mechanism $y$ that grants an outcome $y$ as a function of reported type
* The agents report, possibly dishonestly, a type profile ${\hat {\theta }}$
* The mechanism is executed (agents receive outcome $y({\hat {\theta }})$)
In order to understand who gets what, it is common to divide the outcome $y$ into a goods allocation and a money transfer, $y(\theta )=\{x(\theta ),t(\theta )\},\ x\in X,t\in T$ where $x$ stands for an allocation of goods rendered or received as a function of type, and $t$ stands for a monetary transfer as a function of type.
As a benchmark the designer often defines what should happen under full information. Define a social choice function $f(\theta )$ mapping the (true) type profile directly to the allocation of goods received or rendered,
    $f(\theta ):\Theta \rightarrow Y$
In contrast a mechanism maps the reported type profile to an outcome (again, both a goods allocation $x$ and a money transfer $t$)
    $y({\hat {\theta }}):\Theta \rightarrow Y$

### Revelation principle

A proposed mechanism constitutes a Bayesian game (a game of private information), and if it is well-behaved the game has a Bayesian Nash equilibrium. At equilibrium agents choose their reports strategically as a function of type
    ${\hat {\theta }}(\theta )$
It is difficult to solve for Bayesian equilibria in such a setting because it involves solving for agents' best-response strategies and for the best inference from a possible strategic lie. Thanks to a sweeping result called the revelation principle, no matter the mechanism a designer can confine attention to equilibria in which agents truthfully report type. The revelation principle states: "To every Bayesian Nash equilibrium there corresponds a Bayesian game with the same equilibrium outcome but in which players truthfully report type."
This is extremely useful. The principle allows one to solve for a Bayesian equilibrium by assuming all players truthfully report type (subject to an incentive compatibility constraint). In one blow it eliminates the need to consider either strategic behavior or lying.
Its proof is quite direct. Assume a Bayesian game in which the agent's strategy and payoff are functions of its type and what others do, $u_{i}\left(s_{i}(\theta _{i}),s_{-i}(\theta _{-i}),\theta _{i}\right)$. By definition agent i's equilibrium strategy $s(\theta _{i})$ is Nash in expected utility:
    $s_{i}(\theta _{i})\in \arg \max _{s'_{i}\in S_{i}}\sum _{\theta _{-i}}\ p(\theta _{-i}\mid \theta _{i})\ u_{i}\left(s'_{i},s_{-i}(\theta _{-i}),\theta _{i}\right)$
Simply define a mechanism that would induce agents to choose the same equilibrium. The easiest one to define is for the mechanism to commit to playing the agents' equilibrium strategies for them.
    $y({\hat {\theta }}):\Theta \rightarrow S(\Theta )\rightarrow Y$
Under such a mechanism the agents of course find it optimal to reveal type since the mechanism plays the strategies they found optimal anyway. Formally, choose $y(\theta )$ such that
    ${\begin{aligned}\theta _{i}\in&\arg \max _{\theta '_{i}\in \Theta }\sum _{\theta _{-i}}\ p(\theta _{-i}\mid \theta _{i})\ u_{i}\left(y(\theta '_{i},\theta _{-i}),\theta _{i}\right)\\[5pt]&=\sum _{\theta _{-i}}\ p(\theta _{-i}\mid \theta _{i})\ u_{i}\left(s_{i}(\theta ),s_{-i}(\theta _{-i}),\theta _{i}\right)\end{aligned}}$

### Implementability

The designer of a mechanism generally hopes either
* to design a mechanism $y$ that "implements" a social choice function
* to find the mechanism $y$ that maximizes some value criterion (e.g. profit)
To implement a social choice function $f(\theta )$ is to find some transfer function $t(\theta )$ that motivates agents to pick $f(\theta )$. Formally, if the equilibrium strategy profile under the mechanism maps to the same goods allocation as a social choice function,
    $f(\theta )=x\left({\hat {\theta }}(\theta )\right)$
we say the mechanism implements the social choice function.
Thanks to the revelation principle, the designer can usually find a transfer function $t(\theta )$ to implement a social choice by solving an associated truthtelling game. If agents find it optimal to truthfully report type,
    ${\hat {\theta }}(\theta )=\theta$
we say such a mechanism is truthfully implementable. The task is then to solve for a truthfully implementable $t(\theta )$ and impute this transfer function to the original game. An allocation $x(\theta )$ is truthfully implementable if there exists a transfer function $t(\theta )$ such that
    $u(x(\theta ),t(\theta ),\theta )\geq u(x({\hat {\theta }}),t({\hat {\theta }}),\theta )\ \forall \theta ,{\hat {\theta }}\in \Theta$
which is also called the incentive compatibility (IC) constraint.
In applications, the IC condition is the key to describing the shape of $t(\theta )$ in any useful way. Under certain conditions it can even isolate the transfer function analytically. Additionally, a participation (individual rationality) constraint is sometimes added if agents have the option of not playing.

#### Necessity

Consider a setting in which all agents have a type-contingent utility function $u(x,t,\theta )$. Consider also a goods allocation $x(\theta )$ that is vector-valued and size $k$ (which permits $k$ number of goods) and assume it is piecewise continuous with respect to its arguments.
The function $x(\theta )$ is implementable only if
    $\sum _{k=1}^{n}{\frac {\partial }{\partial \theta }}\left({\frac {\partial u/\partial x_{k}}{\left|\partial u/\partial t\right|}}\right){\frac {\partial x}{\partial \theta }}\geq 0$
whenever $x=x(\theta )$ and $t=t(\theta )$ and x is continuous at $\theta$. This is a necessary condition and is derived from the first- and second-order conditions of the agent's optimization problem assuming truth-telling.
Its meaning can be understood in two pieces. The first piece says the agent's marginal rate of substitution (MRS) increases as a function of the type,
    ${\frac {\partial }{\partial \theta }}\left({\frac {\partial u/\partial x_{k}}{\left|\partial u/\partial t\right|}}\right)={\frac {\partial }{\partial \theta }}\mathrm {MRS} _{x,t}$
In short, agents will not tell the truth if the mechanism does not offer higher agent types a better deal. Otherwise, higher types facing any mechanism that punishes high types for reporting will lie and declare they are lower types, violating the truthtelling incentive-compatibility constraint. The second piece is a monotonicity condition waiting to happen,
    ${\frac {\partial x}{\partial \theta }}$
which, to be positive, means higher types must be given more of the good.
There is potential for the two pieces to interact. If for some type range the contract offered less quantity to higher types $\partial x/\partial \theta <0$, it is possible the mechanism could compensate by giving higher types a discount. But such a contract already exists for low-type agents, so this solution is pathological. Such a solution sometimes occurs in the process of solving for a mechanism. In these cases it must be "ironed". In a multiple-good environment it is also possible for the designer to reward the agent with more of one good to substitute for less of another (e.g. butter for margarine). Multiple-good mechanisms are an area of continuing research in mechanism design.

#### Sufficiency

Mechanism design papers usually make two assumptions to ensure implementability:
${\frac {\partial }{\partial \theta }}{\frac {\partial u/\partial x_{k}}{\left|\partial u/\partial t\right|}}>0\ \forall k$
This is known by several names: the single-crossing condition, the sorting condition and the Spence–Mirrlees condition. It means the utility function is of such a shape that the agent's MRS is increasing in type.
$\exists K_{0},K_{1}{\text{ such that }}\left|{\frac {\partial u/\partial x_{k}}{\partial u/\partial t}}\right|\leq K_{0}+K_{1}|t|$
This is a technical condition bounding the rate of growth of the MRS.
These assumptions are sufficient to provide that any monotonic $x(\theta )$ is implementable (a $t(\theta )$ exists that can implement it). In addition, in the single-good setting the single-crossing condition is sufficient to provide that only a monotonic $x(\theta )$ is implementable, so the designer can confine his search to a monotonic $x(\theta )$.

## Highlighted results
### Revenue equivalence theorem

Vickrey (1961) gives a celebrated result that any member of a large class of auctions assures the seller of the same expected revenue and that the expected revenue is the best the seller can do. This is the case if
* The buyers have identical valuation functions (which may be a function of type)
* The buyers' types are independently distributed
* The buyers types are drawn from a continuous distribution
* The type distribution bears the monotone hazard rate property
* The mechanism sells the good to the buyer with the highest valuation
The last condition is crucial to the theorem. An implication is that for the seller to achieve higher revenue he must take a chance on giving the item to an agent with a lower valuation. Usually this means he must risk not selling the item at all.

### Vickrey–Clarke–Groves mechanisms

The Vickrey (1961) auction model was later expanded by Clarke (1971) and Groves to treat a public choice problem in which a public project's cost is borne by all agents, e.g. whether to build a municipal bridge. The resulting "Vickrey–Clarke–Groves" mechanism can motivate agents to choose the socially efficient allocation of the public good even if agents have privately known valuations. In other words, it can solve the "tragedy of the commons"—under certain conditions, in particular quasilinear utility or if budget balance is not required.
Consider a setting in which $I$ number of agents have quasilinear utility with private valuations $v(x,t,\theta )$ where the currency $t$ is valued linearly. The VCG designer designs an incentive compatible (hence truthfully implementable) mechanism to obtain the true type profile, from which the designer implements the socially optimal allocation
    $x_{I}^{*}(\theta )\in {\underset {x\in X}{\operatorname {argmax} }}\sum _{i\in I}v(x,\theta _{i})$
The cleverness of the VCG mechanism is the way it motivates truthful revelation. It eliminates incentives to misreport by penalizing any agent by the cost of the distortion he causes. Among the reports the agent may make, the VCG mechanism permits a "null" report saying he is indifferent to the public good and cares only about the money transfer. This effectively removes the agent from the game. If an agent does choose to report a type, the VCG mechanism charges the agent a fee if his report is pivotal, that is if his report changes the optimal allocation x so as to harm other agents. The payment is calculated
    $t_{i}({\hat {\theta }})=\sum _{j\in I-i}v_{j}(x_{I-i}^{*}(\theta _{I-i}),\theta _{j})-\sum _{j\in I-i}v_{j}(x_{I}^{*}({\hat {\theta }}_{i},\theta _{I}),\theta _{j})$
which sums the distortion in the utilities of the other agents (and not his own) caused by one agent reporting.

### Gibbard–Satterthwaite theorem

Gibbard (1973) and Satterthwaite (1975) give an impossibility result similar in spirit to Arrow's impossibility theorem. For a very general class of games, only "dictatorial" social choice functions can be implemented.
A social choice function $f(\cdot )$ is dictatorial if one agent always receives his most-favored goods allocation,
    ${\text{for }}f(\Theta ){\text{, }}\exists i\in I{\text{ such that }}u_{i}(x,\theta _{i})\geq u_{i}(x',\theta _{i})\ \forall x'\in X$
The theorem states that under general conditions any truthfully implementable social choice function must be dictatorial if,
* X is finite and contains at least three elements
* Preferences are rational
* $f(\Theta )=X$

### Myerson–Satterthwaite theorem

Myerson and Satterthwaite (1983) show there is no efficient way for two parties to trade a good when they each have secret and probabilistically varying valuations for it, without the risk of forcing one party to trade at a loss. It is among the most remarkable negative results in economics—a kind of negative mirror to the fundamental theorems of welfare economics.

### Shapley value

Phillips and Marden (2018) proved that for cost-sharing games with concave cost functions, the optimal cost-sharing rule that firstly optimizes the worst-case inefficiencies in a game (the price of anarchy), and then secondly optimizes the best-case outcomes (the price of stability), is precisely the Shapley value cost-sharing rule. A symmetrical statement is similarly valid for utility-sharing games with convex utility functions.

### Price discrimination

Mirrlees (1971) introduces a setting in which the transfer function t is easy to solve for. Due to its relevance and tractability it is a common setting in the literature. Consider a single-good, single-agent setting in which the agent has quasilinear utility with an unknown type parameter $\theta$
    $u(x,t,\theta )=V(x,\theta )-t$
and in which the principal has a prior CDF over the agent's type $P(\theta )$. The principal can produce goods at a convex marginal cost c(x) and wants to maximize the expected profit from the transaction
    $\max _{x(\theta ),t(\theta )}\mathbb {E} _{\theta }\left[t(\theta )-c\left(x(\theta )\right)\right]$
subject to IC and IR conditions
    $u(x(\theta ),t(\theta ),\theta )\geq u(x(\theta '),t(\theta '),\theta )\ \forall \theta ,\theta '$
    $u(x(\theta ),t(\theta ),\theta )\geq {\underline {u}}(\theta )\ \forall \theta$
The principal here is a monopolist trying to set a profit-maximizing price scheme in which it cannot identify the type of the customer. A common example is an airline setting fares for business, leisure and student travelers. Due to the IR condition it has to give every type a good enough deal to induce participation. Due to the IC condition it has to give every type a good enough deal that the type prefers its deal to that of any other.
A trick given by Mirrlees (1971) is to use the envelope theorem to eliminate the transfer function from the expectation to be maximized,
    ${\text{let }}U(\theta )=\max _{\theta '}u\left(x(\theta '),t(\theta '),\theta \right)$
    ${\frac {dU}{d\theta }}={\frac {\partial u}{\partial \theta }}={\frac {\partial V}{\partial \theta }}$
Integrating,
    $U(\theta )={\underline {u}}(\theta _{0})+\int _{\theta _{0}}^{\theta }{\frac {\partial V}{\partial {\tilde {\theta }}}}d{\tilde {\theta }}$
where $\theta _{0}$ is some index type. Replacing the incentive-compatible $t(\theta )=V(x(\theta ),\theta )-U(\theta )$ in the maximand,
    ${\begin{aligned}&\mathbb {E} _{\theta }\left[V(x(\theta ),\theta )-{\underline {u}}(\theta _{0})-\int _{\theta _{0}}^{\theta }{\frac {\partial V}{\partial {\tilde {\theta }}}}d{\tilde {\theta }}-c\left(x(\theta )\right)\right]\\&=\mathbb {E} _{\theta }\left[V(x(\theta ),\theta )-{\underline {u}}(\theta _{0})-{\frac {1-P(\theta )}{p(\theta )}}{\frac {\partial V}{\partial \theta }}-c\left(x(\theta )\right)\right]\end{aligned}}$
after an integration by parts. This function can be maximized pointwise.
Because $U(\theta )$ is incentive-compatible already the designer can drop the IC constraint. If the utility function satisfies the Spence–Mirrlees condition then a monotonic $x(\theta )$ function exists. The IR constraint can be checked at equilibrium and the fee schedule raised or lowered accordingly. Additionally, note the presence of a hazard rate in the expression. If the type distribution bears the monotone hazard ratio property, the FOC is sufficient to solve for t. If not, then it is necessary to check whether the monotonicity constraint (see sufficiency, above) is satisfied everywhere along the allocation and fee schedules. If not, then the designer must use Myerson ironing.

### Myerson ironing

In some applications the designer may solve the first-order conditions for the price and allocation schedules yet find they are not monotonic. For example, in the quasilinear setting this often happens when the hazard ratio is itself not monotone. By the Spence–Mirrlees condition the optimal price and allocation schedules must be monotonic, so the designer must eliminate any interval over which the schedule changes direction by flattening it.
Intuitively, what is going on is the designer finds it optimal to bunch certain types together and give them the same contract. Normally the designer motivates higher types to distinguish themselves by giving them a better deal. If there are insufficiently few higher types on the margin the designer does not find it worthwhile to grant lower types a concession (called their information rent) in order to charge higher types a type-specific contract.
Consider a monopolist principal selling to agents with quasilinear utility, the example above. Suppose the allocation schedule $x(\theta )$ satisfying the first-order conditions has a single interior peak at $\theta _{1}$ and a single interior trough at $\theta _{2}>\theta _{1}$, illustrated at right.
* Following Myerson (1981) flatten it by choosing $x$ satisfying $\int _{\phi _{2}(x)}^{\phi _{1}(x)}\left({\frac {\partial V}{\partial x}}(x,\theta )-{\frac {1-P(\theta )}{p(\theta )}}{\frac {\partial ^{2}V}{\partial \theta \,\partial x}}(x,\theta )-{\frac {\partial c}{\partial x}}(x)\right)d\theta =0$ where $\phi _{1}(x)$ is the inverse function of x mapping to $\theta \leq \theta _{1}$ and $\phi _{2}(x)$ is the inverse function of x mapping to $\theta \geq \theta _{2}$. That is, $\phi _{1}$ returns a $\theta$ before the interior peak and $\phi _{2}$ returns a $\theta$ after the interior trough.
* If the nonmonotonic region of $x(\theta )$ borders the edge of the type space, simply set the appropriate $\phi (x)$ function (or both) to the boundary type. If there are multiple regions, see a textbook for an iterative procedure; it may be that more than one troughs should be ironed together.

#### Proof

The proof uses the theory of optimal control. It considers the set of intervals $\left[{\underline {\theta }},{\overline {\theta }}\right]$ in the nonmonotonic region of $x(\theta )$ over which it might flatten the schedule. It then writes a Hamiltonian to obtain necessary conditions for a $x(\theta )$ within the intervals
* that does satisfy monotonicity
* for which the monotonicity constraint is not binding on the boundaries of the interval
Condition two ensures that the $x(\theta )$ satisfying the optimal control problem reconnects to the schedule in the original problem at the interval boundaries (no jumps). Any $x(\theta )$ satisfying the necessary conditions must be flat because it must be monotonic and yet reconnect at the boundaries.
As before maximize the principal's expected payoff, but this time subject to the monotonicity constraint
    ${\frac {\partial x}{\partial \theta }}\geq 0$
and use a Hamiltonian to do it, with shadow price $\nu (\theta )$
    $H=\left(V(x,\theta )-{\underline {u}}(\theta _{0})-{\frac {1-P(\theta )}{p(\theta )}}{\frac {\partial V}{\partial \theta }}(x,\theta )-c(x)\right)p(\theta )+\nu (\theta ){\frac {\partial x}{\partial \theta }}$
where $x$ is a state variable and $\partial x/\partial \theta$ the control. As usual in optimal control the costate evolution equation must satisfy
    ${\frac {\partial \nu }{\partial \theta }}=-{\frac {\partial H}{\partial x}}=-\left({\frac {\partial V}{\partial x}}(x,\theta )-{\frac {1-P(\theta )}{p(\theta )}}{\frac {\partial ^{2}V}{\partial \theta \,\partial x}}(x,\theta )-{\frac {\partial c}{\partial x}}(x)\right)p(\theta )$
Taking advantage of condition 2, note the monotonicity constraint is not binding at the boundaries of the $\theta$ interval,
    $\nu ({\underline {\theta }})=\nu ({\overline {\theta }})=0$
meaning the costate variable condition can be integrated and also equals 0
    $\int _{\underline {\theta }}^{\overline {\theta }}\left({\frac {\partial V}{\partial x}}(x,\theta )-{\frac {1-P(\theta )}{p(\theta )}}{\frac {\partial ^{2}V}{\partial \theta \,\partial x}}(x,\theta )-{\frac {\partial c}{\partial x}}(x)\right)p(\theta )\,d\theta =0$
The average distortion of the principal's surplus must be 0. To flatten the schedule, find an $x$ such that its inverse image maps to a $\theta$ interval satisfying the condition above.