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