# Why is this set of continued fractions perfect?

Would somebody please explain why the set of continued fractions in this answer

http://math.stackexchange.com/a/1067/20873

i.e. "the set of all irrationals with continued fractions consisting only of 1's and 2's in any arrangement" is a perfect set? Thank you.

(I do know the definition of a perfect set, but this is the first time I've come across infinite continued fractions in this context, and I don't know much about their properties either.)

-
Do you know what a perfect set is? or do you also need that explained? – Gerry Myerson Jul 16 '12 at 13:37
@GerryMyerson I do know what a perfect is. A set is perfect if it is equal to its set of limit points. – hwhm Jul 16 '12 at 13:51
So, if some continued fractions with only 1,2 is an isolated point, what would its continued fraction look like? (You also have to show your set is closed, but in fact it is compact, right? Continuous image of a natural product space.) – GEdgar Jul 16 '12 at 14:16
From Gerry and Gerald's comments, I'm guessing this is well known. Meanwhile, for, um, flavor, I really like The Markoff and Lagrange Spectra, by Thomas W. Cusick and Mary E. Flahive. I was working with the number theoretic aspects, so i looked closely at just the first two chapters and the appendices. There is also the short Continued Fractions by Khinchin, who was deeply involved in the measure theory of continued fractions. – Will Jagy Jul 16 '12 at 20:34
@GEdgar Thanks. Is it $C\times C$, where $C$ is the standard (ternary) Cantor set, that you're talking about? I'm really having trouble finding something to say about the distance between two given members of that set of continued fractions... I'd really appreciate it if I can have a bit more hints still. After that I'll try and answer this thread myself. – hwhm Jul 19 '12 at 10:55

Let the set of continued fractions described be $X$. There are no isolated points in $X$, for if $x \in X$ and $$x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \dotso}}$$ where $a_i \in \{1,2\}$, define the sequence $x_n$ for $n>0$ by replacing $a_n$ in the expansion of $x$ with $1$ if $a_n = 2$, $2$ if $a_n = 1$. Then, denoting the denominator of the $n$-th convergent of $x$ by $q_n$, and using the determinant formula, $|x_n - x| < \frac{1}{q_n q_{n-1}}$. So $x_n \to x$.
$X$ is compact, hence closed and bounded: Let $C$ denote the standard (ternary) Cantor set, and define $f:C\to X$ by $0.b_0 b_1 \dotso _3$ (in ternary) $\mapsto$ $x$ where $a_n = 1$ if $b_n = 0$, $a_n = 2$ if $b_n = 2$. This is continuous because given $y:=0.b_0 b_1 \dotso _3$ (in ternary) $\in C$ and a $\frac{1}{q_n q_{n-1}}$ of $f(y)$ (see above), if we let $\delta = 3^{-n-2}$ then $( z\in C$ and $|z-y| < \delta )$ $\implies$ $| f(z) - f(y) | < \frac{1}{q_n q_{n-1}}$.