I am trying to solve the following exercise from Artin's Algebra.
Prove that the nonempty fibres of a map form a partition of the domain.
Here is my attempt.
Let $f: A \to B$ be a map. If $A = B = \emptyset$, then the nonempty fibres of $f$, of which there are none, vacuously partition $A$. If $A = \emptyset$ and $B \neq \emptyset$, there are again no nonempty fibres, but they gain partition the empty domain. Suppose $A,B \neq \emptyset$. For each $b \in \mathrm{Im}(f)$, define $\gamma_b = f^{-1} (b)$. Notice that $\gamma_b \neq \emptyset$, and if $b_1 \neq b_2$, then $\gamma_{b_1} \cap \gamma_{b_2} = \emptyset$ since $f$ is a well-defined map. I claim that \begin{align*} \bigsqcup\limits_{b \in \mathrm{Im}(f)} = A. \end{align*} Indeed, we have: \begin{align*} x \in A & \iff \exists ! b \in B, \; f(x) = b \\ & \iff \exists !b \in B, \; x \in f^{-1} (b) = \gamma_b \\ & \iff x \in \bigsqcup\limits_{b \in \mathrm{Im}(f)} \gamma_b. \end{align*} So, by dual containment, we conclude that the $\gamma_b$ partition $A$.
How does this proof look? The hardest part for me to write out was the edge cases where either both $A$ and $B$ or just $A$ were empty.