.p4      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y!z!{!|!}!~!!!!!!!!!!!!!!!!!!!!!!!!!!!""""""""""""""""""""""""""""""################################################################################## # # # # ##$$$$$$$$$$$$$$$$$ $!$"$#$$$%$&$'$($)%*%+%,%-%.%/%0%1%2%3%4%5&6&7&8&9&:&;&<&=&>&?&@&A&B&C&D&E&F&G'H'I'J'K'L'M'N'O'P'Q'R'S'T'U'V'W'X'Y'Z'['\']'^'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'u'v'w'x'y'z'{'|'}'~''''''''''''''''(((((((((((()))))))))))))))))))****************************++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------................ . . . . ................... .!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8/9/:/;/</=/>/?/@/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~0000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1 1 1 1 1111111111111111111 2!2"2#2$2%2&2'2(2)2*2+2,2-2.2/202122232425262728292:2;2<3=3>3?3@3A3B3C3D3E3F3G3H3I3J3K3L3M3N3O3P3Q3R3S3T3U3V3W3X3Y3Z3[3\3]3^3_3`3a3b3c4d4e4f4g4h4i4j4k4l4m4n4o4p4q5r5s5t5u5v5w5x5y5z5{5|5}5~5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555556 6 6 6 6 6666666666677777777 7!7"7#7$7%7&7'7(7)7*7+7,7-7.7/707172737475767778797:7;8<8=8>8?8@8A8B8C8D8E8F8G8H8I8J8K9L9M9N9O9P9Q9R9S9T9U9V9W9X9Y9Z9[9\9]9^9_9`9a9b9c9d9e9f9g9h9i9j9k9l9m9n9o9p9q9r9s9t9u9v9w9x9y9z9{9|9}9~999999999:::::::::::::::::::::::::::::::::::::::::: Safe-Inferred6<=KG  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF1  !"#$%&'()*+,-./0G   FD)E*C+B@'A(?,->=;%<&./:9875#6$423"! 10 +,-./014 23"! 75#6$89:=;%<&>?B@'A(CFD)E*NoneHA (lazy) list of the primesJIs this number prime? The algorithm consists of using trial division to test for very small factors, followed if necessary by the Miller-Rabin probabilistic test.L Given n,  prevPrime n4 returns the greatest p, p < n, such that p is primeM Given n,  nextPrime n1 returns the least p, p > n, such that p is prime GHIJKLMGHIJKLMHGIJKLM GHIJKLM Safe-InferredNGiven a finite vector space basis b, Dual b can be used to represent a basis for the dual vector space. The intention is that for a given individual basis element b_i, (Dual b_i) represents the indicator function for b_i, which takes b_i to 1 and all other basis elements to 0.l(Note that if the basis b is infinite, then Dual b may only represent a sub-basis of the dual vector space.)PTrivial k is the field k considered as a k-vector space. In maths, we would not normally make a distinction here, but in the code, we need this if we want to be able to put k as one side of a tensor product.SGiven a field type k and a basis type b, Vect k b is the type of the free k-vector space over b. Elements (values) of Vect k b consist of k-linear combinations of elements (values) of b.<In order for Vect k b to be a vector space, it is necessary that k is a field (that is, an instance of Fractional). In practice, we often relax this condition, and require that k is a ring (that is, an instance of Num). In that case, Vect k b should more correctly be called (the type of) the free k-module over b.tMost of the code requires that b is an instance of Ord. This is primarily to enable us to simplify to a normal form.VAReturn the coefficient of the specified basis element in a vectorW;Remove the term for a specified basis element from a vectorXThe zero vectorYAddition of vectorsZ!Addition of vectors (same as add)\Sum of a list of vectors]Negation of a vector^Subtraction of vectors_#Scalar multiplication (on the left)`>Same as smultL. Mnemonic is "multiply through (from the left)"a"Scalar multiplication on the rightb?Same as smultR. Mnemonic is "multiply through (from the right)"cConvert an element of Vect k b into normal form. Normal form consists in having the basis elements in ascending order, with no duplicates, and all coefficients non-zerodA linear map between vector spaces A and B can be defined by giving its action on the basis elements of A. The action on all elements of A then follows by linearity.wIf we have A = Vect k a, B = Vect k b, and f :: a -> Vect k b is a function from the basis elements of A into B, then linear f2 is the linear map that this defines by linearity.iJWrap an element of the field k to an element of the trivial k-vector spacejLUnwrap an element of the trivial k-vector space to an element of the field kw[Given a field k, the type constructor (Vect k) is a monad, the "free k-vector space monad".In order to understand this, it is probably easiest to think of a free k-vector space as a kind of container, a bit like a list, except that order doesn't matter, and you're allowed arbitrary (even negative or fractional) quantities of the basis elements in the container.vAccording to this way of thinking, return is the function that puts a basis element into the vector space (container).Given a function f from the basis of one vector space to another vector space (a -> Vect k b), bind (>>=) lifts it to a function (>>= f) from the first vector space to the second (Vect k a -> Vect k b).Note that in general (>>= f) applied to a vector will not return a result in normal form, so it is usually preferable to use (linear f) instead.yJGiven a field k, (Vect k) is a functor, the "free k-vector space" functor.QIn the mathematical sense, this can be regarded as a functor from the category Set (of sets) to the category k-Vect (of k-vector spaces). In Haskell, instead of Set we have Hask, the category of Haskell types. However, for our purposes it is helpful to identify Hask with Set, by identifying a Haskell type with its set of inhabitants.The type constructor (Vect k) gives the action of the functor on objects in the category, taking a set (type) to a free k-vector space. fmap gives the action of the functor on arrows in the category, taking a function between sets (types) to a linear map between vector spaces.Note that if f is not order-preserving, then (fmap f) is not guaranteed to return results in normal form, so it may be preferable to use (nf . fmap f).-NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz'NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst-STzUVWXYZ[\]^_`abcyxwdQRvefghPijNOuklmnopqrst*NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzZ^`bpq Safe-Inferred {A type for constructing a basis for the tensor product of vector spaces. The tensor product of Vect k a and Vect k b is Vect k (Tensor a b)|A type for constructing a basis for the direct sum of vector spaces. The direct sum of Vect k a and Vect k b is Vect k (DSum a b)})Injection of left summand into direct sum~*Injection of right summand into direct sumThe coproduct of two linear functions (with the same target). Satisfies the universal property that f == coprodf f g . i1 and g == coprodf f g . i2,Projection onto left summand from direct sum-Projection onto right summand from direct sumThe product of two linear functions (with the same source). Satisfies the universal property that f == p1 . prodf f g and g == p2 . prodf f g+The direct sum of two vector space elementsThe direct sum of two linear functions. Satisfies the universal property that f == p1 . dsumf f g . i1 and g == p2 . dsumf f g . i2/The tensor product of two vector space elements*The tensor product of two linear functions{|}~{|}~|}~{{|}~ Safe-Inferred246 A pairing is a non-degenerate bilinear form U x V -> k. We are typically interested in pairings having additional properties. For example:A bialgebra pairing is a pairing between bialgebras A and B such that the mult in A is adjoint to the comult in B, and vice versa, and the unit in A is adjoint to the counit in B, and vice versa.sA Hopf pairing is a bialgebra pairing between Hopf algebras A and B such that the antipodes in A and B are adjoint.A bialgebra is an algebra which is also a coalgebra, subject to the compatibility conditions that counit and comult must be algebra morphisms (or equivalently, that unit and mult must be coalgebra morphisms)dAn instance declaration for Coalgebra k b is saying that the vector space Vect k b is a k-coalgebra.Caution: If we declare an instance Algebra k b, then we are saying that the vector space Vect k b is a k-algebra. In other words, we are saying that b is the basis for a k-algebra. So a more accurate name for this class would have been AlgebraBasis.MonoidBSometimes it is more convenient to work with this version of unit.DSometimes it is more convenient to work with this version of counit.:The pairing function with a more Haskellish type signatureUThe tensor product of k-coalgebras can itself be given the structure of a k-coalgebraQThe tensor product of k-algebras can itself be given the structure of a k-algebraThe direct sum of k-coalgebras can itself be given the structure of a k-coalgebra. This is the coproduct object in the category of k-coalgebras.The direct sum of k-algebras can itself be given the structure of a k-algebra. This is the product object in the category of k-algebras.++ Safe-InferredGiven a list of rewrite rules of the form (left,right), and a word, rewrite it by repeatedly replacing any left substring in the word by the corresponding right Implementation of the Knuth-Bendix algorithm. Given a list of relations, return a confluent rewrite system. The algorithm is not guaranteed to terminate. WGiven generators and a confluent rewrite system, return (normal forms of) all elements FGiven generators and relations, return (normal forms of) all elements  Safe-Inferred Safe-InferredEA class representing algebraic structures having an inverse operation. Note that in some cases not every element has an inverse.The class of finite setsThe set union of two ascending lists. If both inputs are strictly increasing, then the output is their union and is strictly increasing. The code does not check that the lists are strictly increasing.$The (multi-)set intersection of two ascending lists. If both inputs are strictly increasing, then the output is the set intersection and is strictly increasing. If both inputs are weakly increasing, then the output is the multiset intersection (with multiplicity), and is weakly increasing.The multiset sum of two ascending lists. If xs and ys are ascending, then multisetSumAsc xs ys == sort (xs++ys). The code does not check that the lists are ascending.The multiset sum of two descending lists. If xs and ys are descending, then multisetSumDesc xs ys == sortDesc (xs++ys). The code does not check that the lists are descending.-The multiset or set difference between two ascending lists. If xs and ys are ascending, then diffAsc xs ys == xs \ ys, and diffAsc is more efficient. If xs and ys are sets (that is, have no repetitions), then diffAsc xs ys is the set difference. The code does not check that the lists are ascending.3The multiset or set difference between two descending lists. If xs and ys are descending, then diffDesc xs ys == xs \ ys, and diffDesc is more efficient. If xs and ys are sets (that is, have no repetitions), then diffDesc xs ys is the set difference. The code does not check that the lists are descending.%Is the element in the ascending list?KWith infinite lists, this can fail to terminate. For example, elemAsc 1 [12,3_4,7/8..] would fail to terminate. However, with a list of Integer, this will always terminate.\Is the element not in the ascending list? (With infinite lists, this can fail to terminate.)BReturn all the ways to "pick one and leave the others" from a list Given a set xs", represented as an ordered list, powersetdfs xs4 returns the list of all subsets of xs, in lex order Given a set xs", represented as an ordered list, powersetbfs xs9 returns the list of all subsets of xs, in shortlex orderGiven a positive integer k , and a set xs, represented as a list, combinationsOf k xsh returns all k-element subsets of xs. The result will be in lex order, relative to the order of the xs. choose n kD is the number of ways of choosing k distinct elements from an n-set&A trick: x^-1 returns the inverse of x"""   Safe-InferredVA digraph is represented as DG vs es, where vs is the list of vertices, and es is the list of edges. Edges are directed: an edge (u,v) means an edge from u to v. A digraph is considered to be in normal form if both es and vs are in ascending order. This is the preferred form, and some functions will only work for digraphs in normal form.Are the two DAGs isomorphic?dGiven a directed acyclic graph (DAG), return a canonical representative for its isomorphism class.  isoRepDAG dag is isomorphic to dag. It follows that if  isoRepDAG dagA == isoRepDAG dagB then dagA is isomorphic to dagB. Conversely,  isoRepDAG dagc is the minimal element in the isomorphism class, subject to some constraints. It follows that if dagA is isomorphic to dagB, then  isoRepDAG dagA == isoRepDAG dagB.The algorithm of course is faster on some DAGs than others: roughly speaking, it prefers "tall" DAGs (long chains) to "wide" DAGs (long antichains), and it prefers asymmetric DAGs (ie those with smaller automorphism groups).                     NoneYList the prime factors of n (with multiplicity). For example: >>> pfactors 60 [2,2,3,5]!This says that 60 = 2 * 2 * 3 * 55The algorithm uses trial division to find small factors, followed if necessary by the elliptic curve method to find larger factors. The running time increases with the size of the second largest prime factor of n. It can find 10-digit prime factors in seconds, but can struggle with 20-digit prime factors.VList the prime power factors of n. For example: >>> ppfactors 60 [(2,2),(3,1),(5,1)]#This says that 60 = 2^2 * 3^1 * 5^14Find the prime factors of all numbers up to n. Thus  pfactorsTo n is equivalent to [(m, pfactors m) | m <- [1..n]], except that the results are not returned in order. For example: >>> pfactorsTo 10 [(8,[2,2,2]),(4,[2,2]),(6,[3,2]),(10,[5,2]),(2,[2]),(9,[3,3]),(3,[3]),(5,[5]),(7,[7]),(1,[])] pfactorsTo n is significantly faster than map pfactors [1..n] for larger n.:Find the prime power factors of all numbers up to n. Thus  ppfactorsTo n is equivalent to  [(m, ppfactors m) | m <- [1..n]], except that the results are not returned in order. For example: >>> ppfactorsTo 10 [(8,[(2,3)]),(4,[(2,2)]),(6,[(3,1),(2,1)]),(10,[(5,1),(2,1)]),(2,[(2,1)]),(9,[(3,2)]),(3,[(3,1)]),(5,[(5,1)]),(7,[(7,1)]),(1,[])] ppfactorsTo n is significantly faster than map ppfactors [1..n] for larger n. GHIJKLM  Safe-Inferred<M= !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV  !"#$%&'()*+,-./0123456789=8967V5U4T3S2R1Q0P/O.N-M,L+K*J)I(H'G&F%E$D#C"B!A @?>=<;:; !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV NoneBM l2F7 is a type for the finite field with 7 elements m2F5 is a type for the finite field with 5 elements n2F3 is a type for the finite field with 3 elements o2F2 is a type for the finite field with 2 elements uRQ is just the rationals, but with a better show function than the Prelude version }f2 lists the elements of F2 ~f3 lists the elements of F3 f5 lists the elements of F5 f7 lists the elements of F7 EWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~?WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Euvwxystpqrz{|o}n~mlkjihgfedcba`_^]\[ZYXWAWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None246<MUFUQNoneCreate 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. %          %          None    None$ !"#$%&'()*+,-./0123456789:;<=>?@AB" !"#$%&'()*+,-./0123456789:;<=>?@$"#B$%&'()*+,-./0123! A456789:;<=>?@!! "#$%&'()*+,-./0123456789:;<=>?@ABNone246LglexVar 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: 8[x,y,z] = map glexVar ["x","y","z"] :: GlexPoly Q StringMIn 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.R@(%%) reduces a polynomial with respect to a list of polynomials.CDEFGHIJKLMNOPQRSTUVWXCDEFGHIJKLMNOPQRJKXWVUILFGHMTNCDEOPQRSCDEFGHIJKLMNOPQRSTUVWXRNone2346YZ[\]^_`abcdefghijklmnopqYZ[\]^_`abcdefghi`baqcd[_^]\pehgfYZonimlkjYZ[_^]\`bacdefghijklmnopqNone246 rstuvwxyz{rstuvw st{zyruxvw rstuvwxyz{None246 |}~ |}~ ~|} |}~None246None246 A data type representing basis elements of the exterior algebra over a set/type. The exterior algebra is the quotient of the tensor algebra by the ideal generated by all self-products u"u and sums of products u"v + v"uA data type representing basis elements of the symmetric algebra over a set/type. The symmetric algebra is the quotient of the tensor algebra by the ideal generated by all differences of products u"v - v"u.TA data type representing basis elements of the tensor algebra over a set/type. Elements of the tensor algebra are linear combinations of iterated tensor products of elements of the set/type. If V = Vect k a is the free vector space over a, then the tensor algebra T(V) = Vect k (TensorAlgebra a) is isomorphic to the infinite direct sum: T(V) = k " V " V"V " V"V"V " ...oInject an element of the free vector space V = Vect k a into the tensor algebra T(V) = Vect k (TensorAlgebra a)^Inject an element of the set/type A/a into the tensor algebra T(A) = Vect k (TensorAlgebra a).3Given vector spaces A = Vect k a, B = Vect k b, where B is also an algebra, lift a linear map f: A -> B to an algebra morphism f': T(A) -> B, where T(A) is the tensor algebra Vect k (TensorAlgebra a). f' will agree with f on A itself (considered as a subspace of T(A)). In other words, f = f' . injectTAGiven a set/type A/a, and a vector space B = Vect k b, where B is also an algebra, lift a function f: A -> B to an algebra morphism f': T(A) -> B. f' will agree with f on A itself. In other words, f = f' . injectTA'Tensor algebra is a functor from k-Vect to k-Alg. The action on objects is Vect k a -> Vect k (TensorAlgebra a). The action on arrows is f -> fmapTA f. If we compose the free vector space functor Set -> k-Vect with the tensor algebra functor k-Vect -> k-Alg, we obtain a functor Set -> k-Alg, the free algebra functor. The action on objects is a -> Vect k (TensorAlgebra a). The action on arrows is f -> fmapTA' f.Algebra morphism from tensor algebra to symmetric algebra. The kernel of the morphism is the ideal generated by all differences of products u"v - v"u.Algebra morphism from tensor algebra to exterior algebra. The kernel of the morphism is the ideal generated by all self-products u"u and sums of products u"v + v"u0'0,None!!None24 None24                    None24 !"#$%&'()*+,-./ !"#$%&'()*+,-/. !"#$%&'()*+,- !"#$%&'()*+,-./None<=K.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]*0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY.4651320][7\>=<;:98Z?@ABCDEFGHIJKLMNOPQRSTUVWXY 0132465?@ABCDEFGHIJKLMNOPQRSTUVWXYZ] [7\>=<;:98None2346)^_`abcdefghijklmnopqrstuvwxyz{|}~^_`abcdefghijklmnopqrst)fghijklmnopdeqbcr`a~}|{s^_zyxwvut%^_`abcdefghijklmnopqrstuvwxyz{|}~None246<=K NoneB"F25 is a type for the finite field with 25 elements. F25 is represented as the extension of F5 by an element a25 satisfying x^2+4x+2 = 0F16 is a type for the finite field with 16 elements. F16 is represented as the extension of F2 by an element a16 satisfying x^4+x+1 = 0F9 is a type for the finite field with 9 elements. F9 is represented as the extension of F3 by an element a9 satisfying x^2+2x+2 = 0F8 is a type for the finite field with 8 elements. F8 is represented as the extension of F2 by an element a8 satisfying x^3+x+1 = 0F4 is a type for the finite field with 4 elements. F4 is represented as the extension of F2 by an element a4 satisfying x^2+x+1 = 03F23 is a type for the finite field with 23 elements3F19 is a type for the finite field with 19 elements3F17 is a type for the finite field with 17 elements3F13 is a type for the finite field with 13 elements3F11 is a type for the finite field with 11 elements1F7 is a type for the finite field with 7 elements1F5 is a type for the finite field with 5 elements1F3 is a type for the finite field with 3 elements1F2 is a type for the finite field with 2 elementsQQ is just the rationals, but with a better show function than the Prelude version"f2 is a list of the elements of F2"f3 is a list of the elements of F3"f5 is a list of the elements of F5"f7 is a list of the elements of F7$f11 is a list of the elements of F11$f13 is a list of the elements of F13$f17 is a list of the elements of F17$f19 is a list of the elements of F19$f23 is a list of the elements of F23Sa4 is a primitive element for F4 as an extension over F2. a4 satisfies x^2+x+1 = 0."f4 is a list of the elements of F4Sa8 is a primitive element for F8 as an extension over F2. a8 satisfies x^3+x+1 = 0."f8 is a list of the elements of F8Ta9 is a primitive element for F9 as an extension over F3. a9 satisfies x^2+2x+2 = 0."f9 is a list of the elements of F9Va16 is a primitive element for F16 as an extension over F2. a16 satisfies x^4+x+1 = 0.$f16 is a list of the elements of F16Wa25 is a primitive element for F25 as an extension over F5. a25 satisfies x^2+4x+2 = 0.$f25 is a list of the elements of F25m     4m     ^     None-246B;A type representing polynomials with Grevlex term ordering.4A type representing monomials with Grevlex ordering.Grevlex stands for graded reverse lexicographic. Thus monomials are ordered first by degree, then by reverse lexicographic order. For example, in Grevlex ordering, monomials up to degree two would be ordered as follows: x^2+xy+y^2+xz+yz+z^2+x+y+z+1.9In general, Grevlex leads to the smallest Groebner bases.8A type representing polynomials with Glex term ordering.1A type representing monomials with Glex ordering.Glex stands for graded lexicographic. Thus monomials are ordered first by degree, then by lexicographic order. For example, in Glex ordering, monomials up to degree two would be ordered as follows: x^2+xy+xz+y^2+yz+z^2+x+y+z+1.7A type representing polynomials with Lex term ordering.0A type representing monomials with Lex ordering.Lex stands for lexicographic ordering. For example, in Lex ordering, monomials up to degree two would be ordered as follows: x^2+xy+xz+x+y^2+yz+y+z^2+z+1.The underlying implementation of monomials in variables of type v. Most often, we will be interested in MonImpl String, with the variable "x" represented by M 1 [("x",1)]. However, other types can be used instead.No Ord instance is defined for MonImpl v, so it cannot be used as the basis for a free vector space of polynomials. Instead, several different newtype wrappers are provided, corresponding to different monomial orderings.We want to be able to construct monomials over any set of variables that we choose. Although we will often use String as the type of our variables, it is useful to define polymorphic types for monomials. In order to work with monomials, we need to be able to multiply them and divide them. Multiplication is defined by the Mon (monoid) class. Division is defined in this class. The functions here are primarily intended for internal use only.(var vv creates a variable in the vector space of polynomials. For example, if we want to work in Q[x,y,z], we might define: 6[x,y,z] = map var ["x","y","z"] :: [GlexPoly Q String]Notice that, in general, it is necessary to provide a type annotation so that the compiler knows which field and which term order to use.)lexvar v creates a variable in the algebra of commutative polynomials over Q with Lex term ordering. It is provided as a shortcut, to avoid having to provide a type annotation, as with varG. For example, the following code creates variables called x, y and z: "[x,y,z] = map lexvar ["x","y","z"]* glexvar v creates a variable in the algebra of commutative polynomials over Q with Glex term ordering. It is provided as a shortcut, to avoid having to provide a type annotation, as with varG. For example, the following code creates variables called x, y and z: #[x,y,z] = map glexvar ["x","y","z"]+ grevlexvar v creates a variable in the algebra of commutative polynomials over Q with Grevlex term ordering. It is provided as a shortcut, to avoid having to provide a type annotation, as with varG. For example, the following code creates variables called x, y and z: &[x,y,z] = map grevlexvar ["x","y","z"],Given (Num k, MonomialConstructor m), then Vect k (m v) is the free commutative algebra over v. As such, it is a monad (in the mathematical sense). The following pseudo-code (not legal Haskell) shows how this would work: binstance (Num k, Monomial m) => Monad (\v -> Vect k (m v)) where return = var (>>=) = bind.bind corresponds to variable substitution, so  v `bind` fE returns the result of making the substitutions encoded in f into v.wNote that the type signature is slightly more general than that required by (>>=). For a monad, we would only require: bind :: (MonomialConstructor m, Num k, Ord (m v), Show (m v), Algebra k (m v)) => Vect k (m u) -> (u -> Vect k (m v)) -> Vect k (m v)sInstead, the given type signature allows us to substitute in elements of any algebra. This is occasionally useful.#bind performs variable substitution./Evaluate a polynomial at a point. For example eval (x^2+y^2) [(x,1),(y,2)], evaluates x^2+y^2 at the point (x,y)=(1,2)./<Perform variable substitution on a polynomial. For example )subst (x*z-y^2) [(x,u^2),(y,u*v),(z,v^2)]8 performs the substitution x -> u^2, y -> u*v, z -> v^2.0'List the variables used in a polynomial=f %% gs is the reduction of a polynomial f with respect to a list of polynomials gs. In the case where the gs are a Groebner basis for an ideal I, then f %% gs\ is the equivalence class representative of f in R/I, and is zero if and only if f is in I.>As a convenience, a partial instance of Fractional is defined for polynomials. The instance is well-defined only for scalars, and gives an error if used on other values. The purpose of this is to allow entry of fractional scalars, in expressions such as x/2,. On the other hand, an expression such as 2/x will return an error.A !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP. !"#$%&'()*+,-./0123456789:;<=A !"#$%&'(PONMLK)JIH*GFE+DCBA@?,-./0123456789:;<=>4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP:= NoneE \mGiven a list of polynomials over a field, return a Groebner basis for the ideal generated by the polynomials.a memberI f gs2 returns whether f is in the ideal generated by gsbKGiven ideals I and J, their sum is defined as I+J = {f+g | f <- I, g <- J}..If fs and gs are generators for I and J, then  sumI fs gs returns generators for I+J.The geometric interpretation is that the variety of the sum is the intersection of the varieties, ie V(I+J) = V(I) intersect V(J)cfGiven ideals I and J, their product I.J is the ideal generated by all products {f.g | f <- I, g <- J}..If fs and gs are generators for I and J, then productI fs gs returns generators for I.J.{The geometric interpretation is that the variety of the product is the union of the varieties, ie V(I.J) = V(I) union V(J)d^The intersection of ideals I and J is the set of all polynomials which belong to both I and J..If fs and gs are generators for I and J, then intersectI fs gs3 returns generators for the intersection of I and JThe geometric interpretation is that the variety of the intersection is the union of the varieties, ie V(I intersect J) = V(I) union V(J).The reason for prefering the intersection over the product is that the intersection of radical ideals is radical, whereas the product need not be.jbGiven ideals I and J, their quotient is defined as I:J = {f | f <- R, f.g is in I for all g in J}..If fs and gs are generators for I and J, then quotientI fs gs returns generators for I:J.The ideal quotient is the algebraic analogue of the Zariski closure of a difference of varieties. V(I:J) contains the Zariski closure of V(I)-V(J), with equality if k is algebraically closed and I is a radical ideal.leliminate vs gsg returns the elimination ideal obtained from the ideal generated by gs by eliminating the variables vs.n-Given variables vs, and a Groebner basis gs, mbasisQA vs gsM returns a monomial basis for the quotient algebra k[vs]/<gs>. For example, mbasisQA [x,y] [x^2+y^2-1]k returns a monomial basis for k[x,y]/<x^2+y^2-1>. In general, the monomial basis is likely to be infinite.oGiven an ideal I, the leading term ideal lt(I) consists of the leading terms of all elements of I. If I is generated by gs, then  ltIdeal gs returns generators for lt(I).q0Given variables vs, and a homogeneous ideal gs, hilbertFunQA vs gs_ returns the Hilbert function for the quotient algebra k[vs]/<gs>. Given an integer i, the Hilbert function returns the number of degree i monomials in a basis for k[vs]/<gs>. For a homogeneous ideal, this number is independent of the monomial ordering used (even though the elements of the monomial basis themselves are dependent on the ordering).If the ideal I is not homogeneous, then R/I is not graded, and the Hilbert function is not well-defined. Specifically, the number of degree i monomials in a basis is likely to depend on which monomial ordering you use.s0Given variables vs, and a homogeneous ideal gs, hilbertSeriesQA vs gs0 returns the Hilbert series for the quotient algebra k[vs]/<gs>. The Hilbert series should be interpreted as a formal power series where the coefficient of t^i is the Hilbert function evaluated at i. That is, the i'th element in the series is the number of degree i monomials in a basis for k[vs]/<gs>.tIn the case where every variable v occurs in some generator g of the homogeneous ideal (the usual case), then the vs can be inferred from the gs. hilbertSeriesQA' gs@ returns the Hilbert series for the quotient algebra k[vs]/<gs>.uZFor i >> 0, the Hilbert function becomes a polynomial in i, called the Hilbert polynomial.(QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx(QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx(QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx(QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx!None246 zBA conjugation operation is required to satisfy the following laws:conj (x+y) = conj x + conj y7conj (x*y) = conj y * conj x (note the order-reversal)conj (conj x) = x conj x = x if and only if x in k{CThe squared norm is defined as sqnorm x = x * conj x. It satisfies:"sqnorm (x*y) = sqnorm x * sqnorm y%sqnorm (unit k) = k^2, for k a scalarJThe quaternions have {1,i,j,k} as basis, where i^2 = j^2 = k^2 = ijk = -1.JThe quaternions have {1,i,j,k} as basis, where i^2 = j^2 = k^2 = ijk = -1.JThe quaternions have {1,i,j,k} as basis, where i^2 = j^2 = k^2 = ijk = -1.MThe scalar part of the quaternion w+xi+yj+zk is w. Also called the real part.TThe vector part of the quaternion w+xi+yj+zk is xi+yj+zk. Also called the pure part.Given a non-zero quaternion q in H, the map x -> q^-1 * x * q defines an action on the 3-dimensional vector space of pure quaternions X (ie linear combinations of i,j,k). It turns out that this action is a rotation of X, and this is a surjective group homomorphism from H* onto SO3. If we restrict q to the group of unit quaternions (those of norm 1), then this homomorphism is 2-to-1 (since q and -q give the same rotation). This shows that the multiplicative group of unit quaternions is isomorphic to Spin3, the double cover of SO3. reprSO3 q. returns the 3*3 matrix representing this map.Given a pair of unit quaternions (l,r), the map x -> l^-1 * x * r defines an action on the 4-dimensional space of quaternions. It turns out that this action is a rotation, and this is a surjective group homomorphism onto SO4. The homomorphism is 2-to-1 (since (l,r) and (-l,-r) give the same map). This shows that the multiplicative group of pairs of unit quaternions (with pointwise multiplication) is isomorphic to Spin4, the double cover of SO4. reprSO4 (l,r). returns the 4*4 matrix representing this map.lIf an algebra has a conjugation operation, then it has multiplicative inverses, via 1/x = conj x / sqnorm x yz{|}~yz{|}~ }~|yz{yz{|}~"None'u <+> v returns the sum u+v of vectors .u <-> v returns the difference u-v of vectors @k *> v returns the product k*v of the scalar k and the vector v Qu <.> v returns the dot product of vectors (also called inner or scalar product) Tu <*> v returns the tensor product of vectors (also called outer or matrix product) *a <<+>> b returns the sum a+b of matrices 1a <<->> b returns the difference a-b of matrices .a <<*>> b returns the product a*b of matrices Ak *>> m returns the product k*m of the scalar k and the matrix m ?m <<*> v is multiplication of a vector by a matrix on the left @v <*>> m is multiplication of a vector by a matrix on the right !iMx n is the n*n identity matrix "jMx n is the n*n matrix of all 1s "zMx n is the n*n matrix of all 0s 5The inverse of a matrix (over a field), if it exists +The determinant of a matrix (over a field)  #NoneiA type for permutations, considered as functions or actions which can be performed on an underlying set. >Construct a permutation from a list of cycles. For example, p [[1,2,3],[4,5]]L returns the permutation that sends 1 to 2, 2 to 3, 3 to 1, 4 to 5, 5 to 4. fx .^ g returns the image of a vertex or point x under the action of the permutation g. For example, 1 .^ p [[1,2,3]]E returns 2. The dot is meant to be a mnemonic for point or vertex. eb -^ g returns the image of an edge or block b under the action of the permutation g. For example, [1,2] -^ p [[1,4],[2,3]]P returns [3,4]. The dash is meant to be a mnemonic for edge or line or block. g ~^ h returns the conjugate of g by h, that is, h^-1*g*h. The tilde is meant to a mnemonic, because conjugacy is an equivalence relation. Ox .^^ gs returns the orbit of the point or vertex x under the action of the gs Mb -^^ gs returns the orbit of the block or edge b under the action of the gs <_C n returns generators for Cn, the cyclic group of order n >_S n returns generators for Sn, the symmetric group on [1..n] @_A n returns generators for An, the alternating group on [1..n] Given generators for groups H and K, acting on sets A and B respectively, return generators for the direct product H*K, acting on the disjoint union A+B (= Either A B) Given generators for a group, return a (sorted) list of all elements of the group. Implemented using a naive closure algorithm, so only suitable for small groups (|G| < 10000) Given generators for a group, return the order of the group (the number of elements). Implemented using a naive closure algorithm, so only suitable for small groups (|G| < 10000) Given a strong generating set, return the order of the group it generates. Note that the SGS is assumed to be relative to the natural order of the points on which the group acts. TGiven a base and strong generating set, return the order of the group it generates. conjClassReps gs returns conjugacy class representatives and sizes for the group generated by gs. This implementation is only suitable for use with small groups (|G| < 10000). WReturn the subgroups of a group. Only suitable for use on small groups (eg < 100 elts) isNormal gs ks returns True if <ks> is normal in <gs>. Note, it is caller's responsibility to ensure that <ks> is a subgroup of <gs> (ie that each k is in <gs>). ^Return the normal subgroups of a group. Only suitable for use on small groups (eg < 100 elts) %quotientGp gs ks returns <gs> / <ks> Synonym for quotientGp  5The HasInverses instance is what enables us to write g^-1% for the inverse of a group element.  -The Num instance is what enables us to write g*h' for the product of group elements and 1 for the group identity. Unfortunately we can't of course give sensible definitions for the other functions declared in the Num typeclass. X     U   X     W     $NoneGiven generators for a permutation group, return a strong generating set. The result is calculated using Schreier-Sims algorithm, and is relative to the base implied by the Ord instance vGiven generators for a group, determine whether a permutation is a member of the group, using Schreier-Sims algorithm qGiven generators for a group, return a (sorted) list of all elements of the group, using Schreier-Sims algorithm  tGiven generators for a group, return the order of the group (the number of elements), using Schreier-Sims algorithm  !"#$%&'( !"#$%&'( !"#$%&'( !"#$%&'(%None-Given generators for a permutation group, return a strong generating set. The result is calculated using random Schreier-Sims algorithm, so has a small (<10^-6) chance of being incomplete. The sgs is relative to the base implied by the Ord instance.4SGiven a strong generating set gs, isMemberSGS gs is a membership test for the group )*+,-./01234 )*+,-./01234 )*+,-./01234 )*+,-./01234&None;JGiven a group gs and a transitive constituent ys, return the kernel and image of the transitive constituent homomorphism. That is, suppose that gs acts on a set xs, and ys is a subset of xs on which gs acts transitively. Then the transitive constituent homomorphism is the restriction of the action of gs to an action on the ys.>Given a transitive group gs, find all non-trivial block systems. That is, if gs act on xs, find all the ways that the xs can be divided into blocks, such that the gs also have a permutation action on the blocks?;A more efficient version of blockSystems, if we have an sgs@GA permutation group is primitive if it has no non-trivial block systemsBGiven a transitive group gs, and a block system for gs, return the kernel and image of the block homomorphism (the homomorphism onto the action of gs on the blocks)56789:;<=>?@ABCDEF56789:;<=>?@ABCDEF56789:;<=>?@ABCDEF56789:;<=>?@ABCDEF'NoneGIDatatype for graphs, represented as a list of vertices and a list of edges. For most purposes, graphs are required to be in normal form. A graph G vs es is in normal form if (i) vs is in ascending order without duplicates, (ii) es is in ascending order without duplicates, (iii) each e in es is a 2-element list [x,y], x<y KZConvert a graph to normal form. The input is assumed to be a valid graph apart from order NSafe constructor for graph from lists of vertices and edges. graph (vs,es) checks that vs and es are valid before returning the graph. V8The null graph on n vertices is the graph with no edges W*The null graph, with no vertices or edges X&c n is the cyclic graph on n vertices Y(k n is the complete graph on n vertices Z;kb m n is the complete bipartite graph on m and n vertices [Gkb' m n is the complete bipartite graph on m left and n right vertices \q k is the graph of the k-cube eGiven a graph with vertices which are lists of small integers, eg [1,2,3], return a graph with vertices which are the numbers obtained by interpreting these as digits, eg 123. The caller is responsible for ensuring that this makes sense (eg that the small integers are all < 10) fGiven a graph with vertices which are lists of 0s and 1s, return a graph with vertices which are the numbers obtained by interpreting these as binary digits. For example, [1,1,0] -> 6. i7The restriction of a graph to a subset of the vertices tBA graph is regular if all vertices have the same valency (degree) u*A 3-regular graph is called a cubic graph xgWithin a graph G, the distance d(u,v) between vertices u, v is length of the shortest path from u to v yJThe diameter of a graph is maximum distance between two distinct vertices {The girth of a graph is the size of the smallest cycle that it contains. Note: If the graph contains no cycles, we return -1, representing infinity. Is the graph connected? kneser n k returns the kneser graph KG n,k - whose vertices are the k-element subsets of [1..n], with edges between disjoint subsets GGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~GIJGHKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(NonehThe Cayley graph (undirected) on the generators (and their inverses), for a group given as permutationstThe Cayley graph (undirected) on the generators (and their inverses), for a group given as generators and relations    )None-E A graph is vertex-transitive if its automorphism group acts transitively on the vertices. Thus, given any two distinct vertices, there is an automorphism mapping one to the other. A graph is edge-transitive if its automorphism group acts transitively on the edges. Thus, given any two distinct edges, there is an automorphism mapping one to the other. A graph is arc-transitive (or flag-transitive) if its automorphism group acts transitively on arcs. (An arc is an ordered pair of adjacent vertices.) A graph is n-arc-transitive if its automorphism group is transitive on n-arcs. (An n-arc is an ordered sequence (v0,...,vn) of adjacent vertices, with crossings allowed but not doubling back.) A graph is distance transitive if given any two ordered pairs of vertices (u,u') and (v,v') with d(u,u') == d(v,v'), there is an automorphism of the graph that takes (u,u') to (v,v') 1Is the permutation an automorphism of the graph? wIs the permutation an automorphism of the incidence structure represented by the graph? (Note that an incidence graph colours points as Left, blocks as Right, and a permutation that swaps points and blocks, even if it is an automorphism of the graph, does not represent an automorphism of the incidence structure. Instead, a point-block crossover is called a duality.) Given a graph g,  graphAuts gB returns a strong generating set for the automorphism group of g. oGiven the incidence graph of an incidence structure between points and blocks (for example, a set system), incidenceAuts g returns a strong generating set for the automorphism group of the incidence structure. The generators are represented as permutations of the points. The incidence graph should be represented with the points on the left and the blocks on the right. Are the two graphs isomorphic? SAre the two incidence structures represented by these incidence graphs isomorphic? >=*None!+None2346bConstruct a permutation, as an element of the group algebra, from a list of cycles. For example, p [[1,2],[3,4,5]]Q constructs the permutation (1 2)(3 4 5), which is displayed as [[1,2],[3,4,5]].Note that the inverse of a group algebra element can only be efficiently calculated if the group generated by the non-zero terms is very small (eg <100 elements).      ,None _ptsAG n fq returns the points of the affine geometry AG(n,Fq), where fq are the elements of Fq cptsPG n fq returns the points of the projective geometry PG(n,Fq), where fq are the elements of Fq \Given a list of points in AG(n,Fq), return their closure, the smallest flat containing them [Given a set of points in PG(n,Fq), return their closure, the smallest flat containing them flatsPG n fq k returns the k-flats in PG(n,Fq), where fq are the elements of Fq. The returned flats are represented as matrices in reduced row echelon form, the rows of which are the points that generate the flat. The full set of points in the flat can be recovered by calling  QflatsAG n fq k returns the k-flats in AG(n,Fq), where fq are the elements of Fq.  The lines (1-flats) in PG(n,fq)  The lines (1-flats) in AG(n,fq) [Incidence graph of PG(n,fq), considered as an incidence structure between points and lines [Incidence graph of AG(n,fq), considered as an incidence structure between points and lines  -None246  .None The incidence matrix of a design, with rows indexed by blocks and columns by points. (Note that in the literature, the opposite convention is sometimes used instead.)  NThe affine plane AG(2,Fq), a 2-(q^2,q,1) design or Steiner system S(2,q,q^2). tThe projective plane PG(2,Fq), a square 2-(q^2+q+1,q+1,1) design or Steiner system S(2,q+1,q^2+q+1). For example, pg2 f26 is the Fano plane, a Steiner triple system S(2,3,7). The dual of a design  The incidence graph of a design DFind a strong generating set for the automorphism group of a design $OGenerators for the Mathieu group M24, a finite simple group of order 244823040 %\A strong generating set for the Mathieu group M24, a finite simple group of order 244823040 &[A strong generating set for the Mathieu group M23, a finite simple group of order 10200960 'YA strong generating set for the Mathieu group M22, a finite simple group of order 443520 )OThe Steiner system S(5,8,24), with 759 blocks, whose automorphism group is M24 *OThe Steiner system S(4,7,23), with 253 blocks, whose automorphism group is M23 +NThe Steiner system S(3,6,22), with 77 blocks, whose automorphism group is M22 3OThe Steiner system S(5,6,12), with 132 blocks, whose automorphism group is M12 4NThe Steiner system S(4,5,11), with 66 blocks, whose automorphism group is M11 5KGenerators for the Mathieu group M12, a finite simple group of order 95040 6XA strong generating set for the Mathieu group M12, a finite simple group of order 95040 7WA strong generating set for the Mathieu group M11, a finite simple group of order 7920 ?      !"#$%&'()*+,-./01234567?      !"#$%&'()*+,-./01234567?      !"#$%&'()*+,-./01234567>      !"#$%&'()*+,-./01234567/None<JIs this hypergraph uniform - meaning that all blocks are of the same size DIs this hypergraph a projective plane - meaning that any two lines meet in a unique point, and any two points lie on a unique line EIs this hypergraph a projective plane with a triangle. This is a weak non-degeneracy condition, which eliminates all points on the same line, or all lines through the same point. FhIs this hypergraph a projective plane with a quadrangle. This is a stronger non-degeneracy condition. K1Is this hypergraph a (projective) configuration. M;The Heawood graph is the incidence graph of the Fano plane U6The Tutte-Coxeter graph, also called the Tutte 8-cage 89:;<=>?@ABCDEFGHIJKLMNOPQRSTUV89:;<=>?@ABCDEFGHIJKLMNOPQRSTUV89:;<=>?@ABCDEFGHIJKLMNOPQRSTUV89:;<=>?@ABCDEFGHIJKLMNOPQRSTUV0NoneW}A poset is represented as a pair (set,po), where set is the underlying set of the poset, and po is the partial order relationaA chain is a poset in which every pair of elements is comparable (ie either x <= y or y <= x). It is therefore a linear or total order. chainN n is the poset consisting of the numbers [1..n] ordered by (<=)bAn antichain is a poset in which distinct elements are incomparable. antichainN n is the poset consisting of [1..n], with x <= y only when x == y.e3posetD n is the lattice of (positive) divisors of ngAposetB n is the lattice of subsets of [1..n] ordered by inclusionjJposetP n is the lattice of set partitions of [1..n], ordered by refinementpHposetIP n is the poset of integer partitions of n, ordered by refinementsposetL n fq is the lattice of subspaces of the vector space Fq^n, ordered by inclusion. Subspaces are represented by their reduced row echelon form. Example usage: posetL 2 f3t.The subposet of a poset satisfying a predicateuThe direct sum of two posetsv The direct product of two posetswThe dual of a posetxmGiven a poset (X,<=), we say that y covers x, written x -< y, if x < y and there is no z in X with x < z < y. The Hasse digraph of a poset is the digraph whose vertices are the elements of the poset, with an edge between every pair (x,y) with x -< y. The Hasse digraph can be represented diagrammatically as a Hasse diagram, by drawing x below y whenever x -< y.yGiven a DAG (directed acyclic graph), return the poset consisting of the vertices of the DAG, ordered by reachability. This can be used to recover a poset from its Hasse digraph.|$Are the two posets order-isomorphic?}.Find all order isomorphisms between two posetsA linear extension of a poset is a linear ordering of the elements which extends the partial order. Equivalently, it is an ordering [x1..xn] of the underlying set, such that if xi <= xj then i <= j.Linear extensions of a poset,WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~*WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~,WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~+WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1None-246M+bA basis for NSym, the Hopf algebra of non-commutative symmetric functions, indexed by compositionsThe complete basis for Sym, the Hopf algebra of symmetric functions. Defined informally as > symH [n] = sum [symM lambda | lambda <- integerPartitions n] -- == all monomials of weight n > symH lambda = product [symH [p] | p <- lambda]The elementary basis for Sym, the Hopf algebra of symmetric functions. Defined informally as > symE [n] = symM (replicate n 1) > symE lambda = product [symE [p] | p <- lambda]mA type for the monomial basis for Sym, the Hopf algebra of symmetric functions, indexed by integer partitions\A type for the fundamental basis for the quasi-symmetric functions, indexed by compositions.YA type for the monomial basis for the quasi-symmetric functions, indexed by compositions.eAn alternative "monomial" basis for (the dual of) the Loday-Ronco Hopf algebra of binary trees, YSym.[The fundamental basis for (the dual of) the Loday-Ronco Hopf algebra of binary trees, YSym.qA type for (rooted) planar binary trees. The basis elements of the Loday-Ronco Hopf algebra are indexed by these.|Although the trees are labelled, we're really only interested in the shapes of the trees, and hence in the type PBT (). The Algebra, Coalgebra and HopfAlgebra instances all ignore the labels. However, it is convenient to allow labels, as they can be useful for seeing what is going on, and they also make it possible to define various ways to create trees from lists of labels.An alternative "monomial" basis for the Malvenuto-Reutenauer Hopf algebra of permutations, SSym. This basis is related to the fundamental basis by Mobius inversion in the poset of permutations with the weak order.VThe fundamental basis for the Malvenuto-Reutenauer Hopf algebra of permutations, SSym.A basis for the shuffle algebra. As a vector space, the shuffle algebra is identical to the tensor algebra. However, we consider a different algebra structure, based on the shuffle product. Together with the deconcatenation coproduct, this leads to a Hopf algebra structure.0Construct a basis element of the shuffle algebravConstruct a fundamental basis element in SSym. The list of ints must be a permutation of [1..n], eg [1,2], [3,4,2,1].sConstruct a monomial basis element in SSym. The list of ints must be a permutation of [1..n], eg [1,2], [3,4,2,1].UConvert an element of SSym represented in the monomial basis to the fundamental basisUConvert an element of SSym represented in the fundamental basis to the monomial basisxThe isomorphism from SSym to its dual that takes a permutation in the fundamental basis to its inverse in the dual basisPConstruct the element of YSym in the fundamental basis indexed by the given treeMConstruct the element of YSym in the monomial basis indexed by the given tree-List all trees with the given number of nodesBThe covering relation for the Tamari partial order on binary trees7The up-set of a binary tree in the Tamari partial orderThe Tamari partial order on binary trees. This is only defined between trees of the same size (number of nodes). The result between trees of different sizes is undefined (we don't check).UConvert an element of YSym represented in the monomial basis to the fundamental basisUConvert an element of YSym represented in the fundamental basis to the monomial basisList the compositions of an integer n. For example, the compositions of 4 are [[1,1,1,1],[1,1,2],[1,2,1],[1,3],[2,1,1],[2,2],[3,1],[4]]TConstruct the element of QSym in the monomial basis indexed by the given compositionWConstruct the element of QSym in the fundamental basis indexed by the given compositionUConvert an element of QSym represented in the monomial basis to the fundamental basisUConvert an element of QSym represented in the fundamental basis to the monomial basis qsymPoly n is is the quasi-symmetric polynomial in n variables for the indices is. (This corresponds to the monomial basis for QSym.) For example, qsymPoly 3 [2,1] == x1^2*x2+x1^2*x3+x2^2*x3.YConstruct the element of Sym in the monomial basis indexed by the given integer partition8Convert from the elementary to the monomial basis of Sym6Convert from the complete to the monomial basis of Sym_Given a permutation p of [1..n], we can construct a tree (the descending tree of p) as follows:,Split the permutation as p = ls ++ [n] ++ rsPlace n at the root of the tree, and recursively place the descending trees of ls and rs as the left and right children of the rooteTo bottom out the recursion, the descending tree of the empty permutation is of course the empty treeVThis map between bases SSymF -> YSymF turns out to induce a morphism of Hopf algebras.+A Hopf algebra morphism from YSymF to QSymFGiven a permutation of [1..n], its descents are those positions where the next number is less than the previous number. For example, the permutation [2,3,5,1,6,4] has descents from 5 to 1 and from 6 to 4. The descents can be regarded as cutting the permutation sequence into segments - 235-16-4 - and by counting the lengths of the segments, we get a composition 3+2+1. This map between bases SSymF -> QSymF turns out to induce a morphism of Hopf algebras.@The injection of Sym into QSym (defined over the monomial basis)?A surjection of NSym onto Sym (defined over the complete basis)_A duality pairing between NSym and QSymM (monomial basis), showing that NSym and QSym are dual.`A duality pairing between the complete and monomial bases of Sym, showing that Sym is self-dual.+A pairing showing that SSym is self-adjoint     ^          2None246  FA type to represent an interval in a poset. The (closed) interval [x,y] is the set {z | x <= z <= y} within the poset. Note that the "empty interval" is not an interval - that is, the interval [x,y] is only defined for x <= y. The (closed) intervals within a poset form a basis for the incidence algebra as a k-vector space.&MList representatives of the order isomorphism classes of intervals in a poset',The unit of the incidence algebra of a poset)The zeta function of a poset+The Mobius function of a poset-The inverse of an element in the incidence algebra of a poset. This is only defined for elements which are non-zero on all intervals (x,x).hA function (ie element of the incidence algebra) that counts the total number of chains in each interval0jA function (ie element of the incidence algebra) that counts the number of maximal chains in each interval4 toIsoClasses is the linear map from the incidence Hopf algebra of a poset to itself, in which each interval is mapped to (the minimal representative of) its isomorphism class. Thus the result can be considered as a linear combination of isomorphism classes of intervals, rather than of intervals themselves. Note that if this operation is to be performed repeatedly for the same poset, then it is more efficient to use toIsoClasses' poset4, which memoizes the isomorphism class lookup table.5Given a poset, toIsoClasses' poset is the linear map from the incidence Hopf algebra of the poset to itself, in which each interval is mapped to (the minimal representative of) its isomorphism class.8tThe incidence algebra of a poset is the free k-vector space having as its basis the set of intervals in the poset, with multiplication defined by concatenation of intervals. The incidence algebra can also be thought of as the vector space of functions from intervals to k, with multiplication defined by the convolution (f*g)(x,y) = sum [ f(x,z) g(z,y) | x <= z <= y ]. !"#$%&'()*+,-./0123456789:; !"#$%&'()*+,-./012345 !;:9"#$%&8'()*+,-7./0123645 !"#$%&'()*+,-./0123456789:;3None'<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab'<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab'@ABCDEFGHIJKLMNOPQRS<?>=TUVWXYZ[\]^_`ab$<?>=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab4Noneh%Are the two latin squares orthogonal?jGAre the latin squares mutually orthogonal (ie each pair is orthogonal)?kMOLS from a projective planecdefghijklmnopcdefghijklmnopcdefghijklmnopcdefghijklmnop5None-?u#A datatype to represent a matroid. M es bs# is the matroid whose elements are es, and whose bases are bs. The normal form is for the es! to be in order, for each of the bs individually to be in order. (So the TrieSet should have the property that any path from the root to a leaf is strictly increasing).w@The data structure that we use to store the bases of the matroid6Return the elements over which the matroid is defined.@Return all the independent sets of a matroid, in shortlex order.UAre these the independent sets of a matroid? (The sets must individually be ordered.)?Construct a matroid from its elements and its independent sets.1Given a matrix, represented as a list of rows, number the columns [1..], and construct the matroid whose independent sets correspond to those sets of columns which are linearly independent (or in case there are repetitions, those multisets of columns which are sets, and which are linearly independent).4Given a list of vectors (or rows of a matrix), number the vectors (rows) [1..], and construct the matroid whose independent sets correspond to those sets of vectors (rows) which are linearly independent (or in case there are repetitions, those multisets which are sets, and which are linearly independent).,Given the edges of an undirected graph, number the edges [1..], and construct the matroid whose independent sets correspond to those sets of edges which contain no cycle. The bases therefore correspond to maximal forests within the graph. The edge set is allowed to contain loops or parallel edges.VGiven a matroid over an arbitrary type, relabel to obtain a matroid over the integers. Are the two matroids isomorphic?(Return the automorphisms of the matroid.2A circuit in a matroid is a minimal dependent set.=Return all circuits for the given matroid, in shortlex order.0Are the given sets the circuits of some matroid?5Reconstruct a matroid from its elements and circuits.?An element e in a matroid M is a loop if {e} is a circuit of M.HElements f and g in a matroid M are parallel if {f,g} is a circuit of M.;A matroid is simple if it has no loops or parallel elements:A base or basis in a matroid is a maximal independent set.&Return all bases for the given matroid-Are the given sets the bases of some matroid?2Reconstruct a matroid from its elements and bases.0Given a matroid m, a basis b, and an element e, fundamentalCircuit m b ev returns the unique circuit contained in b union {e}, which is called the fundamental circuit of e with respect to b.sThe uniform matroid U m n is the matroid whose independent sets are all subsets of [1..n] with m or fewer elements.8The restriction of a matroid to a subset of its elementsGiven a matroid m,  rankfun m3 is the rank function on subsets of its element set3The rank of a matroid is the cardinality of a basis9Reconstruct a matroid from its elements and rank functionGiven a matroid m,  closure m6 is the closure operator on subsets of its element set<Reconstruct a matroid from its elements and closure operatorTA flat in a matroid is a closed set, that is a set which is equal to its own closurePThe flats of a matroid are its closed sets. They form a lattice under inclusion.RReconstruct a matroid from its flats. (The flats must be given in shortlex order.)TA subset of the elements in a matroid is spanning if its closure is all the elementsFA hyperplane is a flat whose rank is one less than that of the matroid7Reconstruct a matroid from its elements and hyperplanesGiven a list of points in k^n, number the points [1..], and construct the matroid whose independent sets correspond to those sets of points which are affinely independent.A multiset of points in k^n is said to be affinely dependent if it contains two identical points, or three collinear points, or four coplanar points, or ... - and affinely independent otherwise.fromGeoRep returns a matroid from a geometric representation consisting of dependent flats of various ranks. Given lists of dependent rank 0 flats (loops), rank 1 flats (points), rank 2 flats (lines) and rank 3 flats (planes), $fromGeoRep loops points lines planes returns the matroid having these as dependent flats. Note that if all the elements lie in the same plane, then this should still be listed as an argument.zA simple matroid has no loops or parallel elements, hence its geometric representation has no loops or dependent points. simpleFromGeoRep lines planes9 returns the simple matroid having these dependent flats.*List the circuit-hyperplanes of a matroid.`Given a matroid m, and a set of elements b which is both a circuit and a hyperplane in m, then relaxation m b is the matroid which is obtained by adding b as a new basis. This corresponds to removing b from the geometric representation of m.Given a set of elements es, and a sequence as = [a1,...,am] of subsets of es, return the matroid whose independent sets are the partial transversals of the as.The dual matroidfA matroid is (2-)connected if, for every pair of distinct elements, there is a circuit containing bothThe direct sum of two matroidsmatroidPG n fqS returns the projective geometry PG(n,Fq), where fq is a list of the elements of FqmatroidAG n fqO returns the affine geometry AG(n,Fq), where fq is a list of the elements of FqGiven a matroid m, the fundamental-circuit incidence matrix relative to a base b has rows indexed by the elements of b, and columns indexed by the elements not in b. The bi, ej entry is 1 if bi is in the fundamental circuit of ej relative to b, and 0 otherwise.Find representations of the matroid m over fq. Specifically, this function will find one representative of each projective equivalence class of representation.gIs the matroid representable over Fq? For example, to find out whether a matroid m is binary, evaluate isRepresentable f2 m.<A binary matroid is a matroid which is representable over F2=A ternary matroid is a matroid which is representable over F3The Fano plane F7 = PG(2,F2):F7-, the relaxation of the Fano plane by removal of a line1The Pappus configuration from projective geometry;Relaxation of the Pappus configuration by removal of a lineThe Desargues configuration=The Vamos matroid V8. It is not representable over any field.P8 is a minor-minimal matroid that is not representable over F4, F8, F16, ... . It is Fq-representable if and only if q is not a power of 2.HP8- is a relaxation of P8. It is Fq-representable if and only if q >= 4.P8-- is a relaxation of P8-. It is a minor-minimal matroid that is not representable over F4. It is Fq-representable if and only if q >= 5.Given a matroid m over elements es, the rank polynomial is a polynomial r(x,y), which is essentially a generating function for the subsets of es, enumerated by size and rank. It is efficiently calculated using deletion and contraction.It has the property that r(0,0) is the number of bases in m, r(1,0) is the number of independent sets, r(0,1) is the number of spanning sets. It can also be used to derive the chromatic polynomial of a graph, the weight enumerator of a linear code, and more.qrstuvwxyz{|}~qrstuvwxyz{|}~ yz{|}~wxuvqtsrqtsruvwxyz{|}~6None246 0The type for elements of quadratic number fields PA basis for quadratic number fields Q(sqrt d), where d is a square-free integer.Although this has the same name as the Prelude.sqrt function, it should be thought of as more like a constructor for creating elements of quadratic fields.Note that for d positive, sqrt d means the positive square root, and sqrt (-d) should be interpreted as the square root with positive imaginary part, that is i * sqrt d. This has the consequence that for example, sqrt (-2) * sqrt (-3) = - sqrt 6.                      7None# !"#$%&'()*+,-./0123456789:# !"#$%&'()*+,-./0123456789:# !"#$%&'()*+,-./0123456789: !"#$%&'()*+,-./0123456789:8None=_The special linear group SL(n,Fq), generated by elementary transvections, returned as matrices ?The projective special linear group PSL(n,Fq) == A(n,Fq) == SL(n,Fq)/Z, returned as permutations of the points of PG(n-1,Fq). This is a finite simple group provided n>2 or q>3. A5The symplectic group Sp(2n,Fq), returned as matrices BThe projective symplectic group PSp(2n,Fq) == Cn(Fq) == Sp(2n,Fq)/Z, returned as permutations of the points of PG(2n-1,Fq). This is a finite simple group for n>1, except for PSp(4,F2). ;<=>?@ABCDEFGHIJ;<=>?@ABCDEFGHIJ;<=>?@ABCDEFGHIJ;<=>?@ABCDEFGHIJ9None<KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~4KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<MNOPQRSKLTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:NoneGenerators for G2(3), a finite simple group of order 4245696, as a permutation group on the 702 unit imaginary octonions over F3 )&)( ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<Bk      !"#$%&'()*+,-./0123456 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                     !"#$%&'(j)*+,-./01234567869:;<=>?@ABCDEFGHIJ%KLMNOPQRSTUVWXYZ[\]^_`abcdefghi(-jklmnopq4rstuvwxxyJz{|}$%.~g)(-n01234*+,01-i./78 LM~ /      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFFGGHHIIJ~K.LMNOPQRSTUVWXYZ[\]^_`abcdef !"gh%&'ijklmnopqrstuvwxyz{|}~jllj(-n8016qk4 A  B  C F      D                  H         N !!!!!!!!!! !!! ! ! !6! ! !!!!!!!!!!!!!!"""" """"""""" "!"""#"$""%"&""'"(")"*"+","-"."/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?#@#A#B#a#C#D#E#F#G#H#I#J#K##L#M# #N# #O#P#Q#R#S#T#U#V##W#X#Y#Z#[#\#]#^#_#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~####$$$$$$$$$$$$$$$_$Y$$X$e$t$$d$$n$o$p%%%%%%%%%%%%&&&&&l&&&&&&&&&&&n&&''''''''''9':''''''''''''''''''''S'U''''''''X'''''''''''''''''''''''''''''''(7(8(((((((((()))))))))))))))))))*****L*** * * * * ****** **********++4,,,, ,!,",#,$,%,&,',(,),*,+,,,-,.,/,0,1,2,3,4,5,6,7,8,9,:,;,<-=->-V-?---@-A-B-C-D-E-F-G.H.J..I.J.K.L.M.N.O.P.Q.R.S.T.U.V..W.X.Y.Z.[.\.].^.._.`..a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.{.|.}.~.../////////f////////////`//////////00000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1 1 1 1 1l1111111111111111111 1!1"1#1$1%1&1'1(1)1*1+1,1-1.1/101112131415161718191:1;1<1=1>11?1@1A1B1C1D1E1F1G1H1I1J1K1L1M1N1O1P1Q2R2S2T2U2V2W2X2Y2Z2[2\2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m3n3{313z3o3p3j3i3q3r3s3t3u3v3w3x3y3z3{3|3}3~3333333333333333344444444444444555555j5555555555555555555555555555555555555555555v5555555L5555,55D55555555555555555555555555555555555555555555555555555555555 5 5 5 55 55555555555555555555 5!5"5#5$5%6&6%6'6(666)66 6 6*6 6 66+6,7-77.77J7z7{7|7/70717D72737475767778797:7;7<7=7>7?7@7A7B7C7D7E7F7G7H8I8J8K8L88M888N8O8P8Q88R88S9T9T99999199U9V9 999W9X9Y9Z9[9\9]9^9_9`9a9b9c9d9e9f9g9h9i9j9k9l9m9n9o99p9q9r9X99s9t9u9v9w9x9y9z9{9|9}9~9999:=:V:?:::@:A:B:C:8:::::::::::::::::::::::::::::::  1                 ))))))=)))))))))))))))))))))))))))))))))))))*****+i+%+%+!+++++++5.HaskellForMaths-0.4.8"Math.QuantumAlgebra.TensorCategoryMath.NumberTheory.PrimeMath.Algebras.VectorSpaceMath.Algebras.TensorProductMath.Algebras.Structures"Math.Algebra.Group.StringRewritingMath.Common.ListSetMath.Core.UtilsMath.Combinatorics.DigraphMath.NumberTheory.FactorMath.Common.IntegerAsTypeMath.Algebra.Field.BaseMath.Algebra.Field.Extension"Math.Algebra.NonCommutative.NCPoly#Math.Algebra.NonCommutative.GSBasis)Math.Algebra.NonCommutative.TensorAlgebraMath.Algebras.CommutativeMath.Algebras.AffinePlaneMath.Algebras.LaurentPolyMath.Algebras.MatrixMath.Algebras.NonCommutativeMath.Algebras.TensorAlgebra%Math.Projects.KnotTheory.LaurentMPolyMath.Projects.KnotTheory.Braid&Math.Projects.KnotTheory.TemperleyLieb%Math.Projects.KnotTheory.IwahoriHecke"Math.QuantumAlgebra.OrientedTangle Math.QuantumAlgebra.QuantumPlaneMath.QuantumAlgebra.TangleMath.Core.Field"Math.CommutativeAlgebra.Polynomial%Math.CommutativeAlgebra.GroebnerBasisMath.Algebras.QuaternionsMath.Algebra.LinearAlgebra#Math.Algebra.Group.PermutationGroupMath.Algebra.Group.SchreierSims%Math.Algebra.Group.RandomSchreierSimsMath.Algebra.Group.SubquotientsMath.Combinatorics.GraphMath.Algebra.Group.CayleyGraphMath.Combinatorics.GraphAutsMath.Projects.RubikMath.Algebras.GroupAlgebra!Math.Combinatorics.FiniteGeometryMath.Algebras.OctonionsMath.Combinatorics.DesignMath.Combinatorics.HypergraphMath.Combinatorics.Poset+Math.Combinatorics.CombinatorialHopfAlgebra#Math.Combinatorics.IncidenceAlgebra'Math.Combinatorics.StronglyRegularGraphMath.Combinatorics.LatinSquaresMath.Combinatorics.Matroid Math.NumberTheory.QuadraticFieldMath.Projects.RootSystem&Math.Projects.ChevalleyGroup.Classical$Math.Projects.MiniquaternionGeometry(Math.Projects.ChevalleyGroup.ExceptionalCob2VectBraidFinCardFinOrd SymmetricBraidedtwist WeakMonoidalassoclunitrunitStrictMonoidalMonoidaltunittobtarMFunctorfobfar MCategoryObArid_sourcetarget>>>OSeqParComultCounitMultUnitIdVectObVectArBraidObBraidAr FinCardOb FinCardArFinOrdObFinOrdArfinOrdAr finCardArfinPermtt'rewrite$fMonoidalCob2 TFCo:R:ObCob2 TFCo:R:ArCob2$fMCategoryCob2 TFCo:R:ObVect TFCo:R:ArVect$fMCategoryVect$fMFunctorBraidFinCard$fBraidedBraid$fMonoidalBraidTFCo:R:ObBraidTFCo:R:ArBraid$fMCategoryBraid$fMFunctorFinOrdFinCard$fMonoidalFinCardTFCo:R:ObFinCardTFCo:R:ArFinCard$fMCategoryFinCard$fMonoidalFinOrdTFCo:R:ObFinOrdTFCo:R:ArFinOrd$fMCategoryFinOrdisTrialDivisionPrimeprimesisMillerRabinPrimeisPrimenotPrime prevPrime nextPrimeDualTrivialEBasisEVtermscoeff removeTermzerovadd<+>addmergesumvnegatev<->smultL*>smultR<*nflinearee1e2e3wrapunwrape'e1'e2'e3'dual<<+>><<->>zerofsumf coeffLens $fShowDual $fShowEBasis $fMonadVect$fApplicativeVect $fFunctorVect $fShowVectTensorDSumi1i2coprodfp1p2prodfdsumedsumftetfassocLassocRunitInLunitOutLunitInRunitOutRdistrLundistrLdistrRundistrRevdeltareify HasPairingpairingComodulecoactionModuleactionMonoidCoalgebraMC SetCoalgebraSC HopfAlgebraantipode Bialgebra CoalgebracounitcomultAlgebraunitmultMonmunitmmultunit'counit'*.pairing'$fHasPairingk(,)(,)$fHasPairingk()()$fComoduleka(,) $fModuleka(,)$fModulek(,)(,) $fComodulekcc $fModulekaa$fCoalgebrakMonoidCoalgebra$fCoalgebrakSetCoalgebra$fCoalgebrakEBasis$fCoalgebrak(,) $fAlgebrak(,)$fCoalgebrakEither$fAlgebrakEither$fCoalgebrak() $fAlgebrak() $fNumVectSGenSrewrite1splitSubstring findOverlap knuthBendix1ordpairshortlex knuthBendix2merge knuthBendix3 knuthBendixnfseltss_s1s2s3_S_S'tri_D $fShowSGen toListSet isListSetunion intersect\\symDiffdisjointisSubset HasInversesinverseFinSettoSetsortDesc insertDesc setUnionAsc setUnionDesc intersectAscmultisetSumAscmultisetSumDescdiffAscdiffDesc isSubsetAscisSubMultisetAscelemAsc notElemAscpickspairsfoldcmplisWeaklyIncreasingisStrictlyIncreasingisWeaklyDecreasingisStrictlyDecreasingcmpfsteqfstfromBase powersetdfs powersetbfscombinationsOfchoose^-DigraphDGverticesedges predecessors successorsadjLists digraphIsos1 digraphIsos2heightPartitionDAGisDAGdagIsosisDagIsoperms isoRepDAG1 isoRepDAG2 isoRepDAG3 isoRepDAG$fFunctorDigraphpfactors ppfactors pfactorsTo ppfactorsToT97T89T83T79T73T71T67T61T59T53T47T43T41T37T31T29T23T19T17T13T11T7T5T3T2TOneTZeroTMinus1M IntegerAsTypevalue$fIntegerAsTypeT97$fIntegerAsTypeT89$fIntegerAsTypeT83$fIntegerAsTypeT79$fIntegerAsTypeT73$fIntegerAsTypeT71$fIntegerAsTypeT67$fIntegerAsTypeT61$fIntegerAsTypeT59$fIntegerAsTypeT53$fIntegerAsTypeT47$fIntegerAsTypeT43$fIntegerAsTypeT41$fIntegerAsTypeT37$fIntegerAsTypeT31$fIntegerAsTypeT29$fIntegerAsTypeT23$fIntegerAsTypeT19$fIntegerAsTypeT17$fIntegerAsTypeT13$fIntegerAsTypeT11$fIntegerAsTypeT7$fIntegerAsTypeT5$fIntegerAsTypeT3$fIntegerAsTypeT2$fIntegerAsTypeTOne$fIntegerAsTypeTZero$fIntegerAsTypeTMinus1$fIntegerAsTypeMF97F89F83F79F73F71F67F61F59F53F47F43F41F37F31F29F23F19F17F13F11F7F5F3F2 FiniteFieldeltsFqbasisFqFpQ numeratorQ denominatorQextendedEuclid primitiveEltpowerscharf2f3f5f7f11f13f17f19f23f29f31f37f41f43f47f53f59f61f67f71f73f79f83f89f97 $fFinSetFp$fFiniteFieldFp$fFractionalFp$fNumFp$fShowFp$fShowQ QSqrtMinus5 QSqrtMinus3 QSqrtMinus2 QSqrtMinus1QSqrt7QSqrt5QSqrt3QSqrt2SqrtF32 ConwayF32F27 ConwayF27F25 ConwayF25F16 ConwayF16F9ConwayF9F8ConwayF8F4ConwayF4ExtensionFieldExtPolynomialAsTypepvalueUPolyUPxshowUPtoUPoly<*>convertdegltmonomial quotRemUPmodUPextendedEuclidUP/>embedpolysf4a4f8a8f9a9f16a16f25a25f27a27f32a32 frobeniusAutdegreesqrt2sqrt3sqrt5sqrt7i sqrtminus2 sqrtminus3 sqrtminus5 conjugate$fPolynomialAsTypeQSqrt$fPolynomialAsTypeFpConwayF32$fPolynomialAsTypeFpConwayF27$fPolynomialAsTypeFpConwayF25$fPolynomialAsTypeFpConwayF16$fPolynomialAsTypeFpConwayF9$fPolynomialAsTypeFpConwayF8$fPolynomialAsTypeFpConwayF4$fFinSetExtensionField$fFiniteFieldExtensionField$fFractionalExtensionField$fNumExtensionField$fShowExtensionField $fNumUPoly $fShowUPoly InvertibleinvVarZYXNPolyNPMonomialdivMcmpTerm mergeTermscollectvaryzlmlc quotRemNPremNP%%remNP2toMonicinjectsubst $fShowVar$fFractionalNPoly $fNumNPoly $fShowNPoly $fOrdNPoly $fNumMonomial$fShowMonomial $fOrdMonomialsPolygb1reducegbgb'gb2gb2'mbasisQAWeylGensDBasise_e4dim tensorBasis extRelationsextnf exteriorBasis symRelationssymnfsymmetricBasis weylRelationsweylnf weylBasisd_x_d1d2d3x1x2x3commweylRelations'weylnf' weylBasis'$fShowWeylGens $fShowBasis DivisionBasisdividesBdivBGlexPoly GlexMonomialGlexglexVarbinddividesTdivT quotRemMP$fDivisionBasisGlexMonomial$fMonomialGlexMonomial$fCoalgebrakGlexMonomial$fAlgebrakGlexMonomial$fShowGlexMonomial$fOrdGlexMonomialSL2ABCDCBAXYabcdsl2Var$fHopfAlgebraQSL2$fBialgebraQSL2$fCoalgebraQSL2 $fMonomialSL2 $fAlgebraQSL2 $fShowSL2 $fShowABCD$fShowXY LaurentPolyLaurentMonomialLMlvarqq'$fFractionalVect$fAlgebrakLaurentMonomial$fMonLaurentMonomial$fShowLaurentMonomialM3E3Mat2'E2'Mat2E2toMat2toEB2toEB $fAlgebrakM3$fCoalgebrakMat2'$fModulekMat2EBasis$fAlgebrakMat2NCPolyNonComMonomialNCMncm$fDivisionBasisNonComMonomial$fMonomialNonComMonomial$fAlgebrakNonComMonomial$fMonNonComMonomial$fShowNonComMonomial$fOrdNonComMonomialTensorCoalgebraTCExteriorAlgebraSymmetricAlgebraSym TensorAlgebraTAinjectTA injectTA'liftTAliftTA'fmapTAfmapTA'bindTAbindTA'toSym injectSym injectSym'liftSymliftSym'fmapSymfmapSym'bindSymbindSym'toExt signedSort injectExt injectExt'liftExtliftExt'fmapExtfmapExt'bindExtbindExt' projectTCcoliftTC coliftTC'cobindTC$fCoalgebrakTensorCoalgebra$fAlgebrakExteriorAlgebra$fShowExteriorAlgebra$fAlgebrakSymmetricAlgebra$fMonSymmetricAlgebra$fShowSymmetricAlgebra$fAlgebrakTensorAlgebra$fMonTensorAlgebra$fShowTensorAlgebra LaurentMPolyLPdegLM denominatorLMlcmLMdivLM quotRemLPreduceLP denominatorLPsqrtvar^^^$fFractionalLaurentMPoly$fNumLaurentMPoly$fShowLaurentMPoly$fFractionalLaurentMonomial$fNumLaurentMonomial$fOrdLaurentMonomial BraidGensLPQs4writhek3_1k4_1k5_1k7_1$fInvertibleNPoly$fShowBraidGens$fInvertibleLaurentMPolyTemperleyLiebGensd' tlRelationsdimTLtlnftlBasistr'tra' fromBraidjones$fShowTemperleyLiebGensIwahoriHeckeGensTt_t1t2t3t4z' ihRelationsdimIHihnfihBasistau'tauhomflylmhomfly'homfly''coeffsjones'$fShowIwahoriHeckeGensOrientedTangleHorizDirToRToLOrientedMinusPlusOTParTSeqTXMinusXPlusCupTCapTIdTidVidV'evalVevalV'coevalVcoevalV'lambdac'testcc'mumu'capRLcapLRcupRLcupLRxplusxminusyplusyminustplustminuszpluszminusoloopotrefoil otrefoil'$fMonoidalOrientedTangleTFCo:R:ObOrientedTangleTFCo:R:ArOrientedTangle$fMCategoryOrientedTangleSL2qM2qAq02Aq20qvardetquvaq20aq02m2qsl2qyb$fHopfAlgebraVectSL2q$fBialgebraVectSL2q$fCoalgebraVectSL2q$fAlgebraVectSL2q$fMonomialSL2q $fShowSL2q$fComoduleVectM2qAq20$fBialgebraVectM2q$fCoalgebraVectM2q$fAlgebraVectM2q $fMonomialM2q $fShowM2q$fAlgebraVectAq02$fMonomialAq02 $fShowAq02$fAlgebraVectAq20$fMonomialAq20 $fShowAq20 TangleRepTangleUnderTOverTcapcupoverunderlooptrefoilkauffmanloopTtrefoilT$fMonoidalTangleTFCo:R:ObTangleTFCo:R:ArTangle$fMCategoryTangle $fAlgebrak[]$fMon[] $fFinSetF25$fFractionalF25$fNumF25 $fShowF25 $fFinSetF16$fFractionalF16$fNumF16 $fShowF16 $fFinSetF9$fFractionalF9$fNumF9$fShowF9 $fFinSetF8$fFractionalF8$fNumF8$fShowF8 $fFinSetF4$fFractionalF4$fNumF4$fShowF4 $fFinSetF23$fFractionalF23$fNumF23 $fShowF23 $fFinSetF19$fFractionalF19$fNumF19 $fShowF19 $fFinSetF17$fFractionalF17$fNumF17 $fShowF17 $fFinSetF13$fFractionalF13$fNumF13 $fShowF13 $fFinSetF11$fFractionalF11$fNumF11 $fShowF11 $fFinSetF7$fFractionalF7$fNumF7$fShowF7 $fFinSetF5$fFractionalF5$fNumF5$fShowF5 $fFinSetF3$fFractionalF3$fNumF3$fShowF3 $fFinSetF2$fFractionalF2$fNumF2$fShowF2Elim2 GrevlexPolyGrevlexLexPolyLexMonImplMonomialConstructormvarmindicesmdividesmdivmgcdmlcmmcoprimemdegmproperlydivideslexvarglexvar grevlexvarflipbindevalvarstdividestdivtgcdtmult*->$fAlgebrakElim2$fMonomialElim2 $fMonElim2 $fShowElim2 $fOrdElim2$fAlgebrakGrevlex $fOrdGrevlex $fShowGrevlex$fAlgebrakGlex $fOrdGlex $fShowGlex $fAlgebrakLex$fOrdLex $fShowLex$fMonomialConstructorMonImpl$fMonomialMonImpl $fMonMonImpl $fShowMonImplisGBpairWith!gb2agb3gb4mergeBysugar cmpNormalcmpSugmemberGBmemberIsumIproductI intersectI toElimFst toElimSnd isElimFst fromElimSnd eliminateFst quotientI quotientP eliminatembasisltIdeal numMonomials hilbertFunQAhilbertSeriesQA1hilbertSeriesQAhilbertSeriesQA' hilbertPolyQAhilbertPolyQA'dim'HasConjugationconjsqnorm QuaternionHBasisKJIOnejk scalarPart vectorPart<.>reflasMatrixreprSO3'reprSO3reprSO4'reprSO4reprSO4done'i'j'k'$fCoalgebrakDual$fHasConjugationkHBasis$fAlgebrakHBasis $fShowHBasis<<*>>*>><<*><*>>fMatrixfMatrix'idMxiMxjMxzMxinverse1inverse2rowEchelonFormreducedRowEchelonFormsolveLinearSystemisZeroinSpanRErankkernel kernelRREdet PermutationProtateLfmapPp fromPairs fromPairs'toPairsfromListsupp.^-^ fromCyclestoCyclescycleOfparitysignorderElt~^closureSclosureorbit.^^orbitPorbitV-^^orbitBorbitEorbits_C_D2_AdpwrtoSn fromDigits fromDigits' fromBinary fromBinary'eltsSorderisMemberminsupporderTGSeltsTGS tgsFromSgsorderSGS orderBSGSgens~^^ conjClass conjClassReps reduceGensisSubgpsubgps isMinimal centralizercentre normalizer stabilizerptStabsetStab normalClosure commutatorGp derivedSubgp-*--**-isNormal normalSubgpsisSimplecosets quotientGp//~~^conjugateSubgps subgpActionrrprrrpr'permutationMatrix$fHasInversesPermutation$fNumPermutation$fShowPermutation cosetRepsGxschreierGeneratorsGxsiftfindBasesgsbsgsbsgs'newLevel newLevel'ssss' isMemberBSGSeltsBSGScartProdindexreduceGensBSGS testProdRepl initProdRepl nextProdRepl updateArrayrssrss' initLevels updateLevels updateLevels'baseTransversalsSGS isMemberSGSisLeftisRightunRight restrictLeft isTransitive!transitiveConstituentHomomorphism"transitiveConstituentHomomorphism' minimalBlock blockSystemsblockSystemsSGS isPrimitiveisPrimitiveSGSblockHomomorphismblockHomomorphism'intersectionNormalClosurecentralizerSymTransGraphGsetpowerset isSetSystemisGraphgraphtoGraphincidenceMatrixfromIncidenceMatrixadjacencyMatrixfromAdjacencyMatrix nullGraph nullGraph'kbkb' tetrahedroncube octahedron dodecahedron icosahedronprismto1npetersen complement restrictioninducedSubgraph lineGraph lineGraph'sizevalency valenciesvalencyPartition regularParam isRegularisCubicnbrs findPathsdistancediameter findCyclesgirthdistancePartitiondistancePartitionS component isConnected componentskneserjohnsonbipartiteKneser desargues1gp petersen2prism'durer mobiusKantor dodecahedron2 desargues2$fFunctorGraphcayleyDigraphP cayleyGraphPcayleyDigraphS cayleyGraphSfromTranspositions fromTrans bubblesorttoTranstoTranspositions inversionsisVertexTransitiveisEdgeTransitiveisArcTransitiveisnArcTransitiveis2ArcTransitiveis3ArcTransitiveis4ArcTransitiveisDistanceTransitive isGraphAutisIncidenceAut graphAuts graphAuts7 graphAuts8 incidenceAutsincidenceAuts2 graphIsos isGraphIso incidenceIsosisIncidenceIsofr rubikCube cornerFaceskerCornerFaces kerEdgeFaces cornerBlocks edgeBlockskerCornerBlocks kerEdgeBlocks_U_u_dbf_R_r_l_Lud_B_b_f_F GroupAlgebra ZeroOneStarStarZeroptsAGptsPGpnfispnf closureAGlineAG closurePGlinePGqtorialqnomial numFlatsPG numFlatsAGqtorialsqnomialsrrefsflatsPGflatsAGlinesPGlinesAGlinesAG1linesAG2incidenceGraphPGincidenceGraphAGorderGLorderAfforderPGLheawood$fShowZeroOneStarOctonionOBasisi0i3i4i5i6i_$fHasConjugationkOBasis$fAlgebrakOBasis $fShowOBasisDesigndesigntoDesignisValidpointsblocksnoRepeatedBlocks tDesignParamsfindvk findlambda designParams isStructureisDesign is2DesignisSquare subsetDesign pairDesignag2pg2 flatsDesignPGpg flatsDesignAGag paleyDesign fanoPlane derivedDesign pointResidualcomplementaryDesign blockResidual isDesignAutincidenceGraph designAuts designAuts1 alphaL2_23 betaL2_23 gammaL2_23l2_23deltaM24m24m24sgsm23sgsm22sgsoctads_5_8_24s_4_7_23s_3_6_22 s_5_8_24' alphaL2_11 betaL2_11 gammaL2_11l2_11deltaM12hexads_5_6_12s_4_5_11m12m12sgsm11sgs HypergraphH hypergraph toHypergraph isUniformsame fromGraph fromDesignisPartialLinearSpaceisProjectivePlaneisProjectivePlaneTriisProjectivePlaneQuadisGeneralizedQuadranglegriddualGridisGenQuadrangle'isConfiguration heawoodGraphdesarguesConfigurationdesarguesGraphpappusConfiguration pappusGraph coxeterGraphduads synthemestutteCoxeterGraphintersectionGraphPosetimplies isReflexiveisAntisymmetricisPosetposet intervalsintervalchainN antichainNdividesdivisorsposetDposetB partitions isRefinementposetPintervalPartitions isIntervalintervalPartitions2integerPartitionsisIPRefinementposetIP subspaces isSubspaceposetLsubposetdsumdprod hasseDigraphreachabilityPosetisOrderPreserving orderIsos01 isOrderIso orderIsos orderAuts1isLinextlinexts $fShowPoset $fEqPosetNSymSymHSymESymMQSymFQSymMYSymMYSymFPBTSSymMSSymFShuffleShshshufflesdeconcatenationsssymF shiftedConcatprop_AssociativeflattenssymM weakOrderssymMtoFssymFtoM ssymFtoDualysymF nodecount leafcountprefixshapeSignature nodeCountTree leafCountTree lrCountTreeshapenumberedsplits multisplitsgraftysymMtrees tamariCovers tamariUpSet tamariOrderysymMtoFysymFtoM compositions quasiShufflesqsymM coarsenings refinementsqsymFqsymMtoFqsymFtoMqsymPolysymMcompositionsFromPartitionsymMultsymEsymEtoMsymHsymHtoMnsymdescendingTreedescendingTreeMapminPermmaxPermleftLeafCompositionleftLeafComposition'leftLeafCompositionMapdescentsdescentComposition descentMapunderCompositionisUnderIrreducibleunderDecomposition ysymmToSh symToQSymM nsymToSymH nsymToSSym$fHasPairingkNSymQSymM$fHasPairingkSymHSymM$fHopfAlgebrakNSym$fBialgebrakNSym$fCoalgebrakNSym$fAlgebrakNSym$fBialgebrakSymH$fCoalgebrakSymH$fAlgebrakSymH$fBialgebrakSymE$fCoalgebrakSymE$fAlgebrakSymE$fHopfAlgebrakSymM$fBialgebrakSymM$fCoalgebrakSymM$fAlgebrakSymM $fOrdSymM$fHopfAlgebrakQSymF$fBialgebrakQSymF$fCoalgebrakQSymF$fAlgebrakQSymF $fShowQSymF $fOrdQSymF$fHopfAlgebrakQSymM$fBialgebrakQSymM$fCoalgebrakQSymM$fAlgebrakQSymM $fShowQSymM $fOrdQSymM$fHopfAlgebrakYSymM$fBialgebrakYSymM$fCoalgebrakYSymM$fAlgebrakYSymM $fShowYSymM$fHopfAlgebrakYSymF$fBialgebrakYSymF$fAlgebrakYSymF$fCoalgebrakYSymF $fShowYSymF$fOrdPBT$fHasPairingkSSymFDual$fHopfAlgebrakDual$fBialgebrakDual$fAlgebrakDual$fHopfAlgebrakSSymM$fBialgebrakSSymM$fCoalgebrakSSymM$fAlgebrakSSymM $fShowSSymM $fOrdSSymM$fHasPairingkSSymFSSymF$fHasInversesSSymF$fHopfAlgebrakSSymF$fBialgebrakSSymF$fCoalgebrakSSymF$fAlgebrakSSymF $fShowSSymF $fOrdSSymF$fHopfAlgebrakShuffle$fBialgebrakShuffle$fCoalgebrakShuffle$fAlgebrakShuffleIntervalIvivPoset intervalIsos isIntervalIsointervalIsoMapintervalIsoClassesunitIAbasisIAzetaIAmuIA1muIAinvIA1invIA numChainsIAetaIAnumMaximalChainsIAmuCmuBmuL toIsoClasses toIsoClasses'$fCoalgebrakInterval$fHasInversesVect$fAlgebrakInterval$fShowInterval $fOrdInterval $fEqInterval DesignVertex srgParamsisSRGl2'l2 paleyGraphclebsch'clebschclebsch2triplesheptads+^+^^hoffmanSingleton'hoffmanSingleton inducedA7hsA7gewirtz'gewirtzhigmanSimsGraph'higmanSimsGraph inducedM22 higmanSimsM22_HS2_HSsp2spswitch schlafli'schlafli mcLaughlin' mcLaughlin_McL2_McL findLatinSqs isLatinSq isOneOfEachincidenceGraphLSincidenceGraphLS' isOrthogonalfindMOLSisMOLSfromProjectivePlaneisOAfromLSfromMOLSgraphOA srgParamsOALMRRMidLMatroidTrieSetTSexistsunique isShortlex toShortlex isClutter deletionsclosedUnderSubsetstsshowtsemptytsinserttsmember tssubmembertstolist tsfromlistelementsindeps isIndependent isDependentisMatroidIndeps fromIndeps fromIndeps1 vectorMatroidvectorMatroid' cycleMatroid cycleMatroid'incidenceGraphBincidenceGraphCincidenceGraphH matroidIsos isMatroidIso matroidAuts isCircuitcircuitsisMatroidCircuits fromCircuitsisLoop isParallelisBasebasesisMatroidBases fromBasesfundamentalCircuituniformMatroid restriction1rankfun fromRankfun fromClosureisFlatflats1 coveringFlats minimalFlatflats fromFlats fromFlats' isSpanning isHyperplane hyperplanes1 hyperplanesisMatroidHyperplanesfromHyperplanes1fromHyperplanes affineMatroid fromGeoRepminimalsimpleFromGeoRepisSimpleGeoRepisCircuitHyperplanecircuitHyperplanes relaxationex161transversalGraphpartialMatchingstransversalMatroidisCoindependentisCobase isCocircuit cocircuitsisColoop isCoparalleldeletion\\\ contraction/// matroidPG matroidAG!fundamentalCircuitIncidenceMatrix"fundamentalCircuitIncidenceMatrix'fcimfcim'markNonInitialRCs substStarsstarSubstitutionsVrepresentations1fcig markedfcimrepresentations2representationsisRepresentableisBinary isTernaryseriesConnectionparallelConnectiontwoSum matroidUnionf7mpappus nonPappus desargues vamosMatroid1 vamosMatroidv8p8p8'p8mp8mm wheelGraphmw4w4'w4 isBinary2 rankPoly1rankPolynumBases numIndeps numSpanning indepCounts whitney2nd whitney1st $fShowTrieSetXVarQNFQNFBasissqrtsqrt6$fAlgebrakQNFBasis$fShowQNFBasisTypeFbasisElt simpleSystemw weylPerms weylMatriceswMx cartanMatrixsetDiagdynkinFromCartan dynkinDiagramcoxeterFromDynkin coxeterMatrixfromCoxeterMatrixfromCoxeterMatrix2coxeterPresentation eltsCoxeter poincarePolyelemMxlieMult+|++-+form rootSystemnumRoots orderWeyl factorialnumPtsAGnumPtsPGslelemTransvectionorderLsorderS2orderS omegaevenomegaoddoJ9norm squaresF9j9autJ9autAautBautCautsJ9conj'isAutisReal isComplexptsPG2orthogonalLinesPG2 rightLinesPG2 leftLinesPG2phiphi'collineationsPhi liftToGraphomega0omegaomega2collineationsOmegaomegaDomegaD1omegaD2psipsi2collineationsPsi collinear isQuadrangle concurrentisQuadrilateralisOval findOvals1findQuadrangles findOvals$fFiniteFieldJ9$fFractionalJ9$fNumJ9$fShowJ9$fFiniteFieldF9toListexpose antiCommutes octonionsisUnitunitImagOctonionsautFrom%^alpha3beta3gamma3sgamma3alpha3'beta3'gamma3'g2_3alpha4beta4gamma4sgamma4alpha4'beta4'gamma4'$fFractionalOctonion $fNumOctonion$fShowOctonionisStrongPseudoPrimeisStrongPseudoPrime'split2s power_modisMillerRabinPrime'EllipticCurvePtInf EllipticCurveECisEltECecAddecSmultdiscriminantECecTrial multipliers findFactorECMparallelInverse parallelEcAddparallelEcSmultparallelEcTrialfindFactorParallelECM SearchTree->^isArcTransitive'findArcs leftDepth leftWidthsgraphAutsEdgeSearchTree graphAuts1 terminalstransversalTerminals graphAuts2 isSingletonintersectCells$graphAutsDistancePartitionSearchTree graphAuts3strongTerminals$graphAutsDistanceColouringSearchTreedistanceColouringintersectColouringcolourPartitionequitableRefinementequitableRefinement'equitablePartitionSearchTreeequitablePartitionSearchTree2$equitableDistancePartitionSearchTreetrace1!equitablePartitionGraphSearchTree%equitablePartitionIncidenceSearchTreeleftLeaf allLeavespartitionBSGS0 partitionBSGSpartitionBSGS3partitionBSGS2g1g1'g2 maybeGraphIso(incidenceAutsDistancePartitionSearchTree graphIsosConincidenceIsosCon edgeFaces imCornerFaces imEdgeFacesimCornerBlocks imEdgeBlocks maybeInverse$fModulekPermutation[]$fModulekPermutationInt$fHopfAlgebrakPermutation$fBialgebrakPermutation$fCoalgebrakPermutation$fAlgebrakPermutation