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