TITLE: Does every bijection of $\mathbb{Z}^2$ extend to a homeomorphism of $\mathbb{R}^2$?
QUESTION [41 upvotes]: Given a bijection $f\colon \mathbb{Z}^2 \to \mathbb{Z}^2$, does there always exist a homeomorphism $h\colon\mathbb{R}^2\to\mathbb{R}^2$ that agrees with $f$ on $\mathbb{Z}^2$?

I don't see any immediate obstruction, but there are certain bijections that seem difficult to extend, such as
$$
f(a,b) \;=\; \begin{cases} (a,b) & \text{if }b\geq 0, \\[3pt] (-a,b) & \text{if }b<0.\end{cases}
$$
Note that it's possible to map any finite set of points $p_1,\ldots,p_n$ to any other finite set $q_1,\ldots,q_n$ by a homeomorphism of $\mathbb{R}^2$, so it's quite important here that $\mathbb{Z}^2$ is infinite.
Of course, one can more generally ask whether any bijection between discrete subsets of $\mathbb{R}^2$ extends to a homeomorphism.

REPLY [3 votes]: Here is another solution, somewhat in the same spirit as Olivier Bégassat's answer. In fact, we will prove a stronger result : any bijection $f : \mathbb{Z}^2 \to \mathbb{Z}^2$ comes from a smooth isotopy $h : \mathbb{R}^2 \times [0,1] \to \mathbb{R}^2$ such that $h(x,0) = x$ and $h(-,1) = f : \mathbb{Z}^2 \to \mathbb{Z}^2$.
As in Hagen von Eitzen's answer, let us consider first the point $O = (\sqrt{2}, \pi)$. It is not in the lattice $\mathbb{Z}^2$ as $\sqrt{2}$ and $\pi$ are irrational numbers. What is more is that any circle centred at $O$ and any straight line through $C$ contains at most one element of the lattice, since $\sqrt{2}$ is algebraic whereas $\pi$ is transcendental.
Fix some bijection $l : \mathbb{N} \to \mathbb{Z}^2$ ; This induces a bijection $g : \mathbb{N} \to \mathbb{N} : n \mapsto (l^{-1} \circ f \circ l)(n)$. Let $C_n$ denote the circle centred at $O$ passing through $l(n)$ ; Similarly, let $L_n$ be the straight line spanned by the segment $\overline{l(n)O}$. We define a continuous path $\beta_n : [0,1] \to \mathbb{R}^2$ as follow :
1) $\beta_n : [0, 1/2] \to C_n$ is a smooth path joining $l(n)$ to the point of intersection of $C_n$ with $L_{g(n)}$.
2) $\beta_n : [1/2, 1] \to L_{g(n)}$ is a smooth path joining the point of intersection of $C_n$ with $L_{g(n)}$ to the $f(l(n)) = l(g(n))$.
A smooth reparametrization of $\beta_n$ yields a smooth path $\gamma_n : ([0,1], \{0\}, \{1\}) \to (C_n \cup L_{g(n)}, l(n), f(l(n)))$.
By construction, at any given time $t$, none of the points $\gamma_n(t)$ coincide. Moreover, since each $\mathrm{Im}\, \gamma_n$ is compact, the set $\{ \gamma_n(t) \,| \, n \in \mathbb{N}   \}$ has only isolated points : since $\mathbb{R}^2$ is a normal space, we can find reccursively a sequence of positive reals $\epsilon_n$ such that at each time $t$, none of the balls $B(\gamma_n(t), \epsilon_n)$ intersect. Remark : We are implicitly using here properties of the $C_n$'s and of the $L_n$'s.
The $\gamma_n$'s define a vector field $V$ on the set $\{ (x,t) \in \mathbb{R}^2 \times [0,1] \, | \, \exists n \in \mathbb{N} \; \mbox{ s.t. } \;  x = \gamma_{n}(t) \}$. More explicitly, $V_{(\gamma_n(t),t)} = \dot{\gamma_n}(t) + \partial/\partial t$. This vector field can be smoothly extended to a vector field $X$ on $\mathbb{R}^2 \times [0,1]$ of the form $\pi^{\ast}Y + \partial/\partial t$ (where $\pi : \mathbb{R}^2 \times [0,1] \to \mathbb{R}^2$ is the canonical projection and $Y$ is a smooth non-autonomous vector field on $\mathbb{R}^2$) in such a way that it equals $\partial/\partial t$ outside the set $\{ (x,t) \in \mathbb{R}^2 \times [0,1] \, | \, \exists n \in \mathbb{N} \; \mbox{ s.t. } \;  d(x,\gamma_{n}(t)) \le \epsilon_{n} \}$. We define the isotopy $h$ as the flow of the vector field $Y$.
Remark : $\mathbb{R}^2$ admits a standard symplectic form $\omega = \mathrm{d}x \wedge \mathrm{d}y$. At each point $p \in \mathbb{R}^2$, this 2-form defines an isomorphism $\Omega_p : T_p\mathbb{R}^2 \to T^{\ast}_p \mathbb{R}^2 : v \mapsto \omega_p(v, -)$. One can extend such a linear 1-form in a constant way in an $\epsilon$-neighbordhood of $p$ in order to get a closed differential 1-form in this neighbordhood. Applying Poincaré's lemma, we get in a smaller neighbordhood of $p$ a smooth function whose exterior derivative equals the given 1-form. Using an appropriate bump function, we obtain a global smooth function $f_p$ such that $(\Omega^{-1} \mathrm{d}f_p)_p = v$ with support in $B(p, \epsilon)$. In fact, $p \mapsto f_p$ can be chosen in a smooth way. As such, at any time $t$, we can define a smooth function $F_t = \sum_{n=1}^{\infty} \, f_{\gamma_{l(n)}(t)}$ smoothly varying with $t$ such that $Y_t := \Omega^{-1} \mathrm{d}F_t$ is as above. The resulting isotopy $h_t$ is a Hamiltonian one ; We conclude that $h$ can be chosen area-preserving.