How do I prove that my piecewise function is bijective

58 Views Asked by At

Question

Prove that the set $$\mathbb{N} \text{ and } S = {x\in \mathbb{R}|x^{2} \in \mathbb{N}}$$ have the same cardinality.

I drew an arrow diagram, and got this equation:

$$ f: \mathbb{N} \rightarrow S $$ $$ f(x) = \left\{\begin{matrix} \sqrt{\frac{x+1}{2}} & \text{when x is odd}\\ -\sqrt{\frac{x}{2}} & \text{when x is even} \end{matrix}\right. $$ Now, I need to prove the bijection of this piecewise function. I get stuck on that.

What I tried:

I know that in order to prove bijection, I need to prove injection & surjection.

Injection: Let $$ f(x_1) = f(x_2) \Rightarrow x_1 = x_2 $$

Now from here, I get stuck in proving $$x_1 = x_2$$

Surjection:

I know I have to try and find the inverse of the equation and prove that $$ y = f(x) $$, but again, with the piecewise, I am stuck.


Incase the LATEX formatting for the piecewise doesn't work (I spent 10 mins trying to make it work), here is a gif piecewise question

1

There are 1 best solutions below

1
On BEST ANSWER

Some things to observe about your function:

  1. If $f(n)>0$, then $n$ is odd
  2. If $f(n)<0$, then $n$ is even
  3. If $f(n)=0$, then $n=0$ (this is actually if and only if)

For injectivity, your attempt is just saying the definition of injective, that is a good start, but let's think about what that means. Say we have that $f(n)=f(m)$. Then there are three cases:

  1. $f(n)=f(m)>0$, then we know that $n$ and $m$ are both odd, say $n=2k+1$ and $m=2l+1$, and we know that $f(n)=f(2k+1)=\sqrt{\frac{2k+2}{2}}$ and $f(m)=f(2l+1)=\sqrt{\frac{2l+2}{2}}$, so you should have that since $f(m)=f(n)$ that $\sqrt{\frac{2k+2}{2}}=\sqrt{\frac{2l+2}{2}}$, you can use this to show that $k=l$, and then conclude $n=m$.

  2. If $f(n)=f(m)<0$, you can do a similar analysis, but say $n$ and $m$ are even.

  3. If $f(n)=f(m)=0$, then by the note you know $m=n=0$ (you might also want to prove this)

Now for surjectivity. Say you have some $x\in\mathbb{R}$ such that $x^2=n$ for some $n\in \mathbb{N}$. Again, there will be $3$ cases

  1. If $x>0$, then look at $2n-1$ which is odd, so $f(2n-1)=\sqrt{\frac{2n-1+1}{2}}=\sqrt{n}=x$ (this gives surjectivity to the positives)
  2. If $x<0$ see if you can do a similar argument to get the negatives.
  3. If $x=0$ just take $n=0$ (note I assume you include $0\in\mathbb{N}$)