On a $\epsilon$-$n$ proof of a limit of a sequence of functions. Put $\delta_n = 2^{-n}$. To each positive integer $n$ and each real number $t$ corresponds a unique integer $k = k_n(t)$ that satisfies $k\delta_n \le t< (k+1) \delta_n$.
Define $$ \psi_n(t) = \begin{cases} k_n(t)\delta_n, & \mbox{if } 0 \le t < n \\ n, & \mbox{if } n \le t \le \infty \end{cases} $$
I want to prove with  $\epsilon$-$n$ that $ \psi_n(t) \rightarrow t$ as $n \rightarrow \infty$.
I proceeded as follows:  $$|\psi_n(t) - t|< \epsilon \implies |k_n(t)\delta_n-t|< \epsilon \implies -k_n(t)\delta_n + t< \epsilon \implies -k2^{-n} + t< \epsilon \implies$$
$$+k2^{-n}>+t-\epsilon \implies \log k -n\log2> \log(t-\epsilon) \implies +n<\frac{-\log(t-\epsilon) + \log(k)}{\log2}$$
But checking with some numbers this result shows that not all $n<\frac{-\log(t-\epsilon) + \log k}{\log2}$ work given an $\epsilon$ when plugged into $|k_n(t)\delta_n-t|< \epsilon$.
What am I doing wrong?
 A: The proof fails because it treats $k$ as if it were constant with $n$. The proof is already off the rails once you get to
$$-k2^{-n}+t<\varepsilon$$
since, from there, you show that this cannot hold for all large enough $n$ - but of course it doesn't hold for all large enough $n$, because that would be equivalent to requiring $t<\varepsilon$, as the $-k2^{-n}$ vanishes as $n$ gets large.
Moreover, the proof proceeds in the wrong direction from the start; it's set up to prove:

If $|\psi_n(t)-t|<\varepsilon$, then $n$ is larger than a constant depending on $\varepsilon$.

But that's not helpful - it could be vacuous, in that $|\psi_n(t)-t|$ could never be less than $\varepsilon$, meaning the implication wouldn't prove anything. What you want to show is that

If $n$ is larger than some constant depending on $\varepsilon$, then $|\psi_n(t)-t|<\varepsilon$.

To start on that one, notice that if $n>t$, then we have, from the inequality at the start of your post and some substitution: $$\psi_n(t)\leq t < \psi_n(t) + \delta_n$$
which implies that $|\psi_n(t)-t|<2^{-n}$ (and that the same holds for any $n'>n$). Use this to, for any $\varepsilon$, choose a large enough $n$ such that $|\psi_n(t)-t|<2^{-n}$.
