Complex Continued Fraction Algorithms

Similar documents
Continued fractions for complex numbers and values of binary quadratic forms

MORE CONSEQUENCES OF CAUCHY S THEOREM

CHAPTER 8: EXPLORING R

(x 1, y 1 ) = (x 2, y 2 ) if and only if x 1 = x 2 and y 1 = y 2.

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

0 Sets and Induction. Sets

Introduction to Abstract Mathematics

COMPLEX NUMBERS WITH BOUNDED PARTIAL QUOTIENTS

3 Finite continued fractions

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

1 Continued Fractions

MATH FINAL EXAM REVIEW HINTS

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Chapter 2 Metric Spaces

2. THE EUCLIDEAN ALGORITHM More ring essentials

NATIONAL UNIVERSITY OF SINGAPORE Department of Mathematics MA4247 Complex Analysis II Lecture Notes Part II

NOTES ON SIMPLE NUMBER THEORY

Notes on Continued Fractions for Math 4400

Solutions for Homework Assignment 2

Math 118: Advanced Number Theory. Samit Dasgupta and Gary Kirby

LeLing13: Polynomials and complex numbers. Division of polynomials. Euclides s algorithm and multiple roots. R ecommended exercises: Geoling 15.

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

Part IA Numbers and Sets

Factorization in Polynomial Rings

MASTERS EXAMINATION IN MATHEMATICS SOLUTIONS

Series of Error Terms for Rational Approximations of Irrational Numbers

K. Ireland, M. Rosen A Classical Introduction to Modern Number Theory, Springer.

Complex Analysis Homework 9: Solutions

1. Factorization Divisibility in Z.

Revision Problems for Examination 1 in Algebra 1

13 Maximum Modulus Principle

MATH 51H Section 4. October 16, Recall what it means for a function between metric spaces to be continuous:

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

CHAPTER 4: EXPLORING Z

Continued Fractions New and Old Results

QUARTIC POWER SERIES IN F 3 ((T 1 )) WITH BOUNDED PARTIAL QUOTIENTS. Alain Lasjaunias

Solutions to Practice Final 3

1 Complex numbers and the complex plane

Sets, Structures, Numbers

Chakravala - a modern Indian method. B.Sury

PRIME NUMBERS YANKI LEKILI

1. multiplication is commutative and associative;

THE UNIT GROUP OF A REAL QUADRATIC FIELD

Real Analysis Math 131AH Rudin, Chapter #1. Dominique Abdi

An Introduction to Complex Analysis and Geometry John P. D Angelo, Pure and Applied Undergraduate Texts Volume 12, American Mathematical Society, 2010

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Chapter One. The Real Number System

Metric Spaces and Topology

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Chapter 5. Number Theory. 5.1 Base b representations

,... We would like to compare this with the sequence y n = 1 n

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt

Chapter 8. P-adic numbers. 8.1 Absolute values

Complex Analysis Qualifying Exam Solutions

Selected Chapters from Number Theory and Algebra

Analysis-3 lecture schemes

Immerse Metric Space Homework

MATH 131A: REAL ANALYSIS (BIG IDEAS)

Review Sheet for the Final Exam of MATH Fall 2009

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Proof by Contradiction

Solutions to Practice Final

Math 61CM - Solutions to homework 2

Some Results Concerning Uniqueness of Triangle Sequences

Course 212: Academic Year Section 1: Metric Spaces

On Representations of integers by the quadratic form x2 Dy2

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Functioning in the Complex Plane

NOTES ON DIOPHANTINE APPROXIMATION

Jeong-Hyun Kang Department of Mathematics, University of West Georgia, Carrollton, GA

Part 2 Continuous functions and their properties

Prime Numbers and Irrational Numbers

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

A Few Primality Testing Algorithms

Standard forms for writing numbers

The Chinese Remainder Theorem

CONTINUED FRACTIONS, PELL S EQUATION, AND TRANSCENDENTAL NUMBERS

CHAPTER 3. Congruences. Congruence: definitions and properties

General Notation. Exercises and Problems

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

NOTES ON FINITE FIELDS

SPECIAL CASES OF THE CLASS NUMBER FORMULA

Infinite Continued Fractions

Considering our result for the sum and product of analytic functions, this means that for (a 0, a 1,..., a N ) C N+1, the polynomial.

ARITHMETIC PROGRESSIONS IN CYCLES OF QUADRATIC POLYNOMIALS

Logical Connectives and Quantifiers

Contribution of Problems

Contribution of Problems

We have been going places in the car of calculus for years, but this analysis course is about how the car actually works.

1 Overview and revision

7 Asymptotics for Meromorphic Functions

Divisibility. Chapter Divisors and Residues

FINITE ABELIAN GROUPS Amin Witno

9. Series representation for analytic functions

MATH Fundamental Concepts of Algebra

17 Advancement Operator Equations

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Transcription:

Complex Continued Fraction Algorithms A thesis presented in partial fulfilment of the requirements for the degree of Master of Mathematics Author: Bastiaan Cijsouw (s3022706) Supervisor: Dr W Bosma Second reader: Prof dr J O Shallit University of Waterloo, Canada November 205

Contents Introduction 5 History 5 2 Thesis outline 5 3 Basic definitions and notation 6 2 Complex continued fractions 9 3 Complex continued fraction algorithms 5 3 Floor functions & sign functions 5 32 Definition of a complex continued fraction algorithm 7 33 General properties 7 34 Greatest common divisor algorithm 2 35 Convergence 22 36 Periodicity 29 4 A complex continued fraction algorithm by A Hurwitz 37 5 Two complex continued fraction algorithms by J Hurwitz 4 5 Complex continued fraction algorithm of the first kind 4 52 Complex continued fraction algorithm of the second kind 44 53 Correspondence between the two algorithms 48 54 Description of the output of the algorithms 48 6 A complex continued fraction algorithm by J O Shallit 49 6 The algorithm 49 62 Convergence 5 63 Periodicity? 53 64 Specific properties of the algorithm 56 7 Real continued fraction algorithms 6 3

4

Introduction In this chapter we will briefly look into the history of continued fractions Subsequently, the outline of this thesis is explained and finally we will look at some basic definitions and notation that are used in this thesis History The origin of real continued fractions can be traced back to the Euclidean algorithm, which was introduced around 300 BCE The Euclidean algorithm is a procedure for finding the greatest common divisor of two natural numbers m and n, but generates as a by-product a continued fraction of m Still, it is not clear whether Euclid and his n contemporaries recognised this phenomenon Another early appearance can be found in the 6th century, when Aryabhata used continued fractions to solve linear diophantine equations Although continued fractions often appear in the history of mathematics, it was not until the end of the 7th century that the theory of continued fractions was generalised Before this date continued fractions only emerged in specific examples, eg, Bombelli calculated a continued fraction of 3 in 579 In 695, Wallis was the first to build up the basic groundwork for the theory of continued fractions Huygens used the convergents of a continued fraction to find the best rational approximations for gear ratios, which he used to build a mechanical planetarium In the 8th century Euler, Lambert and Lagrange made huge contributions to the theory of continued fractions Euler showed that every rational number can be expressed as a finite continued fraction Lambert was the first to prove that π is irrational by using continued fractions and Lagrange proved that the continued fraction of a quadratic irrational number is periodic Along with real continued fractions, complex continued fractions have also been studied In 887, A Hurwitz generalised the nearest integer continued fraction expansion to the complex numbers, where the partial quotients are Gaussian integers Fifteen years later, his brother J Hurwitz devised two complex continued fraction expansions where the partial quotients are to be taken from the set ( + i)z[i] Another famous complex continued fraction is due to A L Schmidt, which he defined in 975, but his approach is fairly different from that of the brothers Hurwitz In 979, J O Shallit devised a complex continued fraction expansion that generalises the regular continued fraction expansion It is notable that only some of the nice properties of real continued fractions also hold for complex continued fractions To this day, the theory of continued fractions is a flourishing field in mathematics and has multiple applications in other fields 2 Thesis outline In Chapter 2 of this thesis we will define what a complex continued fraction is and have a quick look at the theory of complex continued fractions In Chapter 3 we give the definition of a complex continued fraction algorithm and we will extensively examine the properties of these algorithms, such as convergence and periodicity In Chapter 4 we will see that the algorithm of A Hurwitz fits in our general framework of complex continued 5

