HaskellForMaths-0.4.5: Combinatorics, group theory, commutative algebra, non-commutative algebra

Safe Haskell | None

Math.Algebras.Commutative

Description

A module defining the algebra of commutative polynomials over a field k

Synopsis

- data GlexMonomial v = Glex Int [(v, Int)]
- type GlexPoly k v = Vect k (GlexMonomial v)
- glexVar :: Num k => v -> GlexPoly k v
- class Monomial m where
  - var :: v -> Vect Q (m v)
  - powers :: m v -> [(v, Int)]
- bind :: (Monomial m, Eq k, Num k, Ord b, Show b, Algebra k b) => Vect k (m v) -> (v -> Vect k b) -> Vect k b
- lt :: Vect t t1 -> (t1, t)
- class DivisionBasis b where
  - dividesB :: b -> b -> Bool
  - divB :: b -> b -> b
- dividesT :: DivisionBasis b => (b, t) -> (b, t1) -> Bool
- divT :: (Fractional t1, DivisionBasis t) => (t, t1) -> (t, t1) -> (t, t1)
- quotRemMP :: (Eq t, Fractional t, Ord b, Show b, Algebra t b, DivisionBasis b) => Vect t b -> [Vect t b] -> ([Vect t b], Vect t b)
- (%%) :: (Eq k, Fractional k, Ord b, Show b, Algebra k b, DivisionBasis b) => Vect k b -> [Vect k b] -> Vect k b

# Documentation

data GlexMonomial v Source

Constructors

Glex Int [(v, Int)] |

Instances

Monomial GlexMonomial |
(Eq k, Num k) => Coalgebra k (GlexMonomial v) |
(Eq k, Num k, Ord v) => Algebra k (GlexMonomial v) |
Eq v => Eq (GlexMonomial v) |
Ord v => Ord (GlexMonomial v) |
Show v => Show (GlexMonomial v) |
Ord v => DivisionBasis (GlexMonomial v) |

type GlexPoly k v = Vect k (GlexMonomial v)Source

glexVar :: Num k => v -> GlexPoly k vSource

glexVar creates a variable in the algebra of commutative polynomials with Glex term ordering. For example, the following code creates variables called x, y and z:

     [x,y,z] = map glexVar ["x","y","z"] :: GlexPoly Q String

class Monomial m where Source

Methods

var :: v -> Vect Q (m v)Source

powers :: m v -> [(v, Int)]Source

Instances

Monomial GlexMonomial |
Monomial SL2 |

bind :: (Monomial m, Eq k, Num k, Ord b, Show b, Algebra k b) => Vect k (m v) -> (v -> Vect k b) -> Vect k bSource

In effect, we have (Num k, Monomial m) => Monad (v -> Vect k (m v)), with return = var, and (>>=) = bind. However, we can't express this directly in Haskell, firstly because of the Ord b constraint, secondly because Haskell doesn't support type functions.

lt :: Vect t t1 -> (t1, t)Source

class DivisionBasis b where Source

Methods

dividesB :: b -> b -> Bool Source

divB :: b -> b -> bSource

Instances

Ord v => DivisionBasis (GlexMonomial v) |

dividesT :: DivisionBasis b => (b, t) -> (b, t1) -> Bool Source

divT :: (Fractional t1, DivisionBasis t) => (t, t1) -> (t, t1) -> (t, t1)Source

quotRemMP :: (Eq t, Fractional t, Ord b, Show b, Algebra t b, DivisionBasis b) => Vect t b -> [Vect t b] -> ([Vect t b], Vect t b)Source

(%%) :: (Eq k, Fractional k, Ord b, Show b, Algebra k b, DivisionBasis b) => Vect k b -> [Vect k b] -> Vect k bSource

(%%) reduces a polynomial with respect to a list of polynomials.