Module

Data.Algebraic.NumberField

Package
purescript-numberfield
Repository
Ebmtranceboy/purescript-numberfield

#Cycle Source

newtype Cycle

Constructors

Instances

#Expression Source

type Expression :: forall k. k -> Type -> Typetype Expression f a = Reflectable f (Framework a) => Proxy f -> Extension (Proxy f) (Framework a)

#Framework Source

newtype Framework a

Constructors

Instances

#Permutation Source

#abelize Source

abelize :: Permutation -> Permutation

Transforms a permutation into a product of disjoint cycles

#bell Source

bell :: Int -> Int

bell 5 = 1+5+10+10+15+10+1 for 5 = 5 : {{a,b,c,d,e}} = 4 + 1 : {{a,b,c,d},{e}},{{a,b,c,e},{d}},{{a,b,d,e},{c}},{{a,c,d,e},{b}},{{b,c,d,e},{a}} = 3 + 2 : {{a,b,c},{d,e}},{{a,b,d},{c,e}},{{a,c,d},{b,e}},{{b,c,d},{a,e}},{{a,b,e},{c,d}} ,{{a,c,e},{b,d}},{{a,d,e},{b,c}},{{b,c,e},{a,d}},{{c,d,e},{a,b}},{{b,d,e},{a,c}} = 3 + 1 + 1 : {{a,b,c},{d},{e}},{{a,b,d},{c},{e}} ,{{a,c,d},{b},{e}},{{b,c,d},{a},{e}} ,{{a,b,e},{c},{d}},{{a,c,e},{b},{d}} ,{{a,d,e},{b},{c}},{{b,c,e},{a},{d}} ,{{c,d,e},{a},{b}},{{b,d,e},{a},{c}} ,a+aa,a+aa,aa+a,aa+a,aaa+* = 2 + 2 + 1 : ++a,++a,++a,+a+,a++ ,++a,++a,+a+,+a+,a++ ,++a,+a+,+a+,+a+,a++ = 2 + 1 + 1 + 1 : {{a},{b},{c},{d,e}},{{a},{b},{d},{c,e}} ,{{a},{c},{d},{b,e}},{{b},{c},{d},{a,e}} ,{{a},{b},{e},{c,d}},{{a},{c},{e},{b,d}} ,{{a},{d},{e},{b,c}},{{b},{c},{e},{a,d}} ,{{c},{d},{e},{a,b}},{{b},{d},{e},{a,c}} = 1 + 1 + 1 + 1 + 1 : {{a},{b},{c},{d},{e}}

#build Source

build :: forall proxy a f. (proxy -> Extension f a) -> proxy -> a

#cardinality Source

cardinality :: Array Int -> Int -> Int

Returns the number of permutations of whole elements satisfying the provided type given by an array of cycle lengths. For instance cardinality [2,2] 5 = cardinality [2,2,1] 5 = 15 for all permutations of type (ab)(cd)(e).

#cardinality' Source

#cayley Source

cayley :: forall a. Divisible a => Eq a => EuclideanRing a => Leadable a => Peel a a => Polynomial a -> Polynomial a -> Polynomial a

Computes the reciprocal of the second polynomial with the help of the previously computed https://en.wikipedia.org/wiki/Resultant between that polynomial and the minimal polynomial of the extension

#cycle Source

cycle :: Cycle -> Array Int -> Array Int

Where do elements land after a cycle

#cyclotomic Source

cyclotomic :: forall a. Eq a => Ring a => Divisible a => Leadable a => CommutativeRing a => Int -> Polynomial a

cyclotomic n returns the (irreductible) univariate minimal polynomial of degree totient n whose roots are all the totient n primitive roots of unity

#destination Source

destination :: Cycle -> Int -> Int

Where does an element land after a cycle

#discriminant Source

discriminant :: forall a. Eq a => Semiring a => Ring a => EuclideanRing a => Ord a => Divisible a => Leadable a => IntLiftable a => Polynomial a -> a

Discriminant of a univariate polynomial

#element Source

element :: forall f a. Eq a => Semiring a => a -> Extension f (Framework a)

#extensionBySum Source

extensionBySum :: forall a. CommutativeRing a => Divisible a => Eq a => Leadable a => Ord a => Ring a => Array (Polynomial a) -> Polynomial a

Builds the minimal polynomial whose root(s) is (are) the sum of the roots of each of the polynomials listed in the array

#factorial Source

#filterM Source

filterM :: forall a. Ord a => (a -> Set Boolean) -> Set a -> Set (Set a)

#framework Source

