TITLE: 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)$"
QUESTION [3 upvotes]: 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)$"

REPLY [1 votes]: 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.
{"set_name": "stack_exchange", "score": 3, "question_id": 707183}