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