Lawvere - Conceptual Mathematics - Criterion for Determination of Maps This is a problem from Lawvere's Conceptual Mathematics, in a section talking about determination problems and retraction maps.
Suppose two maps of sets $f: A \to B$, $h: A \to C$ satisfy the condition: If $f(a_1) = f(a_2)$, then $ h(a_1) = h(a_2)$. Must there be a map $g: B \to C$ with $h = g \circ f$?
I think the answer is yes, because $g$ should essentially be determined by $h$. We know for any $a \in A$ there is an element $b \in B$ such that $f(a) = b$, and we know there is an element $c \in C$ with $h(a) = c$, so I think we should just define $g(b) = c$. Such a $g$ is well defined because, by our assumption, if we have $f(a_1) = f(a_2)$ then $h(a_1) = (g \circ f)(a_1) = (g \circ f)(a_2) = h(a_2)$.
That proof seems hand-wavy, and too easy. Is there a better way to put the argument (assuming it is true)?
 A: You have exactly the right idea. And we've already resolved the issue of defining the desired map $g$ for all elements of $B$ in the comments thread above. But you still don't have a valid proof of why $g$ is well-defined — as I said, you understand the key idea for it, but it's not expressed properly. The

Such a $g$ is well defined because, by our assumption, if we have $f(a_1)=f(a_2)$ then $h(a_1)=(g\circ f)(a_1)=(g\circ f)(a_2)=h(a_2)$

part doesn't even seem to address the question of $g$ being well-defined.
Let's review carefully: how did you define $g$? First of all, I presume we are given that $A$, $B$, and $C$ are non-empty sets. Then you need to define $g(b)$ for any $b\in B$. There are two cases:


*

*if $b$ is in the image of $f$, then $b=f(a)$ for some $a\in A$, and we define $g(b)=h(a)$ (which is exactly what you said in your original post, but without using one more named variable $c$);

*if $b$ is not in the image of $f$, then … (what we discussed in the comments).
Where can we have any troubles with $g$ being or not well-defined? Only in the first case, because defining $g(b)$ depends on the choice of a certain $a\in A$. We must show that in fact the result is independent of this choice. So we need to examine it more carefully.
Assume $b$ is in the image of $f$. What if we have that $b=f(a_1)$ and $b=f(a_2)$ for  two distinct $a_1,a_2\in A$, $a_1\ne a_2$? By assumption, since $b=f(a_1)=f(a_2)$, we know that $h(a_1)=h(a_2)$. So defining $g(b)=h(a_1)$ or $g(b)=h(a_2)$ yields the same result. This is a proof that the definition of $g$ is independent of choices made.
