Surjective function: $x^2- \lfloor x \rfloor^2$?

50 Views Asked by At

I understand that a function $f$ from a set $X$ to a set $Y$ is surjective, if, for every element $y$ in the codomain $Y$ of $f$, there is at least one element $x$ in the domain $X$ of $f$ such that $f(x) = y$.

Is $x^2- \lfloor x \rfloor^2$ surjective for all real numbers greater than or equal to $0$? I know that it is from graphing it, however, I'm not sure how to formally prove it.

2

There are 2 best solutions below

0
On

Here's the graph:

enter image description here

Clearly the answer is "yes."

0
On

Suppose $n \le x < n+1$ for some integer $n$. Then $[x] = n$

Then $n^2 \le x^2 < n^2 + 2n + 1$ and $n^2 - n \le x^2 -[x] < n^2 + 2n+1$.

Now these intervals, $[n^2-n, n^2+2n+1)$ overlap, that is, if $m=n+1$ then $[n^2-n, n^2 +n + 1)$ and $[m^2-m, m^2 + 2m + 1)$ ovelap because $m^2-m < m^2=n^2+2n+1$. And they cover all the reals, that is if $x\in \mathbb R$ then there is some integer $n$ so that $n^2 \le x < (n+1)^2=n^2+2n+1$ so $x \in [n^2-n, n^2+2n + 1)$.

So that should give us a hint.

If $y \ge 0$ there is an $n$ so that $0\le x < 2n+1$ so $n^2 \le y + n^2 < n^2 + 2n + 1$ and $n \le \sqrt{y + n^2} < n+1$.

Let $x =\sqrt {y+n^2}$. $[x] = n$ and so

$x^2 - [x]^2 = x^2 - n^2 = (y+n^2) - n^2 = y$.

if $y < 0$ then there is some positive so then $-n^2 < y < 0 < 2n + 1$ so $n^2 < y+n^2 < n^2 + 2y+1$ and again....

if $x = \sqrt {y+n^2}$ then $[x]=n$ and $x^2-[x]^2 = y$.