trim M -- produce a module isomorphic to the module M obtained
by replacing its generators by a minimal set of generators, and doing
the same for the relations.
Also works for rings and ideals.
i1 : R = ZZ/101[x]
o1 = R
o1 : PolynomialRing
i2 : M = subquotient( matrix {{x,x^2,x^3}}, matrix {{x^3,x^4,x^5}})