Solution (source code)

= Solution

Use a strictly positive <bank account> as <numéraire>, and write all prices and payoffs in discounted units. There are $d$ risky assets with deterministic initial price vector $S_0$, terminal price vector $S_1\in L^2(P)$, and gains $Y=S_1-S_0$. A <self-financing portfolio> with initial capital $x$ and constant risky holdings $\theta$ has discounted terminal wealth $x+\theta^TY$. The initial amount in the <bank account> is $x-\theta^TS_0$, so $x$ denotes total initial capital, not just the cash holding. Assume the usual absence of <arbitrage>, and hence existence of an <equivalent martingale measure>; wherever a general <probability space> is used below, explicitly assume that such a measure exists and makes the asset payoffs integrable.

The <attainable claims> are precisely the <linear subspace>
$$
\mathcal A=\operatorname{span}\{1,Y_1,\ldots,Y_d\}\subset L^2(P).
$$
The <finite-dimensional subspace is closed>, so every <square-integrable> <contingent claim> $H$ has a unique <orthogonal projection> onto $\mathcal A$. This is its optimal <one-period least-squares hedging> payoff. Holdings are unique after redundant assets have been removed. Put
$$
m=\mathbb E_PY,\qquad C=\operatorname{Cov}_P(Y),\qquad c_H=\operatorname{Cov}_P(Y,H),
$$
and suppose the remaining <covariance matrix> $C$ is invertible. Expanding the squared error gives
$$
\mathbb E_P(H-x-\theta^TY)^2
=(\mathbb E_PH-x-\theta^Tm)^2+\operatorname{Var}_P(H)-2\theta^Tc_H+\theta^TC\theta.
$$
First minimize over $x$, then complete the square in $\theta$. Thus
$$
\boxed{\theta_*=C^{-1}c_H,\qquad x_*=\mathbb E_PH-m^TC^{-1}c_H.}
$$
The residual $L=H-x_*-\theta_*^TY$ satisfies
$$
\mathbb E_PL=0,\qquad\mathbb E_P[YL]=0,
\qquad\min_{x,\theta}\mathbb E_P(H-x-\theta^TY)^2
=\operatorname{Var}_P(H)-c_H^TC^{-1}c_H.
$$
Indeed, every other squared error equals this minimum plus
$$
(x-x_*+(\theta-\theta_*)^Tm)^2+(\theta-\theta_*)^TC(\theta-\theta_*).
$$
This proves optimality, and also shows that zero error is equivalent to <attainability of a European contingent claim>. If initial capital $x$ is prescribed instead, the <normal equations for linear least squares> give $\mathbb E[YY^T]\theta=\mathbb E[Y(H-x)]$; one must not use the free-capital formula without this adjustment.

A <dominated martingale measure> is a <probability measure> $Q\ll P$ such that $\mathbb E_QY=0$. Its <Radon-Nikodym derivative> $Z$ satisfies $Z\geq0$, $\mathbb E_PZ=1$, and $\mathbb E_P[ZY]=0$. An <equivalent martingale measure> additionally requires $Z>0$ almost surely. Every integrable <attainable claim> $H=x+\theta^TY$ then has price $x=\mathbb E_QH$, independent of which such measure is chosen. For an unattainable <contingent claim>, different <dominated martingale measures> can give different prices; least-squares approximation chooses a projection criterion rather than exact replication.

