# Prove that if any f:X-->Y is continuous, X is the discrete topology

• docnet
In summary, the proof shows that for any topological space ##Y## and any map ##f:X\longrightarrow Y##, the pre-image of any open set ##V## in ##Y## is open in ##X##. This results in every subset of ##X## being open, equipping ##X## with the discrete topology. Hence, for any topological space ##Y## and any map ##f:X\longrightarrow Y##, ##X## is equipped with the discrete topology.f

#### docnet

Homework Statement
Let ##X## be a topological space so that, for any topological space ##Y##, any map ##f:X\longrightarrow Y## is continuous. Prove that ##X## is the discrete topology.
Relevant Equations
None
Sketch of proof:

##1.## Let ##V## be open in ##Y##.

##2.## For arbitrary ##f:X\longrightarrow Y## and for arbitrary ##V##, ##f^{-1}(V)## is in ##X##.

##3.## ##f:X\longrightarrow Y## is continuous, so ##f^{-1}(V)## is open in ##X##.

##4.## Every subset ##f^{-1}(V)## of ##X## is open, so ##X## is equipped with the discrete topology.

Question: are "member" and "element" interchangeable terms in mathematics?

Question: Is it necessary to define an open-set cover of ##X## composed of ##f^{-1}(V)##?

The second part of step 4 does not follow from the first part. You need EVERY subset of X to be open, not just those that can be expressed as the pre-image of an open set in Y (ie as ##f^{-1}(V)## for some ##f## and some ##Y## and some ##V## that is open in ##Y##).

Hint: what happens if you take ##Y## to have the same elements as ##X## but with the discrete topology? Can you think of a function ##f:X\to Y## for that case that would allow you to show that every subset of ##X## is open (or equivalently, that every element of ##X## is an open subset of ##X##)?

1. People often use 'element' and 'member' interchangeably, but the former is more common and more formal. But don't see that as relevant to this problem.
2. I don't see open covers as having any use in solving this problem.

EDIT: corrected "open topology" to "discrete topology". My fingers weren't following my brain!

Last edited:
docnet
Hint: There are two very important ”any” in the problem statement. That any function to any topological space is continuous. This is important. For example, if ##Y## was fixed it would be easy to construct a counter example:

Let ##Y## be a topological space with a single element ##e## (equipped with the only possible topology). Now, ##f(x) = e## is the only function from ##X## to ##Y## and ##f^{-1}(e) = X## is always open regardless of the topology of ##X##. We therefore cannot conclude that ##X## has the discrete topology.

You need to make an explicit construction that shows that any set in ##X## is open. It does not need to be with a single function ##f## for all sets (but it will be a more elegant proof if it is!)

docnet
Homework Statement:: Let ##X## be a topological space so that, for any topological space ##Y##, any map ##f:X\longrightarrow Y## is continuous. Prove that ##X## is the discrete topology.
Relevant Equations:: None

Sketch of proof:

##1.## Let ##V## be open in ##Y##.

##2.## For arbitrary ##f:X\longrightarrow Y## and for arbitrary ##V##, ##f^{-1}(V)## is in ##X##.

##3.## ##f:X\longrightarrow Y## is continuous, so ##f^{-1}(V)## is open in ##X##.

##4.## Every subset ##f^{-1}(V)## of ##X## is open, so ##X## is equipped with the discrete topology.

Question: are "member" and "element" interchangeable terms in mathematics?

Question: Is it necessary to define an open-set cover of ##X## composed of ##f^{-1}(V)##?
The fundamental problem here is that you didn't use any specific examples of ##f## and ##Y##. Usually this idea is needed when looking for a counterexample to a proposition. In this case, the skill is to find a specific set of ##f's## and ##Y's## that show you have the discrete topology on ##X##.

Last edited:
docnet
For arbitrary $U \subset X$, can you construct a function from $X$ to a finite set such that $U$ is the preimage of a singleton?

docnet
PS There is, in fact, a sneaky way to prove this extremely simply. It's just needs the right choice of ##Y##!

docnet
PS There is, in fact, a sneaky way to prove this extremely simply. It's just needs the right choice of ##Y##!
... and ##f## ... and I would call it elegant rather than sneaky if we are thinking about the same thing ...

Last edited:
docnet and PeroK
Hint: what happens if you take ##Y## to have the same elements as ##X## but with the discrete topology? Can you think of a function ##f:X\to Y## for that case that would allow you to show that every subset of ##X## is open (or equivalently, that every element of ##X## is an open subset of ##X##)?
##0.## Assume that every element ##a## in ##Y## is open in ##Y## and every ##a## in ##Y## is also in ##X##.

##1.## ##Y## is equipped with the discrete topology, so every ##a## in ##Y## is open in ##Y##.

##2. ## Any map ##f:X\longrightarrow Y## is continuous, so the function ##f:X\longrightarrow Y## given by the rule ##f(a)=a## is continuous.

##3.## ##a## is open in ##Y## and ##f## is continuous, so ##f^{-1}(a)=a## is open in ##X##.

##4.## An arbitrary subset ##U## of ##X## is a union of the ##f^{-1}(a)##'s.

##5.## ##f^{-1}(a)=a## is open in ##X## and arbitrary unions of open sets is open, so ##U## is open. Hence ##X## is equipped with the discrete topology.

Hint: There are two very important ”any” in the problem statement. That any function to any topological space is continuous. This is important. For example, if ##Y## was fixed it would be easy to construct a counter example:

Let ##Y## be a topological space with a single element ##e## (equipped with the only possible topology). Now, ##f(x) = e## is the only function from ##X## to ##Y## and ##f^{-1}(e) = X## is always open regardless of the topology of ##X##. We therefore cannot conclude that ##X## has the discrete topology.

You need to make an explicit construction that shows that any set in ##X## is open. It does not need to be with a single function ##f## for all sets (but it will be a more elegant proof if it is!)

##1.## Let ##U## be an arbitrary subset of ##X##, and let ##V## be an open subset of ##Y##.

##2.## Let ##e## be an element in ##V## and ##w## be an element in ##Y-V##.

##3.## Any map ##f:X\longrightarrow Y## is continuous, so the function given by the rule $$f=\begin{cases}e&\text{if}\quad x\in U \\ w&\text{if}\quad x\notin U\end{cases}\quad \text{is continuous.}$$
##4.## ##e## is open in ##Y## and ##f## is continuous, so ##f^{-1}(e)=S## is open in ##X##. Hence ##X## is equipped with the discrete topology.

Question: I am unable to make that proof work if ##Y## only has a single element ##e##, because there is nowhere to send ##x\notin S## to. It seems that ##Y## must contain at least two open elements for this proof to work. @Orodruin Can you please share your thoughts?

@PeroK @pasmith
Question: I saw a proof where the same outline was used with ##Y=\mathbb{R}##. It seemed like they only proved this for a specific case ##Y=\mathbb{R}## and not for all the possible ##Y##'s. Assuming their proof is correct, why is proving it for ##\mathbb{R}## sufficient?

As always thanks.

andrewkirk
Question: I am unable to make that proof work if Y only has a single element e, because there is nowhere to send x∉S to. It seems that Y must contain at least two open elements for this proof to work. @Orodruin Can you please share your thoughts?
This is one of the proofs I thought of before I realized you can just pick ##Y## to have the same elements as ##X## and discrete topology and use the identity map. As you discovered, you need to have at least two elements in ##Y## to single out any open set in ##X##.

It seemed like they only proved this for a specific case Y=R and not for all the possible Y's. Assuming their proof is correct, why is proving it for R sufficient?
You are told that any ##f## to any ##Y## is continuous and you are asked to show a property of ##X##. It does not mean that you can use any ##Y## and ##f## to show this property (as demonstrated by my example of a single element set), but you also do not need to because there are others that will.

docnet
@PeroK @pasmith
Question: I saw a proof where the same outline was used with ##Y=\mathbb{R}##. It seemed like they only proved this for a specific case ##Y=\mathbb{R}## and not for all the possible ##Y##'s. Assuming their proof is correct, why is proving it for ##\mathbb{R}## sufficient?

As always thanks.
Your logic is failing you here.

What you appear to be trying to prove is:

Let ##f:X \rightarrow Y## be continuous. Show that ##X## has the discrete topology.

Which is not true. Question: how do you prove it's not true?

What you are asked to prove is that assuming every function on ##X## is continuous, then show that ##X## has the discrete topology.

Before you prove that you might consider this:

Exercise: show that if ##X## has the discrete topology, then every function on ##X## is continuous.

What you are asked to prove is that only the discrete topology has this property.

Logically, that means you need to find (specific, well chosen) examples of ##Y## and ##f## that enforce the discrete topology on ##X##.

You need to really understand the logic here.

Orodruin
##0.## Assume that every element ##a## in ##Y## is open in ##Y## and every ##a## in ##Y## is also in ##X##.

##1.## ##Y## is equipped with the discrete topology, so every ##a## in ##Y## is open in ##Y##.

##2. ## Any map ##f:X\longrightarrow Y## is continuous, so the function ##f:X\longrightarrow Y## given by the rule ##f(a)=a## is continuous.

##3.## ##a## is open in ##Y## and ##f## is continuous, so ##f^{-1}(a)=a## is open in ##X##.

##4.## An arbitrary subset ##U## of ##X## is a union of the ##f^{-1}(a)##'s.

##5.## ##f^{-1}(a)=a## is open in ##X## and arbitrary unions of open sets is open, so ##U## is open. Hence ##X## is equipped with the discrete topology.

##1.## Let ##U## be an arbitrary subset of ##X##, and let ##V## be an open subset of ##Y##.

##2.## Let ##e## be an element in ##V## and ##w## be an element in ##Y-V##.

##3.## Any map ##f:X\longrightarrow Y## is continuous, so the function given by the rule $$f=\begin{cases}e&\text{if}\quad x\in U \\ w&\text{if}\quad x\notin U\end{cases}\quad \text{is continuous.}$$
##4.## ##e## is open in ##Y## and ##f## is continuous, so ##f^{-1}(e)=S## is open in ##X##. Hence ##X## is equipped with the discrete topology.

Question: I am unable to make that proof work if ##Y## only has a single element ##e##, because there is nowhere to send ##x\notin S## to. It seems that ##Y## must contain at least two open elements for this proof to work. @Orodruin Can you please share your thoughts?

@PeroK @pasmith
Question: I saw a proof where the same outline was used with ##Y=\mathbb{R}##. It seemed like they only proved this for a specific case ##Y=\mathbb{R}## and not for all the possible ##Y##'s. Assuming their proof is correct, why is proving it for ##\mathbb{R}## sufficient?

As always thanks.
Re #2. It may not make sense to use ##f(a)=a; a ## may not be contained in ##Y##.
EDIT:And you may want to extract additional information you may use eventually. Notice a map into a space with two points. If you assume ##\{f(X) \} =\{a,b\} ## is continuous, what can you say about ##X##?

docnet
Re #2. It may not make sense to use ##f(a)=a; a ## may not be contained in ##Y##.
By assertion #0 we are considering a ##Y## such that it contains all elements of ##X##.

Question: I am unable to make that proof work if ##Y## only has a single element ##e##, because there is nowhere to send ##x\notin S## to. It seems that ##Y## must contain at least two open elements for this proof to work.
We must assume, therefore, that there exist sets with more than one element!

Note that every function ##f: X \rightarrow \{a\}## is continuous. This is because ##f^{-1}(\{a\}) = X##, which is open in every topology on ##X##.

docnet
Related to what @PeroK said in previous post, this may be a productive line of inquiry: Given any two topological spaces ##X,Y ##: Does there always a non-constant continuous function between them? (Similar for other Mathematical Structures in different settings: groups, rings, etc.)

Last edited:
docnet
Related to what @PeroK said in previous post, this may be a productive line of inquiry: Given any two topological spaces ##X,Y ##: Does there always a non-constant continuous function between them? (Similar for other Mathematical Structures in different settings: groups, rings, etc.
Are you asking because you want to know or to make OP think about it?

Are you asking because you want to know or to make OP think about it?
No, I've explored this, just as a suggestion towards answering questions like the OP. Clearly, e.g., there are no non-constant continuous functions between connected and disconnected spaces, etc
EDIT: It would be great, though, if someone knew how to frame this in terms of Category Theory.

Last edited:
Exercise: show that if ##X## has the discrete topology, then every function on ##X## is continuous.

##1.## A function ##f:X\longrightarrow Y## assigns to each element of ##X## exactly one element of ##Y##. So every function ##f:X\longrightarrow Y## maps the element ##x## in ##X## to some element, w.l.o.g., ##e## in ##Y##.

##2.## ##Y## is a topological space, hence there is some open subset ##V## in ##Y## that contains ##e##.

##3.## ##f^{-1}(V)=U## is a subset of ##X## that contains ##f^{-1}(e)=x##.

##4.## ##X## has the discrete topology, so every subset ##U## of ##X## is open, hence ##U## is open in ##X##.

##4.## For every open subset ##V## of ##Y##, its preimage ##U## is open in ##X##, so ##f## is continuous.

If you assume ##\{f(X) \} =\{a,b\} ## is continuous, what can you say about ##X##?

##1.## ##\{a,b\} ## has the discrete topology, so every subset of ##\{a,b\} ## is open, hence ##a## and ##b## are open in ##\{a,b\}##.

##2.## ##f:X\longrightarrow \{a,b\}## is continuous, so ##f^{-1}(a)=U## and
##f^{-1}(b)=V## are open subsets of ##X##.

Case 1:

##3.## ##U=u## and ##V=v## are singletons sets in ##X## such that ##X=\{u,v\}##.

##4.## Then, ##u## and ##v## are open in ##X##, and the arbitrary union of open subsets are open, so every subset of ##X## is open, hence ##X## is equipped with the discrete topology.

Case 2:

##3.## One or both of ##U## and ##V## are not singleton sets in ##X##.

##4.## Then, could be a subset ##W## of ##U## or ##V## that is not open in ##X##.

WWGD
EDIT:And you may want to extract additional information you may use eventually. Notice a map into a space with two points. If you assume {f(X)}={a,b} is continuous, what can you say about X?
You also need to provide the topology on {a,b} (there are in essence three inequivalent choices). For example, if you assume the indiscrete topology, any function ##f## will be continuous because ##f^{-1}(\{a,b\}) = X##, which is open, and ##f^{-1}(\emptyset) = \emptyset##, which is open.

docnet
##1.## A function ##f:X\longrightarrow Y## assigns to each element of ##X## exactly one element of ##Y##. So every function ##f:X\longrightarrow Y## maps the element ##x## in ##X## to some element, w.l.o.g., ##e## in ##Y##.

##2.## ##Y## is a topological space, hence there is some open subset ##V## in ##Y## that contains ##e##.

##3.## ##f^{-1}(V)=U## is a subset of ##X## that contains ##f^{-1}(e)=x##.

##4.## ##X## has the discrete topology, so every subset ##U## of ##X## is open, hence ##U## is open in ##X##.

##4.## For every open subset ##V## of ##Y##, its preimage ##U## is open in ##X##, so ##f## is continuous.
First, a general point. I'm not a fan of repeating definitions in a proof. There may be cases where it's useful, but generally a restatement of definitions is not part of a proof. Moreover, IMO, it gets the proof off on the wrong foot and gets the student thinking in the wrong way. I suggest you try to stop doing this.

Note that almost every student on here does this. It seems to be a common difficulty.

Instead, you should be looking for and stating what specifically needs to be done for this particular proof.

In this case, I would almost completely automatically start the proof with:

Let ##X## be a topological space with the discrete topology. Let ##Y## be any topological space and ##f: X \rightarrow Y## be any function.

We need to show that ##f## is continuous.

Let ##U \subseteq Y##. As ##Y##, ##f## and ##U## are arbitrary, it is enough to show that ##f^{-1}(U)## is open in ##X##.

[Here, instead of regurgitating the definition of continuity, I've interpreted the definition to tell me what specifically I need to do in this particular proof.]

Finally, as ##X## has the discrete topology, all sets are open, hence ##f^{-1}(U)## is open and ##f## is continuous. QED

Notice that you and I laboured different aspects of the proof. You repeated general definitions; but didn't describe the objects you were using. I only touched on the general definitions, but emphasised/defined every object I used.

I suggest you make a mental note to change your approach to proofs. Don't rely on repeating definitions. But, do define all the objects you are using in your proof and what properties you are assuming they have; or, intend to prove they have.

docnet
You also need to provide the topology on {a,b} (there are in essence three inequivalent choices). For example, if you assume the indiscrete topology, any function ##f## will be continuous because ##f^{-1}(\{a,b\}) = X##, which is open, and ##f^{-1}(\emptyset) = \emptyset##, which is open.
Yes, of course, here the indiscrete topology doesn't provide much of use in this case.

docnet
Yes, of course, here the indiscrete topology doesn't provide much of use in this case.
It is however useful for a similar statement to ”any function from a set with discrete topology is continuous”, namely ”any function to a set with indiscrete topology is continuous” (because the preimages of both open sets are necessarily open in any topology).

docnet
Though I guess the indiscrete topology is the simplest example of a non-metrizable and " strongly-connected"( nowhere-Hausdorff topology).

docnet
Sure. It is also the prime example of a pseudometric space (with the distance between any two points being identically zero). It is the simplest example of many things and often a canonical choice for an extreme case (in the opposite direction of the discrete topology) when you need to prove some topological. The discrete and indiscrete topologies are each other’s opposites in many ways.

docnet
Sure. It is also the prime example of a pseudometric space (with the distance between any two points being identically zero). It is the simplest example of many things and often a canonical choice for an extreme case (in the opposite direction of the discrete topology) when you need to prove some topological. The discrete and indiscrete topologies are each other’s opposites in many ways.
I'm curious as to whether there are category-theoretical names for the two, in the category of Topological spaces. Maybe (co)limits, etc?