algebra-4.2: Constructive abstract algebra

Numeric.Algebra

Synopsis

```(a + b) + c = a + (b + c)
sinnum 1 a = a
sinnum (2 * n) a = sinnum n a + sinnum n a
sinnum (2 * n + 1) a = sinnum n a + sinnum n a + a```

Minimal complete definition

(+)

Methods

(+) :: r -> r -> r infixl 6 Source

sinnum1p :: Natural -> r -> r Source

sinnum1p n r = sinnum (1 + n) r

sumWith1 :: Foldable1 f => (a -> r) -> f a -> r Source

Instances

sum1 :: (Foldable1 f, Additive r) => f r -> r Source

class Additive r => Abelian r Source

a + b = b + a

Instances

 Abelian Bool Abelian Int Abelian Int8 Abelian Int16 Abelian Int32 Abelian Int64 Abelian Integer Abelian Word Abelian Word8 Abelian Word16 Abelian Word32 Abelian Word64 Abelian () Abelian Natural Abelian Euclidean Abelian r => Abelian (Complex r) Abelian r => Abelian (Quaternion r) Abelian r => Abelian (Dual r) Abelian r => Abelian (Hyper' r) Abelian r => Abelian (Hyper r) Abelian r => Abelian (Dual' r) Abelian (BasisCoblade m) Abelian r => Abelian (Quaternion' r) Abelian r => Abelian (Trig r) Commutative r => Abelian (Log r) Abelian r => Abelian (End r) Abelian r => Abelian (Opposite r) Abelian r => Abelian (RngRing r) Abelian r => Abelian (ZeroRng r) Euclidean d => Abelian (Fraction d) Abelian r => Abelian (e -> r) (Abelian a, Abelian b) => Abelian (a, b) Abelian s => Abelian (Covector s a) (Abelian a, Abelian b, Abelian c) => Abelian (a, b, c) Abelian s => Abelian (Map s b a) (Abelian a, Abelian b, Abelian c, Abelian d) => Abelian (a, b, c, d) (Abelian a, Abelian b, Abelian c, Abelian d, Abelian e) => Abelian (a, b, c, d, e)

class Additive r => Idempotent r Source

`a + a = a`

Instances

 Idempotent Bool Idempotent () Idempotent r => Idempotent (Complex r) Idempotent r => Idempotent (Quaternion r) Idempotent r => Idempotent (Dual r) Idempotent r => Idempotent (Hyper' r) Idempotent r => Idempotent (Hyper r) Idempotent r => Idempotent (Dual' r) Idempotent r => Idempotent (Quaternion' r) Idempotent r => Idempotent (Trig r) Band r => Idempotent (Log r) Idempotent r => Idempotent (Opposite r) Idempotent r => Idempotent (ZeroRng r) Idempotent r => Idempotent (e -> r) (Idempotent a, Idempotent b) => Idempotent (a, b) Idempotent r => Idempotent (Covector r a) (Idempotent a, Idempotent b, Idempotent c) => Idempotent (a, b, c) (Idempotent a, Idempotent b, Idempotent c, Idempotent d) => Idempotent (a, b, c, d) (Idempotent a, Idempotent b, Idempotent c, Idempotent d, Idempotent e) => Idempotent (a, b, c, d, e)

sinnumIdempotent :: (Integral n, Idempotent r, Monoidal r) => n -> r -> r Source

class Additive m => Partitionable m where Source

Methods

partitionWith :: (m -> m -> r) -> m -> NonEmpty r Source

partitionWith f c returns a list containing f a b for each a b such that a + b = c,

Instances

 Partitionable Bool Partitionable () Partitionable Natural Partitionable r => Partitionable (Complex r) Partitionable r => Partitionable (Quaternion r) Partitionable r => Partitionable (Dual r) Partitionable r => Partitionable (Hyper' r) Partitionable r => Partitionable (Hyper r) Partitionable r => Partitionable (Dual' r) Partitionable r => Partitionable (Quaternion' r) Partitionable r => Partitionable (Trig r) Factorable r => Partitionable (Log r) (Partitionable a, Partitionable b) => Partitionable (a, b) (Partitionable a, Partitionable b, Partitionable c) => Partitionable (a, b, c) (Partitionable a, Partitionable b, Partitionable c, Partitionable d) => Partitionable (a, b, c, d) (Partitionable a, Partitionable b, Partitionable c, Partitionable d, Partitionable e) => Partitionable (a, b, c, d, e)

class (LeftModule Natural m, RightModule Natural m) => Monoidal m where Source

`zero + a = a = a + zero`

Minimal complete definition

zero

Methods

zero :: m Source

sinnum :: Natural -> m -> m Source

sumWith :: Foldable f => (a -> m) -> f a -> m Source

Instances

 Monoidal Bool Monoidal Int Monoidal Int8 Monoidal Int16 Monoidal Int32 Monoidal Int64 Monoidal Integer Monoidal Word Monoidal Word8 Monoidal Word16 Monoidal Word32 Monoidal Word64 Monoidal () Monoidal Natural Monoidal Euclidean Monoidal r => Monoidal (Complex r) Monoidal r => Monoidal (Quaternion r) Monoidal r => Monoidal (Dual r) Monoidal r => Monoidal (Hyper' r) Monoidal r => Monoidal (Hyper r) Monoidal r => Monoidal (Dual' r) Monoidal (BasisCoblade m) Monoidal r => Monoidal (Quaternion' r) Monoidal r => Monoidal (Trig r) Unital r => Monoidal (Log r) Monoidal r => Monoidal (End r) Monoidal r => Monoidal (Opposite r) (Abelian r, Monoidal r) => Monoidal (RngRing r) Monoidal r => Monoidal (ZeroRng r) Euclidean d => Monoidal (Fraction d) Monoidal r => Monoidal (e -> r) (Monoidal a, Monoidal b) => Monoidal (a, b) Monoidal s => Monoidal (Covector s a) (Monoidal a, Monoidal b, Monoidal c) => Monoidal (a, b, c) Monoidal s => Monoidal (Map s b a) (Monoidal a, Monoidal b, Monoidal c, Monoidal d) => Monoidal (a, b, c, d) (Monoidal a, Monoidal b, Monoidal c, Monoidal d, Monoidal e) => Monoidal (a, b, c, d, e)

sum :: (Foldable f, Monoidal m) => f m -> m Source

class (LeftModule Integer r, RightModule Integer r, Monoidal r) => Group r where Source

Minimal complete definition

Nothing

Methods

(-) :: r -> r -> r infixl 6 Source

negate :: r -> r Source

subtract :: r -> r -> r Source

times :: Integral n => n -> r -> r infixl 7 Source

Instances

 Group Int Group Int8 Group Int16 Group Int32 Group Int64 Group Integer Group Word Group Word8 Group Word16 Group Word32 Group Word64 Group () Group Euclidean Group r => Group (Complex r) Group r => Group (Quaternion r) Group r => Group (Dual r) Group r => Group (Hyper' r) Group r => Group (Hyper r) Group r => Group (Dual' r) Group r => Group (Quaternion' r) Group r => Group (Trig r) Division r => Group (Log r) Group r => Group (End r) Group r => Group (Opposite r) (Abelian r, Group r) => Group (RngRing r) Group r => Group (ZeroRng r) Euclidean d => Group (Fraction d) Group r => Group (e -> r) (Group a, Group b) => Group (a, b) Group s => Group (Covector s a) (Group a, Group b, Group c) => Group (a, b, c) Group s => Group (Map s b a) (Group a, Group b, Group c, Group d) => Group (a, b, c, d) (Group a, Group b, Group c, Group d, Group e) => Group (a, b, c, d, e)

# Multiplicative

## multiplicative semigroups

class Multiplicative r where Source

A multiplicative semigroup

Minimal complete definition

(*)

Methods

(*) :: r -> r -> r infixl 7 Source

pow1p :: r -> Natural -> r infixr 8 Source

productWith1 :: Foldable1 f => (a -> r) -> f a -> r Source

Instances

 Multiplicative Bool Multiplicative Int Multiplicative Int8 Multiplicative Int16 Multiplicative Int32 Multiplicative Int64 Multiplicative Integer Multiplicative Word Multiplicative Word8 Multiplicative Word16 Multiplicative Word32 Multiplicative Word64 Multiplicative () Multiplicative Natural Multiplicative Euclidean (Commutative r, Rng r) => Multiplicative (Complex r) (TriviallyInvolutive r, Rng r) => Multiplicative (Quaternion r) (Commutative r, Rng r) => Multiplicative (Dual r) (Commutative k, Semiring k) => Multiplicative (Hyper' k) (Commutative k, Semiring k) => Multiplicative (Hyper k) (Commutative r, Rng r) => Multiplicative (Dual' r) Multiplicative (BasisCoblade m) (TriviallyInvolutive r, Semiring r) => Multiplicative (Quaternion' r) (Commutative k, Rng k) => Multiplicative (Trig k) Additive r => Multiplicative (Exp r) Multiplicative (End r) Multiplicative r => Multiplicative (Opposite r) Rng r => Multiplicative (RngRing r) Monoidal r => Multiplicative (ZeroRng r) Euclidean d => Multiplicative (Fraction d) Algebra r a => Multiplicative (a -> r) (Multiplicative a, Multiplicative b) => Multiplicative (a, b) Multiplicative (Rect i j) Coalgebra r m => Multiplicative (Covector r m) (Multiplicative a, Multiplicative b, Multiplicative c) => Multiplicative (a, b, c) Coalgebra r m => Multiplicative (Map r b m) (Multiplicative a, Multiplicative b, Multiplicative c, Multiplicative d) => Multiplicative (a, b, c, d) (Multiplicative a, Multiplicative b, Multiplicative c, Multiplicative d, Multiplicative e) => Multiplicative (a, b, c, d, e)

product1 :: (Foldable1 f, Multiplicative r) => f r -> r Source

## commutative multiplicative semigroups

class Multiplicative r => Commutative r Source

A commutative multiplicative semigroup

Instances

 Commutative Bool Commutative Int Commutative Int8 Commutative Int16 Commutative Int32 Commutative Int64 Commutative Integer Commutative Word Commutative Word8 Commutative Word16 Commutative Word32 Commutative Word64 Commutative () Commutative Natural Commutative Euclidean (TriviallyInvolutive r, Rng r) => Commutative (Complex r) (TriviallyInvolutive r, Rng r) => Commutative (Dual r) (Commutative k, Semiring k) => Commutative (Hyper' k) (Commutative k, Semiring k) => Commutative (Hyper k) (TriviallyInvolutive r, Rng r) => Commutative (Dual' r) Commutative (BasisCoblade m) (Commutative k, Rng k) => Commutative (Trig k) Abelian r => Commutative (Exp r) (Abelian r, Commutative r) => Commutative (End r) Commutative r => Commutative (Opposite r) (Commutative r, Rng r) => Commutative (RngRing r) Monoidal r => Commutative (ZeroRng r) (Commutative d, Euclidean d) => Commutative (Fraction d) CommutativeAlgebra r a => Commutative (a -> r) (Commutative a, Commutative b) => Commutative (a, b) (Commutative m, Coalgebra r m) => Commutative (Covector r m) (Commutative a, Commutative b, Commutative c) => Commutative (a, b, c) (Commutative m, Coalgebra r m) => Commutative (Map r b m) (Commutative a, Commutative b, Commutative c, Commutative d) => Commutative (a, b, c, d) (Commutative a, Commutative b, Commutative c, Commutative d, Commutative e) => Commutative (a, b, c, d, e)

## multiplicative monoids

class Multiplicative r => Unital r where Source

Minimal complete definition

one

Methods

one :: r Source

pow :: r -> Natural -> r infixr 8 Source

productWith :: Foldable f => (a -> r) -> f a -> r Source

Instances

 Unital Bool Unital Int Unital Int8 Unital Int16 Unital Int32 Unital Int64 Unital Integer Unital Word Unital Word8 Unital Word16 Unital Word32 Unital Word64 Unital () Unital Natural Unital Euclidean (Commutative r, Ring r) => Unital (Complex r) (TriviallyInvolutive r, Ring r) => Unital (Quaternion r) (Commutative r, Ring r) => Unital (Dual r) (Commutative k, Rig k) => Unital (Hyper' k) (Commutative k, Rig k) => Unital (Hyper k) (Commutative r, Ring r) => Unital (Dual' r) Unital (BasisCoblade m) (TriviallyInvolutive r, Ring r) => Unital (Quaternion' r) (Commutative k, Ring k) => Unital (Trig k) Monoidal r => Unital (Exp r) Unital (End r) Unital r => Unital (Opposite r) Rng r => Unital (RngRing r) Euclidean d => Unital (Fraction d) (Unital r, UnitalAlgebra r a) => Unital (a -> r) (Unital a, Unital b) => Unital (a, b) CounitalCoalgebra r m => Unital (Covector r m) (Unital a, Unital b, Unital c) => Unital (a, b, c) CounitalCoalgebra r m => Unital (Map r b m) (Unital a, Unital b, Unital c, Unital d) => Unital (a, b, c, d) (Unital a, Unital b, Unital c, Unital d, Unital e) => Unital (a, b, c, d, e)

product :: (Foldable f, Unital r) => f r -> r Source

## idempotent multiplicative semigroups

class Multiplicative r => Band r Source

An multiplicative semigroup with idempotent multiplication.

`a * a = a`

Instances

 Band Bool Band () Idempotent r => Band (Exp r) Band r => Band (Opposite r) (Band a, Band b) => Band (a, b) Band (Rect i j) (Idempotent r, IdempotentCoalgebra r a) => Band (Covector r a) (Band a, Band b, Band c) => Band (a, b, c) (Band a, Band b, Band c, Band d) => Band (a, b, c, d) (Band a, Band b, Band c, Band d, Band e) => Band (a, b, c, d, e)

pow1pBand :: r -> Natural -> r Source

powBand :: Unital r => r -> Natural -> r Source

## multiplicative groups

class Unital r => Division r where Source

Minimal complete definition

Nothing

Methods

recip :: r -> r Source

(/) :: r -> r -> r infixl 7 Source

(\\) :: r -> r -> r infixl 7 Source

(^) :: Integral n => r -> n -> r infixr 8 Source

Instances

 Division () (Commutative r, InvolutiveSemiring r, DivisionRing r) => Division (Complex r) (TriviallyInvolutive r, Ring r, Division r) => Division (Quaternion r) (Commutative r, InvolutiveSemiring r, DivisionRing r) => Division (Dual r) (Commutative r, InvolutiveSemiring r, DivisionRing r) => Division (Hyper' r) (Commutative r, InvolutiveSemiring r, DivisionRing r) => Division (Dual' r) (TriviallyInvolutive r, Ring r, Division r) => Division (Quaternion' r) Group r => Division (Exp r) Division r => Division (Opposite r) (Rng r, Division r) => Division (RngRing r) Euclidean d => Division (Fraction d) (Unital r, DivisionAlgebra r a) => Division (a -> r) (Division a, Division b) => Division (a, b) (Division a, Division b, Division c) => Division (a, b, c) (Division a, Division b, Division c, Division d) => Division (a, b, c, d) (Division a, Division b, Division c, Division d, Division e) => Division (a, b, c, d, e)

## factorable multiplicative semigroups

class Multiplicative m => Factorable m where Source

`factorWith f c` returns a non-empty list containing `f a b` for all `a, b` such that `a * b = c`.

Results of factorWith f 0 are undefined and may result in either an error or an infinite list.

Methods

factorWith :: (m -> m -> r) -> m -> NonEmpty r Source

Instances

 Factorable Bool Factorable () Partitionable r => Factorable (Exp r) (Factorable a, Factorable b) => Factorable (a, b) (Factorable a, Factorable b, Factorable c) => Factorable (a, b, c) (Factorable a, Factorable b, Factorable c, Factorable d) => Factorable (a, b, c, d) (Factorable a, Factorable b, Factorable c, Factorable d, Factorable e) => Factorable (a, b, c, d, e)

## involutive multiplicative semigroups

class Multiplicative r => InvolutiveMultiplication r where Source

An semigroup with involution

`adjoint a * adjoint b = adjoint (b * a)`

Methods

adjoint :: r -> r Source

`adjoint = id`

# Ring-Structures

## Semirings

class (Additive r, Abelian r, Multiplicative r) => Semiring r Source

A pair of an additive abelian semigroup, and a multiplicative semigroup, with the distributive laws:

```a(b + c) = ab + ac -- left distribution (we are a LeftNearSemiring)
(a + b)c = ac + bc -- right distribution (we are a [Right]NearSemiring)```

Common notation includes the laws for additive and multiplicative identity in semiring.

If you want that, look at `Rig` instead.

Ideally we'd use the cyclic definition:

`class (LeftModule r r, RightModule r r, Additive r, Abelian r, Multiplicative r) => Semiring r`

to enforce that every semiring r is an r-module over itself, but Haskell doesn't like that.

Instances

 Semiring Bool Semiring Int Semiring Int8 Semiring Int16 Semiring Int32 Semiring Int64 Semiring Integer Semiring Word Semiring Word8 Semiring Word16 Semiring Word32 Semiring Word64 Semiring () Semiring Natural Semiring Euclidean (Commutative r, Rng r) => Semiring (Complex r) (TriviallyInvolutive r, Rng r) => Semiring (Quaternion r) (Commutative r, Rng r) => Semiring (Dual r) (Commutative k, Semiring k) => Semiring (Hyper' k) (Commutative k, Semiring k) => Semiring (Hyper k) (Commutative r, Rng r) => Semiring (Dual' r) Semiring (BasisCoblade m) (TriviallyInvolutive r, Semiring r) => Semiring (Quaternion' r) (Commutative k, Rng k) => Semiring (Trig k) (Abelian r, Monoidal r) => Semiring (End r) Semiring r => Semiring (Opposite r) Rng r => Semiring (RngRing r) (Monoidal r, Abelian r) => Semiring (ZeroRng r) Euclidean d => Semiring (Fraction d) Algebra r a => Semiring (a -> r) (Semiring a, Semiring b) => Semiring (a, b) Coalgebra r m => Semiring (Covector r m) (Semiring a, Semiring b, Semiring c) => Semiring (a, b, c) Coalgebra r m => Semiring (Map r b m) (Semiring a, Semiring b, Semiring c, Semiring d) => Semiring (a, b, c, d) (Semiring a, Semiring b, Semiring c, Semiring d, Semiring e) => Semiring (a, b, c, d, e)

class (Semiring r, InvolutiveMultiplication r) => InvolutiveSemiring r Source

Instances

 InvolutiveSemiring Bool InvolutiveSemiring Int InvolutiveSemiring Int8 InvolutiveSemiring Int16 InvolutiveSemiring Int32 InvolutiveSemiring Int64 InvolutiveSemiring Integer InvolutiveSemiring Word InvolutiveSemiring Word8 InvolutiveSemiring Word16 InvolutiveSemiring Word32 InvolutiveSemiring Word64 InvolutiveSemiring () InvolutiveSemiring Natural InvolutiveSemiring Euclidean (Commutative r, Rng r, InvolutiveSemiring r) => InvolutiveSemiring (Complex r) (Commutative r, Rng r, InvolutiveSemiring r) => InvolutiveSemiring (Dual r) (Commutative r, InvolutiveSemiring r, Rng r) => InvolutiveSemiring (Hyper' r) (Commutative r, Group r, InvolutiveSemiring r) => InvolutiveSemiring (Hyper r) (Commutative r, Rng r, InvolutiveSemiring r) => InvolutiveSemiring (Dual' r) (Commutative r, Rng r, InvolutiveSemiring r) => InvolutiveSemiring (Trig r) (InvolutiveSemiring a, InvolutiveSemiring b) => InvolutiveSemiring (a, b) (InvolutiveSemiring a, InvolutiveSemiring b, InvolutiveSemiring c) => InvolutiveSemiring (a, b, c) (InvolutiveSemiring a, InvolutiveSemiring b, InvolutiveSemiring c, InvolutiveSemiring d) => InvolutiveSemiring (a, b, c, d) (InvolutiveSemiring a, InvolutiveSemiring b, InvolutiveSemiring c, InvolutiveSemiring d, InvolutiveSemiring e) => InvolutiveSemiring (a, b, c, d, e)

class (Semiring r, Idempotent r) => Dioid r Source

Instances

 (Semiring r, Idempotent r) => Dioid r

## Rngs

class (Group r, Semiring r) => Rng r Source

A Ring without an identity.

Instances

 (Group r, Semiring r) => Rng r (Group r, Abelian r) => Rng (ZeroRng r)

## Rigs

class (Semiring r, Unital r, Monoidal r) => Rig r where Source

A Ring without (n)egation

Minimal complete definition

Nothing

Methods

fromNatural :: Natural -> r Source

Instances

 Rig Bool Rig Int Rig Int8 Rig Int16 Rig Int32 Rig Int64 Rig Integer Rig Word Rig Word8 Rig Word16 Rig Word32 Rig Word64 Rig () Rig Natural Rig Euclidean (Commutative r, Ring r) => Rig (Complex r) (TriviallyInvolutive r, Ring r) => Rig (Quaternion r) (Commutative r, Ring r) => Rig (Dual r) (Commutative r, Rig r) => Rig (Hyper' r) (Commutative r, Rig r) => Rig (Hyper r) (Commutative r, Ring r) => Rig (Dual' r) Rig (BasisCoblade m) (TriviallyInvolutive r, Ring r) => Rig (Quaternion' r) (Commutative r, Ring r) => Rig (Trig r) (Abelian r, Monoidal r) => Rig (End r) Rig r => Rig (Opposite r) Rng r => Rig (RngRing r) Euclidean d => Rig (Fraction d) (Rig a, Rig b) => Rig (a, b) (Rig r, CounitalCoalgebra r m) => Rig (Covector r m) (Rig a, Rig b, Rig c) => Rig (a, b, c) (Rig r, CounitalCoalgebra r m) => Rig (Map r b m) (Rig a, Rig b, Rig c, Rig d) => Rig (a, b, c, d) (Rig a, Rig b, Rig c, Rig d, Rig e) => Rig (a, b, c, d, e)

# Rings

class (Rig r, Rng r) => Ring r where Source

Minimal complete definition

Nothing

Methods

fromInteger :: Integer -> r Source

Instances

 Ring Int Ring Int8 Ring Int16 Ring Int32 Ring Int64 Ring Integer Ring Word Ring Word8 Ring Word16 Ring Word32 Ring Word64 Ring () Ring Euclidean (Commutative r, Ring r) => Ring (Complex r) (TriviallyInvolutive r, Ring r) => Ring (Quaternion r) (Commutative r, Ring r) => Ring (Dual r) (Commutative r, Ring r) => Ring (Hyper' r) (Commutative r, Ring r) => Ring (Hyper r) (Commutative r, Ring r) => Ring (Dual' r) (TriviallyInvolutive r, Ring r) => Ring (Quaternion' r) (Commutative r, Ring r) => Ring (Trig r) (Abelian r, Group r) => Ring (End r) Ring r => Ring (Opposite r) Rng r => Ring (RngRing r) Euclidean d => Ring (Fraction d) (Ring a, Ring b) => Ring (a, b) (Ring r, CounitalCoalgebra r m) => Ring (Covector r m) (Ring a, Ring b, Ring c) => Ring (a, b, c) (Ring r, CounitalCoalgebra r m) => Ring (Map r a m) (Ring a, Ring b, Ring c, Ring d) => Ring (a, b, c, d) (Ring a, Ring b, Ring c, Ring d, Ring e) => Ring (a, b, c, d, e)

## Division Rings

class Ring r => LocalRing r Source

class (Division r, Ring r) => DivisionRing r Source

Instances

 (Division r, Ring r) => DivisionRing r

class (Commutative r, DivisionRing r) => Field r Source

Instances

 (Commutative r, DivisionRing r) => Field r

# Modules

class (Semiring r, Additive m) => LeftModule r m where Source

Methods

(.*) :: r -> m -> m infixl 7 Source

Instances

 LeftModule Integer Int LeftModule Integer Int8 LeftModule Integer Int16 LeftModule Integer Int32 LeftModule Integer Int64 LeftModule Integer Integer LeftModule Integer Word LeftModule Integer Word8 LeftModule Integer Word16 LeftModule Integer Word32 LeftModule Integer Word64 LeftModule Integer Euclidean Additive m => LeftModule () m Semiring r => LeftModule r () LeftModule Natural Bool LeftModule Natural Int LeftModule Natural Int8 LeftModule Natural Int16 LeftModule Natural Int32 LeftModule Natural Int64 LeftModule Natural Integer LeftModule Natural Word LeftModule Natural Word8 LeftModule Natural Word16 LeftModule Natural Word32 LeftModule Natural Word64 LeftModule Natural Natural LeftModule Natural Euclidean Division r => LeftModule Integer (Log r) (Abelian r, Group r) => LeftModule Integer (RngRing r) Group r => LeftModule Integer (ZeroRng r) Euclidean d => LeftModule Integer (Fraction d) LeftModule r s => LeftModule r (Complex s) LeftModule r s => LeftModule r (Quaternion s) LeftModule r s => LeftModule r (Dual s) LeftModule r s => LeftModule r (Hyper' s) LeftModule r s => LeftModule r (Hyper s) LeftModule r s => LeftModule r (Dual' s) LeftModule r s => LeftModule r (Quaternion' s) LeftModule r s => LeftModule r (Trig s) LeftModule r m => LeftModule r (End m) RightModule r s => LeftModule r (Opposite s) LeftModule Natural (BasisCoblade m) Unital r => LeftModule Natural (Log r) (Abelian r, Monoidal r) => LeftModule Natural (RngRing r) Monoidal r => LeftModule Natural (ZeroRng r) Euclidean d => LeftModule Natural (Fraction d) (LeftModule r a, LeftModule r b) => LeftModule r (a, b) LeftModule r m => LeftModule r (e -> m) LeftModule r s => LeftModule r (Covector s m) (LeftModule r a, LeftModule r b, LeftModule r c) => LeftModule r (a, b, c) LeftModule r s => LeftModule r (Map s b m) (LeftModule r a, LeftModule r b, LeftModule r c, LeftModule r d) => LeftModule r (a, b, c, d) (LeftModule r a, LeftModule r b, LeftModule r c, LeftModule r d, LeftModule r e) => LeftModule r (a, b, c, d, e) (Commutative r, Rng r) => LeftModule (Complex r) (Complex r) (TriviallyInvolutive r, Rng r) => LeftModule (Quaternion r) (Quaternion r) (Commutative r, Rng r) => LeftModule (Dual r) (Dual r) (Commutative r, Semiring r) => LeftModule (Hyper' r) (Hyper' r) (Commutative r, Semiring r) => LeftModule (Hyper r) (Hyper r) (Commutative r, Rng r) => LeftModule (Dual' r) (Dual' r) (TriviallyInvolutive r, Rng r) => LeftModule (Quaternion' r) (Quaternion' r) (Commutative r, Rng r) => LeftModule (Trig r) (Trig r) (Monoidal m, Abelian m) => LeftModule (End m) (End m) Semiring r => LeftModule (Opposite r) (Opposite r) Rng s => LeftModule (RngRing s) (RngRing s) Coalgebra r m => LeftModule (Covector r m) (Covector r m) Coalgebra r m => LeftModule (Map r b m) (Map r b m)

class (Semiring r, Additive m) => RightModule r m where Source

Methods

(*.) :: m -> r -> m infixl 7 Source

Instances

 RightModule Integer Int RightModule Integer Int8 RightModule Integer Int16 RightModule Integer Int32 RightModule Integer Int64 RightModule Integer Integer RightModule Integer Word RightModule Integer Word8 RightModule Integer Word16 RightModule Integer Word32 RightModule Integer Word64 RightModule Integer Euclidean Additive m => RightModule () m Semiring r => RightModule r () RightModule Natural Bool RightModule Natural Int RightModule Natural Int8 RightModule Natural Int16 RightModule Natural Int32 RightModule Natural Int64 RightModule Natural Integer RightModule Natural Word RightModule Natural Word8 RightModule Natural Word16 RightModule Natural Word32 RightModule Natural Word64 RightModule Natural Natural RightModule Natural Euclidean Division r => RightModule Integer (Log r) (Abelian r, Group r) => RightModule Integer (RngRing r) Group r => RightModule Integer (ZeroRng r) Euclidean d => RightModule Integer (Fraction d) RightModule r s => RightModule r (Complex s) RightModule r s => RightModule r (Quaternion s) RightModule r s => RightModule r (Dual s) RightModule r s => RightModule r (Hyper' s) RightModule r s => RightModule r (Hyper s) RightModule r s => RightModule r (Dual' s) RightModule r s => RightModule r (Quaternion' s) RightModule r s => RightModule r (Trig s) RightModule r m => RightModule r (End m) LeftModule r s => RightModule r (Opposite s) RightModule Natural (BasisCoblade m) Unital r => RightModule Natural (Log r) (Abelian r, Monoidal r) => RightModule Natural (RngRing r) Monoidal r => RightModule Natural (ZeroRng r) Euclidean d => RightModule Natural (Fraction d) (RightModule r a, RightModule r b) => RightModule r (a, b) RightModule r m => RightModule r (e -> m) RightModule r s => RightModule r (Covector s m) (RightModule r a, RightModule r b, RightModule r c) => RightModule r (a, b, c) RightModule r s => RightModule r (Map s b m) (RightModule r a, RightModule r b, RightModule r c, RightModule r d) => RightModule r (a, b, c, d) (RightModule r a, RightModule r b, RightModule r c, RightModule r d, RightModule r e) => RightModule r (a, b, c, d, e) (Commutative r, Rng r) => RightModule (Complex r) (Complex r) (TriviallyInvolutive r, Rng r) => RightModule (Quaternion r) (Quaternion r) (Commutative r, Rng r) => RightModule (Dual r) (Dual r) (Commutative r, Semiring r) => RightModule (Hyper' r) (Hyper' r) (Commutative r, Semiring r) => RightModule (Hyper r) (Hyper r) (Commutative r, Rng r) => RightModule (Dual' r) (Dual' r) (TriviallyInvolutive r, Rng r) => RightModule (Quaternion' r) (Quaternion' r) (Commutative r, Rng r) => RightModule (Trig r) (Trig r) (Monoidal m, Abelian m) => RightModule (End m) (End m) Semiring r => RightModule (Opposite r) (Opposite r) Rng s => RightModule (RngRing s) (RngRing s) Coalgebra r m => RightModule (Covector r m) (Covector r m) Coalgebra r m => RightModule (Map r b m) (Map r b m)

class (LeftModule r m, RightModule r m) => Module r m Source

Instances

 (LeftModule r m, RightModule r m) => Module r m

# Algebras

## associative algebras over (non-commutative) semirings

class Semiring r => Algebra r a where Source

An associative algebra built with a free module over a semiring

Methods

mult :: (a -> a -> r) -> a -> r Source

Instances

 Algebra () a Semiring r => Algebra r IntSet Semiring r => Algebra r () Rng k => Algebra k ComplexBasis (TriviallyInvolutive r, Rng r) => Algebra r QuaternionBasis the quaternion algebra Rng k => Algebra k DualBasis (Commutative k, Semiring k) => Algebra k HyperBasis' Semiring k => Algebra k HyperBasis the trivial diagonal algebra Semiring k => Algebra k DualBasis' (TriviallyInvolutive r, Semiring r) => Algebra r QuaternionBasis' the trivial diagonal algebra (Commutative k, Rng k) => Algebra k TrigBasis (Semiring r, Monoidal r, Partitionable a) => Algebra r (IntMap a) (Semiring r, Ord a) => Algebra r (Set a) Semiring r => Algebra r (Seq a) The tensor algebra Semiring r => Algebra r [a] The tensor algebra (Commutative r, Monoidal r, Semiring r, LocallyFiniteOrder a) => Algebra r (Interval a) (Algebra r a, Algebra r b) => Algebra r (a, b) (Semiring r, Monoidal r, Ord a, Partitionable b) => Algebra r (Map a b) (Algebra r a, Algebra r b, Algebra r c) => Algebra r (a, b, c) (Algebra r a, Algebra r b, Algebra r c, Algebra r d) => Algebra r (a, b, c, d) (Algebra r a, Algebra r b, Algebra r c, Algebra r d, Algebra r e) => Algebra r (a, b, c, d, e)

class Semiring r => Coalgebra r c where Source

Methods

comult :: (c -> r) -> c -> c -> r Source

Instances

 Semiring r => Coalgebra r IntSet the free commutative band coalgebra over Int Semiring r => Coalgebra r () Rng k => Coalgebra k ComplexBasis (TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis the trivial diagonal coalgebra Rng k => Coalgebra k DualBasis (Commutative k, Monoidal k, Semiring k) => Coalgebra k HyperBasis' (Commutative k, Semiring k) => Coalgebra k HyperBasis the hyperbolic trigonometric coalgebra Rng k => Coalgebra k DualBasis' (TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis' dual quaternion comultiplication (Commutative k, Rng k) => Coalgebra k TrigBasis (Semiring r, Additive b) => Coalgebra r (IntMap b) the free commutative coalgebra over a set and Int (Semiring r, Ord a) => Coalgebra r (Set a) the free commutative band coalgebra Semiring r => Coalgebra r (Seq a) The tensor Hopf algebra Semiring r => Coalgebra r [a] The tensor Hopf algebra (Commutative r, Monoidal r, Semiring r, PartialSemigroup a) => Coalgebra r (Morphism a) (Eq a, Commutative r, Monoidal r, Semiring r) => Coalgebra r (Interval' a) Eigenmetric r m => Coalgebra r (BasisCoblade m) (Semiring r, Ord a, Additive b) => Coalgebra r (Map a b) the free commutative coalgebra over a set and a given semigroup (Coalgebra r a, Coalgebra r b) => Coalgebra r (a, b) Algebra r m => Coalgebra r (m -> r) Every coalgebra gives rise to an algebra by vector space duality classically. Sadly, it requires vector space duality, which we cannot use constructively. The dual argument only relies in the fact that any constructive coalgebra can only inspect a finite number of coefficients, which we CAN exploit. (Coalgebra r a, Coalgebra r b, Coalgebra r c) => Coalgebra r (a, b, c) (Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d) => Coalgebra r (a, b, c, d) (Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d, Coalgebra r e) => Coalgebra r (a, b, c, d, e)

## unital algebras

class Algebra r a => UnitalAlgebra r a where Source

An associative unital algebra over a semiring, built using a free module

Methods

unit :: r -> a -> r Source

Instances

 Semiring r => UnitalAlgebra r () Rng k => UnitalAlgebra k ComplexBasis (TriviallyInvolutive r, Rng r) => UnitalAlgebra r QuaternionBasis Rng k => UnitalAlgebra k DualBasis (Commutative k, Monoidal k, Semiring k) => UnitalAlgebra k HyperBasis' Semiring k => UnitalAlgebra k HyperBasis Semiring k => UnitalAlgebra k DualBasis' (TriviallyInvolutive r, Semiring r) => UnitalAlgebra r QuaternionBasis' (Commutative k, Rng k) => UnitalAlgebra k TrigBasis (Monoidal r, Semiring r) => UnitalAlgebra r (Seq a) (Monoidal r, Semiring r) => UnitalAlgebra r [a] (Commutative r, Monoidal r, Semiring r, LocallyFiniteOrder a) => UnitalAlgebra r (Interval a) (UnitalAlgebra r a, UnitalAlgebra r b) => UnitalAlgebra r (a, b) (UnitalAlgebra r a, UnitalAlgebra r b, UnitalAlgebra r c) => UnitalAlgebra r (a, b, c) (UnitalAlgebra r a, UnitalAlgebra r b, UnitalAlgebra r c, UnitalAlgebra r d) => UnitalAlgebra r (a, b, c, d) (UnitalAlgebra r a, UnitalAlgebra r b, UnitalAlgebra r c, UnitalAlgebra r d, UnitalAlgebra r e) => UnitalAlgebra r (a, b, c, d, e)

class Coalgebra r c => CounitalCoalgebra r c where Source

Methods

counit :: (c -> r) -> r Source

Instances

 Semiring r => CounitalCoalgebra r () Rng k => CounitalCoalgebra k ComplexBasis (TriviallyInvolutive r, Rng r) => CounitalCoalgebra r QuaternionBasis Rng k => CounitalCoalgebra k DualBasis (Commutative k, Monoidal k, Semiring k) => CounitalCoalgebra k HyperBasis' (Commutative k, Semiring k) => CounitalCoalgebra k HyperBasis Rng k => CounitalCoalgebra k DualBasis' (TriviallyInvolutive r, Rng r) => CounitalCoalgebra r QuaternionBasis' (Commutative k, Rng k) => CounitalCoalgebra k TrigBasis Semiring r => CounitalCoalgebra r (Seq a) Semiring r => CounitalCoalgebra r [a] (Commutative r, Monoidal r, Semiring r, PartialMonoid a) => CounitalCoalgebra r (Morphism a) (Eq a, Bounded a, Commutative r, Monoidal r, Semiring r) => CounitalCoalgebra r (Interval' a) Eigenmetric r m => CounitalCoalgebra r (BasisCoblade m) (CounitalCoalgebra r a, CounitalCoalgebra r b) => CounitalCoalgebra r (a, b) (Unital r, UnitalAlgebra r m) => CounitalCoalgebra r (m -> r) (CounitalCoalgebra r a, CounitalCoalgebra r b, CounitalCoalgebra r c) => CounitalCoalgebra r (a, b, c) (CounitalCoalgebra r a, CounitalCoalgebra r b, CounitalCoalgebra r c, CounitalCoalgebra r d) => CounitalCoalgebra r (a, b, c, d) (CounitalCoalgebra r a, CounitalCoalgebra r b, CounitalCoalgebra r c, CounitalCoalgebra r d, CounitalCoalgebra r e) => CounitalCoalgebra r (a, b, c, d, e)

class (UnitalAlgebra r a, CounitalCoalgebra r a) => Bialgebra r a Source

A bialgebra is both a unital algebra and counital coalgebra where the `mult` and `unit` are compatible in some sense with the `comult` and `counit`. That is to say that `mult` and `unit` are a coalgebra homomorphisms or (equivalently) that `comult` and `counit` are an algebra homomorphisms.

Instances

 Semiring r => Bialgebra r () Rng k => Bialgebra k ComplexBasis (TriviallyInvolutive r, Rng r) => Bialgebra r QuaternionBasis Rng k => Bialgebra k DualBasis (Commutative k, Monoidal k, Semiring k) => Bialgebra k HyperBasis' (Commutative k, Semiring k) => Bialgebra k HyperBasis Rng k => Bialgebra k DualBasis' (TriviallyInvolutive r, Rng r) => Bialgebra r QuaternionBasis' (Commutative k, Rng k) => Bialgebra k TrigBasis (Monoidal r, Semiring r) => Bialgebra r (Seq a) (Monoidal r, Semiring r) => Bialgebra r [a] (Bialgebra r a, Bialgebra r b) => Bialgebra r (a, b) (Bialgebra r a, Bialgebra r b, Bialgebra r c) => Bialgebra r (a, b, c) (Bialgebra r a, Bialgebra r b, Bialgebra r c, Bialgebra r d) => Bialgebra r (a, b, c, d) (Bialgebra r a, Bialgebra r b, Bialgebra r c, Bialgebra r d, Bialgebra r e) => Bialgebra r (a, b, c, d, e)

## involutive algebras

class (InvolutiveSemiring r, Algebra r a) => InvolutiveAlgebra r a where Source

Methods

inv :: (a -> r) -> a -> r Source

Instances

 InvolutiveSemiring r => InvolutiveAlgebra r () (InvolutiveSemiring k, Rng k) => InvolutiveAlgebra k ComplexBasis (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => InvolutiveAlgebra r QuaternionBasis (InvolutiveSemiring k, Rng k) => InvolutiveAlgebra k DualBasis (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveAlgebra k HyperBasis' (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveAlgebra k HyperBasis (InvolutiveSemiring k, Rng k) => InvolutiveAlgebra k DualBasis' (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => InvolutiveAlgebra r QuaternionBasis' (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveAlgebra k TrigBasis (InvolutiveAlgebra r a, InvolutiveAlgebra r b) => InvolutiveAlgebra r (a, b) (InvolutiveAlgebra r a, InvolutiveAlgebra r b, InvolutiveAlgebra r c) => InvolutiveAlgebra r (a, b, c) (InvolutiveAlgebra r a, InvolutiveAlgebra r b, InvolutiveAlgebra r c, InvolutiveAlgebra r d) => InvolutiveAlgebra r (a, b, c, d) (InvolutiveAlgebra r a, InvolutiveAlgebra r b, InvolutiveAlgebra r c, InvolutiveAlgebra r d, InvolutiveAlgebra r e) => InvolutiveAlgebra r (a, b, c, d, e)

class (InvolutiveSemiring r, Coalgebra r c) => InvolutiveCoalgebra r c where Source

Methods

coinv :: (c -> r) -> c -> r Source

Instances

 InvolutiveSemiring r => InvolutiveCoalgebra r () (InvolutiveSemiring k, Rng k) => InvolutiveCoalgebra k ComplexBasis (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => InvolutiveCoalgebra r QuaternionBasis (InvolutiveSemiring k, Rng k) => InvolutiveCoalgebra k DualBasis (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveCoalgebra k HyperBasis' (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveCoalgebra k HyperBasis (InvolutiveSemiring k, Rng k) => InvolutiveCoalgebra k DualBasis' (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => InvolutiveCoalgebra r QuaternionBasis' (Commutative k, Group k, InvolutiveSemiring k) => InvolutiveCoalgebra k TrigBasis (InvolutiveCoalgebra r a, InvolutiveCoalgebra r b) => InvolutiveCoalgebra r (a, b) (InvolutiveCoalgebra r a, InvolutiveCoalgebra r b, InvolutiveCoalgebra r c) => InvolutiveCoalgebra r (a, b, c) (InvolutiveCoalgebra r a, InvolutiveCoalgebra r b, InvolutiveCoalgebra r c, InvolutiveCoalgebra r d) => InvolutiveCoalgebra r (a, b, c, d) (InvolutiveCoalgebra r a, InvolutiveCoalgebra r b, InvolutiveCoalgebra r c, InvolutiveCoalgebra r d, InvolutiveCoalgebra r e) => InvolutiveCoalgebra r (a, b, c, d, e)

class (Bialgebra r h, InvolutiveAlgebra r h, InvolutiveCoalgebra r h) => InvolutiveBialgebra r h Source

Instances

 (Bialgebra r h, InvolutiveAlgebra r h, InvolutiveCoalgebra r h) => InvolutiveBialgebra r h

class (CommutativeAlgebra r a, TriviallyInvolutive r, InvolutiveAlgebra r a) => TriviallyInvolutiveAlgebra r a Source

Instances

 (TriviallyInvolutive r, InvolutiveSemiring r) => TriviallyInvolutiveAlgebra r () (TriviallyInvolutiveAlgebra r a, TriviallyInvolutiveAlgebra r b) => TriviallyInvolutiveAlgebra r (a, b) (TriviallyInvolutiveAlgebra r a, TriviallyInvolutiveAlgebra r b, TriviallyInvolutiveAlgebra r c) => TriviallyInvolutiveAlgebra r (a, b, c) (TriviallyInvolutiveAlgebra r a, TriviallyInvolutiveAlgebra r b, TriviallyInvolutiveAlgebra r c, TriviallyInvolutiveAlgebra r d) => TriviallyInvolutiveAlgebra r (a, b, c, d) (TriviallyInvolutiveAlgebra r a, TriviallyInvolutiveAlgebra r b, TriviallyInvolutiveAlgebra r c, TriviallyInvolutiveAlgebra r d, TriviallyInvolutiveAlgebra r e) => TriviallyInvolutiveAlgebra r (a, b, c, d, e)

Instances

 (TriviallyInvolutive r, InvolutiveSemiring r) => TriviallyInvolutiveCoalgebra r () (TriviallyInvolutiveCoalgebra r a, TriviallyInvolutiveCoalgebra r b) => TriviallyInvolutiveCoalgebra r (a, b) (TriviallyInvolutiveCoalgebra r a, TriviallyInvolutiveCoalgebra r b, TriviallyInvolutiveCoalgebra r c) => TriviallyInvolutiveCoalgebra r (a, b, c) (TriviallyInvolutiveCoalgebra r a, TriviallyInvolutiveCoalgebra r b, TriviallyInvolutiveCoalgebra r c, TriviallyInvolutiveCoalgebra r d) => TriviallyInvolutiveCoalgebra r (a, b, c, d) (TriviallyInvolutiveCoalgebra r a, TriviallyInvolutiveCoalgebra r b, TriviallyInvolutiveCoalgebra r c, TriviallyInvolutiveCoalgebra r d, TriviallyInvolutiveCoalgebra r e) => TriviallyInvolutiveCoalgebra r (a, b, c, d, e)

Instances

 (InvolutiveBialgebra r h, TriviallyInvolutiveAlgebra r h, TriviallyInvolutiveCoalgebra r h) => TriviallyInvolutiveBialgebra r h

## idempotent algebras

class Algebra r a => IdempotentAlgebra r a Source

Instances

 (Semiring r, Band r) => IdempotentAlgebra r () (Semiring r, Band r) => IdempotentAlgebra r IntSet (Semiring r, Band r, Ord a) => IdempotentAlgebra r (Set a) (IdempotentAlgebra r a, IdempotentAlgebra r b) => IdempotentAlgebra r (a, b) (IdempotentAlgebra r a, IdempotentAlgebra r b, IdempotentAlgebra r c) => IdempotentAlgebra r (a, b, c) (IdempotentAlgebra r a, IdempotentAlgebra r b, IdempotentAlgebra r c, IdempotentAlgebra r d) => IdempotentAlgebra r (a, b, c, d) (IdempotentAlgebra r a, IdempotentAlgebra r b, IdempotentAlgebra r c, IdempotentAlgebra r d, IdempotentAlgebra r e) => IdempotentAlgebra r (a, b, c, d, e)

class (Bialgebra r h, IdempotentAlgebra r h, IdempotentCoalgebra r h) => IdempotentBialgebra r h Source

Instances

 (Bialgebra r h, IdempotentAlgebra r h, IdempotentCoalgebra r h) => IdempotentBialgebra r h

## commutative algebras

class Algebra r a => CommutativeAlgebra r a Source

Instances

 (Commutative r, Semiring r) => CommutativeAlgebra r IntSet (Commutative r, Semiring r) => CommutativeAlgebra r () (Commutative r, Monoidal r, Semiring r, Abelian b, Partitionable b) => CommutativeAlgebra r (IntMap b) (Commutative r, Semiring r, Ord a) => CommutativeAlgebra r (Set a) (Commutative r, Monoidal r, Semiring r, Ord a, Abelian b, Partitionable b) => CommutativeAlgebra r (Map a b) (CommutativeAlgebra r a, CommutativeAlgebra r b) => CommutativeAlgebra r (a, b) (CommutativeAlgebra r a, CommutativeAlgebra r b, CommutativeAlgebra r c) => CommutativeAlgebra r (a, b, c) (CommutativeAlgebra r a, CommutativeAlgebra r b, CommutativeAlgebra r c, CommutativeAlgebra r d) => CommutativeAlgebra r (a, b, c, d) (CommutativeAlgebra r a, CommutativeAlgebra r b, CommutativeAlgebra r c, CommutativeAlgebra r d, CommutativeAlgebra r e) => CommutativeAlgebra r (a, b, c, d, e)

class (Bialgebra r h, CommutativeAlgebra r h, CocommutativeCoalgebra r h) => CommutativeBialgebra r h Source

Instances

 (Bialgebra r h, CommutativeAlgebra r h, CocommutativeCoalgebra r h) => CommutativeBialgebra r h

class Coalgebra r c => CocommutativeCoalgebra r c Source

Instances

 (Commutative r, Semiring r) => CocommutativeCoalgebra r IntSet (Commutative r, Semiring r) => CocommutativeCoalgebra r () (Commutative r, Semiring r, Abelian b) => CocommutativeCoalgebra r (IntMap b) (Commutative r, Semiring r, Ord a) => CocommutativeCoalgebra r (Set a) (Commutative r, Semiring r, Ord a, Abelian b) => CocommutativeCoalgebra r (Map a b) (CocommutativeCoalgebra r a, CocommutativeCoalgebra r b) => CocommutativeCoalgebra r (a, b) CommutativeAlgebra r m => CocommutativeCoalgebra r (m -> r) (CocommutativeCoalgebra r a, CocommutativeCoalgebra r b, CocommutativeCoalgebra r c) => CocommutativeCoalgebra r (a, b, c) (CocommutativeCoalgebra r a, CocommutativeCoalgebra r b, CocommutativeCoalgebra r c, CocommutativeCoalgebra r d) => CocommutativeCoalgebra r (a, b, c, d) (CocommutativeCoalgebra r a, CocommutativeCoalgebra r b, CocommutativeCoalgebra r c, CocommutativeCoalgebra r d, CocommutativeCoalgebra r e) => CocommutativeCoalgebra r (a, b, c, d, e)

## division algebras

class UnitalAlgebra r a => DivisionAlgebra r a where Source

Methods

recipriocal :: (a -> r) -> a -> r Source

## Hopf alegebras

class Bialgebra r h => HopfAlgebra r h where Source

A HopfAlgebra algebra on a semiring, where the module is free.

When `antipode . antipode = id` and antipode is an antihomomorphism then we are an InvolutiveBialgebra with `inv = antipode` as well

Methods

antipode :: (h -> r) -> h -> r Source

Instances

 (InvolutiveSemiring k, Rng k) => HopfAlgebra k ComplexBasis (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => HopfAlgebra r QuaternionBasis (InvolutiveSemiring k, Rng k) => HopfAlgebra k DualBasis (Commutative k, Group k, InvolutiveSemiring k) => HopfAlgebra k HyperBasis' (Commutative k, Group k, InvolutiveSemiring k) => HopfAlgebra k HyperBasis (InvolutiveSemiring k, Rng k) => HopfAlgebra k DualBasis' (TriviallyInvolutive r, InvolutiveSemiring r, Rng r) => HopfAlgebra r QuaternionBasis' (Commutative k, Group k, InvolutiveSemiring k) => HopfAlgebra k TrigBasis (HopfAlgebra r a, HopfAlgebra r b) => HopfAlgebra r (a, b) (HopfAlgebra r a, HopfAlgebra r b, HopfAlgebra r c) => HopfAlgebra r (a, b, c) (HopfAlgebra r a, HopfAlgebra r b, HopfAlgebra r c, HopfAlgebra r d) => HopfAlgebra r (a, b, c, d) (HopfAlgebra r a, HopfAlgebra r b, HopfAlgebra r c, HopfAlgebra r d, HopfAlgebra r e) => HopfAlgebra r (a, b, c, d, e)

# Ring Properties

## Characteristic

class Rig r => Characteristic r where Source

Methods

char :: proxy r -> Natural Source

Instances

 Characteristic Bool NB: we're using the boolean semiring, not the boolean ring Characteristic Int Characteristic Int8 Characteristic Int16 Characteristic Int32 Characteristic Int64 Characteristic Integer Characteristic Word Characteristic Word8 Characteristic Word16 Characteristic Word32 Characteristic Word64 Characteristic () Characteristic Natural (Characteristic d, Euclidean d) => Characteristic (Fraction d) (Characteristic a, Characteristic b) => Characteristic (a, b) (Characteristic a, Characteristic b, Characteristic c) => Characteristic (a, b, c) (Characteristic a, Characteristic b, Characteristic c, Characteristic d) => Characteristic (a, b, c, d) (Characteristic a, Characteristic b, Characteristic c, Characteristic d, Characteristic e) => Characteristic (a, b, c, d, e)

charInt :: (Integral s, Bounded s) => proxy s -> Natural Source

charWord :: (Integral s, Bounded s) => proxy s -> Natural Source

## Order

class Order a where Source

Minimal complete definition

Nothing

Methods

(<~) :: a -> a -> Bool Source

(<) :: a -> a -> Bool Source

(>~) :: a -> a -> Bool Source

(>) :: a -> a -> Bool Source

(~~) :: a -> a -> Bool Source

(/~) :: a -> a -> Bool Source

order :: a -> a -> Maybe Ordering Source

comparable :: a -> a -> Bool Source

Instances

 Order Bool Order Int Order Int8 Order Int16 Order Int32 Order Int64 Order Integer Order Word Order Word8 Order Word16 Order Word32 Order Word64 Order () Order Natural Ord a => Order (Set a) (Order a, Order b) => Order (a, b) (Order a, Order b, Order c) => Order (a, b, c) (Order a, Order b, Order c, Order d) => Order (a, b, c, d) (Order a, Order b, Order c, Order d, Order e) => Order (a, b, c, d, e)

class (AdditiveOrder r, Rig r) => OrderedRig r Source

Instances

 OrderedRig Bool OrderedRig Integer OrderedRig () OrderedRig Natural (OrderedRig a, OrderedRig b) => OrderedRig (a, b) (OrderedRig a, OrderedRig b, OrderedRig c) => OrderedRig (a, b, c) (OrderedRig a, OrderedRig b, OrderedRig c, OrderedRig d) => OrderedRig (a, b, c, d) (OrderedRig a, OrderedRig b, OrderedRig c, OrderedRig d, OrderedRig e) => OrderedRig (a, b, c, d, e)

z + x <= z + y = x <= y = x + z <= y + z

Instances

class Order a => LocallyFiniteOrder a Source

Minimal complete definition

Instances

 LocallyFiniteOrder Bool LocallyFiniteOrder Int LocallyFiniteOrder Int8 LocallyFiniteOrder Int16 LocallyFiniteOrder Int32 LocallyFiniteOrder Int64 LocallyFiniteOrder Integer LocallyFiniteOrder Word LocallyFiniteOrder Word8 LocallyFiniteOrder Word16 LocallyFiniteOrder Word32 LocallyFiniteOrder Word64 LocallyFiniteOrder () LocallyFiniteOrder Natural Ord a => LocallyFiniteOrder (Set a) (LocallyFiniteOrder a, LocallyFiniteOrder b) => LocallyFiniteOrder (a, b) (LocallyFiniteOrder a, LocallyFiniteOrder b, LocallyFiniteOrder c) => LocallyFiniteOrder (a, b, c) (LocallyFiniteOrder a, LocallyFiniteOrder b, LocallyFiniteOrder c, LocallyFiniteOrder d) => LocallyFiniteOrder (a, b, c, d) (LocallyFiniteOrder a, LocallyFiniteOrder b, LocallyFiniteOrder c, LocallyFiniteOrder d, LocallyFiniteOrder e) => LocallyFiniteOrder (a, b, c, d, e)

class Monoidal r => DecidableZero r Source

Minimal complete definition

isZero

Instances

 DecidableZero Bool DecidableZero Int DecidableZero Int8 DecidableZero Int16 DecidableZero Int32 DecidableZero Int64 DecidableZero Integer DecidableZero Word DecidableZero Word8 DecidableZero Word16 DecidableZero Word32 DecidableZero Word64 DecidableZero () DecidableZero Natural DecidableZero (BasisCoblade m) DecidableZero r => DecidableZero (Opposite r) Euclidean d => DecidableZero (Fraction d) (DecidableZero a, DecidableZero b) => DecidableZero (a, b) (DecidableZero a, DecidableZero b, DecidableZero c) => DecidableZero (a, b, c) (DecidableZero a, DecidableZero b, DecidableZero c, DecidableZero d) => DecidableZero (a, b, c, d) (DecidableZero a, DecidableZero b, DecidableZero c, DecidableZero d, DecidableZero e) => DecidableZero (a, b, c, d, e)

class Unital r => DecidableUnits r Source

Minimal complete definition

recipUnit

Instances

 DecidableUnits Bool DecidableUnits Int DecidableUnits Int8 DecidableUnits Int16 DecidableUnits Int32 DecidableUnits Int64 DecidableUnits Integer DecidableUnits Word DecidableUnits Word8 DecidableUnits Word16 DecidableUnits Word32 DecidableUnits Word64 DecidableUnits () DecidableUnits Natural DecidableUnits (BasisCoblade m) DecidableUnits r => DecidableUnits (Opposite r) Euclidean d => DecidableUnits (Fraction d) (DecidableUnits a, DecidableUnits b) => DecidableUnits (a, b) (DecidableUnits a, DecidableUnits b, DecidableUnits c) => DecidableUnits (a, b, c) (DecidableUnits a, DecidableUnits b, DecidableUnits c, DecidableUnits d) => DecidableUnits (a, b, c, d) (DecidableUnits a, DecidableUnits b, DecidableUnits c, DecidableUnits d, DecidableUnits e) => DecidableUnits (a, b, c, d, e)

class Unital r => DecidableAssociates r Source

Minimal complete definition

isAssociate

# Natural numbers

data Natural :: *

Type representing arbitrary-precision non-negative integers.

Operations whose result would be negative `throw (Underflow :: ArithException)`.

The `Natural` type has become part of `base` starting with `base-4.8.0.0`.

addRep :: (Applicative m, Additive r) => m r -> m r -> m r Source

sinnum1pRep :: (Functor m, Additive r) => Natural -> m r -> m r Source

`sinnum1p` default definition

# Representable Monoidal

zeroRep :: (Applicative m, Monoidal r) => m r Source

`zero` default definition

sinnumRep :: (Functor m, Monoidal r) => Natural -> m r -> m r Source

`sinnum` default definition

# Representable Group

negateRep :: (Functor m, Group r) => m r -> m r Source

`negate` default definition

minusRep :: (Applicative m, Group r) => m r -> m r -> m r Source

`Group.(-)` default definition

subtractRep :: (Applicative m, Group r) => m r -> m r -> m r Source

`subtract` default definition

timesRep :: (Integral n, Functor m, Group r) => n -> m r -> m r Source

`times` default definition

# Representable Multiplicative (via Algebra)

mulRep :: (Representable m, Algebra r (Rep m)) => m r -> m r -> m r Source

`Multiplicative.(*)` default definition

# Representable Unital (via UnitalAlgebra)

oneRep :: (Representable m, Unital r, UnitalAlgebra r (Rep m)) => m r Source

`one` default definition

# Representable Rig (via Algebra)

fromNaturalRep :: (UnitalAlgebra r (Rep m), Representable m, Rig r) => Natural -> m r Source

`fromNatural` default definition

# Representable Ring (via Algebra)

fromIntegerRep :: (UnitalAlgebra r (Rep m), Representable m, Ring r) => Integer -> m r Source

`fromInteger` default definition

# Norm

Methods

quadrance :: m -> r Source

Instances

# Covectors

newtype Covector r a Source

Linear functionals from elements of an (infinite) free module to a scalar

Constructors

 Covector Fields(\$*) :: (a -> r) -> r

Instances

 RightModule r s => RightModule r (Covector s m) LeftModule r s => LeftModule r (Covector s m) Monoidal r => Alternative (Covector r) Monad (Covector r) Functor (Covector r) Monoidal r => MonadPlus (Covector r) Applicative (Covector r) Monoidal r => Plus (Covector r) Additive r => Alt (Covector r) Apply (Covector r) Bind (Covector r) Idempotent r => Idempotent (Covector r a) Abelian s => Abelian (Covector s a) Additive r => Additive (Covector r a) Monoidal s => Monoidal (Covector s a) Coalgebra r m => Semiring (Covector r m) Coalgebra r m => Multiplicative (Covector r m) Group s => Group (Covector s a) CounitalCoalgebra r m => Unital (Covector r m) (Idempotent r, IdempotentCoalgebra r a) => Band (Covector r a) (Rig r, CounitalCoalgebra r m) => Rig (Covector r m) (Ring r, CounitalCoalgebra r m) => Ring (Covector r m) (Commutative m, Coalgebra r m) => Commutative (Covector r m) Distinguished a => Distinguished (Covector r a) Complicated a => Complicated (Covector r a) Hamiltonian a => Hamiltonian (Covector r a) Infinitesimal a => Infinitesimal (Covector r a) Hyperbolic a => Hyperbolic (Covector r a) Trigonometric a => Trigonometric (Covector r a) Coalgebra r m => RightModule (Covector r m) (Covector r m) Coalgebra r m => LeftModule (Covector r m) (Covector r m)

## Covectors as linear functionals

counitM :: UnitalAlgebra r a => a -> Covector r () Source

comultM :: Algebra r a => a -> Covector r (a, a) Source

multM :: Coalgebra r c => c -> c -> Covector r c Source

antipodeM :: HopfAlgebra r h => h -> Covector r h Source

convolveM antipodeM return = convolveM return antipodeM = comultM >=> uncurry joinM

convolveM :: (Algebra r c, Coalgebra r a) => (c -> Covector r a) -> (c -> Covector r a) -> c -> Covector r a Source