55 Additive Magmas

This chapter deals with domains that are closed under addition `+`

, which are called *near-additive magmas* in **GAP**. Together with the domains closed under multiplication `*`

(see 35), they are the basic algebraic structures. In many cases, the addition is commutative (see `IsAdditivelyCommutative`

(55.3-1)), the domain is called an *additive magma* then. Every module (see 57), vector space (see 61), ring (see 56), or field (see 58) is an additive magma. In the cases of all *(near-)additive magma-with-zero* or *(near-)additive magma-with-inverses*, additional additive structure is present (see 55.1).

`‣ IsNearAdditiveMagma` ( obj ) | ( category ) |

A *near-additive magma* in **GAP** is a domain \(A\) with an associative but not necessarily commutative addition `+`

\(: A \times A \rightarrow A\).

`‣ IsNearAdditiveMagmaWithZero` ( obj ) | ( category ) |

A *near-additive magma-with-zero* in **GAP** is a near-additive magma \(A\) with an operation `0*`

(or `Zero`

(31.10-3)) that yields the zero element of \(A\).

So a near-additive magma-with-zero `A` does always contain a unique additively neutral element \(z\), i.e., \(z + a = a = a + z\) holds for all \(a \in A\) (see `AdditiveNeutralElement`

(55.3-5)). This zero element \(z\) can be computed with the operation `Zero`

(31.10-3), by applying this function to \(A\) or to any element \(a\) in \(A\). The zero element can be computed also as `0 * `

\(a\), for any \(a\) in \(A\).

*Note* that it may happen that a near-additive magma containing a zero does *not* lie in the category `IsNearAdditiveMagmaWithZero`

(see 31.6).

`‣ IsNearAdditiveGroup` ( obj ) | ( category ) |

`‣ IsNearAdditiveMagmaWithInverses` ( obj ) | ( category ) |

A *near-additive group* in **GAP** is a near-additive magma-with-zero \(A\) with an operation `-1*`

\(: A \rightarrow A\) that maps each element \(a\) of \(A\) to its additive inverse `-1*`

\(a\) (or `AdditiveInverse( `

`a`` )`

, see `AdditiveInverse`

(31.10-9)).

The addition `+`

of \(A\) is assumed to be associative, so a near-additive group is not more than a *near-additive magma-with-inverses*. `IsNearAdditiveMagmaWithInverses`

is just a synonym for `IsNearAdditiveGroup`

, and can be used alternatively in all function names involving the string `"NearAdditiveGroup"`

.

Note that not every trivial near-additive magma is a near-additive magma-with-zero, but every trivial near-additive magma-with-zero is a near-additive group.

`‣ IsAdditiveMagma` ( obj ) | ( category ) |

An *additive magma* in **GAP** is a domain \(A\) with an associative and commutative addition `+`

\(: A \times A \rightarrow A\), see `IsNearAdditiveMagma`

(55.1-1) and `IsAdditivelyCommutative`

(55.3-1).

`‣ IsAdditiveMagmaWithZero` ( obj ) | ( category ) |

