Connectedness of an interval (source code)

= Connectedness of an interval

Every real interval is <connected>. Otherwise a separation into two nonempty relatively open sets defines a continuous real function equal to zero on one side and one on the other. Choose one point of each set. The <intermediate value theorem> on the closed segment between them requires the value $1/2$, a contradiction. The converse also holds: a connected subset of the real line contains every point between two of its points, since omitting an intermediate point separates it into its intersections with the two open half-lines.