$f$ has a left inverse iff $f$ is injective

first-order-logicfunctionslogicreal-analysis

From wiki, I got every injection $f$ with a non-empty domain has a left inverse $g$. I know how to prove the proposition but just curious why we need to stress the non-empty domain.

If the domain or codomain (or the domain and the codomain) is empty, then the only choice for $f$ is $\emptyset$, then all the statements for $f$ are vacuously true, not alone $f$ has a left inverse, I can even say it has an inverse?

The statement I want to prove is:
Let $f$ is a function from $A$ to $B$,

$\forall x,y \in A, f(x)=f(y) \longrightarrow x=y$
$\Leftrightarrow$
$\exists f^{-1} \subset B \times A, f^{-1} f=Id_{A}$

Suppose $X$ and $Y$ are not empty, I have three special cases

$\Longrightarrow$

Case 1: $f:X \rightarrow \emptyset$

Vacuously True

Case 2: $f:\emptyset \rightarrow \emptyset$

$\exists f^{-1} \subset \emptyset, f^{-1} f=\emptyset=Id_{\emptyset}$

Case 3: $f:\emptyset \rightarrow Y$

$\exists f^{-1} \subset \emptyset, f^{-1} f=\emptyset=Id_{\emptyset}$

Best Answer

Only "for all" statements are vacuously true. You ask about a "there exists" statement:

$f$ has a left inverse

means

There exists $g$ from the codomain (target) of $f$ back to the empty set such that $g \circ f = \operatorname{id}_{\varnothing}$.

Write $X$ for the codomain of $f$ so that $f\colon \varnothing \to X$. Assuming $X$ is nonempty, there are no functions at all $X\to \varnothing$, so no $g$ can exist.

Related Question