I was trying to think of an example of a set that satisfies almost all of the properties of a group except associativity for pedagogical purposes. Two examples I came up with are: moving around on a spiral staircase, and hysteresis in a magnet. In each case, it was trivial to define a binary operation on the transitions (vector steps add as vectors to produce a new straight line path, adding changes in applied field as normal numbers). The problem I ran into is that the examples actually fail at the level of the result of the binary operation to combine transformations doesn't produce a unique equivalent transformation for all states in the space the transformations are defined on. My instinct is telling me that the problem is that the pole/hysteresis are in the space the transformations are defined on, and not in the space of transformations, itself, but I'm not sure.
In detail, is there an example of: a set $G$, a binary operation $\cdot$, and a definition of equality/equivalence between elements of $G$ such that:
- closure: $\forall\ g,\ h \in G:\ g\cdot h \in G,$
- identity element $e$: $\forall\ g \in G:\ g\cdot e = g,$
- inverse element: $\forall g\in G:\ g\cdot g^{-1} = e,$ and
- non-associativity: there exists $g,\ h,\ k \in G$ such that $(g\cdot h) \cdot k \neq g \cdot (h\cdot k).$
Ideally, the equality would be defined as follows: $g = h$ iff $g(s) = h(s)\ \forall s \in S$, where $S$ is a set of states on which the elements of $G$ are all automorphisms. Thus we need $[g\cdot(h\cdot k)](s) \neq [(g\cdot h)\cdot k](s)$ for at least one $s\in S$ and one set of $g$, $h$ and $k \in G$. In other words, the binary operations combining elements in $G$ need to be done before the resulting operation is applied to an element of $S$.