In analysis one is interested in approximation processes (limits) and functions that preserve the approximation processes (continuous functions). A topology on a set consists of structure that allows one to define approximation processes in the set. For example, such a structure on the real numbers is induced by the usual notion of distance.
In this chapter we are interested in a topological structure on the set of decimal expansions of real numbers, and its relation to the topological structure on the set of real numbers. Notice the distinction; a decimal expansion is a concrete syntactic entity (a sequence of digits), but a real number is an abstract mathematical entity.
To motivate this, consider a program that runs forever, printing the decimal expansion of 10#10. At any stage of the computation, only a finite prefix of the decimal expansion will be observed. However, a prefix as long as we are patient to wait for will be observed. Moreover, the collection of all such (finite) prefixes uniquely determines the entire (infinite) decimal expansion. Thus, the computation can be thought as a sequence of approximations that converges to the entire decimal expansion.
Now consider a program that runs forever, sometimes reading decimal digits from the input, and sometimes printing decimal digits to the output, so that a function on decimal expansions is implemented. As before, both the input and the output are infinite. However, it is clear that finite amounts of output digits can depend only on finite amounts of input digits. In this sense, the program respects the approximation process describe above and hence is continuous with respect to this notion of approximation.
All this can be made mathematically precise in various ways. For instance, one can define a notion of distance between decimal expansions. For simplicity, we shall consider only fractional infinite decimal expansions in these notes; we therefore ignore the decimal point and the leading digit zero, so that a decimal expansion is just a sequence of decimal digits. We can say, for example, that the distance between two distinct expansions 11#11 and 12#12 is 2-n where n is the first position at which they differ--admittedly, the number 2-n is rather arbitrary, and other choices such as 1/n work equally well. With this, continuity in the above sense is formalized by the usual 13#13 definition that occurs in real analysis. In this way, the decimal expansions are made into a metric space.
If we abstract from the metric, whose numerical details are for the most part irrelevant, one gets a topological space. Let 14#14 mean that the distance between 11#11 and 12#12 is smaller than 2-n, that is, that 15#15 for all i < n. Then a set U of decimal expansions is open with respect to this notion of distance iff whenever 16#16 there is an n such that 17#17 for all 18#18. A sequence 19#19 of decimal expansions converges to a decimal expansion 12#12 iff for every open set U with 17#17, as small as we please, there is an n such that 20#20 for all 21#21. A function 22#22 of decimal expansions is continuous with respect to this topology iff for every 11#11 and every n there is a k such that 23#23 implies 24#24 for all 12#12. The reader who is familiar with topology may have noticed that this way of topologizing decimal expansions is equivalent to endowing the digit set 25#25 with the discrete topology and then the set 26#26 of decimal expansions with the product topology.
In the following chapters we use topological arguments to prove computational propositions. Unfortunately, we cannot include all the background details here, so refer the interested reader to Smyth [54] and Vickers [57] for introductions to topology for computer scientists.