d\s         ! "#$ % & ' ( ) * + , - . / 0 1 2 3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg h i j!k!l!m!n!o!p!q!r!s"t"u"v#w#x#y$z${$|$}$~$$$$$$$$$%%%%%&&&&&'''((())))9*           (a + b) + c = a + (b + c)  replicate 1 a = a 5 replicate (2 * n) a = replicate n a + replicate n a = replicate (2 * n + 1) a = replicate n a + replicate n a + a &replicate1p n r = replicate (1 + n) r z + x < = z + y = x < = y = x + z <= y + z UpartitionWith f c returns a list containing f a b for each a b such that a + b = c, an additive abelian semigroup a + b = b + a + @An associative algebra built with a free module over a semiring eA pair of an additive abelian semigroup, and a multiplicative semigroup, with the distributive laws:   a(b + c) = ab + ac  (a + b)c = ac + bc XCommon notation includes the laws for additive and multiplicative identity in semiring. If you want that, look at Rig instead.  Ideally we'd use the cyclic definition:  ` class (LeftModule r r, RightModule r r, Additive r, Abelian r, Multiplicative r) => Semiring r Nto enforce that every semiring r is an r-module over itself, but Haskell doesn' t like that. A multiplicative semigroup  !  !  !"#NEvery coalgebra gives rise to an algebra by vector space duality classically. N Sadly, it requires vector space duality, which we cannot use constructively. ~ This is the dual, which relies in the fact that any constructive coalgebra can only inspect a finite number of coefficients. "#"#"##,$IAn associative unital algebra over a semiring, built using a free module %&'()*$%&'()*$%%&'()'()* +,$%+,$%+,+,, -:a Hopf algebra on a semiring, where the module is a free. If antipode . antipode = id then we are Involutive .-.-.-..- "#$%+,-. $%"#+,-. &'()*&'()* /0Bb is an associate of a if there exists a unit u such that b = a*u UThis relationship is symmetric because if u is a unit, u^-1 exists and is a unit, so  b*u^-1 = a*u*u^-1 = a 12/012/012/0012  !! 3<An multiplicative semigroup with idempotent multiplication.  a * a = a 4534534534567a rectangular band is a nowhere commutative semigroup. = That is to say, if ab = ba then a = b. From this it follows = classically that aa = a and that such a band is isomorphic  to the following structure 76767677.3456789:;<=89:;<=89:;<=89:;9:;<=>?@AB>?@AB>?@AB>?@AB?@ABC'A commutative multiplicative semigroup CCCDAn semigroup with involution ) adjoint a * adjoint b = adjoint (b * a) EFDEFDEFDEEFG`factorWith f c`% returns a non-empty list containing `f a b` for all `a, b` such that ` a * b = c`. _Results of factorWith f 0 are undefined and may result in either an error or an infinite list. HGHGHGHH/ !&'()*>?@ABCDEFGHIJKLIJKLKLIJIJJKLLMAn additive monoid  zero + a = a = a + zero NOPQMNOPQMNOPQMNOPNOPQR0An additive semigroup with idempotent addition.   a + a = a 7An (Idempotent r, Rig r) => r is also known as a dioid STRSTRSTRST0 !34567CDEFRST1# !&'()*34567CDEFMNOPQRSTUVUVUVUVVWA Ring without (n)egation XYZWXYZWXYZWXXYZ[[[[2  [\(adjoint (x + y) = adjoint x + adjoint y \\\]]]]3\]^_`ab^_`ab^_`ab^_`ab_`ab4- !&'()*34567>?@ABCDEFMNOPQRST^_`abcA Ring without an i dentity. cccdefdefdefdeef5IJKL6MNOPQRST^_`ab ghighighighihi! jkl>Linear functionals from elements of a free module to a scalar mnopqrThe augmentation ring homomorphism from r^a -> r, generalizes the augmentation homomorphism from a monoid semiring to the underlying semiring JLjklmnopqr lmnLJjokpqr jklmnmnopqr"sBAntilinear functionals from elements of a free module to a scalar tustustustutu#vwxvwxvwxvwxwx$yIlinear maps from elements of a free module to another free module over r  " f $# x + y = (f $# x) + (f $# y)  f $# (r .* x) = r .* (f $# x)  Map r b a; represents a linear mapping from a free module with basis a over r to a free module with basis b over r. QNote well the change of direction, due to the contravariance of change of basis! ]This way enables we can employ arbitrary pure functions as linear maps by lifting them using , or build them l by using the monad instance for Map r b. As a consequence Map is an instance of, well, almost everything. z{|.extract a linear functional from a linear map }M(inefficiently) combine a linear combination of basis vectors to make a map. ~'Memoize the results of this linear map Econvolution given an associative algebra and coassociative coalgebra 1The augmentation ring homomorphism from r^a -> r yz{|}~yz{|~}yz{z{|}~%\The endomorphism ring of an abelian group or the endomorphism semiring of an abelian monoid http:en.wikipedia.orgwikiEndomorphism_ring &NB: we'4re using the boolean semiring, not the boolean ring 7 WXYZ['8 \]^_`abc(http:en.wikipedia.orgwikiOpposite_ring )=The free Ring given a Rng obtained by adjoining Z, such that   RngRing r = n*1 + r "This ring is commonly denoted r^. )The rng homomorphism from r to RngRing r igiven a rng homomorphism from a rng r into a ring s, liftRngHom yields a ring homomorphism from the ring `r^` into s. 9def:;<==>?@ABCDEFGHIJKLMNOPQ+R+S+T+U+V+W+X+Y+Z[\,],^,_,`,a,b,c d e f g h i j klmnoopqrstuvwxyz{|}~   !!!!!!!!!"""###$$$$$$$$$$$$$$%%%%%&&&&&'''((())))&& algebra-0.3.0Numeric.Natural.InternalNumeric.Order.ClassNumeric.Semigroup.AdditiveNumeric.Order.AdditiveNumeric.Addition.PartitionableNumeric.Addition.AbelianNumeric.Algebra.Free.ClassNumeric.Semiring.Class Numeric.Semigroup.MultiplicativeNumeric.Algebra.Free.UnitalNumeric.Monoid.MultiplicativeNumeric.Algebra.Free.HopfNumeric.Decidable.AssociatesNumeric.Band.ClassNumeric.Band.RectangularNumeric.Decidable.UnitsNumeric.Group.Multiplicative"Numeric.Multiplication.Commutative!Numeric.Multiplication.Involutive!Numeric.Multiplication.FactorableNumeric.Module.ClassNumeric.Monoid.AdditiveNumeric.Addition.IdempotentNumeric.Decidable.ZeroNumeric.Rig.ClassNumeric.Rig.OrderedNumeric.Semiring.InvolutiveNumeric.Semiring.IntegralNumeric.Group.AdditiveNumeric.Rng.ClassNumeric.Ring.Class Numeric.ExpNumeric.Functional.LinearNumeric.Functional.Antilinear Numeric.LogNumeric.Map.LinearNumeric.Ring.EndomorphismNumeric.Rig.CharacteristicNumeric.Rng.ZeroNumeric.Ring.OppositeNumeric.Ring.RngNumeric.NaturalNumeric.Semiring.Internal&Numeric.Monoid.Multiplicative.InternalNumeric.Algebra.Free Numeric.BandNumeric.MultiplicationNumeric.SemigroupNumeric.Monoid Numeric.OrderNumeric.Semiring Numeric.GroupNumeric.ModuleNumeric.Addition Numeric.Rig Numeric.Rng Numeric.RingWhole toNatural unsafePredNatural runNaturalOrder<~<>~>~~/~order comparableorderOrdAdditive+ replicate1psumWith1sum1 AdditiveOrder Partitionable partitionWithAbelian FreeAlgebrajoinSemiringMultiplicative*pow1p productWith1product1 pow1pIntegral FreeCoalgebracojoinFreeUnitalAlgebraunitUnitalonepow productWithproductFreeCounitalCoalgebracounitHopfantipodeDecidableAssociates isAssociateisAssociateIntegralisAssociateWholeBand pow1pBandpowBandRectDecidableUnits recipUnitisUnit^?recipUnitIntegralrecipUnitWholeMultiplicativeGrouprecip/\\^ CommutativeInvolutiveMultiplicationadjointadjointCommutative Factorable factorWith RightModule*. LeftModule.*AdditiveMonoidzero replicatesumWithsum Idempotentreplicate1pIdempotentreplicateIdempotent DecidableZeroisZeroRig fromNaturalfromNaturalNum fromWhole OrderedRig InvolutiveIntegralSemiring AdditiveGroup-negatesubtracttimesRngRing fromInteger fromIntegralExprunExpVectorCovectorLinear$* unitVectorcounitCovector embedCovectoraugmentCovector Antilinear appAntilinearLogrunLogMap$#$@arrMapmemoMapjoinMap cojoinMapunitMap counitMap convolveMap antipodeMapembedMap augmentMapEndappEndtoEndfromEndCharacteristicchar frobeniuscharIntcharWordZeroRng runZeroRngOpposite runOppositeRngRing rngRingHom liftRngHomconcat$fFreeCoalgebrar(->)base Control.ArrowarrofRing$fCharacteristicBool