The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V12. Number theory

Mathlib.NumberTheory.DiophantineApproximation.Hurwitz

15 declarations. Mathlib docs · Source

Hurwitz's Theorem in Diophantine Approximation

This file proves Hurwitz's approximation theorem: if $\xi$ is an irrational real number, then there are infinitely many irreducible rationals $x/y$ such that $$\left|\xi - \frac{x}{y}\right| < \frac{1}{\sqrt{5},y^2} ,.$$

This strengthens the corresponding Real.infinite_rat_abs_sub_lt_one_div_den_sq_of_irrational (Dirichlet's Theorem) with constant $1$ proved in Mathlib/NumberTheory/DiophantineApproximation/Basic.lean. In fact the constant $\sqrt 5$ is best possible, with the golden ratio being a counterexample for larger constants.

The proof avoids continued fractions entirely, instead using Farey brackets, which are pairs of rationals $\frac{p}{q} < \xi < \frac{r}{s}$ with $qr - ps = 1$. We can show that at least one of $\frac{p}{q}$, $\frac{r}{s}$ and the mediant $\frac{p+r}{q+s}$ satisfies the bound, and by repeatedly constructing smaller intervals around $\xi$, infinitude is achieved.

Main definitions

  • Real.Hurwitz.IsFarey, defining a Farey interval on 4 integers p, q, r, s such that 0 < q, s and p/q < ξ < r/s with q*r - p*s = 1.

  • Real.Hurwitz.IsGoodApprox defines a good approximation as one satisfying the Hurwitz bound without using division for simplicity. It can be accessed using Real.Hurwitz.isGoodApprox_iff.

Main statements

  • Real.infinite_rat_abs_sub_lt_one_div_sqrt_five_mul_den_sq_of_irrational, which states that for irrational ξ the set {q : ℚ | |ξ - q| < 1/(√5 * q.den^2)} is infinite.

Implementation notes

We use the namespace Real for the main result and a secondary namespace Real.Hurwitz for the technical auxiliary lemmas, and a further IsFarey namespace is used to contain theorems regarding Farey brackets and mediants, following the pattern of Real.ContfracLegendre in Mathlib/NumberTheory/DiophantineApproximation/Basic.lean.

Intermediate lemmas are stated in the division-free form |y*ξ - x| * y * √5 < 1 rather than |ξ - x/y| < 1/(√5*y^2), which is substantially easier to manipulate. The two are related by Real.Hurwitz.IsGoodApprox.abs_sub_div_lt.

References

Tags

Diophantine approximation, Hurwitz's theorem, Farey sequence, Stern-Brocot tree, mediant

Bridging IsGoodApprox to aux₀ hypotheses

Important contradiction

Mediant properties

Key step: one of three consecutive Farey endpoints is good

Generating brackets of arbitrarily large denominators

From ℤ to ℚ, and infinitude

structure Real.Hurwitz.IsFarey E3 #

ℝ → ℤ → ℤ → ℤ → ℤ → Prop

IsFarey ξ p q r s means p/q < ξ < r/s with q * r - p * s = 1. The determinant/ unimodularity condition ensures the mediant (p + r) / (q + s) creates a valid interval with each endpoint.

ctor Real.Hurwitz.IsFarey.mk E0 #

∀ {ξ : ℝ} {p q r s : ℤ}, 0 < q → 0 < s → q * r - p * s = 1 → ↑p / ↑q < ξ → ξ < ↑r / ↑s → Real.Hurwitz.IsFarey ξ p q r s

theorem Real.Hurwitz.IsFarey.q_pos E1 #

∀ {ξ : ℝ} {p q r s : ℤ}, Real.Hurwitz.IsFarey ξ p q r s → 0 < q

Left denominator is positive.

theorem Real.Hurwitz.IsFarey.s_pos E1 #

∀ {ξ : ℝ} {p q r s : ℤ}, Real.Hurwitz.IsFarey ξ p q r s → 0 < s

Right denominator is positive.

theorem Real.Hurwitz.IsFarey.det E1 #

∀ {ξ : ℝ} {p q r s : ℤ}, Real.Hurwitz.IsFarey ξ p q r s → q * r - p * s = 1

Unimodularity condition.

theorem Real.Hurwitz.IsFarey.left E1 #

∀ {ξ : ℝ} {p q r s : ℤ}, Real.Hurwitz.IsFarey ξ p q r s → ↑p / ↑q < ξ

p / q is a lower bound for ξ.

theorem Real.Hurwitz.IsFarey.right E1 #

∀ {ξ : ℝ} {p q r s : ℤ}, Real.Hurwitz.IsFarey ξ p q r s → ξ < ↑r / ↑s

r / s is an upper bound for ξ.

def Real.Hurwitz.IsGoodApprox E3 #

ℝ → ℤ → ℤ → Prop

Divisionless reformulation of Hurwitz bound |ξ - x / y| < 1 / (√5 * y ^ 2).

theorem Real.Hurwitz.isGoodApprox_iff E3 #

∀ {ξ : ℝ} {x y : ℤ}, Real.Hurwitz.IsGoodApprox ξ x y ↔ 0 < y ∧ |↑y * ξ - ↑x| * ↑y * √5 < 1

Unfolding lemma for IsGoodApprox.

theorem Real.Hurwitz.IsFarey.isGoodApprox_or E1 #

∀ {ξ : ℝ},
  Irrational ξ →
    ∀ {p q r s : ℤ},
      Real.Hurwitz.IsFarey ξ p q r s →
        Real.Hurwitz.IsGoodApprox ξ p q ∨ Real.Hurwitz.IsGoodApprox ξ r s ∨ Real.Hurwitz.IsGoodApprox ξ (p + r) (q + s)

If IsFarey ξ p q r s, then at least one of p/q, r/s, and the mediant (p + r)/(q + s) satisfies the Hurwitz bound.

theorem Real.Hurwitz.IsFarey.exists_isGoodApprox E1 #

∀ {ξ : ℝ},
  Irrational ξ →
    ∀ {p q r s : ℤ},
      Real.Hurwitz.IsFarey ξ p q r s → ∃ x y, Real.Hurwitz.IsGoodApprox ξ x y ∧ |ξ - ↑x / ↑y| < 1 / (↑q * ↑s)

If IsFarey ξ p q r s, then there exists a good approximation to ξ closer than the width of the bracket.

theorem Real.Hurwitz.exists_isFarey_large E1 #

∀ {ξ : ℝ}, Irrational ξ → ∀ (n : ℕ), ∃ p q r s, Real.Hurwitz.IsFarey ξ p q r s ∧ ↑n ≤ q + s

Farey brackets around ξ with arbitrarily large denominator sum q + s (and therefore arbitrarily small width) exist.

theorem Real.Hurwitz.IsGoodApprox.abs_sub_div_lt E1 #

∀ {ξ : ℝ} {x y : ℤ}, Real.Hurwitz.IsGoodApprox ξ x y → |ξ - ↑x / ↑y| < 1 / (√5 * ↑y ^ 2)

A good approximation in the division-free sense satisfies the usual Hurwitz bound |ξ - x / y| < 1 / (√5 * y ^ 2).

theorem Real.Hurwitz.exists_rat_abs_sub_lt_one_div_sqrt_five_mul_den_sq_and_lt_of_irrational E1 #

∀ {ξ : ℝ}, Irrational ξ → ∀ (t : ℚ), ∃ t', |ξ - ↑t'| < 1 / (√5 * ↑t'.den ^ 2) ∧ |ξ - ↑t'| < |ξ - ↑t|

Given any rational t, there is a rational t' satisfying the Hurwitz bound that is strictly closer to ξ than t is.

theorem Real.infinite_rat_abs_sub_lt_one_div_sqrt_five_mul_den_sq_of_irrational E3 #

∀ {ξ : ℝ}, Irrational ξ → {t | |ξ - ↑t| < 1 / (√5 * ↑t.den ^ 2)}.Infinite

Hurwitz's theorem. For irrational ξ, the set {q : ℚ | |ξ - q| < 1 / (√5 * q.den ^ 2)} is infinite.