Solution (source code)

= Solution

For holdings $h\in\mathbb R^n$, let $V_0=h\cdot P_0$ and $V_1=h\cdot P_1$. Under the <investment-consumption arbitrage> convention used here, an <arbitrage> satisfies
$$
\boxed{V_0\leq0,\quad V_1\geq0\ \text{a.s.},\quad V_0<0\ \text{or}\ \mathbb P(V_1>0)>0.}
$$
The initial <consumption> is $-V_0$, and the terminal <consumption> is $V_1$: there is a possible gain with no external funding and no negative <consumption>. A <pure-investment arbitrage> additionally requires $V_0=0$. This convention is important because the last part distinguishes initial <consumption> from pure investment.