Useful for building modules by generators and relations.
Here, we build a $\ZZ[x]$-module by placing generators in degrees 1, 2, and 3, and imposing two relations.
i1 : declareGenerators(ZZ[x], {a => 1, b => 2, c => 3})
3
o1 = (ZZ[x])
o1 : ZZ[x]-module, free, degrees {3, 1..2}
|
i2 : cospan(x*a-2*b,x*b-2*c)
o2 = cokernel {3} | 0 -2 |
{1} | x 0 |
{2} | -2 x |
3
o2 : ZZ[x]-module, quotient of (ZZ[x])
|
In M2, multiplication of ring elements by module elements happens on the left, so use x*a, not a*x.
The object cospan is a method function with a single argument.