Theorem (optimality iff complementary slackness for a linear program)

For a linear program defined here, let $\v x$ be primal feasible and $\v \lambda$ be dual feasible (i.e. feasible solutions of the primal and feasible problems).

$\v x$ and $\v \lambda$ are optimal for the two respective problems iff complementary slackness holds, i.e. $$ \begin{align*} \lambda_i(\v a_i^T \v x - b_i) &= 0 &&\forall i\in M_1\cup M_2\cup M_3, \\ (c_j - \v A_j^T \v \lambda) x_j &= 0 &&\forall j\in N_1\cup N_2\cup N_3. \end{align*} $$

Proof