Questions tagged [semigroup]

Semigroup is an algebraic structure consisting of a set together with an associative binary operation

In mathematics, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that a semigroup need not have an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.

The binary operation of a semigroup is most often denoted multiplicatively: x•y, or simply xy, denotes the result of applying the semigroup operation to the ordered pair (x,y). The operation is required to be associative so that (x•y)•z = x•(y•z) for all x, y and z, but need not be commutative so that x•y does not have to equal y•x (contrast to the standard multiplication operator on real numbers, where xy = yx).

By definition, a semigroup is an associative magma. A semigroup with an identity element is called a monoid. A group is then a monoid in which every element has an inverse element. Semigroups must not be confused with quasigroups which are sets with a not necessarily associative binary operation such that division is always possible.

Wikipedia page: http://en.wikipedia.org/wiki/Semigroup

47 questions
0
votes
1 answer

Computing all infix products for a monoid / semigroup

Introduction: Infix products for a group Suppose I have a group G = (G, *) and a list of elements A = {0, 1, ..., n} ⊂ ℕ x : A -> G If our goal is to implement a function f : A × A -> G such that f(i, j) = x(i) * x(i+1) * ... * x(j) (and we…
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
1 answer

mempty with different definition depending on whether mempty is left or right arg?

I have the following datatype and semigroup instance: data Or a b = Fst a | Snd b deriving (Eq, Show) instance Semigroup (Or a b) where (<>) (Fst a) (Fst b) = Fst b (<>) (Snd a) (Fst b) = Snd a (<>) (Fst a) (Snd b) = Snd b (<>) (Snd a)…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
1 2 3
4