4

For $f:\mathbb{N}\times\mathbb{N}\to\mathbb{Z}$, $f(x,y)=x-y$ is the function injective?

I got this question in my homework and this is how I attempted to solve it:

If I want to prove that a certain function $f:\,A\to B$ is injective, we need to show that

$a,b\in A, f(a)=f(b) \therefore a=b$. So let there be arbitrary $x,y,a,b$ so that $f((x,y))=f((a,b))\implies x-y=a-b$, from here I should somehow prove (if the function is injective) that $x=a, b=y$

But now I'm facing a problem and I'm not sure what to do now or if I have already solved the question: there are infinitely many pairs of $a,b\in\mathbb N$ that result in $a-b\in\mathbb Z$

I tried using WolframAlpha but it couldn't answer my question, so I'm asking for help with my proof. What do I do now? Did I finish and I'm too blind to see it?

Sammy Black
  • 25,273
  • 6
    You have correctly argued that $f$ is not injective. For good measure, you can write a concrete counter-example: $f(2,1) = f(3,2)$ but $(2,1) \neq (3,2)$. – Ivo Terek Nov 10 '23 at 16:51
  • 2
    Hint. Try thinking in words about the meaning of the formula. Can you find two different pairs of integers that are the same distance apart? – Ethan Bolker Nov 10 '23 at 16:52
  • I want to thank everyone! thank you for answering! – Yaniv Polischuk Nov 10 '23 at 17:05

0 Answers0