fraction algorithms Additionally, we will study specific properties of this algorithm In Chapter 5 it is shown that also the algorithms of J Hurwitz suit this framework, and we will look at some special properties of his algorithms In Chapter 6 the algorithm of J O Shallit is defined We will see that also this algorithm fits in our framework and we will examine some particular properties of this algorithm In Chapter 7 we will investigate the relation between complex continued fraction algorithms and real continued fraction algorithms 3 Basic definitions and notation In this section we will provide some useful definitions and notation standard, but given for completeness Most of this is Let N = {0,, 2, 3, } be the set of all natural numbers Let N >0 be the set of natural numbers which are strictly greater than 0 Let Z = {, 2,, 0,, 2, } be the set of all integers Let Q = { p q p Z, q N>0 } be the set of all real rational numbers Let R be the set of all real numbers Then we have N Z Q R Let i be the imaginary unit, where i 2 = Let Z[i] = {a + bi a, b Z} be the set of the Gaussian integers Let Q[i] = { p q p Z[i], q Z[i] \ {0}} be the set of all complex rational numbers Let C be the set of all complex numbers Here we have Z[i] Q[i] C Moreover, we obtain Z Z[i], Q Q[i] and R C Let z C; we call z rational if z Q[i], and we call z irrational if z C \ Q[i] We call z quadratic irrational if z is irrational and there exists A, B and C Z[i] such that Az 2 + Bz + C = 0, where A 0 Let 2Z = {2a a Z} and let ( + i)z[i] = {( + i)a a Z[i]} Note that ( + i)z[i] = {a + bi a, b Z, a + b 0 (mod 2)} Let z C, z 0 Note that y 2 = z has two solutions in C, and if y 0 is a solution, then y 0 also is a solution We define the square root z of z to be the number y such that y 2 = z and y {x C Re(x) > 0 or Re(x) = 0 Im(x) 0} Of course, 0 := 0 We can write any complex number z C in the form z = x + yi, where x, y R We call x the real part of z, and denote this by Re(z) Similarly, we call y the imaginary part of z, and denote this by Im(z) The conjugate of z is denoted by z and given by z = x yi The modulus of z is denoted by z and given by z = x 2 + y 2 Let a, b Z[i], b 0 We define the greatest common divisor gcd(a, b) of a and b up to units That is, we define gcd(a, b) to be a Gaussian integer g such that g a and g b and there is no h Z[i] such that h > g and h a and h b As {,, i, i} is the set of units in Z[i] we have that if g = gcd(a, b), then also σg = gcd(a, b) for σ {,, i, i} For p C, r > 0, we define B r (p) := {x C x p < r} We define Br (p) to be the closure of B r (p), so B r (p) := {x C x p r} Let c n C for every n N We say that lim n c n = if lim n c n = 0 Let z C and let A C be a finite subset of C We define d(z, A) := min a A z a 6

For x R we define x to be the floor of x, that is: the largest integer a Z such that a x Note that x x < We also have the following: x x + 2 2 We end this section with a proposition Proposition Let z C Then: z is quadratic irrational if and only if z = p+q r s for some p, q, r, s Z[i], q 0, s 0 and r not a square Proof Suppose z is quadratic irrational Accordingly: let A, B, C Z[i] such that A 0 and Az 2 + Bz + C = 0 Then we have by the quadratic formula: z = B + B 2 4AC 2A or z = B B 2 4AC 2A It follows that B 2 4AC is not a square, otherwise z would be rational So we can write z = p+q r for some p, q, r, s Z[i], q 0, s 0 and r not a square s For the other direction, let p, q, r, s Z[i] such that q 0, s 0 and r not a square Let z := p+q r As q 0 and r not a square, we have that z is irrational Now consider s the polynomial s 2 x 2 2psx + (p 2 q 2 r) We see: s 2, 2ps, p 2 q 2 r Z[i] and s 2 0 Now: ( p + q r ) 2 s 2 z 2 2psz + (p 2 q 2 r) = s 2 p + q r 2ps + (p 2 q 2 r) s s = p 2 + 2pq r + q 2 r 2p 2 2pq r + p 2 q 2 r = 0 As z is irrational we conclude by the last equation: z is quadratic irrational 7

8

2 Complex continued fractions In this chapter we define what a complex continued fraction is We will also study these complex continued fractions by proving some results about their properties As we distinguish between a finite and an infinite complex continued fraction, we first give the definition of a finite complex continued fraction Definition 2 Let n N A finite complex continued fraction is a tuple A, E, where A = (a 0, a,, a n ) is a finite sequence with a k Z[i] for every k {0,, n}, and E = (e, e 2,, e n ) is a finite sequence with e k {,, i, i} for every k {,, n} We will also use the notation [a 0, e /a,, e n /a n ] for a finite complex continued fraction The definition of an infinite complex continued fraction is similar Definition 22 An infinite complex continued fraction is a tuple A, E, where A = (a 0, a, a 2, ) is an infinite sequence with a k Z[i] for every k N, and E = (e, e 2, ) is an infinite sequence with e k {,, i, i} for every k N >0 We will also use the notation [a 0, e /a, e 2 /a 2, ] for an infinite complex continued fraction In a finite or infinite complex continued fraction the e k+ are called the partial numerators, and the a k are called the partial quotients, for every k N We define the length of a complex continued fraction as follows: [a 0, e /a,, e n /a n ] = n + for a finite complex continued fraction, and [a 0, e /a, e 2 /a 2, ] = for an infinite complex continued fraction In order to perform calculations with complex continued fractions, one more definition is needed Definition 23 Let n N A pseudo continued fraction is a tuple A, E, where A = (a 0, a,, a n ) is a finite sequence with a n C, a k Z[i] for every k {0,, n }, and E = (e, e 2,, e n ) is a finite sequence with e k {,, i, i} for every k {,, n} We will also use the notation [a 0, e /a,, e n /a n ] for a pseudo continued fraction Definition 24 Let P be the set of all pseudo continued fractions We inductively define Val : P C { } Val([a 0 ]) := a 0, Val([a 0, e /a,, e n /a n ]) := a 0 + e V if V / {0, }, Val([a 0, e /a,, e n /a n ]) := if V {0, }, where V := Val([a, e 2 /a 2,, e n /a n ]) The function Val can be thought of as a function giving a finite complex continued fraction a value We use the symbol to denote undefined, as not all finite complex continued fractions have a value in C An example is given by [2, /i, /i] To compute Val([2, /i, /i]), it is required to compute Val([i, /i]) first As Val([i, /i]) = i + Val([i]) = i + i = i i = 0, we obtain: Val([2, /i, /i]) = The function Val gives rise to the following definition Definition 25 We call a pseudo continued fraction [a 0, e /a,, e n /a n ] proper if Val([a 0, e /a,, e n /a n ]) 9

