Solution (source code)

= Solution

A portfolio $H\in\mathbb R^n$ is an <arbitrage> when $H\cdot P_0\leq0$, $H\cdot P_1\geq0$ almost surely, and at least one inequality supplies a strict gain: either $H\cdot P_0<0$ or $\mathbb P(H\cdot P_1>0)>0$. It is a <terminal-consumption arbitrage> when $H\cdot P_0=0$, $H\cdot P_1\geq0$ almost surely, and the terminal inequality is strict with positive probability.