First checks that the generator degrees are the same. Then computes a random degree 0 map A --> B and B --> A, and returns true iff both are surjections.
i1 : S = ZZ/11[a,b] o1 = S o1 : PolynomialRing |
i2 : M = coker random(S^{-2,0,1,2}, S^{3:-3})
o2 = cokernel {2} | -3a-4b a-3b 3a-b |
{0} | 3a3-3a2b-4ab2+2b3 3a3-3a2b-3ab2+3b3 -4a3+5a2b+5ab2-5b3 |
{-1} | 3a4-a3b+3a2b2-2ab3-5b4 -5a4-5a3b-4a2b2-5ab3 -3a4-2a3b-5a2b2+2ab3+2b4 |
{-2} | -5a5+5a4b+5a3b2-2a2b3+5ab4+3b5 -2a5-5a4b-4a3b2+4a2b3+b5 3a5+3a4b-4a3b2-a2b3+4ab4-3b5 |
4
o2 : S-module, quotient of S
|
i3 : N = coker (random(cover M, cover M)*presentation M)
o3 = cokernel {2} | -5a-3b -2a-5b 5a+2b |
{0} | -2a3-2a2b-2ab2 a3-2a2b-4ab2-4b3 a3+3a2b-5ab2 |
{-1} | -4a4-3a3b-3a2b2-3ab3+4b4 4a4+4a3b-3a2b2+5ab3+2b4 -3a4-2a3b-3ab3-5b4 |
{-2} | -a5-2a4b-2a3b2+4a2b3-2ab4-4b5 3a5+a4b-4a3b2+5a2b3-3ab4 2a5-4a4b+3a3b2-5a2b3+3ab4+5b5 |
4
o3 : S-module, quotient of S
|
i4 : tally apply(100, j->isIsomorphic(M,N))
o4 = Tally{false => 13}
true => 87
o4 : Tally
|
If the function returns true then the modules ARE isomorphic. But if it returns false they may be isomorphic anyway.
The object isIsomorphic is a method function.