# Heap (mathematics)

In abstract algebra, a semiheap is an algebraic structure consisting of a non-empty set H with a ternary operation denoted $[x,y,z]\in H$ that satisfies a modified associativity property:

$\forall \ a,b,c,d,e\in H\ \ \ \ [[a,b,c],d,e]=[a,[d,c,b],e]=[a,b,[c,d,e]].$ A biunitary element h of a semiheap satisfies [h,h,k] = k = [k,h,h] for every k in H.:75,6

A heap is a semiheap in which every element is biunitary.:80

The term heap is derived from Груда, Russian for "heap", "pile", or "stack". Anton Sushkevich used the term in his Theory of Generalized Groups (1937) which influenced Viktor Wagner, promulgator of semiheaps, heaps, and generalized heaps.:11 Груда contrasts with Групп (group) which was taken into Russian by transliteration. Indeed, a heap has been called a groud in English text.)

## Examples

#### Two element heap

Turn $H=\{a,b\}$ into the cyclic group $C_{2}$ , by defining $a$ the identity element, and $bb=a$ . Then it produces the following heap:

$[a,a,a]=a,\,[a,a,b]=b,\,[b,a,a]=b,\,[b,a,b]=a,$ $[a,b,a]=b,\,[a,b,b]=a,\,[b,b,a]=a,\,[b,b,b]=b.$ Defining $b$ as the identity element and $aa=b$ would have given the same heap.

#### Heap of integers

If $x,y,z$ are integers, we can set $[x,y,z]=x-y+z$ to produce a heap. We can then choose any integer $k$ to be the identity of a new group on the set of integers, with the operation $*$ $x*y=x+y-k$ and inverse

$x^{-1}=2k-x$ .

### Heap of a groupoid with two objects

One may generalize the notion of the heap of a group to the case of a groupoid which has two objects A and B when viewed as a category. The elements of the heap may be identified with the morphisms from A to B, such that three morphisms x, y, z define a heap operation according to:

$[x,y,z]=xy^{-1}z.$ This reduces to the heap of a group if a particular morphism between the two objects is chosen as the identity. This intuitively relates the description of isomorphisms between two objects as a heap and the description of isomorphisms between multiple objects as a groupoid.

### Heterogeneous relations

Let A and B be different sets and ${\mathcal {B}}(A,B)$ the collection of heterogeneous relations between them. For $p,\ q,\ r\in {\mathcal {B}}(A,B)$ define the ternary operator $[p,\ q,\ r]\ =\ pq^{T}r$ where qT is the converse relation of q. The result of this composition is also in ${\mathcal {B}}(A,B)$ so a mathematical structure has been formed by the ternary operation. Viktor Wagner was motivated to form this heap by his study of transition maps in an atlas which are partial functions. Thus a heap is more than a tweak of a group: it is a general concept including a group as a trivial case.

## Theorems

Theorem: A semiheap with a biunitary element e may be considered an involuted semigroup with operation give by ab = [a, e, b] and involution by a–1 = [e, a, e].:76

Theorem: Every semiheap may be embedded in an involuted semigroup.:78

## Generalizations and related concepts

• A pseudoheap or pseudogroud satisfies the partial para-associative condition
$[[a,b,c],d,e]=[a,b,[c,d,e]].$ [dubious ]
• A Malcev operation satisfies the identity law but not necessarily the para-associative law, that is, a ternary operation $f$ on a set $X$ satisfying the identity $f(x,x,y)=f(y,x,x)=y$ .
• A semiheap or semigroud is required to satisfy only the para-associative law but need not obey the identity law.
An example of a semigroud that is not in general a groud is given by M a ring of matrices of fixed size with
$[x,y,z]=x\cdot y^{\mathrm {T} }\cdot z$ where • denotes matrix multiplication and T denotes matrix transpose.
• An idempotent semiheap is a semiheap where $[a,a,a]=a$ for all a.
• A generalised heap or generalised groud is an idempotent semiheap where
$[a,a,[b,b,x]]=[b,b,[a,a,x]]$ and $[[x,a,a],b,b]=[[x,b,b],a,a]$ for all a and b.

A semigroud is a generalised groud if the relation → defined by

$a\rightarrow b\Leftrightarrow [a,b,a]=a$ is reflexive (idempotence) and anti-symmetric. In a generalised groud, → is an order relation.