# How to deal with infinite continued fractions in formal language?

A continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number, then writing this other number as the sum of its integer part and another reciprocal, and so on.

Continued fractions can be infinite,

e.g. $$a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\ddots}}}$$

So it seems a term of first-order language. However, every term in first-order language has finite depth, compared with continued fractions, they have depth $\omega$, used individual and function symbols infinite times, hence are not a proper terms of first-order language.

So my question: Is there an extension of first-order language that can admit this kind of expression?

• There is no infinite depth at all, just like there is no «sum of infinitely many terms» in a series: that's just notation. An «infinite continued fraction» is just a limit, and you can deal with this sort of limits in exactly the same way in which you deal with other limits. Commented Apr 5, 2013 at 5:40
• @MarianoSuárez-Alvarez I found it is hard to express limits in first-order language either... We need to express supremum and infimum of sets(possibly infinite), so does it require higher-order language? Commented Apr 5, 2013 at 6:01

When such things are reasoned about formally, set theory is usually assumed as a background theory.

Formal set theory is itself a first-order theory, but provides enough machinery that higher-order concepts can be modeled in a fairly direct way.

In this case, a continued fraction would be modeled formally as a sequence of naturals, which is again a function $\mathbb N\to \mathbb N$; a function $f$ is modeled as the set of ordered pairs $\langle x,f(x)\rangle$ for all $x$ in its domain, and the ordered pair $\langle x,y\rangle$ is represented by the set $\{\{x\},\{x,y\}\}$. So in the end everything can be reduced to sets.

(Which does, of course, not mean that everything should be reduced to set theory all of the time. Most ordinary mathematical reasoning is better served by imagining one is working in a richly-typed higher-order setting. Being prepared to deliver the set-theoretical formalization if a foundational challenge should arise is quite sufficient; one doesn't need to do so spontaneously).

• I see, generally infinite continued fraction $[x_0;x_1,\dots]$ is a (partial) function in ${\mathbb R}^{{\mathbb R}^{\omega}}$, which maps some infinite sequences $\langle x_0,x_1,\dots\rangle$ of reals to a real number. Commented Apr 6, 2013 at 8:06