Note that if [a 0, e /a,, e n /a n ] is proper, then [a k, e k+ /a k+,, e n /a n ] is also proper for every 0 k n The following proposition clarifies why we call [a 0, e /a,, e n /a n ] a complex continued fraction Proposition 26 Let [a 0, e /a,, e n /a n ] be a proper complex continued fraction Then Val([a 0, e /a,, e n /a n ]) = a 0 + a + e e 2 + e n a n Proof We prove this by induction By definition: Val([a n ]) = a n Now suppose for 0 k < n: Val([a k+, e k+2 /a k+2,, e n /a n ]) = a k+ + e k+2 a k+2 + e k+3 e n + a n As [a 0, e /a,, e n /a n ] is proper, we have Val([a k+, e k+2 /a k+2,, e n /a n ]) / {0, }, therefore: Val([a k, e k+ /a k+,, e n /a n ]) = a k + and this ends the proof = a k + e k+ Val([a k+, e k+2 /a k+2,, e n /a n ]) e k+ a k+ + e, k+2 e n + a n From this result we easily obtain the following consequence Proposition 27 Let [a 0, e /a,, e n /a n ] be a proper finite complex continued fraction Then: Val([a 0, e /a,, e n /a n ]) Q[i] Proof As a k Z[i] for every k {0,, n} and e k {,, i, i} for every k {,, n}, this follows directly from Proposition 26 Let [a 0, e /a, e 2 /a 2, ] be an infinite complex continued fraction Note that for every k N we have that [a 0, e /a,, e k /a k ] is a finite complex continued fraction We call [a 0, e /a,, e k /a k ] a prefix of [a 0, e /a, e 2 /a 2, ] Similarly, for a finite complex continued fraction [a 0, e /a,, e n /a n ] we call [a 0, e /a,, e k /a k ] an prefix for every k {0,, n} From now on, we will sometimes drop the word complex from complex finite continued fraction and complex infinite continued fraction and write finite continued fraction and infinite continued fraction respectively 0

Definition 28 Let [a 0, e /a, e 2 /a 2, ] be an infinite continued fraction We define for every k N: c k := Val([a 0, e /a,, e k /a k ]) and call c k the k-th convergent of the continued fraction For a finite continued fraction [a 0, e /a,, e n /a n ] we define c k in the same way, with the obvious restriction k n Definition 29 Let [a 0, e /a, e 2 /a 2, ] be an infinite continued fraction We inductively define two infinite sequences (p k ) k and (q k ) k, by p := p 0 := a 0 p k := a k p k + e k p k 2, q := 0 q 0 := q k := a k q k + e k q k 2 For a finite continued fraction [a 0, e /a,, e n /a n ] we define the two finite sequences (p k ) k n and (q k ) k n in the same way, with the obvious restriction k n Now we will formulate some useful properties of the sequences (p k ) k and (q k ) k Proposition 20 Let [a 0, e /a, e 2 /a 2, ] be an infinite continued fraction, and let (p k ) k and (q k ) k as in Definition 29 Then for every n N: i p n p n = ( ) n n k= e k, ii gcd(p n, ) = Proof We prove this by induction We find: p 0 q p q 0 = 0 = ( ) 0 k= e k Now suppose p n p n = ( ) n n k= e k Then: p n+ p n + = (a n+ p n + e n+ p n ) p n (a n+ + e n+ ) = e n+ (p n p n ) n = e n+ ( ) n n+ = ( ) n k= e k and this proves the first statement For the second statement: suppose g p n and g Then: g p n p n = ( ) n n k= e k, so g Therefore we conclude: gcd(p n, ) = Proposition 2 Let [a 0, e /a, e m /a m ] be a finite continued fraction, and let (p n ) n m and ( ) k m as in Definition 29 Then for every 0 n m: i p n p n = ( ) n n k= e k, ii gcd(p n, ) = Proof The proof is similar to the proof of Proposition 20 and is therefore left to the reader k= e k

Note that it is possible that = 0 for some n > 0 Here is an example: consider [2, /i, /i] Then q 0 =, q = i and q 2 = 0 For completeness: p 0 = 2, p = + 2i and p 2 = i We see that it makes no sense to consider p 2 q 2 in this case Note that we already found that Val([2, /i, /i]) = However, for a proper continued fraction, we have the following result Proposition 22 Let [a 0, e /a, e 2 /a 2, ] be an infinite continued fraction and suppose [a 0, e /a,, e k /a k ] is proper for every k N Let c k be the k-th convergent of this fraction, and let p k and q k as in Definition 29 Then: c k = p k q k for every k N Proof According to the definitions we have c 0 = Val([a 0 ]) = a 0 = a 0 = p 0 Val([a 0, e /a ]) = a 0 + e a = a 0a +e a = p q Suppose c j = p j q j prove: c k+ = p k+ q k+ q 0 and c = for every j k We have to Claim: Val([a 0, e /a,, e k /a k, e k+ /a k+ ]) = Val([a 0, e /a,, e k /(a k + e k+ a k+ )]) Proof of claim: This follows because Val[a k, e k+ /a k+ ] = a k + e k+ a k+ = Val([a k + e k+ a k+ ]) Note that for [a 0, e /a,, e k /a k, e k+ /a k+ ] and [a 0, e /a,, e k /a k + e k+ a k+ ], both the sequences (p j ) j k and (q j ) j k are the same Together with the claim this gives: and this ends the proof c k+ = Val([a 0, e /a,, e k /a k, e k+ /a k+ ]) = Val([a 0, e /a,, e k /(a k + e k+ a k+ )]) = (a k + e k+ a k+ )p k + e k p k 2 (a k + e k+ a k+ )q k + e k q k 2 = (a kp k + e k p k 2 ) + e k+ a k+ p k (a k q k + e k q k 2 ) + e k+ a k+ q k = a k+p k + e k+ p k a k+ q k + e k+ q k = p k+ q k+, Proposition 23 Let [a 0, e /a,, e n /a n ] be a finite continued fraction and suppose [a 0, e /a,, e k /a k ] is proper for every k n Let c k be the k-th convergent of this fraction, and let p k and q k as in Definition 29 Then: c k = p k q k for every k n Proof This proof is similar to the proof of Proposition 22 and is therefore left to the reader Proposition 22 and Proposition 23 turn out to be false if we do not assume that [a 0, e /a,, e k /a k ] is proper for every k An example is given by [4, /2, /i, /i, ] and [4, /2, /i, /i] respectively In both cases we find c 3 = Val([4, /2, /i, /i]) =, and on the other hand: p 3 q 3 = 4i i = 4 Therefore we have c 3 p 3 q 3 The following lemmas will be useful in the next chapter 2

Lemma 24 Let [a 0, e /a,, e n /a n ] be a finite continued fraction Let 0 k n Then Val([a k+, e k+2 /a k+2,, e n /a n ]) = 0 iff Val([a n, e n /a n,, e k+2 /a k+ ]) = 0 Proof Note that in the following equations we have for every j {2,, n k} that Therefore: a k+j + e k+j e k+j+ + e n a n Val([a k+, e k+2 /a k+2,, e n /a n ]) = 0 a k+ + a k+2 + a k+3 + 0 e k+2 a k+2 + e k+3 + e n e k+3 a n a k+3 + e k+4 + e n e k+4 a n a k+4 + e k+5 + e n a n = 0 = e k+2 a k+ = e k+3 a k+2 + e k+2 a k+ a n = a n + e n e n + e k+2 a k+ 0 = a n e n e n a n + e k+2 + a k+ 0 = Val([a n, e n /a n,, e k+2 /a k+ ]), as had to be shown Lemma 25 Let n N >0 and let [a 0, e /a,, e n /a n ] be a finite continued fraction Let (q k ) k n as in Definition 29 Suppose q k 0 for every k {0,, n } Then: = Val([a n, e n /a n,, e 2 /a ]) Proof We prove this by induction For n = it follows that q q 0 = a = a = Val([a ]) Now suppose the claim is true for n, so = Val([a n, e n /a n,, e 2 /a ]) Note that qn 3

