Definition:Morphism

Definition
A morphism is an object $f$, together with two objects $X = \operatorname{dom}f$ and $Y = \operatorname{cod}f$ called the domain and codomain of $f$ repectively, written $f : X \to Y$ or $X \stackrel{f}{\longrightarrow} Y$.

Moreover a morphism satisfies:


 * 1. Composition: for objects $X,Y,Z$ and morphisms $X \stackrel{f}{\longrightarrow} Y \stackrel{g}{\longrightarrow} Z$, there exists a morphism:


 * $g \circ f : X \to Z$


 * called the composition of $f$ and $g$.


 * 2. Identity: for every object $X$ there is a morphism $\operatorname{id}_X : X \to X$ such that for any object $Y$, and any morphisms $f : X \to Y$, $g : Y \to X$:


 * $f \circ \operatorname{id}_X = f$, and $\operatorname{id}_X \circ g = g$


 * called the identity morphism.


 * 3. Associativity: For any three morphisms $f,g,h$:


 * $f \circ (g \circ h) = (f \circ g) \circ h$


 * whenever the compositions are defined (as determined by 1.).

Note that a morphism is not necessarily a function, and $X$, $Y$ need not be sets.

Therefore, these are axioms, and do not equate with the definitions from set theory.