Write $Y=m+M$, where $M=Y-m$ is the centered <martingale> part of the one-period gains. The <minimal martingale measure in a one-period market> changes the means of the traded gains to zero while preserving all <square-integrable> mean-zero directions $L$ <orthogonal> to $M$. Its candidate density is
$$
\boxed{Z_*=1-m^TC^{-1}(Y-m).}
$$
Direct computation gives $\mathbb E_PZ_*=1$ and $\mathbb E_P[Z_*Y]=m-CC^{-1}m=0$. If $\mathbb E_PL=0$ and $\mathbb E_P[ML]=0$, then $\mathbb E_P[Z_*L]=0$, as required. Conversely, an $L^2$ density with this preservation property is <orthogonal> to the <orthogonal complement> of $\operatorname{span}\{1,M_1,\ldots,M_d\}$, so it lies in that span. Its normalization and <martingale> constraints force exactly $Z_*$. Moreover,
$$
x_*=\mathbb E_P[Z_*H].
$$
Every other <square-integrable> signed pricing density has the form $Z_*+D$, with $D$ <orthogonal> to $1$ and $Y$, hence to $Z_*$. Therefore
$$
\mathbb E_P[(Z_*+D)^2]=\mathbb E_PZ_*^2+\mathbb E_PD^2,
$$
so the minimal density is also the <minimum-norm one-period pricing weight>. This coincidence concerns one period; it is not an unrestricted assertion about dynamic hedging models.

Positivity needs checking. If $Z_*>0$ it defines an <equivalent martingale measure>; if merely $Z_*\geq0$, it defines a <dominated martingale measure>. Otherwise it defines only a <signed martingale measure>. For example, take $S_0=2$ and $Y=-1,1,3$ with physical probabilities $1/100,89/100,10/100$. Then $m=59/50$, $C=1019/2500$, and $Z_*=-4350/1019$ in the third state. There is nonetheless an <equivalent martingale measure> assigning probabilities $3/5,3/10,1/10$, whose mean gain is zero. Thus absence of <arbitrage> does not guarantee positivity of the least-squares density, and a least-squares initial cost need not be an arbitrage-free price for an unattainable payoff.

Finally prove <completeness and uniqueness of dominated martingale measures>. Suppose first that every bounded <contingent claim> is attainable. For any event $A$, replicate $\mathbf1_A=x_A+\theta_A^TY$. Under any <dominated martingale measure>, $Q(A)=x_A$. Thus all such measures agree on every event. Existence follows from our no-arbitrage assumption, giving uniqueness.

Conversely, fix an <equivalent martingale measure> $Q_0$, and let $k=\dim\mathcal A$. If the <probability space> admits $k+1$ disjoint events $A_1,\ldots,A_{k+1}$ of positive probability, choose a basis $a_1,\ldots,a_k$ of $\mathcal A$, including $1$. The $k\times(k+1)$ matrix with entries $\mathbb E_{Q_0}[a_i\mathbf1_{A_j}]$ has a nonzero null vector $(c_j)$. Consequently the bounded, nonzero <random variable>
$$
h=\sum_{j=1}^{k+1}c_j\mathbf1_{A_j}
$$
satisfies $\mathbb E_{Q_0}h=0$ and $\mathbb E_{Q_0}[hY]=0$. For $0<|\varepsilon|<1/\|h\|_\infty$, define
$$
\frac{dQ_\varepsilon}{dQ_0}=1+\varepsilon h.
$$
These are distinct <equivalent martingale measures>, because their densities are positive and their gain moments remain zero. Thus uniqueness rules out such a partition. A <probability space> with no $k+1$ disjoint positive-probability events consists, modulo null sets, of at most $k$ atoms: repeatedly split any non-atomic positive event to obtain a larger finite partition. On $N$ atoms the payoff space has dimension $N$, while $\mathcal A$ has dimension $k\leq N$. Hence $N=k$ and $\mathcal A$ is the whole payoff space. Every <contingent claim> is attainable. This proves
$$
\boxed{\text{complete, arbitrage-free one-period market}\quad\Longleftrightarrow\quad\text{unique dominated martingale measure}.}
$$
Here completeness means all bounded claims, or all <square-integrable> claims in the $L^2$ formulation. The existence/no-arbitrage hypothesis matters: on a one-state space, cash and a <stock> with a sure positive discounted gain span every payoff, but no <dominated martingale measure> can make that gain have zero mean.