What is a topological space?

It is a mathematical device to define what a continuous function is, in a general setting.

1. A topological space is a set X together with a collection of subsets of X, called open, such that finite intersections of open sets are open, and arbitrary unions of open sets are open.

2. A function of topological spaces is continuous if inverse images of open sets are open.

What is the intuition behind (1) and (2)?

I claim that it is better to ask, instead, how mathematicians came up with (1) and (2).

1/

At the beginning, people considered continuous functions ℝ → ℝ.

One of the wrong intuitions, at that time, was that such a function is continuous if "you can draw it without lifting the pen".

A counter-example is Cantor's devil's staircase. This continuous function you can't draw, with or without lifting the pen.

https://en.wikipedia.org/wiki/Cantor_function

Mathematicians spoke of continuous functions for a long time before there was a precise definition of continuous function. This was a vague idea, which, nevertheless, was useful.

At some point the definition of continuity for a function f : ℝ → ℝ was elucidated.

∀ x ∈ ℝ , ∀ ε > o, ∃ δ > 0 , ∀ x' ∈ ℝ, ∣ x - x' | < δ → | f(x) - f(x') | < ε.

This definition allowed a lot of theorems to be proved rigorously. This is why it was useful.
A lot of theorems that were claimed, could now be proved.
2/

Cantor function - Wikipedia

This definition *does* have an intuition.

Suppose you want to calculate f(x₀), for example because you are an engineer and want to build a bridge, where x₀ is a physical quantity. Unfortunately, we can't measure x₀ exactly.

But you still want to know what y₀ = f (x₀) is, at least approximately.

But "approximately" doesn't mean anything. You want to know y₀, say, with two correct decimal digits. This will do to build a robust bridge.

Then the question is, how many correct digits of x₀ do you need to know, in order to get the desired two decimal digits of y₀?

More generally, we want the following to be the case. In order to know n digits of output of the function, it is enough to know m digits of the input, where m depends on the input and on n.

This is possible if and only if the function is continuous.

So one intuition about continuity is that "finite amounts of output depend on only finite amounts of input".

3/

But this was for functions ℝ → ℝ only.

Soon people started to consider continuous functions "of two variables", that is, functions ℝ × ℝ → ℝ, and then of n variable, so ℝⁿ → ℝ, and in each case a different definition was needed.

Moreover, because people were trying to e.g. solve differential equations, which amounts to given one *input* function (called the initial condition) to figure out an *output* function (the solution), people came across functions mapping continuous functions to continuous functions, which, themselves, may or may not be continuous.

So a general definition of continuity was needed to clean up the mess and be able to make progress more efficiently.

A first, rather useful, general setting was that of a metric space. You say what the distance between two things (e.g. real numbers, tuples of real numbers, continuous functions) is. The axioms for metric spaces are very intuitive, and I won't reproduce their statement here.

But I want to say this.

1. The definition of continuity is the same as above, with the absolute value of the difference replaced by the distance function d. A function f : X → Y is continuous iff

∀ x ∈ X , ∀ ε > o, ∃ δ > 0 , ∀ x' ∈ X, d(x,x') < δ → d(f(x),f(x')) < ε.

2. We can then define a set U to be open if for every x ∈ U there is ε > 0 such that every x' with d(x,x') < ε is in U.

3. The open sets are closed under finite intersections and arbitrary unions.

4. A function is continuous in the above ε-δ sense iff inverse images of open sets are open.

4/

This, and much more, is beautifully explained in the book

George F. Simmons. Topology and modern analysis
https://archive.org/details/introduction-to-topology-and-modern-analysis-simmons

which I highly recommend.

What happens next is that metric spaces are not enough. There are sets on which we want to consider continuous functions which can't be metrized so that metric continuity coincides with the notion of continuity we want.

I like this book because it starts from trivial things, making them less and less trivial as we progress, until it gets eventually to many things, including Stone duality. I self-learned topology from this book as an undergrad.

5/

Introduction to topology and modern analysis : Simmons, George Finlay, 1925- : Free Download, Borrow, and Streaming : Internet Archive

This is a classical introductory textbook on topology and analysis

Internet Archive

Then comes computer science. Smyth, Abramsky and Vickers propose a radically different intuition for the axioms of topology and the definition of continuous function.

I will stop this post at this point, at least for now, giving four seminal references.

Michael .B. Smyth. Power domains and predicate transformers: a topological view.
https://link.springer.com/chapter/10.1007/BFb0036946

Michael .B. Smyth. Topology.
https://dl.acm.org/doi/10.5555/162573.162536

Samson Abramsky. Domain Theory and the logic of observable properties
https://arxiv.org/abs/1112.0347

Steve Vickers. Topology via logic.
https://www.cambridge.org/gb/universitypress/subjects/computer-science/programming-languages-and-applied-logic/topology-logic?format=PB&isbn=9780521576512

I started my PhD after reading the above, and I was lucky to have had Smyth as my supervisor.

6/

Power domains and predicate transformers: A topological view

The broad theme of the paper is that topological concepts are basic to computer science. Such concepts as “specifications”, “predicate transformer”, and “nondeterminism” can be greatly illuminated by being formulated in topological...

SpringerLink

But one should say the following. Actually, the connection of topology with computation started with Brouwer, who was a topologist himself, in fact one of the founding fathers of topology before Hausdorff come up with the axiomatization of topological spaces which I described above.

7/

@MartinEscardo In a book called "Grundzüge der Mengenlehre" ("Elements of Set Theory") I love that.
@MartinEscardo Hausdorff defined topologies in terms of neighborhoods (not open sets) and it was Weierstrass who invented the concept.
@MartinEscardo In between Cantor gave his opinion.
@MartinEscardo The problem (Weierstrass's) at first was more limit points than continuity. Continuity came later.
@MartinEscardo It's a problem by the way because giving the definition of topology as open sets is the best way to generate in student's mind the question : "why did they use this definition?" The answer is easy: topology was not defined as open sets at the beginning. Neighborhoods are more appropriate for an intuitive definition.
@MartinEscardo And (horresco referens) it is Bourbaki who propelled the definition of topologies as open sets. Take out a clove of garlic.
@MartinEscardo To conclude using neighboorhoods and giving the Bolzano-Weierstrass theorem is certainly the best way to keep topology in its historical order. The problem then is to find an example easy enough to explain what the Bolzano-Weierstrass theorem can be good for.
@fl @MartinEscardo : He also required them to be Hausdorff (hence that name), yes?
@TobyBartels @MartinEscardo I don't remember but according to Wikipedia, yes. It was he who defined them in the same book.

@fl @MartinEscardo : Not just that he defined Hausdorff spaces in the same book where he defined general topological spaces, but that his most general definition in that book was of only Hausdorff spaces.

At least that is what Wikipedia seems to say, and that is what the definition does that I found on page 213 of a 1914 edition of his book on the Internet Archive. (But I didn't look through the rest of the chapter to see if he has a more general definition later on.)