# Prove explicitly that if a function has a left inverse it is injective and if it has a right inverse it is surjective

A function g : S → T is said to be a left inverse for the function f : T → S if g◦f equals the identity function on $T$. In this case, f is also a right inverse for g . Prove explicitly that

That t any a function has a left inverse it is injective and if it has a right inverse it is surjective, give an example of a function that has 2 distinct left inverses.

I'm not too sure if i understand the difference the difference of between a left and right inverse to begin with. I think it's left inverse if in f: S --> T and g: T --> S meaning in f is you plug in S to f(x) you get T and for g(x) plugging in T you get S. So g(x) is the inverse of f(x) and vice versa.

Left inverse f(g(x)) = S and right inverse when rather g(f(x)) = T. Definitions have $1_S$ and $1_T$ which confuses me.

To be injective i also know that for every value of the codomain T there must be a unique value of S the domain. So there cannot be more than one value of T that maps into a value of S.

To surjective and everyone value of T the codomain must map to a value the domain S. So for example e^x is not surjective for all real x because its range is y > 0 rather than having a range of all real x. However you could cut the parameters to something like x>0 and even say it's bijective where it is both surjective and injective.

.

Let $g : S \rightarrow T$ be the left inverse of $f$, it means $g \circ f = I_{T}$. If $f(x) = f(y)$, then $x=g(f(x))=g(f(y)) = y$, so $f$ is injective.

Let $h : S \rightarrow T$ be the right inverse of $f$, it means $f \circ h = I_{T}$. For any $y \in T$ we have $y = f(h(y))$. By arbitrariness of $y$, f is surjective.

Also worth adding that implications go both ways in both cases.

• But how do i show that there is a unique value of T for every value of S? Aug 18, 2015 at 5:11
• Does this mean that since $f(x) = f(y)$, then $x=g(f(x))=g(f(y)) = y$ that for every value y the co-domain from B there is a value x from the domain A? Hence injective. Aug 18, 2015 at 5:28
• That means that whenever $f(x) = f(y)$ you get that $x = y$ so $f$ is injective. Aug 18, 2015 at 9:15

Let $f: T \to S$. A function $g:S \to T$ is a left inverse for $f$ if $g(f(x))=x$ for all $x \in T$. For example, if $f$ is $f(x)=x+2$, then $g(x)=x-2$ is a left inverse for $f$ because $g(f(x))=f(x)-2=x+2-2=x$ for any $x$.

On the other hand, a function $g:S \to T$ is a right inverse for $f$ if $f(g(x))=x$ for all $x \in S$. In my example above, $g$ is also a right inverse for $f$, since $f(g(x))=g(x)+2=x-2+2=x$ for any $x$.

$1_T$ is the identity function on $T$; it is defined by $1_T(x)=x$ for any $x \in T$. Similarly, $1_S$ is the identity on $S$: it is defined by $1_S(x)=x$ for any $x \in S$. They use the notation $1_T$ and $1_S$ because these are functions on different spaces $S$ and $T$.

I think you understand injective and surjective...

An example should clear things up. Consider the function $f\colon \mathbb Z \to \mathbb R$ defined by $f(x) = x^3$. It is easy to see that $f$ is injective but not surjective. In other words, $f$ has a left inverse but not a right inverse. Indeed, consider the function $g\colon \mathbb R \to \mathbb Z$ defined by: $$g(y) = \begin{cases}\sqrt{y} &\text{if } \sqrt{y} \in \mathbb Z \\ 0 &\text{otherwise} \end{cases}$$ We need this extra if statement because if $y = 1/8$, then $\sqrt{y} = 1/2$ is not in the codomain, which violates the definition of a function. Notice that $g \circ f\colon \mathbb Z \to \mathbb Z$ is the identity function on $\mathbb Z$, so $f$ has a left inverse. But $f \circ g\colon \mathbb R \to \mathbb R$ is not the identity function on $\mathbb R$, since: $$f(g(1/8)) = f(0) = 0 \neq 1/8$$