# What is the logic underlying this proof?

Proposition: A metric space $X$ is connected if, and only if, every continuous function $f:X\to (\{0,1\},d_D)$ is a constant function, where $d_D$ is the discrete metric on the set $\{0,1\}$.

Proof: Suppose $X$ is disconnected. Then $X$ has a nonempty proper subset $A$ which is both open and closed. Define the function $f:X\to (\{0,1\},d_D)$ by $$f(x)=\left\{\begin{array} &0 & \text{if } x\in A\\ 1 & \text{if } x\notin A \end{array} \right.$$ There are only four open sets in $\{0,1\}$, and it is easy to check that the inverse image of each one of them under the function $f$ is an open set in $X$. Hence $f$ is continuous, and clearly not constant.

Conversely, suppose there is a continuous function $f:X\to (\{0,1\},d_D)$ which is not constant....

Can you please explain the logic behind the first part of the proof given above? This is my attempt to understand the logic:

Let the statement "every continuous function $f:X\to (\{0,1\},d_D)$ is a constant function" be denoted $A$; and the statement "$X$ is connected" be denoted $B$. The first part of the proof has proved that $A\wedge\neg B$ is false when $B$ is false. Hence $A$ is false (I'm not sure if this is relevant, but it does mean that $A\implies B$ is true, because $A$ is false).

If the author is trying to prove the contrapositive, I think that he failed because he did not prove $\neg B \implies \neg A$ for all cases of non-constant continuous functions, just one. What I usually expect is a proof by contradiction. If this were a proof by contradiction, what is being implied at the start are the words, "Suppose $X$ is disconnected and suppose every continuous function $f:X\to (\{0,1\},d_D)$ is constant." Why would a contradiction then lead to the conclusion that $X$ must have been connected? Why do we not simply conclude that there exists a non-constant function $f:X\to (\{0,1\},d_D)$ when $X$ is disconnected? What is so special about the statement $A$ that it must be possible to be true under one of the conditions '$X$ is connected' or '$X$ is disconnected'?

• He did prove the contrapositive. What you seem to be overlooking is that the negation of "for every continuous $f$, blah blah" is "there exists a continuous $f$ such that not blah blah". – David C. Ullrich May 1 '16 at 14:08

The author proves $\neg B \implies \neg A$, so $A\implies B$.

Indeed $\neg A$ reads "there is a continuous non-constant function $X\to \{0;1\}$", which is what the author proves.

• I like this answer, except that the statement is $\neg A$, not $\neg B$. I'm sorry if I was being unconventional - I was trying to define A and B so that $A\implies B$ is what was being proved. – ahorn May 1 '16 at 14:17
• No, that was just a typo on my part. :) – Captain Lama May 1 '16 at 14:17

I think it is simpler less wordy: if there exists a continuous surjective $\;f:X\to \{0,1\}\;$ , then

$$\begin{cases}1).-\;&X=f^{-1}(\{0\})\cup f^{-1}(\{1\})\\{}\\2).-\;&f^{-1}(\{0\})\,,\;\; f^{-1}(\{1\})\;\;\text{are open and non-empty}\\{}\\3).-\;&f^{-1}(\{0\})\cap f^{-1}(\{1\})=\emptyset\end{cases}\;\;\;\;\implies\;X\;\;\text{is disconnected}$$

The above is just the contrapositive of what you read.

• This is the second half of the proof, not the first. – ahorn May 1 '16 at 14:40
• @ahorn Perhaps...it was too wordy: I didn't read the whole thing. – DonAntonio May 1 '16 at 15:39

The proposition is $B\iff A$. The first part of th eprove starts with "Suppose $\neg A$" and deduces $\neg B$ from that, thus shows $\neg A\implies \neg B$ (or equivalently $B\implies A$)

• I'm voting this down because you used A and B incorrectly. – ahorn May 1 '16 at 14:12