Surjective homomorphism into a magma confers all the algebraic properties of the domain Let $A$ be your favorite algebraic object (group, abelian group, rng, ring, commutative ring, field, module, vector space). Let $M$ be a magma. The image of a "homomorphism" $\phi : A \to M$ qualifies as the same type of object as $A$. In particular, if $\phi$ is surjective, then $M$ is a group/abelian group/.../vector space.
For example, if $G$ is a group and $\phi : G \to M$ satisfies $\phi(g g') = \phi(g) \phi(g')$ for all $g, g' \in G$, then $\phi(G)$ is a group. Mutatis mutandis, the same holds for the other algebraic objects listed above. In the case of a ring $R$, we need $M$ to have two binary operations, "addition" and "multiplication"; a similar adjustment is needed for modules. For fields we need to ensure that the image is not the zero ring, which can be done with a stipulation like $\phi(0) \neq \phi(1)$.

(1) Are there any algebraic objects where this phenomenon fails? That is, $\phi : A \to M$ is a surjective "homomorphism," but $M$ doesn't qualify as a group/.../vector space.

As far as I can see, there aren't.

(2) Is there a proof or explanation for this phenomenon other than just following your nose and checking that $\phi(A)$ satisfies all the relevant properties (associative, commutative, etc.)? I wonder if category theory can help.


Artin's Algebra utilizes this fact to introduce quotient groups. If $N$ is a normal subgroup of a group $G$ and $gN$ and $g'N$ are cosets, then the "product set" $(gN)(g'N) = \{ gng'n' : n, n' \in N \}$ is equal to the coset $gg'N$. Since the set product of cosets is a coset, the operation on $G/N$ can simply be the set product, making $G/N$ a magma. In fact, $G/N$ is a group since the canonical map $\pi : G \to G/N$ is a surjective "homomorphism."
 A: First of all, let's fix the right general setting for your question. As you've noted, just talking about magmas is not enough: In general you might need several binary operations, distinguished constants, etc. So let's get very general and adopt the setting of first-order logic / model theory. A reader who is familiar with the terminology of model theory can skip to below the break.

A signature $L$ (in the sense of mathematical logic) is a set of "constant symbols", "function symbols", and "relation symbols". Each function symbol and each relation symbol has an arity, which is the number of inputs. For example, the signature of ordered rings is $\{0,1,+,-,\times,\leq\}$, where $0$ and $1$ are constant symbols, $+$ and $\times$ are binary function symbols, $-$ is a unary function symbol (for the multiplicative inverse), and $\leq$ is a binary relation symbol.
The case of magmas in your question is the case where $L = \{\cdot\}$, and $\cdot$ is a binary function symbol.
Given a signature $L$, an $L$-structure is a set $A$ given together with interpretations of all the symbols in the signature:

*

*For each constant symbol $c$, we have an element $c^A\in A$.

*For each function symbol $f$ of arity $n$, we have an $n$-ary function $f^A\colon A^n\to A$.

*For each relation symbol $R$ of arity $m$, we have an $m$-ary relation $R^A\subseteq A^m$.

Now there is a natural notion of homomorphism between $L$-structures $A$ and $B$. A function $h\colon A\to B$ is a homomorphism if it respects the interpretations of the symbols in the signature in the following sense:

*

*For each constant symbol $c$, $h(c^A) = c^B$.

*For each function symbol $f$ of arity $n$, and all $a_1,\dots,a_n\in A$, we have $h(f^A(a_1,\dots,a_n)) = f^B(h(a_1),\dots,h(a_n))$.

*For each relation symbol $R$ of arity $m$, and all $a_1,\dots,a_m\in A$, we have that if $(a_1,\dots,a_n)\in R^A$, then $(h(a_1),\dots,h(a_n))\in R^B$.

Now suppose $h\colon A\to B$ is a surjective homomorphism of $L$-structures. In this case, $B$ is often called a homomorphic image of $A$. Your observation is that many properties of $A$ transfer to any homomorphic image of $A$. Again, logic gives a good framework for making this statement precise. I'll give a quick introduction to formulas of first-order logic.

