TITLE: Negation of injectivity
QUESTION [7 upvotes]: I'm having some problems understanding the negation of injectivity.
Take the function $f: \mathbb{R} \rightarrow \mathbb{R}$ given by $f(x) = x^2$. The formal definition of injectivity is $f(a)=f(b) \implies a = b$. Therefore the function $f(x)$ is not injective because $-1 \neq 1$ while $f(-1)=f(1)=1$.
But when I try to specify the negation of the statement "f is injective", I run into problems. I know that the negation of "P implies Q" is "P but not Q" so the formal definition of non-injectivity should be $f(a)=f(b) \implies a\neq b$, right? The problem is this statement doesn't hold for the function $f(x)=x^2$, because $f(1) = f(1)$ while it's not true that $1 \neq 1$.
What am I doing wrong?

REPLY [2 votes]: "P but not Q" so the formal definition of non-injectivity should be
  $f(a)=f(b) \implies a\neq b$, right?

Wrong, but close. You said "P but not Q" (which really means "P and not Q") and then you wrote the equivalent of "P implies not Q". These are different.
You also have to be careful how to take negation inside a quantifier. The definition of injectivity really is "for all $x,y$ something", which is negated as "there exists $x,y$ for which NOT something". Substituting "P implies Q" for "something", and using the rule for negating an implication, we get that the negation of "for $x,y$ P implies Q" is "there exists $x,y$ such that P and not Q".