An *additive magma-with-zero* in **GAP** is an additive magma \(A\) (see `IsAdditiveMagma`

(55.1-4) with an operation `0*`

(or `Zero`

(31.10-3)) that yields the zero of \(A\).

So an additive magma-with-zero \(A\) does always contain a unique additively neutral element \(z\), i.e., \(z + a = a = a + z\) holds for all \(a \in A\) (see `AdditiveNeutralElement`

(55.3-5)). This element \(z\) can be computed with the operation `Zero`

(31.10-3) as `Zero( `

\(A\)` )`

, and \(z\) is also equal to `Zero( `

\(a\)` )`

and to `0*`

\(a\) for each element \(a\) in \(A\).

*Note* that it may happen that an additive magma containing a zero does *not* lie in the category `IsAdditiveMagmaWithZero`

(see 31.6).

`‣ IsAdditiveGroup` ( obj ) | ( category ) |

`‣ IsAdditiveMagmaWithInverses` ( obj ) | ( category ) |

An *additive group* in **GAP** is an additive magma-with-zero \(A\) with an operation `-1*`

\(: A \rightarrow A\) that maps each element \(a\) of \(A\) to its additive inverse `-1*`

\(a\) (or `AdditiveInverse( `

\(a\)` )`

, see `AdditiveInverse`

(31.10-9)).

The addition `+`

of \(A\) is assumed to be commutative and associative, so an additive group is not more than an *additive magma-with-inverses*. `IsAdditiveMagmaWithInverses`

is just a synonym for `IsAdditiveGroup`

, and can be used alternatively in all function names involving the string `"AdditiveGroup"`

.

Note that not every trivial additive magma is an additive magma-with-zero, but every trivial additive magma-with-zero is an additive group.

This section describes functions that create additive magmas from generators (see `NearAdditiveMagma`

(55.2-1), `NearAdditiveMagmaWithZero`

(55.2-2), `NearAdditiveGroup`

(55.2-3)), the underlying operations for which methods can be installed (see `NearAdditiveMagmaByGenerators`

(55.2-4), `NearAdditiveMagmaWithZeroByGenerators`

(55.2-5), `NearAdditiveGroupByGenerators`

(55.2-6)) and functions for forming additive submagmas (see `SubnearAdditiveMagma`

(55.2-7), `SubnearAdditiveMagmaWithZero`

(55.2-8), `SubnearAdditiveGroup`

(55.2-9)).

`‣ NearAdditiveMagma` ( [Fam, ]gens ) | ( function ) |

returns the (near-)additive magma \(A\) that is generated by the elements in the list `gens`, that is, the closure of `gens` under addition `+`

. The family `Fam` of \(A\) can be entered as first argument; this is obligatory if `gens` is empty (and hence also \(A\) is empty).

`‣ NearAdditiveMagmaWithZero` ( [Fam, ]gens ) | ( function ) |

returns the (near-)additive magma-with-zero \(A\) that is generated by the elements in the list `gens`, that is, the closure of `gens` under addition `+`

and `Zero`

(31.10-3). The family `Fam` of \(A\) can be entered as first argument; this is obligatory if `gens` is empty (and hence \(A\) is trivial).

`‣ NearAdditiveGroup` ( [Fam, ]gens ) | ( function ) |

returns the (near-)additive group \(A\) that is generated by the elements in the list `gens`, that is, the closure of `gens` under addition `+`

, `Zero`

(31.10-3), and `AdditiveInverse`

(31.10-9). The family `Fam` of \(A\) can be entered as first argument; this is obligatory if `gens` is empty (and hence \(A\) is trivial).

`‣ NearAdditiveMagmaByGenerators` ( [Fam, ]gens ) | ( operation ) |

An underlying operation for `NearAdditiveMagma`

(55.2-1).

`‣ NearAdditiveMagmaWithZeroByGenerators` ( [Fam, ]gens ) | ( operation ) |

An underlying operation for `NearAdditiveMagmaWithZero`

(55.2-2).

`‣ NearAdditiveGroupByGenerators` ( [Fam, ]gens ) | ( operation ) |

An underlying operation for `NearAdditiveGroup`

(55.2-3).

`‣ SubnearAdditiveMagma` ( D, gens ) | ( function ) |

`‣ SubadditiveMagma` ( D, gens ) | ( function ) |

`‣ SubnearAdditiveMagmaNC` ( D, gens ) | ( function ) |

`‣ SubadditiveMagmaNC` ( D, gens ) | ( function ) |

`SubnearAdditiveMagma`

returns the near-additive magma generated by the elements in the list `gens`, with parent the domain `D`. `SubnearAdditiveMagmaNC`

does the same, except that it does not check whether the elements of `gens` lie in `D`.

`SubadditiveMagma`

and `SubadditiveMagmaNC`

are just synonyms of these functions.

`‣ SubnearAdditiveMagmaWithZero` ( D, gens ) | ( function ) |

`‣ SubadditiveMagmaWithZero` ( D, gens ) | ( function ) |

`‣ SubnearAdditiveMagmaWithZeroNC` ( D, gens ) | ( function ) |

`‣ SubadditiveMagmaWithZeroNC` ( D, gens ) | ( function ) |

`SubnearAdditiveMagmaWithZero`

returns the near-additive magma-with-zero generated by the elements in the list `gens`, with parent the domain `D`. `SubnearAdditiveMagmaWithZeroNC`

does the same, except that it does not check whether the elements of `gens` lie in `D`.

`SubadditiveMagmaWithZero`

and `SubadditiveMagmaWithZeroNC`

are just synonyms of these functions.

`‣ SubnearAdditiveGroup` ( D, gens ) | ( function ) |

`‣ SubadditiveGroup` ( D, gens ) | ( function ) |

`‣ SubnearAdditiveGroupNC` ( D, gens ) | ( function ) |

`‣ SubadditiveGroupNC` ( D, gens ) | ( function ) |

`SubnearAdditiveGroup`

returns the near-additive group generated by the elements in the list `gens`, with parent the domain `D`. `SubadditiveGroupNC`

does the same, except that it does not check whether the elements of `gens` lie in `D`.

`SubadditiveGroup`

and `SubadditiveGroupNC`

are just synonyms of these functions.

`‣ IsAdditivelyCommutative` ( A ) | ( property ) |

A near-additive magma `A` in **GAP** is *additively commutative* if for all elements \(a, b \in \textit{A}\) the equality \(a + b = b + a\) holds.

Note that the commutativity of the *multiplication* `*`

in a multiplicative structure can be tested with `IsCommutative`

(35.4-9).

`‣ GeneratorsOfNearAdditiveMagma` ( A ) | ( attribute ) |

`‣ GeneratorsOfAdditiveMagma` ( A ) | ( attribute ) |

is a list of elements of the near-additive magma `A` that generates `A` as a near-additive magma, that is, the closure of this list under addition is `A`.

`‣ GeneratorsOfNearAdditiveMagmaWithZero` ( A ) | ( attribute ) |

`‣ GeneratorsOfAdditiveMagmaWithZero` ( A ) | ( attribute ) |

is a list of elements of the near-additive magma-with-zero `A` that generates `A` as a near-additive magma-with-zero, that is, the closure of this list under addition and `Zero`

(31.10-3) is `A`.

`‣ GeneratorsOfNearAdditiveGroup` ( A ) | ( attribute ) |

`‣ GeneratorsOfAdditiveGroup` ( A ) | ( attribute ) |

is a list of elements of the near-additive group `A` that generates `A` as a near-additive group, that is, the closure of this list under addition, taking the zero element, and taking additive inverses (see `AdditiveInverse`

(31.10-9)) is `A`.

`‣ AdditiveNeutralElement` ( A ) | ( attribute ) |

returns the element \(z\) in the near-additive magma `A` with the property that \(z + a = a = a + z\) holds for all \(a \in\) `A`, if such an element exists. Otherwise `fail`

is returned.

A near-additive magma that is not a near-additive magma-with-zero can have an additive neutral element \(z\); in this case, \(z\) *cannot* be obtained as `Zero( `

or as `A` )`0*`

