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

Safe Haskell | None
Language | Haskell98

Math.Algebra.NonCommutative.NCPoly

Description

A module providing a type for non-commutative polynomials.

Synopsis

- newtype Monomial v = M [v]
- divM :: Eq v => Monomial v -> Monomial v -> Maybe (Monomial v, Monomial v)
- newtype NPoly r v = NP [(Monomial v, r)]
- cmpTerm :: Ord a => (a, b1) -> (a, b2) -> Ordering
- mergeTerms :: (Ord a, Eq b, Num b) => [(a, b)] -> [(a, b)] -> [(a, b)]
- collect :: (Num a1, Eq a2, Eq a1) => [(a2, a1)] -> [(a2, a1)]
- data Var
  - = X
  - | Y
  - | Z
- var :: Num k => v -> NPoly k v
- x :: NPoly Q Var
- y :: NPoly Q Var
- z :: NPoly Q Var
- lm :: NPoly r v -> Monomial v
- lc :: NPoly r v -> r
- lt :: NPoly r v -> NPoly r v
- quotRemNP :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> ([(NPoly r v, NPoly r v)], NPoly r v)
- remNP :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v
- (%%) :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v
- remNP2 :: (Num r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v
- toMonic :: (Eq r, Ord v, Show v, Fractional r) => NPoly r v -> NPoly r v
- inject :: (Num r, Eq r, Eq v, Show v) => r -> NPoly r v
- subst :: (Num r1, Ord v1, Show v1, Eq r1, Eq v2, Eq r2, Show r2, Show v2, Num r2) => [(NPoly r2 v2, NPoly r1 v1)] -> NPoly r1 v2 -> NPoly r1 v1
- class Invertible a where
  - inv :: a -> a
- (^-) :: (Integral b, Invertible a, Num a) => a -> b -> a

# Documentation

newtype Monomial v Source #

Constructors

M [v] |

Instances

Eq v => Eq (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (==) :: Monomial v -> Monomial v -> Bool Source # (/=) :: Monomial v -> Monomial v -> Bool Source #
(Eq v, Show v) => Num (Monomial v) Source # |

Instance details

Defined in Math.Algebra.NonCommutative.NCPoly

Methods

(+) :: Monomial v -> Monomial v -> Monomial v Source #

(-) :: Monomial v -> Monomial v -> Monomial v Source #

(*) :: Monomial v -> Monomial v -> Monomial v Source #

negate :: Monomial v -> Monomial v Source #

abs :: Monomial v -> Monomial v Source #

signum :: Monomial v -> Monomial v Source #

fromInteger :: Integer -> Monomial v Source #

Ord v => Ord (Monomial v) Source # |

Instance details

Defined in Math.Algebra.NonCommutative.NCPoly

Methods

compare :: Monomial v -> Monomial v -> Ordering Source #

(<) :: Monomial v -> Monomial v -> Bool Source #

(<=) :: Monomial v -> Monomial v -> Bool Source #

(>) :: Monomial v -> Monomial v -> Bool Source #

(>=) :: Monomial v -> Monomial v -> Bool Source #

max :: Monomial v -> Monomial v -> Monomial v Source #

min :: Monomial v -> Monomial v -> Monomial v Source #

(Eq v, Show v) => Show (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods showsPrec :: Int -> Monomial v -> ShowS Source # show :: Monomial v -> String Source # showList :: [Monomial v] -> ShowS Source #

divM :: Eq v => Monomial v -> Monomial v -> Maybe (Monomial v, Monomial v) Source #

newtype NPoly r v Source #

Constructors

NP [(Monomial v, r)] |

Instances

(Eq v, Eq r) => Eq (NPoly r v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (==) :: NPoly r v -> NPoly r v -> Bool Source # (/=) :: NPoly r v -> NPoly r v -> Bool Source #
(Eq k, Fractional k, Ord v, Show v) => Fractional (NPoly k v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (/) :: NPoly k v -> NPoly k v -> NPoly k v Source # recip :: NPoly k v -> NPoly k v Source # fromRational :: Rational -> NPoly k v Source #
(Eq r, Num r, Ord v, Show v) => Num (NPoly r v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (+) :: NPoly r v -> NPoly r v -> NPoly r v Source # (-) :: NPoly r v -> NPoly r v -> NPoly r v Source # (*) :: NPoly r v -> NPoly r v -> NPoly r v Source # negate :: NPoly r v -> NPoly r v Source # abs :: NPoly r v -> NPoly r v Source # signum :: NPoly r v -> NPoly r v Source # fromInteger :: Integer -> NPoly r v Source #
(Ord r, Ord v) => Ord (NPoly r v) Source # |

Instance details

Defined in Math.Algebra.NonCommutative.NCPoly

Methods

compare :: NPoly r v -> NPoly r v -> Ordering Source #

(<) :: NPoly r v -> NPoly r v -> Bool Source #

(<=) :: NPoly r v -> NPoly r v -> Bool Source #

(>) :: NPoly r v -> NPoly r v -> Bool Source #

(>=) :: NPoly r v -> NPoly r v -> Bool Source #

max :: NPoly r v -> NPoly r v -> NPoly r v Source #

min :: NPoly r v -> NPoly r v -> NPoly r v Source #

(Show r, Eq v, Show v) => Show (NPoly r v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods showsPrec :: Int -> NPoly r v -> ShowS Source # show :: NPoly r v -> String Source # showList :: [NPoly r v] -> ShowS Source #
Invertible (NPoly LPQ BraidGens) Source # |
Instance details Defined in Math.Projects.KnotTheory.Braid Methods inv :: NPoly LPQ BraidGens -> NPoly LPQ BraidGens Source #
Invertible (NPoly LPQ IwahoriHeckeGens) Source # |
Instance details Defined in Math.Projects.KnotTheory.IwahoriHecke Methods inv :: NPoly LPQ IwahoriHeckeGens -> NPoly LPQ IwahoriHeckeGens Source #

cmpTerm :: Ord a => (a, b1) -> (a, b2) -> Ordering Source #

mergeTerms :: (Ord a, Eq b, Num b) => [(a, b)] -> [(a, b)] -> [(a, b)] Source #

collect :: (Num a1, Eq a2, Eq a1) => [(a2, a1)] -> [(a2, a1)] Source #

data Var Source #

Constructors

X |
Y |
Z |

Instances

Eq Var Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (==) :: Var -> Var -> Bool Source # (/=) :: Var -> Var -> Bool Source #
Ord Var Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods compare :: Var -> Var -> Ordering Source # (<) :: Var -> Var -> Bool Source # (<=) :: Var -> Var -> Bool Source # (>) :: Var -> Var -> Bool Source # (>=) :: Var -> Var -> Bool Source # max :: Var -> Var -> Var Source # min :: Var -> Var -> Var Source #
Show Var Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods showsPrec :: Int -> Var -> ShowS Source # show :: Var -> String Source # showList :: [Var] -> ShowS Source #

var :: Num k => v -> NPoly k v Source #

Create a non-commutative variable for use in forming non-commutative polynomials. For example, we could define x = var "x", y = var "y". Then x*y /= y*x.

x :: NPoly Q Var Source #

y :: NPoly Q Var Source #

z :: NPoly Q Var Source #

lm :: NPoly r v -> Monomial v Source #

lc :: NPoly r v -> r Source #

lt :: NPoly r v -> NPoly r v Source #

quotRemNP :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> ([(NPoly r v, NPoly r v)], NPoly r v) Source #

remNP :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v Source #

(%%) :: (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v infixl 7 Source #

remNP2 :: (Num r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v Source #

toMonic :: (Eq r, Ord v, Show v, Fractional r) => NPoly r v -> NPoly r v Source #

inject :: (Num r, Eq r, Eq v, Show v) => r -> NPoly r v Source #

subst :: (Num r1, Ord v1, Show v1, Eq r1, Eq v2, Eq r2, Show r2, Show v2, Num r2) => [(NPoly r2 v2, NPoly r1 v1)] -> NPoly r1 v2 -> NPoly r1 v1 Source #

class Invertible a where Source #

Methods

inv :: a -> a Source #

Instances

Invertible LPQ Source # |
Instance details Defined in Math.Projects.KnotTheory.Braid Methods inv :: LPQ -> LPQ Source #
Invertible (NPoly LPQ BraidGens) Source # |
Instance details Defined in Math.Projects.KnotTheory.Braid Methods inv :: NPoly LPQ BraidGens -> NPoly LPQ BraidGens Source #
Invertible (NPoly LPQ IwahoriHeckeGens) Source # |
Instance details Defined in Math.Projects.KnotTheory.IwahoriHecke Methods inv :: NPoly LPQ IwahoriHeckeGens -> NPoly LPQ IwahoriHeckeGens Source #

(^-) :: (Integral b, Invertible a, Num a) => a -> b -> a Source #