Solution (source code)

= Solution

A <pricing kernel> is a strictly positive <random variable> $R$ such that $RP_1^i$ is integrable and
$$
\boxed{P_0^i=\mathbb E[RP_1^i]\qquad(i=1,\ldots,n).}
$$
It is a one-period <state-price density>, converting a terminal payoff into its initial price. Strict positivity means $R>0$ <almost surely>, not merely $R\geq0$. When cash has price $1$ at both dates, this identity forces $\mathbb ER=1$, so $d\mathbb Q=R\,d\mathbb P$ defines an <equivalent martingale measure>.