Contents

# Functions for type MODZ

This type represents finitely generated Abelian groups or, equivalently, finitely generated Z-modules. They usually come up as results of integral homology computations, see for instance PCOMPLEX[homology]. To construct them directly, use the function modz.
&<>
```&<>(M1::MODZ, M2::MODZ)::boolean
M1 &<> M2
```

Test whether M1 and M2 represent different Abelian groups.

&=
```&=(M1::MODZ, M2::MODZ)::boolean
M1 &= M2
```

Test whether M1 and M2 represent the same Abelian group.

corank
```corank(M::MODZ)::nonnegint
```

The corank of a Z-module is its minimal number of generators.

directsum
```directsum(M1::MODZ, ...)::MODZ
```

The direct sum of the given modules.

Examples
 M1 := modz(1, [2]); M2 := modz([3]);
M1 := Z+Z[2]
M2 := Z[3]
 directsum(M1, M2);
Z+Z[6]
Without arguments, the function must be called in its long form:
 MODZ[directsum]();
0
modz
```modz(r::nonnegint, t::list(posint))::MODZ
```

Creates an object of type MODZ representing a Z-module isomorphic to Z^r+Z /t[1]+...+Z /t[-1]. The torsion part is transformed into a chain of divisors, and 1's are omitted. If r is omitted, it is taken to be 0; if t is omitted, it is taken to be the empty list.

Examples
 modz(3, [2, 7, 8, 1]);
3*Z+Z[2]+Z[56]
Distinguish between an object of type MODZ and its visual representation:
 modz(); evalb(modz() = 0);
0
false
 M1 := modz(1, [2])+modz([2]); type(M1, MODZ);
M1 := Z+2*Z[2]
false
 M2 := directsum(modz(1, [2]), modz([2])); type(M2, MODZ);
M2 := Z+2*Z[2]
true
rank
```rank(M::MODZ)::nonnegint
```

The rank of the (free) quotient of M by its torsion submodule.

torsion
```torsion(M::MODZ)::list(posint)
```

The list of elementary divisors of the torsion submodule of M as a chain of divisors.