Math 2.0

Number theory Proof

Proof that the continued fraction of a real number is finite exactly when the number is rational

Builds on Continued fraction expansion of a real numberFloor functionMathematical induction

Proof

We use the notation xnx_n, ana_n of the continued fraction expansion of xx: x0=xx_0 = x, an=⌊xn⌋a_n = \floor{x_n}, and xn+1=1/(xn−an)x_{n+1} = 1/(x_n - a_n) when xn≠anx_n \ne a_n.

  1. Suppose the expansion is finite. Then the process stops at some nn, so xn=anx_n = a_n is an integer.
  2. For k<nk < n, the process did not stop at kk, so xk+1=1/(xk−ak)x_{k+1} = 1/(x_k - a_k). Solving gives xk=ak+1/xk+1x_k = a_k + 1/x_{k+1}.
  3. If xk+1x_{k+1} is rational, then so is xk=ak+1/xk+1x_k = a_k + 1/x_{k+1}, since aka_k is an integer.
  4. By step 1 and step 3, applied for k=n−1,n−2,…,0k = n-1, n-2, \dots, 0 in turn, each xkx_k is rational. In particular x=x0x = x_0 is rational.
  5. Conversely, let x=r/sx = r/s with integers rr and ss, s>0s > 0. We show that the process stops.
  6. Claim: if the process has not stopped before step kk, then xk=rk/skx_k = r_k / s_k with integers rkr_k and sks_k, and 1≤sk≤s−k1 \le s_k \le s - k.
  7. For k=0k = 0, take r0=rr_0 = r and s0=ss_0 = s.
  8. Suppose the claim holds for kk, and the process does not stop at kk, so xk≠akx_k \ne a_k. Since aka_k is the floor of xkx_k, we have 0<xk−ak<10 < x_k - a_k < 1.
  9. Put tk=rk−akskt_k = r_k - a_k s_k, an integer. Then xk−ak=tk/skx_k - a_k = t_k / s_k, so 0<tk<sk0 < t_k < s_k by step 8.
  10. Then xk+1=1/(xk−ak)=sk/tkx_{k+1} = 1/(x_k - a_k) = s_k / t_k. Put rk+1=skr_{k+1} = s_k and sk+1=tks_{k+1} = t_k. We get 1≤sk+1≤sk−1≤s−(k+1)1 \le s_{k+1} \le s_k - 1 \le s - (k+1). This proves the claim by induction on kk.
  11. If the process had not stopped before step ss, the claim would give 1≤ss≤01 \le s_s \le 0, which is impossible. So the process stops at some k<sk < s, and the expansion of xx is finite.
  12. So the expansion of xx is finite if and only if xx is rational.

Idea

For a fraction r/sr/s, each step of the algorithm replaces the denominator by a smaller positive integer, exactly as in the Euclidean algorithm. A decreasing sequence of positive integers must stop. Conversely, a finite expansion can be folded back from its last term, and each step keeps the number rational.

Reading path

To understand this page from the ground up, read these 42 pages in order. The foundations come first. The path takes the proofs Proof of the approximation property of the supremum, 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. Integers object
  5. Mathematical induction concept
  6. Ordered field definition
  7. Proposition concept
  8. Rational numbers object
  9. Real numbers object
  10. Set bounded above definition
  11. Simple continued fraction definition
  12. Set definition
  13. Ring of integers statement
  14. Archimedean ordered field definition
  15. Implication definition
  16. Predicate definition
  17. The reals form a field statement
  18. Supremum definition
  19. Continued fraction expansion of a real number definition
  20. Ordered pair definition
  21. The rationals form a field statement
  22. Universal quantifier definition
  23. Completeness axiom statement
  24. Cartesian product definition
  25. Subset definition
  26. The rationals form an ordered field statement
  27. Binary relation definition
  28. Order on the reals definition
  29. Antisymmetric relation definition
  30. Reflexive relation definition
  31. Transitive relation definition
  32. Preorder definition
  33. Partial order definition
  34. Total order definition
  35. Proof that the reals form an ordered field, with the Cauchy sequence construction proof
  36. The reals form an ordered field statement
  37. Proof of the approximation property of the supremum proof
  38. Approximation property of the supremum statement
  39. Proof that the reals are Archimedean from the completeness axiom proof
  40. The reals are Archimedean statement
  41. Floor function definition
  42. Proof that the continued fraction of a real number is finite exactly when the number is rational proof

Where this leads

5 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Simple_continued_fraction, Finite continued fractions
About this page
Tag7EDZQY5MV9
URIm2://7EDZQY5MV9
Kindproof
WritingW0 stub
MSC11A55
ProvesThe continued fraction of a rational number terminates
UsesContinued fraction expansion of a real number, Floor function, 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.