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 | -48x+12y 15x+43y 36x-15y -47x-24y -46x-23y -x+38y -2x-7y -33x |
| 22x-41y -39x-36y 28x-48y -47x-38y 33x+28y -20x-26y -37x+25y -21x+26y |
| -49x-10y 30x-49y -17x+39y 42x-y -30x-26y -34x-32y -x-7y -10x-30y |
| -29x+39y 33x+46y -38x+15y 8x+43y -42x+39y -29x-27y 22x+50y 24x-34y |
| 40x-26y -41x+27y 10x+39y -43x-3y -42x+28y 35x+33y 13x+23y -3x-17y |
5
o3 : R-module, quotient of R
|
i4 : (N,f) = decomposeModule M
o4 = (cokernel | y x 0 0 0 0 0 0 |, | 45 -30 -15 -9 -7 |)
| 0 0 x 0 y 0 0 0 | | -12 5 -30 27 7 |
| 0 0 0 y x 0 0 0 | | -26 -32 4 -14 38 |
| 0 0 0 0 0 x 0 y | | 1 0 0 0 0 |
| 0 0 0 0 0 0 y x | | -27 -31 4 22 -29 |
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
|