# Bijective function on a dense set

Suppose X is a complete metric space, and $f:X↦X$ a continuous surjective function. Let D be a dense set. Suppose $f:D↦D$ is injective and $f^{-1}(D)=D$.

Is $f$ injective ?

Is there a family of metric spaces where you can conclude $f$ is injective?

• nice question... why should we close it? Oct 31, 2011 at 8:16
• @Joel: is it obvious that one can `symmetrize' the examples in the question you link to so as to apply to the present question? Oct 31, 2011 at 8:27
• Oct 31, 2011 at 8:28
• Yemon, no, I guess not. This question is more interesting! Oct 31, 2011 at 8:47
• Joel, I understand from the text that $f$ splits into $f_{|D}:D\to D$ which is bijective and $f_{|X\setminus D}:X\setminus D\to X\setminus D$ which is surjective. Oct 31, 2011 at 11:49

Sorry but I could not resist: The map is defined on $[0,1]\times[0,1]$, and can be written as $$f(x,y) = \begin{cases} (x, (2-x)y) & \text{ if }y\leq 1/2, \\ (x, xy+1-x) & \text{ if }y> 1/2. \end{cases}$$

Just take $D$ to be the set of $(x,y)$ with rational coordinates in $(0,1)\times(0,1)$, then $f$ is bijective on $D$ (because it can be easily inverted), but it is clearly not injective on $[0,1]\times[0,1]$.

Here is another example which is easy to visualize. Let $X=[-1,1]^2$, $I$ be the segment between $(-1,0)$ and $(1,0)$ and $I_0$ its subsegment between $(-1/2,0)$ and $(1/2,0)$. There is a homeomorphism $f$ between $X\setminus I_0$ and $X\setminus \{0\}$ which sends $I\setminus I_0$ to $I\setminus\{0\}$ and extends continuously by setting $f(I_0)=0$. (Think of contracting the segment $I_0$ to the center while deforming the rest of the square continuously.) This map can be given by an explicit formula which is piecewise linear on each horizontal segment. Now define $D=X\setminus I$ and we are done.

The answer to the second question is "yes, for discrete spaces where metric is $d(x, y) = 1,$ for $x \neq y.$

• This is by far the best answer to a question that I am surprised was not closed immediately. Nov 3, 2011 at 18:18

I think I can prove that if X=[0,1] (or 1-dimensional) then the claim of FelipeG is true.

Indeed, let $X=[0,1]$ and $D,f$ be as above, and proceed by contradiction. Assume there are points $a,b\in [0,1]$ such that $a<b$ and $f(a)=f(b)$; then, since $(a,b)\cap D$ has infinitely many elements, then there is some point $c\in D \cap (a,b)$ such that $f(c)=s \neq r$ (say $s>r$). On the other hand, by continuity of $f$, for every value $y\in D\cap (r,s)$ (which is not empty) there is an element $x_1\in (a,c)$ such that $f(x_1) = y$ and an element $x_2\in (c,b)$ such that $f(x_2)= y$. But, since $f^{-1}D=D$ both $x_1, x_2$ belong to $D$, which contradits the injectivity of $f_{|_D}$.

PS: this construction works if $f_{|_D}$ is a bijection (as one might argue from the title), otherwise there is a counterexample

• I took the liberty of fixing your LaTeX -- hope you don't mind Oct 31, 2011 at 8:24
• @Yemon Choi I was trying to fix it as well... In fact I still cannot visualize my comment correctly: may be the fact we were both working on the file simultaneously has generated some mess Oct 31, 2011 at 8:28
• Let me have another go... Oct 31, 2011 at 8:28
• [@Yemon Choi] now it works: thanks! Oct 31, 2011 at 8:32
• Nice. I understand that $r:=f(a)$, right? Oct 31, 2011 at 12:41

There are counterexamples.

Let $X$ be the ordinal $\omega^2+1$, which as a topological space is the same as infinitely many convergent sequences, whose limit points converge. This space is homeomorphic to a countable closed subset of the unit interval and is therefore completely metrizable. Let $D$ be the isolated points of $X$, which is exactly the set of successor ordinals below $\omega^2$. This is dense, since the closure adds the missing limit ordinals. Let $f$ be the function that interleaves two successive sequences together into one. That, we combine the successor ordinals in the interval $[\omega\cdot 2n,\omega\cdot 2(n+1))$ to those in $[\omega\cdot n,\omega\cdot(n+1))$ by an injective function that simply interleaves the two sequences into one. This is injective on $D$ and also surjective. The function $f$ extends continuously to $X$ by mapping the limit points of the successive sequences, $\omega\cdot2n$ and $\omega\cdot2(n+1)$ both to $\omega\cdot n$, and $\omega^2\mapsto \omega^2$. Note that the extension $f$ is not injective.

A simpler version of this example, without ordinals, is to take $X$ to be the positive integers, plus a sequence converging to each of them in the interval below. Specifically, let $X$ have points $k$ and also $k-\frac 1n$ for positive integers $k$ and $n$. Thus, $X$ is a countable closed subset of $\mathbb{R}$. Let $D$ be the isolated points $k−\frac1n$, and let $f$ be the function that interleaves successive convergent sequences into one. That is, for each adjecent pair of sequences, converging to $2n$ and $2(n+1)$, we map the isolated points of the sequences bijectively to the sequence converging to $n$. This is bijective on D, but extends continuously to $X$, and is not injective on $X$.

(I have removed the earlier flawed example.)

• I don't understand. You have $1\in D$ and $f(-1)=1$, so $-1\in f^{-1}(D)$ but $-1\not\in D$. Oct 31, 2011 at 11:07
• Oops. I go back to my first examples, where $f$ is bijective on $D$. Oct 31, 2011 at 12:36

Here's an example. First take a countable family $\lbrace A_n:n\in\mathbb{N}\rbrace$ of countable dense sets in $(0,1)$ and then let $f:[0,1]\to\[0,1]$ be continuous such that for each $n$ the maps $f$ is an order-isomorpism between $A_n\cap(0,1/1)$ onto $A_{2n}$ and an order-reversing isomorphism between $A_n\cap(1/2,1)$ and $A_{2n+1}$. Thus $f$ is a bijection between $D=\bigcup_{n]1}^\infty A_n$ and itself, but it is not injective on $[0,1]$. The map $f$ is readily constructed, first recursively on $D$ and then by continuous extension to all of $[0,1]$.

Addendum: to construct the restriction of $f$ to $[0,1/2]$ modify Cantor's proof of the uniqueness of $\mathbb{Q}$ to construct an order-isomorphism $g$ between $D\cap(0,1/2)$ and $E=\bigcup_{n=1}^\infty A_{2n}$ that maps $A_n\cap(0,1/2)$ onto $A_{2n}$ for each $n$. Then define $f(x)=\sup\lbrace g(d):d\in D, d < x \rbrace$. Define $f$ on $[1/2,1]$ in a similar fashion.

Another addendum: I missed/overlooked the condition that $D=f^{-1}[D]$; my map is a bijection from $D$ to itself and that's it. The near-homeomorphisms on the square settle it nicely. In the spirit of those constructions one can get a one-dimensional example on the $\sin\frac1x$-curve: in every arc between points with coordinates $((n+\frac12)\pi)^{-1}$ and $((n+\frac32)\pi)^{-1}$ shrink the interval of points with $y$-coordinates between $-1/2$ and $1/2$ to the interval $[-1/n,1/n]$, everything in a bijective way. Then on the limit segment $\lbrace0\rbrace\times[-1,1]$ the interval $[-1/2,1/2]$ is collapsed to a point. Here $D$ is the graph of $\sin\frac1x$ of course.

• I don't understand how you can extend your function to $[0,1]$, you will need uniform continuity. Oct 31, 2011 at 0:00
• I think your counterexample contains a bug (probably the problem is in the continuous extension). In fact I think I can prove that if X=[0,1] (or 1-dimensional) then the claim of FelipeG is true. Oct 31, 2011 at 8:03
• ---I think I can prove that if X=[0,1] (or 1-dimensional) then the claim of FelipeG is true--- That's unlikely. Take $f:x\mapsto 2x^2-1$ on $[-1,1]$ and take some dense set of transcendental algebraicly independent numbers. Now, for each number take its full forward orbit and some its backward orbit (say, choosing the preimage from $[0,1]$ at each step). Clearly, all numbers you get will be different, so $f$ is one to one on the resulting dense set $D$. A similar construction should work in all but very degenerate metric spaces. Oct 31, 2011 at 13:20
• Fedja, if you only take some of the pre-image, then you won't have $f^{-1}(D)=D$. Oct 31, 2011 at 13:26
• Ah, right you are! I somehow missed that part of the condition entirely. Shame on me! Oct 31, 2011 at 17:59