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)
>>>
x / 2
Product {getProduct = 2 % 1}
(*) :: MultiplicativeGroup g => g -> g -> g infixl 7 Source #
Infix alias for multiplicative (
.<>
)
Examples:
>>>
Product (2 :: Rational) * Product (3 :: Rational)
Product {getProduct = 6 % 1}
(^) :: (Integral n, MultiplicativeGroup a) => a -> n -> a infixr 8 Source #
Infix alias for power
.
Examples:
>>>
let x = Product (3 :: Rational)
>>>
x ^ 3
Product {getProduct = 27 % 1}
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:
>>>
power (Product (3 :: Rational)) 3
Product {getProduct = 27 % 1}
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.