The following are two definitions of the concept that two mappings $ f:A\mapsto B $ and $ g:A^\prime\mapsto B^\prime $ are equivalent.
Def1 : Both the domains and codomains are the same, i.e., $A=A^\prime, B=B^\prime$, and $\forall x\in A, f(x) = g(x)$.
Def2 : Only the domains are the same , i.e., $A=A^\prime$, and $\forall x\in A, f(x) = g(x)$.
We see that Def2 in principle only requires that $f(A) \subseteq B\bigcap B^\prime$, which is looser than Def1 which requires $f(A) \subseteq B=B^\prime$
I am asking which one is correct and why.
To be more precise, I haven't encountered those two definitions written explicitly. I am inferring Def1 from some other definitions. One example is the morphism in the category theory discussed below. The second one comes from my naive argument that mapping takes one thing to another, so as long as with the same input we obtain the same output then no one can differentiate those two mappings at all.
Example in category theory
The definition of the category requires that if $A\neq A^\prime$ or $B\neq B^\prime$, then $\mathrm{Mor}(A,B)$ and $\mathrm{Mor}(A^\prime,B^\prime)$ are disjoint.
Let's take the category $\mathrm{\mathbf{Grp}}$ as an example. The morphism here is the group homomorphism, which down in the deep is just a mapping. If $A\neq A^\prime$, then both definitions of mapping equivalence indicate that $\mathrm{Mor}(A,B) \bigcap \mathrm{Mor}(A^\prime,B^\prime) = \emptyset$. But what if $A = A^\prime, B\subsetneq B^\prime$? Under Def2 we would then have $\mathrm{Mor}(A,B) \subsetneq \mathrm{Mor}(A^\prime,B^\prime)$. Clearly, Def1 is what is implicit in the definition of category.
Function understood as a subset of Cartesian product
Another example is an alternate interpretation of function as a subset of Cartesian product. $f:A\mapsto B$ can be defined as a subset of $A\times B$, where $\forall a\in A$ there exists one and only one elements in $f\subseteq A\times B$ whose first element is $a$. Under this interpretation, Def1 of mapping equivalence requires not only that this subset $f$ is the same but also that it comes out of the same total set $A\times B$. This seems a little bit over-definition for me.
If you mean "equal", then only definition 1 works, two functions with a different codomain are not the same functions even if the outputs are all identical. Otherwise, concepts like "surjective function" would not be well defined.
It you mean equivalent in some other way, definition 2 does in fact enduce an equivalence relation on functions between sets (tho, that equivalence relation would be "too big" to be definable in ZFC set theory, as it'd be a proper class). It's likely not a particularly useful notion of equivalence tho
– kabel abel Jan 26 '24 at 19:55