*

*A term is an expression built up from variables (like $x,y,z$), the constant symbols in $L$, and the function symbols in $L$, in the natural way. For example, in the signature of ordered rings, terms include: $0$, $x$, $(-(x+y))\times 1$, $((1+ 1)+1)+1$, etc.

*An atomic formula is either an equation $t_1 = t_2$, where $t_1$ and $t_2$ are terms, or an expression of the form $R(t_1,\dots,t_m)$, where $R$ is an $m$-ary relation symbol in $L$ and $t_1,\dots,t_m$ are terms. For example, in the signature of ordered rings, $x+y = 1$ and $x\leq x+1$ are both atomic formulas.

*A formula is an expression built up from atomic formulas using the logical connectives $\top, \bot, \lnot$, $\land$, $\lor$, $\forall x$, and $\exists x$ (where $x$ is any variable), in the natural way. A formula in which all the variables have been bound by quantifiers is a sentence. We say a formula  is positive if it does not contain $\lnot$, so it is built up from atomic formulas only using $\top, \bot, \land$, $\lor$, $\forall$, and $\exists$.
For example, in the signature of ordered rings, $\exists y\, \lnot (x\leq y)$ is a formula which is not positive (with free variable $x$), and $\forall x\, (x = 0\lor \exists y\, (x\times y = 1)))$ is a positive sentence.

MODEL THEORY TUTORIAL ENDS HERE

Now the theorem is that for any positive sentence $\varphi$, if $\varphi$ is true in the $L$-structure $A$, and $B$ is a homomorphic image of $A$, then $\varphi$ true in $B$.
It's not hard to prove this by proving a slightly stronger claim by induction on the structure of formulas: If $\varphi(x_1,\dots,x_n)$ is a positive formula with free variables $x_1,\dots,x_n$, and $h\colon A\to B$ is a surjective homomorphism, and $a_1,\dots,a_n\in A$, then if $\varphi(a_1,\dots,a_n)$ is true in $A$, then $\varphi(h(a_1),\dots,h(a_n))$ is true in $B$. The statement above is just the special case when $\varphi$ has no free variables.
A much harder theorem is the converse, sometimes called Lyndon's preservation theorem: If a property is definable by a sentence (respectively, by a theory: a set of sentences), and it is preserved by homomorphic images, then it is definable by a positive sentence (respectively, by a positive theory: a set of positive sentences). See Theorem 3.2.4 in the book Model Theory by Chang and Keisler. This book is a good reference for many other "preservation theorems" of this kind. For example, the sentences which are preserved by passing to substructures are exactly those which are equivalent to universal sentences: those of the form $\forall x_1\dots \forall x_n\, \varphi(x_1,\dots,x_n)$, where $\varphi$ is a quantifier-free formula (built up from atomic formulas by $\top$, $\bot$, $\lnot$, $\land$, and $\lor$, but not $\forall$ or $\exists$).
So the observation in your question really comes down to this: Many algebraic properties are preserved by homomorphic images exactly because many algebraic properties are definable by positive sentences.
You've already noted in your question that this is not universally true. For example, the axiom of fields $\lnot (0 = 1)$ is not positive, and it is not preserved under homomorphic images. (By contrast the inverses axiom $\forall x\, (x = 0\lor \exists y\, (x\times y = 1)))$ is positive and is preserved by homomorphic images.)
Another example of a class of algebraic structures which is not closed under homomorphic images is the class of integral domains. The axiom ruling out zero-divisors is $\forall x\, \forall y\, (x = 0 \lor y = 0\lor \lnot (x\times y = 0))$. This is not positive, and it is not equivalent to any positive sentence, as witnessed (for example) by the fact that the non-domain $\mathbb{Z}/6\mathbb{Z}$ is a homomorphic image of the domain $\mathbb{Z}$.
