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 :: forall v r. (Fractional r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> ([(NPoly r v, NPoly r v)], NPoly r v)
- remNP :: forall v r. (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 :: forall v r. (Num r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v
- toMonic :: forall v r. (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

Instances details

Eq v => Eq (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (==) :: Monomial v -> Monomial v -> Bool (/=) :: Monomial v -> Monomial v -> Bool
(Eq v, Show v) => Num (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods (+) :: Monomial v -> Monomial v -> Monomial v (-) :: Monomial v -> Monomial v -> Monomial v (*) :: Monomial v -> Monomial v -> Monomial v negate :: Monomial v -> Monomial v abs :: Monomial v -> Monomial v signum :: Monomial v -> Monomial v fromInteger :: Integer -> Monomial v
Ord v => Ord (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods compare :: Monomial v -> Monomial v -> Ordering (<) :: Monomial v -> Monomial v -> Bool (<=) :: Monomial v -> Monomial v -> Bool (>) :: Monomial v -> Monomial v -> Bool (>=) :: Monomial v -> Monomial v -> Bool max :: Monomial v -> Monomial v -> Monomial v min :: Monomial v -> Monomial v -> Monomial v
(Eq v, Show v) => Show (Monomial v) Source # |
Instance details Defined in Math.Algebra.NonCommutative.NCPoly Methods showsPrec :: Int -> Monomial v -> ShowS show :: Monomial v -> String showList :: [Monomial v] -> ShowS

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

newtype NPoly r v Source #

Constructors

NP [(Monomial v, r)] |

#### Instances

Instances details

(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 (/=) :: NPoly r v -> NPoly r v -> Bool
(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 recip :: NPoly k v -> NPoly k v fromRational :: Rational -> NPoly k v
(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 (-) :: NPoly r v -> NPoly r v -> NPoly r v (*) :: NPoly r v -> NPoly r v -> NPoly r v negate :: NPoly r v -> NPoly r v abs :: NPoly r v -> NPoly r v signum :: NPoly r v -> NPoly r v fromInteger :: Integer -> NPoly r v
(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 (<) :: NPoly r v -> NPoly r v -> Bool (<=) :: NPoly r v -> NPoly r v -> Bool (>) :: NPoly r v -> NPoly r v -> Bool (>=) :: NPoly r v -> NPoly r v -> Bool max :: NPoly r v -> NPoly r v -> NPoly r v min :: NPoly r v -> NPoly r v -> NPoly r v
(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 show :: NPoly r v -> String showList :: [NPoly r v] -> ShowS
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

Instances details

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

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 :: forall v r. (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 :: forall v r. (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 :: forall v r. (Num r, Ord v, Show v, Eq r) => NPoly r v -> [NPoly r v] -> NPoly r v Source #

toMonic :: forall v r. (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

Instances details

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 #