we have Val([a n, e n /a n,, e 2 /a ]) / {0, }, as 0 Therefore: + = a n+ + e n+ = a n+ + e n+ ( qn ) e n+ = a n+ + Val([a n, e n /a n,, e 2 /a ]) = Val([a n+, e n+ /a n,, e 2 /a ]), and this ends the proof We end this chapter by giving two important definitions regarding infinite complex continued fractions Definition 26 Let z C and let [a 0, e /a, e 2 /a 2, ] be an infinite continued fraction Let (c n ) n N be the convergents of [a 0, e /a, e 2 /a 2, ] We say that this continued fraction converges to z if lim k c k = z Here we use the convention that z = for every z C Definition 27 Let [a 0, e /a, e 2 /a 2, ] be an infinite complex continued fraction We call this continued fraction periodic if there exists N N and m N >0 such that (a n, e n+ ) = (a n+m, e n+m+ ) for every n N We call a continued fraction purely periodic if this holds with N = 0 We say that m is the length of the period if there exists no 0 < k < m such that (a n, e n+ ) = (a n+k, e n+k+ ) for every n N We will use the following notation for a periodic continued fraction: let [a 0, e /a, e 2 /a 2, ] be an infinite complex fraction such that (a n, e n+ ) = (a n+m0, e n+m0 +) for every n N 0 Then we will denote this fraction by [a 0, e /a,, e N0 /a N0, e N0 /a N0, e N0 +/a N0 +,, e N0 +m 0 /a N0 +m 0, e N0 +m 0 /] Remark 28 This definition of a periodic continued fraction generalizes both the definition of a periodic continued fraction by A Hurwitz and the definition of a periodic continued fraction by J Hurwitz That is: if one of the brothers Hurwitz calls a continued fraction periodic, then it is also periodic according to Definition 27 4

3 Complex continued fraction algorithms In this chapter we will define what a complex continued fraction algorithm is Furthermore, we prove some general properties of a continued fraction algorithm and we will find a relation with the greatest common divisor algorithm We will also study convergence and periodicity of continued fractions which are obtained by a complex continued fraction algorithm 3 Floor functions & sign functions Before we can give a formal definition of a complex continued fraction algorithm, we will first consider two special kinds of complex functions Definition 3 Let f : C Z[i] be a function We call f a floor function if f(z) z < for every z C Definition 32 We call f : C Z[i] a shift floor function if f is a floor function and f(z + α) = f(z) + α for every z C, α Z[i] Example 33 Define f : C Z[i] as follows: f(z) := Re(z) + + Im(z) + i Then 2 2 f is a floor function, and moreover, it is a shift floor function For the proof of this, see Proposition 43 Lemma 34 Let f be a floor function If z Z[i], then f(z) = z Proof Let z Z[i] By definition we have: f(z) Z[i] and f(z) {x x z < } Therefore: f(z) Z[i] {x x z < } = {z}, and we obtain: f(z) = z A floor function f gives rise to a tiling of the complex plane For every α Z[i] we define the tile T f α of α by T f α := {z C f(z) = α} As f is a function, every z C lies in exactly one tile We have by definition that f(z) = α for every z T f α For every α Z[i] we define the set U f α C by U f α := {z α z T f α } We define f := and call f the fundamental domain of f α Z[i] Proposition 35 Let f be a floor function Then i z f(z) f for every z C, ii f B (0) Proof First, let z C and let α := f(z) As z Tα f, we have z f(z) = z α Uα f Therefore: z f(z) f For the second statement: let α Z[i] and consider Uα f We have x Uα f iff x = z α for some z Tα f As z α = z f(z) for every z Tα f, and z f(z) <, we have that x <, so x B (0) Therefore: Uα f B (0) As α is arbitrary, we obtain: f = α Z[i] Uα f B (0) U f α 5

Proposition 36 Let f be a shift floor function Then: f = {z C f(z) = 0} = T f 0 Proof Let α Z[i], then: z U f 0 iff z T f 0 iff f(z) = 0 iff f(z)+α = α iff f(z+α) = α iff z + α T f α iff z U f α Consequently: U f 0 = U f α As α is arbitrary: f = α Z[i] U f α = U f 0 Now: U f 0 = T f 0 = {z C f(z) = 0}, and therefore: f = {z C f(z) = 0} Definition 37 We call any function g : C {,, i, i} a sign function Let f be a floor function and g be a sign function We define Vα f,g C for every α Z[i] by Vα f,g := { g(z) z f(z) z T f α, z f(z) 0} We define Γ f,g := α Z[i] V f,g α and call Γ f,g the fundamental codomain of f and g Proposition 38 Let f be a floor function and g be a sign function Then: i g(z) z f(z) Γ f,g for every z C, z f(z) 0, ii Γ f,g C \ B (0) Proof First let z C such that z f(z) 0 and let α := f(z) Then by definition: g(z) V f,g g(z) z f(z) α, therefore: Γ z f(z) f,g For the second statement, let α Z[i] and let x Vα f,g Now we have that x = g(z) for z f(z) a z C, z f(z) 0 As g(z) = and z f(z) < we have that x = g(z) > z f(z) Therefore: Vα f,g C \ B (0) and we conclude: Γ f,g = α Z[i] V α f,g C \ B (0) Proposition 39 Let f be a floor function and g be a sign function If g is a constant function, then Γ f,g = { g(z) z z f, z 0} Proof Suppose that g is constant, say g(z) = ρ for every z C First suppose x Γ f,g, then x = ρ for some y C, y f(y) 0 Consequently: as y f(y) y f(y) f, we have that x = ρ { g(z) y f(y) z z f, z 0} Now suppose x { g(z) z z f, z 0} Then x = ρ for some y y f, y 0 As y f, there exists some z C such that y = z f(z) So x = ρ Γ z f(z) f,g We obtain x Γ f,g iff x { g(z) z z f, z 0}, and this completes the proof i i i i Figure : Fundamental domain f, with f as in Example 33text text text text text text text Figure 2: Fundamental codomain Γ f,g, with f as in Example 33 and g(z) = for every z C 6

32 Definition of a complex continued fraction algorithm Now we have defined what a floor function and a sign function is, we can give the definition of a complex continued fraction algorithm Definition 30 A complex continued fraction algorithm is a floor function fl : C Z[i] and a sign function sg : C {,, i, i}, together with the following sequence of transformations x 0 := x a n := fl(x n ) e n+ := sg(x n ) x n+ := e n+ x n a n These transformations recursively define a n, e n+ and x n+ for n starting at 0 The input of such an algorithm should be a complex number x C The algorithm halts if a k = x k for some k N, and outputs the finite continued fraction [a 0, e /a,, e k /a k ] Otherwise the algorithm will not halt However, we could say it then produces an infinite list [a 0, e /a, e 2 /a 2, ], which is indeed an infinite continued fraction In this case we will say that the algorithm outputs an infinite continued fraction We call (x n ) n N the complete quotients of x under the continued fraction algorithm Remark 3 As we study infinite continued fractions, it is convenient to consider them as one object Therefore we say that a complex continued fraction algorithm can output an infinite continued fraction, although this is not fully in accordance with the usual idea of an algorithm This general definition of a complex continued fraction algorithm will serve as a framework for specific complex continued fraction algorithms When results are proven for this general definition, they apply to any instance of a complex continued fraction algorithm In the following chapters we will look at some well-known algorithms concerning complex continued fractions, and we will see that they fit in this framework In the following sections, we will prove results for this general definition of a complex continued fraction algorithm Remark 32 A famous algorithm concerning complex continued fractions is due to A L Schmidt [8] Unfortunately, his algorithm is not an instance of a complex continued fraction algorithm as given in Definition 30 In contrast, the idea of this algorithm is to partition the complex plane in areas bounded by arcs of circles and line segments Then successively refine this partition, and consider the areas to which the input x C belongs These areas correspond to rational convergents which are the output of the algorithm, rather than a complex continued fraction 33 General properties In this section and in the following sections of this chapter, let CF be a complex continued fraction algorithm Let fl be the floor function and sg be the sign function of CF Next, we will prove some general properties of a complex continued fraction algorithm Proposition 33 Let z Z[i], then CF(z) = [z] 7