\(a\) for an element \(a\) in `A`, see `Zero`

(31.10-3).

`‣ TrivialSubnearAdditiveMagmaWithZero` ( A ) | ( attribute ) |

is the additive magma-with-zero that has the zero of the near-additive magma-with-zero `A` as its only element.

`‣ ClosureNearAdditiveGroup` ( A, a ) | ( operation ) |

`‣ ClosureNearAdditiveGroup` ( A, B ) | ( operation ) |

returns the closure of the near-additive magma `A` with the element `a` or with the near-additive magma `B`, w.r.t. addition, taking the zero element, and taking additive inverses.

`‣ ShowAdditionTable` ( R ) | ( function ) |

`‣ ShowMultiplicationTable` ( M ) | ( function ) |

For a structure `R` with an addition given by `+`

, respectively a structure `M` with a multiplication given by `*`

, this command displays the addition (multiplication) table of the structure in a pretty way.

gap> ShowAdditionTable(GF(4)); + | 0*Z(2) Z(2)^0 Z(2^2) Z(2^2)^2 ---------+------------------------------------ 0*Z(2) | 0*Z(2) Z(2)^0 Z(2^2) Z(2^2)^2 Z(2)^0 | Z(2)^0 0*Z(2) Z(2^2)^2 Z(2^2) Z(2^2) | Z(2^2) Z(2^2)^2 0*Z(2) Z(2)^0 Z(2^2)^2 | Z(2^2)^2 Z(2^2) Z(2)^0 0*Z(2) gap> ShowMultiplicationTable(GF(4)); * | 0*Z(2) Z(2)^0 Z(2^2) Z(2^2)^2 ---------+------------------------------------ 0*Z(2) | 0*Z(2) 0*Z(2) 0*Z(2) 0*Z(2) Z(2)^0 | 0*Z(2) Z(2)^0 Z(2^2) Z(2^2)^2 Z(2^2) | 0*Z(2) Z(2^2) Z(2^2)^2 Z(2)^0 Z(2^2)^2 | 0*Z(2) Z(2^2)^2 Z(2)^0 Z(2^2)

generated by GAPDoc2HTML