# Why surjectivity is defined by "for every $y$,there exist $x$ such that$f(x)=y$" instead of "$x_1=x_2\Rightarrow f(x_1)=f(x_2)$"

I think injective and surjective is a dual concept. Injective: $f(x_1)=f(x_2) \Rightarrow x_1=x_2$ But the definition of surjective is so different. It's "for every $y$,there exist $x$ such that $f(x)=y$".

so why we define surjective by "for every $y$,there exist $x$ such that $f(x)=y$" instead of "$x_1=x_2 \Rightarrow f(x_1)=f(x_2)$"

• ? $x_1=x_2\Longrightarrow f(x_1)=f(x_2)$ holds for any function... Mar 10, 2014 at 20:21
• If we are dealing with binary relations, the duality you mention is natural. But one is primarily interested in functions. Mar 10, 2014 at 20:23

You are correct that the concepts of injectivity and surjectivity are somehow dual. However, you are missing the "big picture" by only thinking on the level of elements.

We may think of injections and surjections in terms of left invertible and right invertible functions.

Definition 1. A function $f:A\to B$ of nonempty sets is injective if there exists a function $g:B\to A$ such that $g\circ f=\operatorname{id}_A$.

Definition 2. A function $f:A\to B$ of nonempty sets is surjective if there exists a function $g:B\to A$ such that $f\circ g=\operatorname{id}_B$.

By comparing these two definitions, we see that injectivity and surjectivity are (in some sense) dual. Injectivity means "left invertible" while surjectivity means "right invertible".

If you want to get fancy, you could rigorously formulate all of this using the language of category theory. Here, the statement is that a morphism $f$ is injective in $\mathsf{Set}$ if and only if it is surjective in $\mathsf{Set}^{\operatorname{op}}$. More generally, a morphism $f$ in a category $\mathsf{C}$ is monic if and only if $f$ is epic in $\mathsf{C}^{\operatorname{op}}$.

• If you bring in categorical parlance, I think it’s better to define injective as left cancellable and surjective as right cancellable (instead of left invertible and right invertible). This still shows the duality of both notions while having three advantages: (1) It generalizes to functions $f: A → B$ where $A$ is empty. (2) It doesn’t require the axiom of choice to be compatible with the elementary set-theoretic definitions. (3) It’s more evident from the elementary set-theoretical definitions (e.g. $f$ being mono is “$fx = fy ⇒ x = y$”, only $x, y$ are arrows instead of elements.). Dec 30, 2014 at 10:17

If $x=y$ then $f(x)=f(y)$ is a basic property of a function. It is true for all functions whether injective, surjective or neither.

• Isn't this something deeper? If $f(x)$ has a defined meaning, then $f(x)=f(y)$ automatically. Mar 10, 2014 at 20:24
• @user2345215 formally, you can define such a monster with a relation on the set $D \times R$ where $D,R$ denote domain and range, respectively. Mar 10, 2014 at 20:26
• @gt6989b but even if $f$ is a relation and $f(x)=\{y\mid(x,y)\in f\}$ the equality still holds, I edited my comment. Mar 10, 2014 at 20:28
• @user2345215 are you suggesting to rephrase this as a basic property of a relation or a map instead of a function? Mar 10, 2014 at 20:32
• @gt6989b: I'm not. It's just a basic property of anything. Mar 10, 2014 at 20:33

Let $X$ be the domain of the function $f$ and $Y$ be its codomain.

Injective function: A function for which to every $y$ in the codomain it exist MAXIMUM one $x \in X$ such that $f(x) = y$

Surjective function: A function for which to every $y$ in its codomain it exist AT LEAST one $x \in X$ such that $f(x) = y$

Bijectve function: A function that is both injective and surjective, in other words, to every $y$ in its codomain it exist precisely ONE $x \in X$ such that $f(x) = y$

I hope this helps.

• Def.: let be $f:A \to B$ a function, $f$ is injective if $$\forall x,y \in A(f(x)=f(y)\to x=y)$$ You can prove$$f \mbox{ is injective} \Leftrightarrow \forall x,y \in A(x \neq y \to f(x) \neq f(y))$$
• Def.: let be $f:A \to B$ a function, $f$ is surjective if $$f(A)=B$$ You can prove $$f \mbox{ is surjective} \Leftrightarrow \forall y \in B(\exists x \in A(f(x)=y))$$

You don't need to know anything about functions to see the problem.

As long as $f(x)$ is defined and it doesn't matter what it is then $$x=y\Longrightarrow f(x)=f(y)$$ simply by the rules of logic, $x=y$ lets you replace $x$ with $y$ anywhere you want.