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