Proof By Lemma 34 we have: z 0 = z = fl(z) = fl(z 0 ) = a 0 Therefore z 0 = a 0 and we obtain CF(z) = [z] Lemma 34 Let x C, n N and let x n+ be the (n + )-th complete quotient and a n+ be the (n + )-th partial quotient of x under CF Then i x n+ >, ii a n+ 0 Proof As fl is a floor function, we have x n fl(x n ) < Therefore it follows that x n+ = e n+ x n a n = x n fl(x n) > For the second statement: suppose a n+ = 0 Then we have > x n+ fl(x n+ ) = x n+ a n+ = x n+ 0 = x n+ > So > This is a contradiction and we conclude that a n+ 0 The next result shows how the fundamental domain fl and the fundamental codomain Γ fl,sg are related to the complex continued fraction algorithm CF Proposition 35 Let x C, n N and let x n be the n-th complete quotient, a n the n-th partial quotient and x n+ the (n + )-th complete quotient of x under CF Then i x n a n fl, ii x n+ Γ fl,sg Proof We have x n a n = x n fl(x n ) and by Proposition 35: x n a n fl Furthermore: x n+ = e n+ x n a n = sg(xn) and by Proposition 38 we conclude that x x n fl(x n) n+ Γ fl,sg Now we will see that the type of the output of CF depends on whether the input is rational or irrational Proposition 36 If x C is rational, then CF(x) is a finite continued fraction Proof Let x Q[i], so we can set x = r, with r, s Z[i] Suppose for the sake of s contradiction: CF(x) is an infinite continued fraction Let CF(x) = [a 0, e /a, e 2 /a 2, ] Now define four sequences in Z[i]: r 0 := r, r n+ := s n f n+, s 0 := s, s n+ := r n s n b n, b n := fl( rn s n ), f n+ := sg( rn s n ) Claim: For every n N: x n = rn s n, a n = b n and e n+ = f n+ Proof of claim: We prove this by induction: x 0 = x = r = r 0 s s 0, a 0 = fl(x 0 ) = fl( r 0 s 0 ) = b 0 and e = sg(x 0 ) = sg( r 0 s 0 ) = f Now: x n+ = e n+ = f n+ r x n a n = s nf n+ = r n+, n s n b n r n s n b n s n+ 8

a n+ = fl(x n+ ) = fl( r n+ s n+ ) = b n+ and e n+2 = sg(x n+ ) = sg( r n+ s n+ ) = f n+2, and the claim follows From the claim we obtain: x n+ = r n+ s n+ = snf n+ s n+, for every n N As x n+ > and f n+ =, we have s n+ < s n for every n N Therefore, as s n Z[i], we have that there exists N N such that s N+ = 0 So: 0 = s N+ = r N s N b N = r N s N a N, and consequently: x N a N = r N sn a N = 0 Therefore the algorithm terminates after N transformations, and outputs a finite continued fraction This contradicts our assumption and we conclude: CF(x) is a finite continued fraction Proposition 37 If x C is irrational, then CF(x) is an infinite continued fraction Proof Let x be irrational Investigating the algorithm CF, we see that the algorithm outputs a finite continued fraction iff x n fl(x n ) = 0 for some n N As x 0 is irrational and fl(x 0 ) is rational, we have x 0 fl(x 0 ) 0 Now suppose x k is irrational, then also x k+ = sg(x k) is irrational Therefore x x k fl(x k ) k+ fl(x k+ ) 0 Consequently, for every n N: x n fl(x n ) 0 and we conclude: CF(x) is an infinite continued fraction Theorem 38 Let x C, then: i x is rational iff CF(x) is a finite continued fraction, ii x is irrational iff CF(x) is an infinite continued fraction Proof This follows directly from Proposition 36 and Proposition 37 Next we will see that CF and Val are closely related Proposition 39 Let x Q[i], then: Val(CF(x)) = x Proof Let CF(x) = [a 0, e /a,, e n /a n ] Claim: Val([a n k, e n k+ /a n k+,, e n /a n ]) = x n k, for every k {0,, n} Proof of claim: We prove this by induction For k = 0 we have Val([a n ]) = a n = x n Now assume that Val([a n k+, e n k+2 /a n k+2,, e n /a n ]) = x n k+ Note that x n k+ > for every k {,, n} So: Val([a n k+, e n k+2 /a n k+2,, e n /a n ]) Q[i]\{0} Therefore: Val([a n k, e n k+ /a n k+,, e n /a n ]) = a n k + = a n k + e n k+ x n k+ = x n k e n k+ Val([a n k+, e n k+2 /a n k+2,, e n /a n ]) and this proves the claim From the claim immediately follows: x = x 0 = Val([a 0, e /a,, e n /a n ]) = Val(CF(x)), and this completes the proof Corollary 320 Let x Q[i], then: CF(x) is proper 9

