The term "groupoid" has at least three definitions currently in use.
The first type of groupoid is an algebraic structure on a set with a binary operator. The only restriction on
the operator is that the set
is closed under it (i.e., applying the binary
operator to two elements of a given set returns a value
which is itself a member of
). Associativity, commutativity,
etc., are not required (Rosenfeld 1968, pp. 88-103). A groupoid can be empty.
The numbers of nonisomorphic groupoids of this
type having
,
2, ... elements are 1, 10, 3330, 178981952, ... (OEIS
A001329), and the corresponding numbers of
nonisomorphic and nonantiisomorphic groupoids are
1, 7, 1734, 89521056, ... (OEIS A001424). An
associative groupoid is called a semigroup.
The second type of groupoid is, roughly, a category which is "group-like" in the sense that every
morphism (or arrow) is
invertible. More precisely, a small groupoid is a
category consisting of a set
of objects and a set
of arrows
whereby each arrow
in
has an inverse arrow
(also in
) subject to the identities
and
. Here,
denotes the source of the arrow
,
denotes the target of
, and
equals the identity arrow
of an object
. This notion of groupoid has become widely applied
throughout modern mathematics and is often seen to generalize many group-theoretic
notions in a number of fields; in particular, examples include the fundamental
groupoid of a manifold
, as well as more general objects
such as Lie groupoids, holonomy
groupoids, Étale groupoids, etc. (Moerdijk and Mrčun 2003).
The third type of groupoid is an algebraic structure first defined by Brandt (1927) and also known as a virtual group. A groupoid with base
(or "over
") is a set
with mappings
and
from
onto
and a partially defined binary operator
, satisfying the following four conditions:
1. is defined iff
, and in this case
and
.
2. Associativity: if either of and
are defined so is the other and they are equal.
3. For each ,
there are left- and right-identity elements
and
respectively, satisfying
.
4. Each
has an inverse
satisfying
and
.
Any group is a groupoid with base a single point.
The most basic example of groupoids with base is the pair groupoid, where
, and
,
, and with multiplication
. Any equivalence
relation on
defines a subgroupoid of the pair groupoid.
A useful way to think of a groupoid of the third type is as a parametrized equivalence relation on ,
as follows. Given a groupoid over
, define an equivalence
relation on
by
for each
. This equivalence
relation is "parameterized" because there may be more than one element
in
which give rise to the same equivalence,
that is,
and
such that
and
.
The second and third definitions are in fact equivalent.