algebra-0.8.0: Constructive abstract algebra

Numeric.Algebra.Class

Contents

Synopsis

Multiplicative Semigroups

class Multiplicative r whereSource

A multiplicative semigroup

Methods

(*) :: r -> r -> rSource

pow1p :: Whole n => r -> n -> rSource

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

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) 
(Commutative k, Rng k) => Multiplicative (Trig k) 
Multiplicative (BasisCoblade m) 
(TriviallyInvolutive r, Semiring r) => Multiplicative (Quaternion' r) 
Additive r => Multiplicative (Exp r) 
Monoidal r => Multiplicative (ZeroRng r) 
Rng r => Multiplicative (RngRing r) 
Multiplicative r => Multiplicative (Opposite r) 
Multiplicative (End r) 
Algebra r a => Multiplicative (a -> r) 
(Multiplicative a, Multiplicative b) => Multiplicative (a, b) 
(HasTrie a, Algebra r a) => Multiplicative (:->: a r) 
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) 

pow1pIntegral :: (Integral r, Integral n) => r -> n -> rSource

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.

Left and Right Modules

class (Semiring r, Additive m) => LeftModule r m whereSource

Methods

(.*) :: r -> m -> mSource

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) 
Group r => LeftModule Integer (ZeroRng r) 
(Abelian r, Group r) => LeftModule Integer (RngRing r) 
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 (Trig s) 
LeftModule r s => LeftModule r (Quaternion' s) 
RightModule r s => LeftModule r (Opposite s) 
LeftModule r m => LeftModule r (End m) 
LeftModule Natural (BasisCoblade m) 
Unital r => LeftModule Natural (Log r) 
Monoidal r => LeftModule Natural (ZeroRng r) 
(Abelian r, Monoidal r) => LeftModule Natural (RngRing r) 
(LeftModule r a, LeftModule r b) => LeftModule r (a, b) 
(HasTrie e, LeftModule r m) => LeftModule r (:->: e m) 
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) 
(Commutative r, Rng r) => LeftModule (Trig r) (Trig r) 
(TriviallyInvolutive r, Rng r) => LeftModule (Quaternion' r) (Quaternion' r) 
Rng s => LeftModule (RngRing s) (RngRing s) 
Semiring r => LeftModule (Opposite r) (Opposite r) 
(Monoidal m, Abelian m) => LeftModule (End m) (End m) 
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 whereSource

Methods

(*.) :: m -> r -> mSource

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) 
Group r => RightModule Integer (ZeroRng r) 
(Abelian r, Group r) => RightModule Integer (RngRing r) 
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 (Trig s) 
RightModule r s => RightModule r (Quaternion' s) 
LeftModule r s => RightModule r (Opposite s) 
RightModule r m => RightModule r (End m) 
RightModule Natural (BasisCoblade m) 
Unital r => RightModule Natural (Log r) 
Monoidal r => RightModule Natural (ZeroRng r) 
(Abelian r, Monoidal r) => RightModule Natural (RngRing r) 
(RightModule r a, RightModule r b) => RightModule r (a, b) 
(HasTrie e, RightModule r m) => RightModule r (:->: e m) 
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) 
(Commutative r, Rng r) => RightModule (Trig r) (Trig r) 
(TriviallyInvolutive r, Rng r) => RightModule (Quaternion' r) (Quaternion' r) 
Rng s => RightModule (RngRing s) (RngRing s) 
Semiring r => RightModule (Opposite r) (Opposite r) 
(Monoidal m, Abelian m) => RightModule (End m) (End m) 
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 

Additive Monoids

class (LeftModule Natural m, RightModule Natural m) => Monoidal m whereSource

An additive monoid

 zero + a = a = a + zero

Methods

zero :: mSource

replicate :: Whole n => n -> m -> mSource

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

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

Associative algebras

class Semiring r => Algebra r a whereSource

An associative algebra built with a free module over a semiring

Methods

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

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' 
(Commutative k, Rng k) => Algebra k TrigBasis 
(TriviallyInvolutive r, Semiring r) => Algebra r QuaternionBasis'

the trivial diagonal algebra

(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) 

Coassociative coalgebras

class Semiring r => Coalgebra r c whereSource

Methods

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

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' 
(Commutative k, Rng k) => Coalgebra k TrigBasis 
(TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis'

dual quaternion comultiplication

(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) 
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) 
(HasTrie m, Algebra r m) => Coalgebra r (:->: m r) 
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)