This function decomposes a module into a direct sum of simple modules, given some fairly strong assumptions on the ring which acts on the ring which acts on the module. This ring must only have two variables, and the square of each of those variables must kill the module.
i1 : Q = ZZ/101[x,y]
o1 = Q
o1 : PolynomialRing
|
i2 : R = Q/(x^2,y^2)
o2 = R
o2 : QuotientRing
|
i3 : M = coker random(R^5, R^8 ** R^{-1})
o3 = cokernel | 24x+y 28x+4y 24x-8y 13x-16y -30x+38y -27x+45y 49x+38y 27y |
| -32x+42y 12x+47y -23x+22y 23x-7y -23x+19y 50x+19y -19x-34y 42x+7y |
| -5x-43y -21x+5y -41x+7y -32x-9y 19x+13y 25x-33y 32x-33y -31x+9y |
| -36x+5y 20x+38y -36x+29y 47x+8y -15x+14y -38x-45y -x+9y 49x-30y |
| -17x-39y 41y 6x-14y -49x-17y -40x-11y -24x-18y 17x+12y -17x-48y |
5
o3 : R-module, quotient of R
|
i4 : (N,f) = decomposeModule M
o4 = (cokernel | y x 0 0 0 0 0 0 |, | 9 -46 13 -20 -13 |)
| 0 0 x 0 y 0 0 0 | | -21 21 6 -38 -20 |
| 0 0 0 y x 0 0 0 | | -25 43 -27 47 -29 |
| 0 0 0 0 0 x 0 y | | 1 0 0 0 0 |
| 0 0 0 0 0 0 y x | | 46 -29 34 18 9 |
o4 : Sequence
|
i5 : components N
o5 = {cokernel | y x |, cokernel | x 0 y |, cokernel | x 0 y |}
| 0 y x | | 0 y x |
o5 : List
|
i6 : ker f == 0
o6 = true
|
i7 : coker f == 0
o7 = true
|