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