  A weakly infeasible semidefinite program (SDP) has no feasible solution, but
it has approximate solutions whose constraint violation is arbitrarily small.
These SDPs are ill-posed and numerically often unsolvable. They are also
closely related to "bad" linear projections that map the cone of positive
semidefinite matrices to a nonclosed set. We describe a simple echelon form of
weakly infeasible SDPs with the following properties: (i) it is obtained by
elementary row operations and congruence transformations, (ii) it makes weak
infeasibility evident, and (iii) it permits us to construct any weakly
infeasible SDP or bad linear projection by an elementary combinatorial
algorithm. Based on our echelon form we generate a challenging library of
weakly infeasible SDPs. Finally, we show that some SDPs in the literature are
in our echelon form, for example, the SDP from the sum-of-squares relaxation of
minimizing the famous Motzkin polynomial.
