6

Real numbers can be approximated to successively better precision using the convergents of a continued fraction.

Is there a similar way to find quadratic integers of fixed (positive) discriminant that approximate reals? I'm aware that it can provably be done, I'm interested in actually finding members of $\mathbb Z (\sqrt d)$ that work.

I've found any number of results proving that reals can be approximated by algebraic numbers of various degrees, but none yet with fixed discriminant, nor any algorithm for actually finding the numbers in question. I suspect that the answer will involve generalized continued fractions somehow, but I don't yet understand them well enough to make this work.

1 Answers1

5

There are probably lots of ways to do this, but here is one.

First pick some integers $a$ and $b$ such that $0 \lt a + b\sqrt{d} \lt 1$ (for example choose $a = -\left\lfloor\sqrt{d}\right\rfloor$ and $b = 1$, which works if $d$ is not a perfect square).

Now given a real number $\alpha$, define the sequence $\{c_n\}_{n=1}^{\infty}$ by $c_1 = \lfloor\alpha\rfloor$ and $c_{i+1} = c_i + \left\lfloor\frac{\alpha - c_i}{(a + b\sqrt{d})^i}\right\rfloor(a+b\sqrt{d})^i$

All the $c_i$ are in $\mathbb{Z}[\sqrt{d}]$ and $\lim\limits_{n\to\infty} c_n = \alpha$.


To show this, first notice that the sequence is monotonically increasing, and that it is bounded above by $\alpha$ (induction and bounds on $\lfloor x \rfloor$), and so it is convergent. Let the limit be $c$.

Then taking limits on the recurrence above we get $$\lim\limits_{n\to\infty}\left\lfloor\frac{\alpha - c_n}{(a + b\sqrt{d})^n}\right\rfloor(a+b\sqrt{d})^n = 0$$

But we also have $$\alpha - c_n - (a + b\sqrt{d})^n \lt \left\lfloor\frac{\alpha - c_n}{(a + b\sqrt{d})^n}\right\rfloor(a+b\sqrt{d})^n \leq \alpha - c_n$$

So rearranging we get $$\left\lfloor\frac{\alpha - c_n}{(a + b\sqrt{d})^n}\right\rfloor(a+b\sqrt{d})^n \leq \alpha - c_n \lt \left\lfloor\frac{\alpha - c_n}{(a + b\sqrt{d})^n}\right\rfloor(a+b\sqrt{d})^n + (a + b\sqrt{d})^n$$

Taking limits and using $0 \lt a + b\sqrt{d} \lt 1$, we get a squeezing result that $\alpha - c = 0$.


I am sure there are nicer ways to prove this... Anyway the intuition is simple, you basically just start moving from $0$ in steps of $1$, until you get as close to $\alpha$ as possible from below. Then you start moving in steps of $(a + b\sqrt{d})$ until you get as close to $\alpha$ as possible from below, then you start moving in steps of $(a + b\sqrt{d})^2$, and so on. It's pretty much like doing a base-x expansion of $\alpha$, where $x$ is this $a + b\sqrt{d}$.

Tob Ernack
  • 5,319
  • Very enlightening, thank you! Are these quadratic integers in some sense the 'best' ones, the way the convergents of a continued fraction are? – Garth Rose Feb 08 '19 at 05:05
  • Maybe if you use the conjugate of the fundamental unit? – Garth Rose Feb 08 '19 at 05:12
  • 1
    I guess you could ask about how small the error is compared to the size of the coefficients of $1$ and $\sqrt{d}$, but I don't know if this is necessarily the best in that sense. It's just the easiest to come up with for me, I guess. – Tob Ernack Feb 08 '19 at 05:14
  • As reuns pointed out in another comment, the error of $|\alpha - c_n|$ is on the order of $(a + b\sqrt{d})^n$ so if you have good rational approximations to $\sqrt{d}$ you can get good approximations for $\alpha$ using a small number of powers. – Tob Ernack Feb 08 '19 at 05:17
  • 1
    Is the fundamental unit $u=a-b\sqrt{d}$ optimal in some sense ? (we want $|u|$ small and $a^2+b^2d$ not too large) How much is $\alpha $ non-optimal ? If $|\beta| > 1,|\overline{\beta}| > 1$ then $\beta \gamma$ is always sub-optimal. So we'd like to characterize $B = { \beta\in \mathbb{Z}[\sqrt{d}],|\beta| > 1,|\overline{\beta}| > 1}$. What about $\mathbb{Z}[\sqrt{d}] - B\mathbb{Z}[\sqrt{d}] $ ? – reuns Feb 08 '19 at 05:36
  • The sequence $\lfloor \frac{\alpha}{(a+b\sqrt d)^i} \rfloor (a+b\sqrt d)^i$ also converges to $\alpha$. Is there an argument that your sequence $c_i$ is more optimal? – Stef Mar 26 '23 at 20:01