Copyright | (c) 2020-2021 Emily Pillmore |
---|---|

License | BSD-style |

Maintainer | Emily Pillmore <emilypi@cohomolo.gy>, Reed Mullanix <reedmullanix@gmail.com> |

Stability | stable |

Portability | non-portable |

Safe Haskell | Safe |

Language | Haskell2010 |

This module contains definitions for `MultiplicativeGroup`

and
`MultiplicativeAbelianGroup`

, along with the relevant combinators.

## Synopsis

- class Group g => MultiplicativeGroup g
- (/) :: MultiplicativeGroup a => a -> a -> a
- (*) :: MultiplicativeGroup g => g -> g -> g
- (^) :: (Integral n, MultiplicativeGroup a) => a -> n -> a
- power :: (Integral n, MultiplicativeGroup g) => g -> n -> g
- class (MultiplicativeGroup g, Abelian g) => MultiplicativeAbelianGroup g

# Multiplicative Groups

class Group g => MultiplicativeGroup g Source #

An multiplicative group is a `Group`

whose operation can be thought of
as multiplication in some sense.

For example, the multiplicative group of rationals \( (ℚ, 1, *) \).

#### Instances

## combinators

(/) :: MultiplicativeGroup a => a -> a -> a infixl 7 Source #

Infix alias for multiplicative inverse.

**Examples**:

`>>>`

`let x = Product (4 :: Rational)`

`>>>`

Product {getProduct = 2 % 1}`x / 2`

(*) :: MultiplicativeGroup g => g -> g -> g infixl 7 Source #

Infix alias for multiplicative `(`

.`<>`

)

**Examples**:

`>>>`

Product {getProduct = 6 % 1}`Product (2 :: Rational) * Product (3 :: Rational)`

(^) :: (Integral n, MultiplicativeGroup a) => a -> n -> a infixr 8 Source #

Infix alias for `power`

.

**Examples**:

`>>>`

`let x = Product (3 :: Rational)`

`>>>`

Product {getProduct = 27 % 1}`x ^ 3`

power :: (Integral n, MultiplicativeGroup g) => g -> n -> g Source #

Multiply an element of a multiplicative group by itself `n`

-many times.

This represents `ℕ`

-indexed powers of an element `g`

of
a multiplicative group, i.e. iterated products of group elements.
This is representable by the universal property
\( C(x, ∏_n g) ≅ C(x, g)^n \).

**Examples**:

`>>>`

Product {getProduct = 27 % 1}`power (Product (3 :: Rational)) 3`

# Multiplicative abelian groups

class (MultiplicativeGroup g, Abelian g) => MultiplicativeAbelianGroup g Source #

A multiplicative abelian group is a `Group`

whose operation can be thought of
as commutative multiplication in some sense. Almost all multiplicative groups
are abelian.