# Elementary function and injection

I am a bit confused on the definition of a function and an injection. I can't seem to distinguish the two.

The definition of a function is: if $(x_1,y_1)\in f, (x_1,y_2)\in f$ then $y_1 = y_2$, whereas an injection is: if $(a,b)$ and $(a,',b)$ are elements of $F$, then $a=a'$; which in other words just means the domain of $f$ maps into distinct elements of $b$.

My question is, isn't the two definitions very similar? For example: $D = \{(x,y):|x|+|y| = 1\}$, is not a function because $y_1 \ne y_2$, but doesn't that mean it is not an injection because it doesn't map the domain into distinct elements which seems to me to be the precise definition of what it is to be a function? What is the difference between being a function and being injective?

-