Define $a_1=1$. If $n$ is an index such that $a_n$ has been defined, then define $$a_{n+1}=\begin{cases}a_n+1/n, & \text{if $a^2_n\leq 2$}\\a_n-1/n,&\text{if $a^2_n>2$} \end{cases}$$ Show that the sequece converges to $\sqrt{2}$.
Proof:
Let $\epsilon>0$. By the Archinmedean Property there exists an index $N$ such that $1/N<\epsilon$. For all $n\geq N$, we can get $1/n\leq1/N$. If $a_n^2\leq 2$, we have $$\left\vert a_n+1/n-\sqrt{2}\right\vert<2/n<2/N<\epsilon\tag1$$ If $a_n^2>2$, we have $$\left\vert a_n-1/n-\sqrt{2}\right\vert<2/n<2/N<\epsilon\tag2$$$
Add $(1)$ and $(2)$, we get $$\left\vert 2a_n-2\sqrt{2}\right\vert<4/n<4/N<2\epsilon\Longrightarrow\left\vert a_n-\sqrt{2}\right\vert<2/n<2/N<\epsilon$$
Thus the sequence converges to $\sqrt{2}$
In $(1)$ and $(2)$, I didn't say anything about why I need minus $\sqrt{2}$, cause I didn't find out any good reason. Without assuming $(1)$ and $(2)$ are incorrect, I don't the proof I have right or not. Can anyone give me a hit or suggestion to write a better proof? Thanks in advanced.
Oops. I did make a fundamental error
==============
Where you say "If $a_n^2\leq 2$, we have"
I'd add "$a_{n}^2 \leq \sqrt 2$ so
$a_{n+1} - \sqrt 2 = a_{n} + 1/n -\sqrt 2\leq \sqrt 2+ 1/n - \sqrt 2 \leq 1/n$ and
===== error =======
its possible that $a_{n+1} - \sqrt 2$ < - 1/n. Thus $|a_{n+1} - \sqrt 2| > 1/n$
==================
$ \sqrt 2- a_{n+1} = \sqrt 2 - a_{n} - 1/n \geq \sqrt 2 - \sqrt 2- 1/n \geq -1/n$ so
======= ditto =========
$ \sqrt 2- a_{n+1}$ could be > 1/n.
I think it turns that these errors are never the case, but we have to show that.
=====================
$|a_{n + 1} - \sqrt 2 | \leq 1/{n} < 1/N < \epsilon$
And then again for $a_{n}^2\geq 2$
... same stuff....
so for all n+1 > N+1 , $|a_{n +1 } - \sqrt 2 | < \epsilon$, so we are done.
I couldn't quite follow in yours how we were getting $|a_{n } - \sqrt 2 | < \epsilon$, although you were clearly going in that direction. (But you put in the expression directly, and your indexing was therefore off by $1$)