0

Was reading up my textbook about the identification of onto and into functions and one of the method given is as follows

Solve $f(x) = y$ for $x$, say $x = g(y)$ Now if $g(y)$ is defined for each $y \in \text{ codomain }$ and $g(y) \in \text{ domain of } f \text{ for all } y \in { codomain}, then f(x) \text{ is onto}$.

Quite did not understand how this works and what even the function $g(y)$ is?, is it the inverse of the function $f(x)$ could someone explain to me how this method works.

daw
  • 54,637
  • 2
  • 44
  • 85
koiboi
  • 384
  • 2
    It is just an extremely imprecise and confusing way of saying that a function $f:X\to Y$ is onto if there exists a function $g:Y\to X$ such that $f(g(y))=y$ for all $y\in Y$. – Michal Adamaszek Mar 26 '24 at 10:32
  • @MichalAdamaszek Yes i did notice it thank you! please post this as a answer so that i can accept it – koiboi Mar 26 '24 at 10:35
  • A simpler definition or method for determining "onto" also called being "surjective" follows. For any and every choice of $y$ in the codomain, some $x$ exists, making $f(x) =y$ true.

    Note: I'm using some informal terminology and methods.

    – nickalh Mar 26 '24 at 10:36
  • 1
    Note: the method given in the original question subtly adds an unnecessary requirement, which will lead to confusion. I do not recommend the method given in the book. Consider a very simple function, with domain$={1,2}$ and codomain, $= { 3 }. f(1) = 3, f(2)=3$ This is clearly onto because the codomain has a single element which gets used by f. However, the reverse is not a function. – nickalh Mar 26 '24 at 10:42

1 Answers1

0

That is indeed quite a confusing way to put it. The idea is that for any $y \in Y$, you can find an $x$, written as $g(y) = x$, such that $f(x) = y$. Below I have written a few things out, also for injective maps (because the idea is similar) and I hope this makes it more clear.

Suppose $f : X \to Y$ is a function. Then

  1. $f$ is surjective iff for each $y \in Y$, there exists an $x \in X$ such that $f(x) = y$.

"$f$ is able to reach every point $y$ in the codomain $Y$"

  1. $f$ is injective iff for all $x_1, x_2 \in X$ we have $f(x_1) = f(x_2)$ implies that $x_1 = x_2$.

"$f$ maps distinct elements in the domain to distinct elements in the codomain"

Now suppose there exists $g : Y \to X$ such that $f(g(y)) = y$ for all $y \in Y$. This implies that $f$ is surjective. This easily follows from the definition. The reverse is also true (actually, only if you assume the axiom of choice, but if you have never heard of this, you should not mind it. see also: Why the fact that surjective map has an inverse at right is equivalent to axiom of choice?).

You want to define $g : Y \to X$ such that $f(g(y)) = y$ for each $y \in Y$, and you do this as follows: for any $y \in Y$, we know by surjectivity that there exists $x \in X$ such that $f(x) = y$, now use this $x$ to define $g(y) = x$. This defines the required map $g : Y \to X$.

For injective maps something similar works. Suppose there exists $g : Y \to X$ such that $g(f(x)) = x$ for all $x \in X$. In a similar way, this implies that $f$ is injective. (Why?) The reverse direction is also true: if $f$ is injective, you can show yourself that there exists $g : Y \to X$ such that $g(f(x)) = x$ for all $x \in X$.