framework :: forall r a n1 n2 n3. Add n3 1 n2 => Add n2 1 n1 => Arity (Polynomial (Polynomial a)) n1 => Axed a r => CommutativeRing a => CommutativeRing r => Divisible a => Divisible r => DivisionRing r => Full n2 (Polynomial a) => GoSwap 0 n1 (Polynomial a) => Leadable a => Leadable r => Nest n2 (Polynomial a) => Ord a => Ord r => Pad n3 (Polynomial r) (Polynomial (Polynomial a)) => Pad n2 (Polynomial r) (Polynomial (Polynomial (Polynomial a))) => Peel a r => Set n2 r (Polynomial a) => Unpad n3 (Polynomial r) (Polynomial (Polynomial a)) => Polynomial a -> Array (Polynomial r) -> Framework (Polynomial a)

Computes the required quantities needed to perform computations with algebraic extensions in the field of rational numbers

#generate Source

generate :: Set Permutation -> Set Permutation

Returns the set of elements generated by an set of permutations. Assumes set of products of disjoint cycles.

#insycleR Source

insycleR :: forall a. Eq a => a -> Array a -> Array (Array a)

Construit la liste des listes obtenues successivement par insertion de l'élément fourni après chacun des éléments de la liste fournie et ce tant que l'élément en question n'est pas rencontré (fonction auxiliaire de permutationsR) :

#isGroup Source

isGroup :: Set Permutation -> Boolean

Tests if the set of given elements is closed under group operation

#isGroupType Source

isGroupType :: Set (Array Int) -> Int -> Boolean

Tests if the set of elements of given types is closed under group operation

#makeBells Source

makeBells :: forall a. Array a -> Array (Array (Array (NonEmptyArray a)))

Partitions d'un ensemble en sous-ensembles :

#makePartitions Source

#minimalPolynomial Source

#nextRepresentation Source

nextRepresentation :: Array Int -> Array Int

Circular permutation of a cycle

#normalSubgroupTypes Source

#normalize Source

normalize :: forall f a n n1. Add n1 1 n => Arity (Polynomial (Polynomial a)) n => Divisible a => Eq a => EuclideanRing a => Full n1 (Polynomial a) => Leadable a => Reflectable f (Framework (Polynomial a)) => Polynomial a -> Extension (Proxy f) (Framework (Polynomial a))

#order Source

order :: Permutation -> Int

Returns 1 if p = id, or k>1 s.t. p^(k-1) /= id and p^k = id
Assumes product disjoint cycles

#partitions Source

#peek Source

peek :: (Int -> Int) -> Int -> Array Int -> Int

Safe (defaulted) index

#permutationsR Source

permutationsR :: forall f a. Foldable f => Eq a => f a -> Array (Array a)

Etablit la liste complète des permutations distinctes d'une liste même en cas d'éléments redondants :

#permute Source

permute :: Permutation -> Array Int -> Array Int

Where do elements land after a permutation

#play Source

play :: Array Int -> Array Int -> Array Cycle

Deduces the disjoint cycles between a base and one of its permutations

#ptype Source

ptype :: Permutation -> Array Int

Returns the type of a permutation, i.e. the list of orders of one of its expected representation as a product of disjoint cycles. This type is notably the characteritic shared by every conjuate of the permutation, in other words, the set of permutations sharing the same type

#ramanujanTau Source

#reciprocal Source

reciprocal :: forall n n1 n2 a r. Add n2 1 n1 => Add n1 1 n => Arity a n => Divisible r => Eq r => EuclideanRing r => Leadable r => Ord r => Pad n2 (Polynomial r) a => Peel r r => Unpad n2 (Polynomial r) a => a -> a -> a

Computes the reciprocal of the first polynomial in the extension whose minimal polynomial is provided by the second polynomial

#run Source

run :: forall a. Framework (Polynomial a) -> Polynomial a

#stirling1 Source

stirling1 :: Int -> Int -> Int

Returns the number of permutations compound of products of exactly k disjoint cycles over n elements. For instance, stirling1 5 3 = 35 for

  • 20 for cardinality of type (abc)(d)(e) and
  • 15 for cardinality of type (ab)(cd)(e)

#subsets Source

subsets :: forall a. Ord a => Set a -> Set (Set a)

#sumDivisors Source

#sylvester Source

sylvester :: forall a. CommutativeRing a => Divisible a => Eq a => Leadable a => Polynomial a -> Polynomial a -> Matrix a

Builds the https://en.wikipedia.org/wiki/Sylvester_matrix of two univariate polynomials with coefficients in a commutative ring

#symmetric Source

symmetric :: Int -> Array Permutation

Presentation of the Symmetric Group of order n as an array of product of disjoint cycles.

#toPrimitive Source

toPrimitive :: forall a. Framework a -> Array (Polynomial a)

#totient Source

totient :: Int -> Int

Euler Totient Function