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

Safe Haskell | None
Language | Haskell98

Math.Algebras.Commutative

Description

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

Most users should probably use Math.CommutativeAlgebra.Polynomial instead, which is basically the same thing but more fully-featured. This module will probably be deprecated at some point, but remains for now because it has a simpler implementation which may be more helpful for people wanting to understand the code.

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 k b -> (b, k)
- class DivisionBasis b where
  - dividesB :: b -> b -> Bool
  - divB :: b -> b -> b
- dividesT :: DivisionBasis b1 => (b1, b2) -> (b1, b3) -> Bool
- divT :: (DivisionBasis a, Fractional b) => (a, b) -> (a, b) -> (a, b)
- quotRemMP :: forall b1 b2. (DivisionBasis b2, Fractional b1, Eq b1, Ord b2, Show b2, Algebra b1 b2) => Vect b1 b2 -> [Vect b1 b2] -> ([Vect b1 b2], Vect b1 b2)
- (%%) :: (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

Instances details

Monomial GlexMonomial Source # |
Instance details Defined in Math.Algebras.Commutative Methods var :: v -> Vect Q (GlexMonomial v) Source # powers :: GlexMonomial v -> [(v, Int)] Source #
(Eq k, Num k) => Coalgebra k (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods counit :: Vect k (GlexMonomial v) -> k Source # comult :: Vect k (GlexMonomial v) -> Vect k (Tensor (GlexMonomial v) (GlexMonomial v)) Source #
(Eq k, Num k, Ord v) => Algebra k (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods unit :: k -> Vect k (GlexMonomial v) Source # mult :: Vect k (Tensor (GlexMonomial v) (GlexMonomial v)) -> Vect k (GlexMonomial v) Source #
Eq v => Eq (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods (==) :: GlexMonomial v -> GlexMonomial v -> Bool (/=) :: GlexMonomial v -> GlexMonomial v -> Bool
Ord v => Ord (GlexMonomial v) Source # |

Instance details

Defined in Math.Algebras.Commutative

Methods

compare :: GlexMonomial v -> GlexMonomial v -> Ordering

(<) :: GlexMonomial v -> GlexMonomial v -> Bool

(<=) :: GlexMonomial v -> GlexMonomial v -> Bool

(>) :: GlexMonomial v -> GlexMonomial v -> Bool

(>=) :: GlexMonomial v -> GlexMonomial v -> Bool

max :: GlexMonomial v -> GlexMonomial v -> GlexMonomial v

min :: GlexMonomial v -> GlexMonomial v -> GlexMonomial v

Show v => Show (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods showsPrec :: Int -> GlexMonomial v -> ShowS show :: GlexMonomial v -> String showList :: [GlexMonomial v] -> ShowS
Ord v => DivisionBasis (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods dividesB :: GlexMonomial v -> GlexMonomial v -> Bool Source # divB :: GlexMonomial v -> GlexMonomial v -> GlexMonomial v Source #

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

glexVar :: Num k => v -> GlexPoly k v Source #

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

Instances details

Monomial GlexMonomial Source # |
Instance details Defined in Math.Algebras.Commutative Methods var :: v -> Vect Q (GlexMonomial v) Source # powers :: GlexMonomial v -> [(v, Int)] Source #
Monomial SL2 Source # |
Instance details Defined in Math.Algebras.AffinePlane Methods var :: v -> Vect Q (SL2 v) Source # powers :: SL2 v -> [(v, Int)] Source #

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 Source #

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 k b -> (b, k) Source #

class DivisionBasis b where Source #

Methods

dividesB :: b -> b -> Bool Source #

divB :: b -> b -> b Source #

#### Instances

Instances details

Ord v => DivisionBasis (GlexMonomial v) Source # |
Instance details Defined in Math.Algebras.Commutative Methods dividesB :: GlexMonomial v -> GlexMonomial v -> Bool Source # divB :: GlexMonomial v -> GlexMonomial v -> GlexMonomial v Source #

dividesT :: DivisionBasis b1 => (b1, b2) -> (b1, b3) -> Bool Source #

divT :: (DivisionBasis a, Fractional b) => (a, b) -> (a, b) -> (a, b) Source #

quotRemMP :: forall b1 b2. (DivisionBasis b2, Fractional b1, Eq b1, Ord b2, Show b2, Algebra b1 b2) => Vect b1 b2 -> [Vect b1 b2] -> ([Vect b1 b2], Vect b1 b2) Source #

(%%) :: (Eq k, Fractional k, Ord b, Show b, Algebra k b, DivisionBasis b) => Vect k b -> [Vect k b] -> Vect k b infixl 7 Source #

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