# Central groupoid

In abstract algebra, a central groupoid is an algebraic structure defined by a binary operation $\cdot$ on a set of elements that satisfies the equation $(a\cdot b)\cdot (b\cdot c)=b.$
As an example, the operation $\cdot$ on points in the Euclidean plane, defined by recombining their Cartesian coordinates as $(x_{1},y_{1})\cdot (x_{2},y_{2})=(y_{1},x_{2})$ is a central groupoid. The same type of recombination defines a central groupoid over the ordered pairs of elements from any set, called a natural central groupoid.
As an algebraic structure with a single binary operation, a central groupoid is a special kind of magma or groupoid. Because central groupoids are defined by an equational identity, they form a variety of algebras in which the free objects are called free central groupoids. Free central groupoids are infinite, and have no idempotent elements. Finite central groupoids, including the natural central groupoids over finite sets, always have a square number of elements, whose square root is the number of idempotent elements.

## Equivalent definitions

A central groupoid consists of a set of elements and a binary operation $\cdot$ on this set that satisfies the equation $(a\cdot b)\cdot (b\cdot c)=b$ for all elements $a$, $b$, and $c$.
Central groupoids can be defined equivalently in terms of central digraphs. These are directed graphs in which, each ordered pair of vertices (not necessarily distinct) form the start and end vertex of a three-vertex directed walk. That is, for each $u$ and $v$ there must exist a unique vertex $w$ such that $u\to w$ and $w\to v$ are directed edges. From any central digraph, one can define a central groupoid in which $u\cdot v=w$ for each directed path $u\to w\to v$. Conversely, for any central groupoid we can define a central digraph by letting the set of vertices be the elements of the groupoid, and saying there is an edge $u\to w$ whenever there exists $v$ with $u\cdot v=w$.
A third equivalent definition of central groupoids involves (0,1)-matrices $M$ with the property that $M^{2}$ is a matrix of ones. These are exactly the directed adjacency matrices of the graphs that define central groupoids.

## Special cases
### Finite

Every finite central groupoid has a square number of elements. If the number of elements is $k^{2}$, then there are exactly $k$ idempotent elements (elements $i$ with the property that $i\cdot i=i$). In the corresponding central digraph, each idempotent vertex has a self-loop. The remaining vertices each belong to a unique 2-cycle. In the matrix view of central groupoids, the idempotent elements form the 1s on the main diagonal of a matrix representing the groupoid. Each row and column of the matrix also contains exactly $k$ 1s. The spectrum of the matrix is $k,0,0,\dots ,0$.
The numbers of central groupoids on $k^{2}$ labeled elements, or equivalently, (0,1)-matrices of dimension $k^{2}\times k^{2}$ whose square is the all-ones matrix, for $k=1,2,3$, are
    1, 12, 1330560 (sequence A283627 in the OEIS).
Finding these numbers, for general values of $k$, was stated as an open problem by Alan J. Hoffman in 1967.

### Free

As with any variety of algebras, the central groupoids have free objects, the free central groupoids. The free central groupoid, for a given set of generating elements, can be defined as having elements that are equivalence classes of finite expressions, under an equivalence relation in which two expressions are equivalent when they can be transformed into each other by repeatedly applying the defining equation of a central groupoid. Unlike finite central groupoids, the free central groupoids have no idempotent elements. The problem of testing the equivalence of expressions for a free central groupoid was one of the motivating examples in the discovery of the Knuth–Bendix completion algorithm for constructing a term rewriting system that solves this problem.
The resulting rewriting system consists of the rules ${\begin{aligned}(a\cdot b)\cdot (b\cdot c)&\to b\\a\cdot {\bigl(a\cdot b)\cdot c{\bigr )}&\to a\cdot b\\{\bigla\cdot (b\cdot c){\bigr )}\cdot c&\to b\cdot c\\\end{aligned}}$ where any subexpression matching the left side of any of these rules is transformed into the right side, until no more matching subexpressions remain. Two expressions are equivalent if they are transformed in this way into the same expression as each other.

### Natural

A natural central groupoid has as its elements the ordered pairs of values in some defining set. Its binary operation $\cdot$ recombines these pairs as $(x_{1},y_{1})\cdot (x_{2},y_{2})=(y_{1},x_{2})$ For instance, if the defining set is the set of real numbers, this operation defines a product on points in the Euclidean plane, described by their Cartesian coordinates. If the defining set is finite, then so is the resulting natural central groupoid.
Natural central groupoids are characterized among the central groupoids by obeying another equation, ${\bigla\cdot (a\cdot a){\bigr )}\cdot b=a\cdot b$ for all elements $a$ and $b$.