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