Math 2.0

Number theory Proof

Proof of Legendre's theorem on continued fractions

Builds on Continued fraction expansion of a real numberConvergents of a continued fractionSimple continued fractionFloor functionThe continued fraction of a rational number terminatesMathematical induction

Proof

We follow the argument of Hardy and Wright. For integers c0c_0 and c1,…,cm≥1c_1, \dots, c_m \ge 1, let PkP_k and QkQ_k (−2≤k≤m-2 \le k \le m) be given by the recurrences in the definition of convergents with terms ckc_k.

  1. Fact 1: PkQk−1−Pk−1Qk=(−1)k+1P_k Q_{k-1} - P_{k-1} Q_k = (-1)^{k+1} for −1≤k≤m-1 \le k \le m. For k=−1k = -1 the left side is 11. For k≥0k \ge 0, inserting the recurrences shows that the left side is minus its value at k−1k - 1.
  2. Fact 2: Qk≥Qk−1≥0Q_k \ge Q_{k-1} \ge 0 and Qk≥1Q_k \ge 1 for 0≤k≤m0 \le k \le m. Indeed Q−1=0Q_{-1} = 0, Q0=1Q_0 = 1, and Qk=ckQk−1+Qk−2≥Qk−1Q_k = c_k Q_{k-1} + Q_{k-2} \ge Q_{k-1} for k≥1k \ge 1, by induction.
  3. Fact 3: let ym+1>0y_{m+1} > 0 be real and put yk=ck+1/yk+1y_k = c_k + 1/y_{k+1} for k=m,m−1,…,0k = m, m-1, \dots, 0. Then y0=yk+1Pk+Pk−1yk+1Qk+Qk−1y_0 = \dfrac{y_{k+1} P_k + P_{k-1}}{y_{k+1} Q_k + Q_{k-1}} for −1≤k≤m-1 \le k \le m.
  4. Proof of fact 3, by induction on kk. For k=−1k = -1 the right side is y0y_0. For the step, substitute yk=ck+1/yk+1y_k = c_k + 1/y_{k+1} into the formula for k−1k - 1 and multiply above and below by yk+1y_{k+1}. The recurrences turn the result into the formula for kk.
  5. Fact 4: in fact 3, assume ym+1>1y_{m+1} > 1. Then the continued fraction expansion of y0y_0 has at least m+2m + 2 terms, and its first m+1m + 1 terms are c0,…,cmc_0, \dots, c_m.
  6. Proof of fact 4. First, yk>1y_k > 1 for 1≤k≤m+11 \le k \le m + 1: this holds for k=m+1k = m + 1, and yk=ck+1/yk+1>ck≥1y_k = c_k + 1/y_{k+1} > c_k \ge 1 for 1≤k≤m1 \le k \le m.
  7. For 0≤k≤m0 \le k \le m we have 0<1/yk+1<10 < 1/y_{k+1} < 1. So the floor of yk=ck+1/yk+1y_k = c_k + 1/y_{k+1} is ckc_k, and yk≠cky_k \ne c_k.
  8. Let xkx_k, aka_k be the complete and partial quotients of y0y_0. By induction on kk, step 7 gives xk=ykx_k = y_k and ak=cka_k = c_k for 0≤k≤m0 \le k \le m, and the process does not stop before step m+1m + 1. This proves fact 4.
  9. Fact 5: by fact 4, the mm-th convergent of y0y_0 is Pm/QmP_m / Q_m, because PmP_m and QmQ_m depend only on c0,…,cmc_0, \dots, c_m.
  10. Now the proof. Write p/q=p′/q′p/q = p'/q' in lowest terms with q′≥1q' \ge 1. Then q′≤qq' \le q, so ∣α−p′/q′∣<12q2≤12q′2\abs{\alpha - p'/q'} < \frac{1}{2q^2} \le \frac{1}{2q'^2}. So we may assume that gcd⁡(p,q)=1\gcd(p, q) = 1.
  11. The expansion of p/qp/q is finite by the termination theorem. Say it is [a0;a1,…,an][a_0; a_1, \dots, a_n], a simple continued fraction, and the process stops with xn=anx_n = a_n.
  12. By fact 3 with m=n−1m = n - 1 and yn=xn=any_n = x_n = a_n, we get p/q=anpn−1+pn−2anqn−1+qn−2=pn/qnp/q = \dfrac{a_n p_{n-1} + p_{n-2}}{a_n q_{n-1} + q_{n-2}} = p_n / q_n. For n=0n = 0 this reads p/q=a0=p0/q0p/q = a_0 = p_0/q_0.
  13. If n≥1n \ge 1, then an=xn=1/(xn−1−an−1)>1a_n = x_n = 1/(x_{n-1} - a_{n-1}) > 1, so an≥2a_n \ge 2.
  14. Consider also the list a0,…,an−1,an−1,1a_0, \dots, a_{n-1}, a_n - 1, 1 of length n+2n + 2. Its terms after the first are positive integers by step 13. Its numerators pk′p'_k satisfy pk′=pkp'_k = p_k for k≤n−1k \le n - 1, pn′=pn−pn−1p'_n = p_n - p_{n-1} and pn+1′=pn′+pn−1=pnp'_{n+1} = p'_n + p_{n-1} = p_n. In the same way qn+1′=qnq'_{n+1} = q_n.
  15. So we have two lists c0,…,cmc_0, \dots, c_m, with m=nm = n and m=n+1m = n + 1, whose terms after the first are positive. For both, Pm/Qm=pn/qn=p/qP_m / Q_m = p_n / q_n = p/q.
  16. By fact 1, gcd⁡(Pm,Qm)=1\gcd(P_m, Q_m) = 1, and Qm≥1Q_m \ge 1 by fact 2. Since also gcd⁡(p,q)=1\gcd(p, q) = 1 and q≥1q \ge 1, we get Pm=pP_m = p and Qm=qQ_m = q for both lists.
  17. If α=p/q\alpha = p/q, then by step 11 the expansion of α\alpha is [a0;…,an][a_0; \dots, a_n], and its nn-th convergent is pn/qn=p/qp_n / q_n = p/q. We are done in this case.
  18. Otherwise write α−p/q=σθ/q2\alpha - p/q = \sigma \theta / q^2 with σ∈{1,−1}\sigma \in \set{1, -1} and 0<θ<120 < \theta < \frac{1}{2}. This is possible by the hypothesis.
  19. The two values of mm in step 15 differ by one. Choose the list with (−1)m=σ(-1)^m = \sigma.
  20. Put ω=1θ−Qm−1Qm\omega = \dfrac{1}{\theta} - \dfrac{Q_{m-1}}{Q_m}. By fact 2, 0≤Qm−1/Qm≤10 \le Q_{m-1}/Q_m \le 1. Since 1/θ>21/\theta > 2, we get ω>1\omega > 1.
  21. Put β=ωPm+Pm−1ωQm+Qm−1\beta = \dfrac{\omega P_m + P_{m-1}}{\omega Q_m + Q_{m-1}}. By the choice of ω\omega, ωQm+Qm−1=Qm/θ>0\omega Q_m + Q_{m-1} = Q_m / \theta > 0.
  22. Over a common denominator, β−PmQm=QmPm−1−PmQm−1Qm(ωQm+Qm−1)\beta - \dfrac{P_m}{Q_m} = \dfrac{Q_m P_{m-1} - P_m Q_{m-1}}{Q_m (\omega Q_m + Q_{m-1})}. By fact 1 the numerator is (−1)m=σ(-1)^m = \sigma.
  23. With step 21 and Qm=qQ_m = q, this gives β−p/q=σθ/q2=α−p/q\beta - p/q = \sigma \theta / q^2 = \alpha - p/q. So β=α\beta = \alpha.
  24. By fact 3 with ym+1=ωy_{m+1} = \omega, the number y0y_0 of fact 3 equals β=α\beta = \alpha.
  25. Since ω>1\omega > 1, fact 5 shows that the mm-th convergent of α\alpha is Pm/Qm=p/qP_m / Q_m = p/q.

Idea

Write p/qp/q as a finite continued fraction; there are two ways, of lengths differing by one, so the parity of the length can be chosen. Then α\alpha is that finite continued fraction with one extra real tail ω\omega. The bound 12q2\frac{1}{2q^2} makes ω>1\omega > 1, and a tail bigger than 11 does not change the earlier partial quotients. So p/qp/q appears among the convergents of α\alpha.

Reading path

To understand this page from the ground up, read these 46 pages in order. The foundations come first. The path takes the proofs Proof of the approximation property of the supremum, Proof that the continued fraction of a real number is finite exactly when the number is rational, Proof that the reals form an ordered field, with the Cauchy sequence construction, Proof that the reals are Archimedean from the completeness axiom.

  1. Construction of the reals from Cauchy sequences concept
  2. Continued fraction definition
  3. Element definition
  4. Euclidean algorithm concept
  5. Integers object
  6. Mathematical induction concept
  7. Ordered field definition
  8. Proposition concept
  9. Rational numbers object
  10. Real numbers object
  11. Set bounded above definition
  12. Simple continued fraction definition
  13. Set definition
  14. Ring of integers statement
  15. Archimedean ordered field definition
  16. Implication definition
  17. Predicate definition
  18. The reals form a field statement
  19. Supremum definition
  20. Continued fraction expansion of a real number definition
  21. Convergents of a continued fraction definition
  22. Ordered pair definition
  23. The rationals form a field statement
  24. Universal quantifier definition
  25. Completeness axiom statement
  26. Cartesian product definition
  27. Subset definition
  28. The rationals form an ordered field statement
  29. Binary relation definition
  30. Order on the reals definition
  31. Antisymmetric relation definition
  32. Reflexive relation definition
  33. Transitive relation definition
  34. Preorder definition
  35. Partial order definition
  36. Total order definition
  37. Proof that the reals form an ordered field, with the Cauchy sequence construction proof
  38. The reals form an ordered field statement
  39. Proof of the approximation property of the supremum proof
  40. Approximation property of the supremum statement
  41. Proof that the reals are Archimedean from the completeness axiom proof
  42. The reals are Archimedean statement
  43. Floor function definition
  44. Proof that the continued fraction of a real number is finite exactly when the number is rational proof
  45. The continued fraction of a rational number terminates statement
  46. Proof of Legendre's theorem on continued fractions proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Simple_continued_fraction, Legendre's theorem on continued fractions
About this page
Tag2MNSMHNRXC
URIm2://2MNSMHNRXC
Kindproof
WritingW0 stub
MSC11J70
ProvesLegendre's theorem on continued fractions
UsesContinued fraction expansion of a real number, Convergents of a continued fraction, Simple continued fraction, Floor function, The continued fraction of a rational number terminates, Mathematical induction
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.