In abstract algebra, a medial magma or medial groupoid is a magma or groupoid (that is, a set with a binary operation) which satisfies the identity or more simply for all x, y, u and v, using the convention that juxtaposition denotes the same operation but has higher precedence. This identity has been variously called medial, abelian, alternation, transposition, interchange, bi-commutative, bisymmetric, surcommutative, entropic etc. Any commutative semigroup is a medial magma, and a medial magma has an identity element if and only if it is a commutative monoid. The "only if" direction is the Eckmann–Hilton argument. Another class of semigroups forming medial magmas are normal bands. Medial magmas need not be associative: for any nontrivial abelian group with operation + and integers m ≠ n, the new binary operation defined by yields a medial magma which in general is neither associative nor commutative. Using the definition of , for a magma M, one may define the Cartesian square magma M × M with the operation (x, y) ∙ (u, v) = (x ∙ u, y ∙ v) . The binary operation ∙ of M, considered as a mapping from M × M to M, maps (x, y) to x ∙ y, (u, v) to u ∙ v, and (x ∙ u, y ∙ v) to (x ∙ u) ∙ (y ∙ v) . Hence, a magma M is medial if and only if its binary operation is a magma homomorphism from M × M to M. This can easily be expressed in terms of a commutative diagram, and thus leads to the notion of a medial magma object in a . (See the discussion in auto magma object.) If f and g are endomorphisms of a medial magma, then the mapping f∙g defined by pointwise multiplication is itself an endomorphism. It follows that the set End(M) of all endomorphisms of a medial magma M is itself a medial magma. The Bruck–Murdoch-Toyoda theorem provides the following characterization of medial quasigroups. Given an abelian group A and two commuting automorphisms φ and ψ of A, define an operation ∗ on A by x ∗ y = φ(x) + ψ(y) + c, where c some fixed element of A. It is not hard to prove that A forms a medial quasigroup under this operation.