matrix-reduction alg over Z/2Z