Bijection iff Left and Right Inverse

Theorem
Let $$f: S \to T$$ be a mapping.

$$f$$ is a bijection iff:


 * $$\exists g_1: T \to S: g_1 \circ f = I_S$$
 * $$\exists g_2: T \to S: f \circ g_2 = I_T$$

where both $$g_1$$ and $$g_2$$ are mappings.

It also follows that it is necessarily the case that $$g_1 = g_2$$ for such to be possible.

Corollary
Let $$f: S \to T$$ and $$g: T \to S$$ be mappings such that:


 * $$g \circ f = I_S$$
 * $$f \circ g = I_T$$

Then both $$f$$ and $$g$$ are bijections.

Necessary Condition
Suppose:
 * $$\exists g_1: T \to S: g_1 \circ f = I_S$$;
 * $$\exists g_2: T \to S: f \circ g_2 = I_T$$.

From Left Inverse Mapping, it follows that $$f$$ is an injection.

From Right Inverse Mapping it follows that $$f$$ is a surjection.

So $$f$$ is both an injection and a surjection and, by definition, therefore also a bijection.

Sufficient Condition
Suppose $$f$$ is a bijection.

Then it is both an injection and a surjection, thus both the described $$g_1$$ and $$g_2$$ must exist from Left Inverse Mapping and Right Inverse Mapping.

Now we need to show that $$g_1 = g_2$$.

Thus:

$$ $$ $$ $$ $$

Proof of Corollary
Suppose we have such mappings $$f$$ and $$g$$ with the given properties.

From the main result, we have that $$f$$ is a bijection, by considering $$g = g_1$$ and $$g = g_2$$.

It directly follows that by setting $$g = f, f = g_1, f = g_2$$, the same result can be used the other way about.