# Dirichlet's approximation theorem

In number theory, Dirichlet's theorem on Diophantine approximation, also called Dirichlet's approximation theorem, states that for any real numbers $\alpha$ and $N$, with $1\leq N$, there exist integers $p$ and $q$ such that $1\leq q\leq N$ and
    $\left|q\alpha -p\right|\leq {\frac {1}{\lfloor N\rfloor +1}}<{\frac {1}{N}}.$
Here $\lfloor N\rfloor$ represents the integer part of $N$. This is a fundamental result in Diophantine approximation, showing that any real number has a sequence of good rational approximations: in fact an immediate consequence is that for a given irrational α, the inequality
    $\left|\alpha -{\frac {p}{q}}\right|<{\frac {1}{q^{2}}}$
is satisfied by infinitely many integers p and q. This shows that any irrational number has irrationality measure at least 2.
The Thue–Siegel–Roth theorem says that, for algebraic irrational numbers, the exponent of 2 in the corollary to Dirichlet’s approximation theorem is the best we can do: such numbers cannot be approximated by any exponent greater than 2. The Thue–Siegel–Roth theorem uses advanced techniques of number theory, but many simpler numbers such as the golden ratio $(1+{\sqrt {5}})/2$ can be much more easily verified to be inapproximable beyond exponent 2.

## Simultaneous version

The simultaneous version of the Dirichlet's approximation theorem states that given real numbers $\alpha _{1},\ldots ,\alpha _{d}$ and a natural number $N$ then there are integers $p_{1},\ldots ,p_{d},q\in \mathbb {Z} ,1\leq q\leq N^{d}$ such that $\left|\alpha _{i}-{\frac {p_{i}}{q}}\right|\leq {\frac {1}{qN}}.$

## Method of proof
### Proof by the pigeonhole principle

This theorem is a consequence of the pigeonhole principle. Peter Gustav Lejeune Dirichlet who proved the result used the same principle in other contexts (for example, the Pell equation) and by naming the principle (in German) popularized its use, though its status in textbook terms comes later. The method extends to simultaneous approximation.
Proof outline: Let $\alpha$ be an irrational number and $N$ be an integer. For every $k=0,1,...,N$ we can write $k\alpha =m_{k}+x_{k}$ such that $m_{k}$ is an integer and $0\leq x_{k}<1$. One can divide the interval $[0,1)$ into $N$ smaller intervals of measure ${\frac {1}{N}}$. Now, we have $N+1$ numbers $x_{0},x_{1},...,x_{N}$ and $N$ intervals. Therefore, by the pigeonhole principle, at least two of them are in the same interval. We can call those $x_{i},x_{j}$ such that $i<j$. Now:
    $|(j-i)\alpha -(m_{j}-m_{i})|=|j\alpha -m_{j}-(i\alpha -m_{i})|=|x_{j}-x_{i}|<{\frac {1}{N}}$
Dividing both sides by $j-i$ will result in:
    $\left|\alpha -{\frac {m_{j}-m_{i}}{j-i}}\right|<{\frac {1}{(j-i)N}}\leq {\frac {1}{\left(j-i\right)^{2}}}$
And we proved the theorem.

### Proof by Minkowski's theorem

Another simple proof of the Dirichlet's approximation theorem is based on Minkowski's theorem applied to the set
    $S=\left\{(x,y)\in \mathbb {R} ^{2}:-N-{\frac {1}{2}}\leq x\leq N+{\frac {1}{2}},\vert \alpha x-y\vert \leq {\frac {1}{N}}\right\}.$
Since the volume of $S$ is greater than $4$, Minkowski's theorem establishes the existence of a non-trivial point with integral coordinates. This proof extends naturally to simultaneous approximations by considering the set
    $S=\left\{(x,y_{1},\dots ,y_{d})\in \mathbb {R} ^{1+d}:-N-{\frac {1}{2}}\leq x\leq N+{\frac {1}{2}},|\alpha _{i}x-y_{i}|\leq {\frac {1}{N^{1/d}}}\right\}.$

## Related theorems
### Legendre's theorem on continued fractions

In his Essai sur la théorie des nombres (1798), Adrien-Marie Legendre derives a necessary and sufficient condition for a rational number to be a convergent of the simple continued fraction of a given real number. A consequence of this criterion, often called Legendre's theorem within the study of continued fractions, is as follows:
Theorem. If α is a real number and p, q are positive integers such that $\left|\alpha -{\frac {p}{q}}\right|<{\frac {1}{2q^{2}}}$, then p/q is a convergent of the continued fraction of α.
This theorem forms the basis for Wiener's attack, a polynomial-time exploit of the RSA cryptographic protocol that can occur for an injudicious choice of public and private keys (specifically, this attack succeeds if the prime factors of the public key n = pq satisfy p < q < 2p and the private key d is less than (1/3)n$^{1/4}$).