---
title: "General Group Properties"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/group-Boolean.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/group-Boolean.md"
part: "Finitely Presented Groups"
chapter: "Abelian Groups"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finitely Presented Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/index-finitely-presented-groups.md"}
  - {"title": "Abelian Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md"}
prev: {"title": "Subgroup Chains", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/subgroup-chains.md"}
next: {"title": "Representation Theory", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/character-representation.md"}
intrinsics:
  - {"name": "IsCyclic", "signature": "IsCyclic(G): GrpAb -> BoolElt"}
  - {"name": "IsElementaryAbelian", "signature": "IsElementaryAbelian(G): GrpAb -> BoolElt"}
  - {"name": "IsFree", "signature": "IsFree(G): GrpAb -> BoolElt"}
  - {"name": "IsMixed", "signature": "IsMixed(G): GrpAb -> BoolElt"}
  - {"name": "IspGroup", "signature": "IspGroup(G): GrpAb -> BoolElt"}
  - {"name": "DerivedLength", "signature": "DerivedLength(G): GrpAb -> RngIntElt"}
  - {"name": "IsMaximal", "signature": "IsMaximal(G, H): GrpAb, GrpAb -> BoolElt"}
  - {"name": "Index", "signature": "Index(G, H): GrpAb, GrpAb -> RngIntElt"}
  - {"name": "FactoredIndex", "signature": "FactoredIndex(G, H): GrpAb, GrpAb -> [<RngIntElt, RngIntElt>]"}
  - {"name": "IsPure", "signature": "IsPure(G, H): GrpAb, GrpAb -> BoolElt"}
  - {"name": "IsNeat", "signature": "IsNeat(G, H): GrpAb, GrpAb -> BoolElt"}
  - {"name": "MaximalSubgroups", "signature": "MaximalSubgroups(G): GrpAb -> [GrpAb]"}
  - {"name": "Subgroups", "signature": "Subgroups(G:parameters): GrpAb -> [Rec]"}
  - {"name": "NumberOfSubgroupsAbelianPGroup", "signature": "NumberOfSubgroupsAbelianPGroup(A): SeqEnum -> SeqEnum"}
  - {"name": "HasComplement", "signature": "HasComplement(G, U): GrpAb, GrpAb -> BoolElt, GrpAb"}
examples:
  - "ex-604d09"
---

# General Group Properties

<a id="function-iscyclic-grpab"></a>
## `IsCyclic(G): GrpAb -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

<a id="function-iselementaryabelian-grpab"></a>
## `IsElementaryAbelian(G): GrpAb -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

<a id="function-isfree-grpab"></a>
## `IsFree(G): GrpAb -> BoolElt`

Returns `true` if $G$ is free, `false` otherwise.

<a id="function-ismixed-grpab"></a>
## `IsMixed(G): GrpAb -> BoolElt`

Returns `true` if $G$ is a mixed group, `false` otherwise. An abelian group is mixed if it is neither a torsion group nor free.

<a id="function-ispgroup-grpab"></a>
## `IspGroup(G): GrpAb -> BoolElt`

Returns `true` if the finite group $G$ is a $p$-group, i.e. if all elements have order a power of $p$.

<a id="function-derivedlength-grpab"></a>
## `DerivedLength(G): GrpAb -> RngIntElt`

The length of the derived series of $G$.

## Properties of Subgroups

<a id="function-ismaximal-grpab-grpab"></a>
### `IsMaximal(G, H): GrpAb, GrpAb -> BoolElt`

Returns `true` if the subgroup $H$ of the finite group $G$ is a maximal subgroup of $G$, `false` otherwise.

<a id="function-index-grpab-grpab"></a>
### `Index(G, H): GrpAb, GrpAb -> RngIntElt`

The index of the subgroup $H$ in the group $G$, returned as an ordinary integer. If $H$ has infinite index in $G$, the value zero is returned.

<a id="function-factoredindex-grpab-grpab"></a>
### `FactoredIndex(G, H): GrpAb, GrpAb -> [<RngIntElt, RngIntElt>]`

The factored index of the subgroup $H$ in the group $G$, returned as a sequence of prime-exponent pairs. If $H$ has infinite index in $G$, the empty sequence is returned.

<a id="function-ispure-grpab-grpab"></a>
### `IsPure(G, H): GrpAb, GrpAb -> BoolElt`

Returns `true` if the subgroup $H$ of the finite group $G$ is pure, ie. if for all $n$ we have $nG \cap H = nH$.

<a id="function-isneat-grpab-grpab"></a>
### `IsNeat(G, H): GrpAb, GrpAb -> BoolElt`

Returns `true` if the subgroup $H$ of the finite group $G$ is neat, i.e., if for all primes $p$ we have $pG \cap H = pH$.

## Enumeration of Subgroups

<a id="function-maximalsubgroups-grpab"></a>
### `MaximalSubgroups(G): GrpAb -> [GrpAb]`

The maximal subgroups of the finite group $G$ returned as a sequence of subgroups.

<a id="function-subgroups-grpab"></a>
### `Subgroups(G:parameters): GrpAb -> [Rec]`

```magma
Sub : [RngIntElt]                    Default: []
Quot: [RngIntElt]                    Default: []
```

The subgroups of the finite group $G$ are returned as a sequence of records. The record fields are `subgroup`, storing the actual group; `order`, storing the group order; and `length`, storing the length of the conjugacy class, which is always 1 for abelian groups.

If the parameter `Sub` is set, only subgroups with invariants equal to the given sequence are found. The given sequence should contain positive integers, such that each divides the following.

If the parameter `Quot` is set, only subgroups such that the quotient group has invariants equal to the given sequence are found. The given sequence should contain positive integers, such that each divides the following.

<a id="function-numberofsubgroupsabelianpgroup-seqenum"></a>
### `NumberOfSubgroupsAbelianPGroup(A): SeqEnum -> SeqEnum`

Return the number of subgroups of each non-trivial order in the abelian $p$-group $G$ where $A = [a_1, a_2, \ldots]$ and $G = C_{a_1} \times C_{a_2} \times \ldots$. The $m$-th entry in the sequence returned is the number of subgroups of order $p^m$.

<a id="function-hascomplement-grpab-grpab"></a>
### `HasComplement(G, U): GrpAb, GrpAb -> BoolElt, GrpAb`

For a finite abelian group $G$ and a subgroup $U$ decide if there exist some other subgroup $V$ such that $G = U+V$ and $U \cap V = \lbrace 0\rbrace$. In case such a $V$ exists, it is returned as the second value.

<a id="example-ex-604d09"></a>
### `Example: Subgroups of an Abelian Group of Order 12 (ex-604d09)`

We look at subgroups of an abelian group of order 12.

```magma
> G := AbelianGroup([2,6]);
> s := Subgroups(G); #s;
10
> s[7];
rec<recformat<order, length, subgroup, presentation> |
   order := 3, length := 1,
   subgroup := Abelian Group isomorphic to Z/3
Defined on 1 generator in supergroup G:
  $.1 = 2*G.2
Relations:
  3*$.1 = 0>
> [x`order:x in s];
[ 12, 6, 4, 2, 6, 6, 3, 2, 2, 1 ]
```

Now we find the elementary abelian subgroup of order 4.

```magma
> s22 := Subgroups(G:Sub := [2,2]); #s22;
1
> s22;
Conjugacy classes of subgroups
------------------------------

[1]     Order 4            Length 1
        Abelian Group isomorphic to Z/2 + Z/2
        Defined on 2 generators in supergroup G:
          $.1 = G.1
          $.2 = 3*G.2
        Relations:
          2*$.1 = 0
          2*$.2 = 0
```

There is more than one subgroup of index 2 in $G$.

```magma
> q2 := Subgroups(G:Quot := [2]); #q2;
3
> q2[3]`subgroup;
Abelian Group isomorphic to Z/6
Defined on 1 generator in supergroup G:
  $.1 = G.1 + G.2
Relations:
  6*$.1 = 0
```