Proof According to Proposition 39: Val(CF(x)) = x In the remaining part of this section, we will more closely examine the complete quotients x n which occur when we compute CF(x), for some x C Proposition 32 Let x C be irrational Let CF(x) = [a 0, e /a, e 2 /a 2, ] and let x n be the n-th complete quotient of CF(x) Then: x = Val([a 0, e /a,, e n /a n, e n /x n ] for every n N Proof This proof is by induction We have x = x 0 = Val([x 0 ]) Now suppose x = Val([a 0, e /a,, e n /a n, e n /x n ] As x n+ = e n+ x n a n we have: Therefore: Val([x n ]) = x n = a n + e n+ e n+ = a n + x n+ Val([x n+ ]) = Val([a n, e n+ /x n+ ]) and this completes the proof x = Val([a 0, e /a,, e n /a n, e n /x n ]) = Val([a 0, e /a,, e n /a n, e n /a n, e n+ /x n+ ]) Proposition 322 Let x C be rational Let CF(x) = [a 0, e /a,, e n /a n ] and let x k be the k-th complete quotient of CF(x) Then: x = Val([a 0, e /a,, e k /a k, e k /x k ] for every k {0,, n} Proof This proof is similar to the proof of Proposition 32 and is therefore left to the reader Corollary 323 Let x C and n N Let x n be the n-th complete quotient, let e k be the k-th partial numerator and a k be the k-th partial quotient of x under CF, for every k n Then: [a 0, e /a,, e n /a n, e n /x n ] is proper Proof According to Proposition 32 and Proposition 322 we have that Val([a 0, e /a,, e n /a n, e n /x n ]) = x and therefore we conclude: [a 0, e /a,, e n /a n, e n /x n ] is proper Proposition 324 Let x C be irrational and let CF(x) = [a 0, e /a, e 2 /a 2, ] Let x n be the n-th complete quotient of CF(x) Then: CF(x n ) = [a n, e n+ /a n+, e n+2 /a n+2, ] for every n N Proof Let n N, and let y := x n Let CF(y) = [b 0, f /b, f 2 /b 2, ] and let y k be the k-th complete quotient of y under CF Claim: y k = x n+k, b k = a n+k and f k+ = e n+k+ for every k N Proof of claim: We prove this by induction By assumption: y 0 = x n, therefore b 0 = fl(y 0 ) = fl(x n ) = a n and f = sg(y 0 ) = sg(x n ) = e n+ Now suppose y k = x n+k, b k = a n+k and f k+ = e n+k+ Then: y k+ = f k+ y k b k = e n+k+ x n+k a n+k = x n+k+, 20

and b k+ = fl(y k+ ) = fl(x n+k+ ) = a n+k+, and f k++ = sg(y k+ ) = sg(x n+k+ ) = e n+k++, and this proves the claim By the claim we conclude: CF(x n ) = CF(y) = [b 0, f /b, f 2 /b 2, ] = [a n, e n+ /a n+, e n+2 /a n+2, ] and this ends the proof Proposition 325 Let x C be rational and let CF(x) = [a 0, e /a,, e n /a n ] Let x k be the k-th complete quotient of CF(x) Then: CF(x k ) = [a k, e k+ /a k+,, e n /a n ] for every k {0,, n} Proof This proof is similar to the proof of Proposition 324 and therefore left to the reader Let x C be irrational and let CF(x) = [a 0, e /a, e 2 /a 2, ] By Proposition 32 we have: x = Val([a 0, e /a,, e n /a n, e n /x n ]) According to Proposition 324 it follows that CF(x n ) = [a n, e n+ /a n+, e n+2 /a n+2, ] This justifies to write CF(x) = [a 0, e /a,, e n /a n, e n /CF(x n )] Obviously, with the same reasoning we obtain a similar result for x rational 34 Greatest common divisor algorithm In this section we will discover a relation between a continued fraction algorithm and a greatest common divisor algorithm Example 326 Consider 7 6i and 26 36i Note that gcd(7 6i, 26 36i) = 7 3i CF JS is a continued fraction algorithm, which we will define in Section 6 When we compute CF JS ( 7 6i ) we find: CF 26 36i JS( 7 6i ) = [ i, / 2i, /2 + i] This continued 26 36i fraction gives rise to the following equations of the form x k = a k + (x k a k ), for k {0,, 2}: 7 6i = i + 7+i, 26 36i 26 36i 26 36i = 2i + 7 3i, 7+i 7+i 7+i = 2 + i 7 3i When we multiply each of the lines above of the form b d = a + c d by d we obtain: 7 6i = ( i)(26 36i) + (7 + i), 26 36i = ( 2i)(7 + i) + (7 3i), 7 + i = (2 + i)(7 3i) These equations look like those of a greatest common divisor algorithm On the last line, we find 7 3i, which is a greatest common divisor of 7 6i and 26 36i This is not a coincidence, as is shown by Proposition 327 2

Proposition 327 Let CF be a complex continued fraction algorithm Let r, s Z[i], and s 0 Let CF( r s ) = [a 0, e /a,, e n /a n ] Now define two finite sequences (r k ) 0 k n and (s k ) 0 k n as follows: Then: gcd(r, s) = s n r 0 := r, r k+ := s k e k+, s 0 := s, s k+ := r k s k a k Proof Claim : For every k {0,, n}: gcd(r, s) = gcd(r k, s k ) Proof of claim : We prove this by induction By assumption: gcd(r, s) = gcd(r 0, s 0 ) Now suppose gcd(r, s) = gcd(r k, s k ) Let g = gcd(r k, s k ), so g r k and g s k Therefore g r k+ = s k e k+ and g s k+ = r k s k a k Now suppose h Z[i] such that h r k+ and h s k+ Then h s k e k+ and h r k s k a k Consequently: h s k a k, therefore: h r k s k a k + s k a k = r k So h r k and h s k, therefore h gcd(r k, s k ) = g We conclude: gcd(r, s) = g = gcd(r k+, s k+ ) Claim 2: Let x k be the k-th complete quotient of CF( r ) Then for every k {0,, n}: s x k = r k sk Proof of claim 2: We prove this by induction By assumption: x 0 = x = r s = r 0 s 0 Now: and this proves the claim x k+ = e k+ = e k+ r x k a k = s ke k+ = r k+, k s k a k r k s k a k s k+ As rn s n a n = x n a n = 0, it follows that r n = s n a n Therefore: s n r n As s n s n we have that s n gcd(r n, s n ) Consequently: s n = gcd(r n, s n ) = gcd(r, s) We will now see that a complex continued fraction algorithm gives rise to a greatest common divisor algorithm Let r, s Z[i], s 0 Compute CF( r s ) = [a 0, e /a,, e n /a n ] Then compute the sequence (s 0,, s n ), which is defined in Proposition 327 Finally, return s n From Proposition 327 it follows that s n = gcd(r, s) 35 Convergence In this section we will prove that the complex continued fraction of an irrational number x which is obtained by a complex continued fraction algorithm, converges to x Before this, we prove some lemmas which will be useful in this and in the next section The following two results are subsequent to the ideas of Section 3 of [2] Lemma 328 Let R := {e mπi/6 m {0,, }}, the set of all 2th roots of unity in C Then: i for every z C, for every a Z[i] \ {0}: if z = and z a = then z R, ii for every ρ R there exists an a Z[i] \ {0} such that ρ a =, iii for every ρ R, for every a Z[i] \ {0}: if ρ a =, then ρ a R 22

i i Figure 3: The complex plane with the unit circle and the set R The other circles are circles with centre c and radius, with c {,, i, i, + i, i, + i, i} Proof We prove the first statement Let z C such that z =, accordingly: z is on the unit circle Let a Z[i] \ {0}, if a / {,, i, i, + i, i, + i, i, 2, 2, 2i, 2i} then z a > We consider the cases a = 2, a = + i and a =, the other cases are similar Define for every α Z[i] the circle S α := {z C z α = } If a = 2 then z = and z a = iff z S 0 S a So z {} and therefore: z R If a = + i then z = and z a = iff z S 0 S a Therefore z {, i} and consequently: z R If a = then z = and z a = iff z S 0 S a As a = we know that there are exactly two points in S 0 S a, say p and q Suppose p is in the upper half plane As 0 = p = p 0 =, we have that the triangle formed by 0, and p is equilateral Therefore we have that angles of this triangle measure 2π From this it 6 follows that p = e 2πi/6 R With the same reasoning: q = e 0πi/6 R As z {p, q} we conclude: z R Now we prove the second statement By symmetry, we only consider two cases: ρ = and ρ = e πi/6 The other cases are similar For ρ = we choose a := + i, then ρ a = For ρ = e πi/6 we see that i fulfils the property: ρ a = e πi/6 i = e πi/6 = Finally we prove the third statement Again, by symmetry, we only consider two cases: ρ = and ρ = e πi/6 The other cases are similar Let ρ = and a Z[i] \ {0} such that ρ a = Then a {2, +i, i} We see: ρ a R for every a {2, +i, i} Now let ρ = e πi/6 and a Z[i] \ {0} such that ρ a = Now there is only one possibility for a, namely: a = i We see: ρ a = e πi/6 i = e πi/6 R This completes the proof We notice that the set R from Lemma 328 is precisely the set of points that are both at unit distance from 0 and at unit distance from a for some a Z[i] \ {0} This fact will be useful in the following proposition 23

Proposition 329 Let z C be irrational, and let (z n+ ) n N be the complete quotients of z under CF Then not: lim n z n = Proof Let CF(z) = [a 0, e /a, e 2 /a 2, ] Let R as in Lemma 328 Suppose for the sake of contradiction: lim n z n = As z n a n = e n+ we also have that lim z n+ n z n a n = Since a n Z[i] \ {0} for every n, we have that lim n d(z n, R) = 0 So, for every n N there exists ρ n R such that lim n z n ρ n = 0 As lim n z n a n = and lim n z n ρ n = 0 we have that lim n a n ρ n = As Z[i] and R are discrete, we conclude that there exists n 0 N such that a n ρ n = for every n n 0 By Lemma 328 we have that ρ n a n R for every n n 0 Now define for every n N: B n := ρ n a n and C n := z n ρ n Then for every n n 0 : B n R and z n a n = B n + C n, and lim n C n = 0 Then: z n+ = e n+ z n a n = e n+ B n + C n = e n+ B n + C ne n+ B n (B n + C n ) We have that C n B n+c n C n, so lim C n n Cn B n+c n = 0 As B n R, also B n for every n n 0 : Consequently: ρ n+ = e n+ B n and C n+ = z n+ ρ n+ = C ne n+ B n (B n + C n ) C n+ = C n B n + C n = C n z n a n > C n R, therefore Therefore C n+ > C n for every n n 0, but we also have that lim n C n = 0 Therefore we obtain a contradiction and we conclude it is not the case that lim n z n = The following result is a direct consequence of Proposition 329 Proposition 330 Let z C be irrational and let (z n+ ) n N be the complete quotients of z under CF Then: lim n n k=0 z k+ = Proof According to Proposition 329: not lim n z n+ = As z n+ > for every n N, it follows that ε > 0 N N n N [ z n+ < + ε ] or, equivalently: ε > 0 N N n N [ z n+ + ε ] Therefore there exist infinitely many indices n such that z n+ + ε 0, for a ε 0 > 0 We conclude: lim n n k=0 z k+ = The following lemmas will be a powerful tool in both this and the following section They will be useful to write down identities involving the quantities x 0, x n+ and x 0 p n Lemma 33 Let x C, n N, and let x n+ be the (n + )-th complete quotient of x under CF Let p n and be as in Definition 29 with respect to CF(x) Then: x 0 = x n+p n + e n+ p n x n+ + e n+ 24

Proof This proof is by induction on n For n = 0 we have x 0 = a 0 + e x = x a 0 + e x = x p 0 + e p x q 0 + e q Again, using Definition 29 and the equality x n+ = e n+ x n a n, we obtain: x n+ p n + e n+ p n x n+ + e n+ = x n+(a n p n + e n p n 2 ) + e n+ p n x n+ (a n + e n 2 ) + e n+ = (a np n + e n p n 2 ) + e n+p n x n+ (a n + e n 2 ) + e n+ x n+ = (a n + e n+ x n+ )p n + e n p n 2 (a n + e n+ x n+ ) + e n 2 = x np n + e n p n 2 x n + e n 2 Lemma 332 Let x C, n N, and let x n+ be the (n + )-th complete quotient of x under CF Let p n and be as in Definition 29 with respect to CF(x) Then: x n+ = e n+ x 0 p n x 0 p n Proof According to Lemma 33 we have x 0 (x n+ + e n+ ) = x n+ p n + e n+ p n Rearranging the terms gives: x n+ (x 0 p n ) = e n+ (x 0 p n ) and the claim follows Lemma 333 Let x C, n N, and let (x k+ ) n k=0 be the first n + complete quotients of x under CF Let p n and be as in Definition 29 with respect to CF(x) Then: Proof According to Lemma 332: x 0 p n = ( ) n n k=0 e k+ x k+ n x k+ = k=0 n k=0 e k+ x 0 q k p k x 0 q k p k = x 0q p x 0 p n n k=0 e n+ = n k=0 e n+ x 0 p n, and we conclude: x 0 p n = n k=0 e n+ n k=0 x k+ = ( ) n n k=0 e k+ x k+ The next proposition will be of great value in the remaining part of this section Recall that [a 0, e /a,, e n /a n ] = n + and [a 0, e /a, e 2 /a 2, ] = We will use the convention = 25

Proposition 334 Let x C, let 0 n < CF(x) and let be as in Definition 29 with respect to CF(x) Then: 0 Proof First, let n = CF(x) As CF(x) is proper by Corollary 320, we obtain by Proposition 22: Val(CF(x)) = c n = pn Q[i], and therefore 0 Now let 0 n < CF(x) By Lemma 333 we have: x 0 p n = ( ) n n e k+ k=0 x k+ Assume that = 0 Then p n = ( ) n n e k+ k=0 x k+ = As x n k=0 x k+ k+ > for every k {0,, n} we have 0 < < Therefore: 0 < p n k=0 x k+ n <, which leads to a contradiction as p n Z[i] We conclude: 0 Proposition 335 Let x C, let 0 n < CF(x) and let p n be as in Definition 29 with respect to CF(x) Then: if x, then p n 0 Proof First, let n = CF(x) Suppose for the sake of contradiction that p n = 0 Then: 0 = pn = c n = Val([a 0, e /a,, e n /a n ]) = x, so x = 0 This is a contradiction as we assumed that x Now let n < CF(x) According to Lemma 333 we have: x 0 p n = ( ) n n e k+ k=0 x k+ Now suppose for the sake of contradiction that p n = 0 Then x 0 = ( ) n n e k+ k=0 x k+ = So: q n k=0 x k+ n = As n > 0 and x n k= x k+ k+ > for every k {0,, n} we have that 0 < < Therefore: 0 < k= x k+ n <, which leads to a contradiction as Z[i] The following result will be useful in proving convergence Proposition 336 Let x C be irrational and let be as in Definition 29 with respect to CF(x) Then: lim n = Proof Suppose for the sake of contradiction, not: lim n = Consequently, ( ) n N has a finite accumulation point, therefore there exists Q Z[i] such that = Q for an infinite number of indices n (as Z[i], which is discrete) So, with the use of Lemma 333 there are an infinite number of indices n such that x 0 Q p n = n k=0 x k+ < Investigating this last inequality, it follows that there exists P Z[i] such that there are infinite number of indices such that p n = P and = Q So there are an infinite number of indices n such that x 0 p n = x 0 Q P However, < x n+ = x 0 p n x 0 p n, or x 0 p n > x 0 p n for every n N, and we obtain a contradiction The following result shows that it makes sense to consider the prefixes of a continued fraction obtained by a complex continued fraction algorithm Theorem 337 Let z C, let a n be the n-th partial quotient and let e n be the n-th partial numerator of CF(x) Then for every k < CF(z) : [a 0, e /a, e k /a k ] is proper Proof First let k = CF(z) Then CF(z) = [a 0, e /a, e k /a k ], and according to Corollary 320 we obtain: [a 0, e /a, e k /a k ] is proper Now let k < CF(z) Suppose for the sake of contradiction that [a 0, e /a, e k /a k ] is not proper Examining Definition 24 and Definition 25 we find that there exists 26

j {0,, k } such that Val([a j+, e j+2 /a j+2,, e k /a k ]) = 0 Observe that it is the case that [a j, e j+ /a j+,, e k /a k ] is a finite continued fraction, so we can compute ( ) n k j using Definition 29 By Proposition 334 we obtain: 0 for q every n {0,, k j} Therefore: k j q k j 0 On the other hand we have that Val([a j+, e j+2 /a j+2,, e k /a k ]) = 0, therefore, by applying Lemma 24 we find that q Val([a k, e k /a k,, e j+2 /a j+ ]) = 0 According to Lemma 25 we have that k j q k j = 0 Hereby we obtain a contradiction In either case we find that [a 0, e /a, e k /a k ] is proper and this completes the proof In Definition 28 we defined c k to be the convergents of a finite or infinite continued fraction In Proposition 22 and Proposition 23 we proved that c k = p k q k, if [a 0, e /a, e k /a k ] is a proper continued fraction In Theorem 337 we saw that that [a 0, e /a, e k /a k ] is proper if it is a prefix of the output of a continued fraction algorithm As from now on we will mainly focus on continued fractions obtained by continued fraction algorithms, we will call p k q k the convergents of a continued fraction, instead of c k The benefits are that we can refer to p k and q k individually, and that we have an easy way to compute the k-th convergent, using Definition 29 Now we prove that a continued fraction obtained by a complex continued fraction algorithm converges to the input of the algorithm Theorem 338 Let x C be irrational and let ( p n p CF Then: lim n n = x )n N be the convergents of x under Proof According to Lemma 333 we have x 0 p n = ( ) n n k=0 e k+ x k+, with x 0 = x As 0 for every n N, we can rewrite this to Therefore: x 0 p n = ( )n n k=0 e k+ x k+ x0 p n = n k=0 x k+ As lim n = (Proposition 336), and lim n n k=0 x k+ = (Proposition 330), we conclude: lim x 0 p n = 0, n and the claim follows From this last result we can prove that the algorithm CF is injective Proposition 339 Let x, y C If CF(x) = CF(y), then x = y 27

Proof Suppose CF(x) = CF(y) If both CF(x) and CF(y) are finite continued fractions, then x and y are rational and by Proposition 39: x = Val(CF(x)) = Val(CF(y)) = y Now suppose CF(x) and CF(y) are infinite continued fractions Then x and y are irrational Let pn be the n-th convergent of CF(x), and rn s n be the n-th convergent of CF(y) Then we have that p n = r n and = s n, and consequently pn = rn s n for every n N Therefore by Theorem 338: and this completes the proof p n r n x = lim = lim = y n n s n The following result gives a simple criterion for a convergent of a continued fraction to be a better approximation than the previous one Proposition 340 Let x C, n N >0 and let pn If then x pn < x p n Proof According to Lemma 332 we have be the n-th convergent of x under CF Therefore: x n+ = e n+ x 0 p n x 0 p n x 0 p n = e n+, x 0 p n x n+ and as < and x n+ we obtain: x p n x p n = and this completes the proof x n+ < We will now define a quantity which more or less estimates the quality of the convergents of a continued fraction Definition 34 Let x C, n N and let pn be the n-th convergent of CF(x) We define θ n := ( x p n ) We will call θ n the relative error of x and pn Writing x pn = θn clarifies why we call θ qn 2 n the relative error of x and pn Note that by Lemma 333 we have: θ n = (x 0 p n ) = ( ) n n+ k= The following result shows an alternative way to express θ n e k x k 28

Lemma 342 Let x C, n N and let pn (n + )-th complete quotient of CF(x) Then: θ n = ( )n n+ k= e k q x n+ + e n n+ be the n-th convergent and x n+ be the Proof Applying Lemma 33 and Proposition 20 gives us: ( θ n = qn 2 x0 p n ) ( = qn 2 xn+ p n + e n+ p n p n xn+ q + e n n+ ) q x n+ + e n+ x n+ + e n n+ = q 2 n and this completes the proof e n+ (p n p n ) x n+ + e n+ = e n+( ) n n k= e k x n+ + e n+ = ( )n n+ k= e k q x n+ + e n, n+ This last result will be useful in the next section 36 Periodicity In this section we will examine the relation between periodic continued fractions and quadratic irrational numbers First we will see that if a continued fraction of a number x obtained by a complex continued fraction algorithm is periodic, then x is quadratic irrational Thereafter we will study the converse of this assertion First we prove two lemmas Lemma 343 Let x C be irrational, and let CF(x) = [a 0, e /a, e 2 /a 2, ] Let x m be the m-th complete quotient of x under CF Let n N and let p k q k be the k-th convergent p of [a n, e n+ /a n+, e n+2 /a n+2, ] Then: lim k k q k = x n Proof According to Proposition 324: CF(x n ) = [a n, e n+ /a n+, e n+2 /a n+2, ] By Theorem 338 we conclude: lim k p k q k = x n Lemma 344 Let x C be irrational and let x n be the n-th complete quotient of x under CF If CF(x) is purely periodic with period length m, then x 0 = x m Proof Let CF(x) = [a 0, e /a, e 2 /a 2, ] and suppose CF(x) is purely periodic with period length m Let p k q k be the k-th convergent of [a 0, e /a, e 2 /a 2, ] and let r k sk be the k-th convergent of [a m, e m+ /a m+, e m+2 /a m+2, ] As CF(x) is purely periodic with period length m we have: a n = a n+m, e n+ = e n+m+ for every n N Therefore: p k = r k and q k = s k and consequently: p k q k = r k sk for every k N By Lemma 343 we obtain: and this completes the proof p k r k x 0 = lim = lim = x m k q k k s k 29

Now we can prove the following result concerning purely periodic continued fractions Proposition 345 Let x C be irrational quadratic irrational If CF(x) is purely periodic, then x is Proof Let m be the period length of CF(x) According to Lemma 344: x 0 = x m By Lemma 33 we have: Therefore: x 0 = x mp m + e m p m 2 x m q m + e m q m 2 = x 0p m + e m p m 2 x 0 q m + e m q m 2 q m x 2 0 + (e m q m 2 p m )x 0 e m p m 2 = 0 As m we have that p m, p m 2, q m, q m 2 and e m are all well-defined As q m Z[i], e m q m 2 p m Z[i], e m p m 2 Z[i], q m 0 and x 0 is irrational, we conclude: x 0 is quadratic irrational In order to give a more general result, we need two more lemmas Lemma 346 Let x C, a Z[i] and e {,, i, i} If x is quadratic irrational, then e + a is quadratic irrational x Proof As x is quadratic irrational, it follows by Proposition we can write x = p+q r s, with p, q, r, s Z[i] where q 0, s 0 and r is not a square Then: e x + a = es p + q r + a = es(p q r) p 2 q 2 r + a(p2 q 2 r) p 2 q 2 r = esp + a(p2 q 2 r) esq r p 2 q 2 r When we set P := esp + a(p 2 q 2 r), Q := esq, S := p 2 q 2 r we obtain: e x + a = P + Q r, S where P, Q, r, S Z[i] and Q 0, S 0 and r is not a square Again by Proposition e we obtain: + a is quadratic irrational x Lemma 347 Let x C be irrational, and let x n be the n-th complete quotient of x under CF If x n is quadratic irrational, then also x 0 is quadratic irrational e Proof Let x n be quadratic irrational We have x n = n x n a n, or: x n = en x n + a n From Lemma 346 follows: x n is quadratic irrational By repeating this argument we obtain: x 0 is quadratic irrational Theorem 348 Let x C be irrational irrational If CF(x) is periodic, then x is quadratic Proof Let n N be the least number such that [a n, e n+ /a n+, e n+2 /a n+2, ] is purely periodic According to Proposition 324 we have: CF(x n ) = [a n, e n+ /a n+, e n+2 /a n+2, ] By Proposition 345 follows that x n is quadratic irrational By Lemma 347 we conclude: x 0 is quadratic irrational 30