# Interval of Totally Ordered Set is Convex

## Theorem

Let $\struct {S, \preccurlyeq}$ be a totally ordered set.

Let $I \subseteq S$ be an interval in $S$.

Then $I$ is convex.

## Proof

There are a number of cases to investigate.

### Open Interval

Let $I = \openint a b$ be an open interval:

$I = \set {x \in S: a \prec x \prec b}$

Let $s, t, x \in I$ such that $s \prec x \prec t$.

Then by definition:

$a \prec s \prec x$

and:

$x \prec t \prec b$

and so:

$a \prec x \prec b$

and $x \in I$.

Thus we have:

$\forall s, t, x, \in I: s \prec x \prec t \implies x \in I$

and $I$ is convex by definition.

$\Box$

### Left Half-Open Interval

Let $I = \hointl a b$ be a left half-open interval:

$I = \set {x \in S: a \prec x \preceq b}$

Let $s, t, x \in I$ such that $s \prec x \prec t$.

Then by definition:

$a \prec s \prec x$

and:

$x \prec t \preceq b$

and so:

$a \prec x \preceq b$

and $x \in I$.

Thus we have:

$\forall s, t, x, \in I: s \prec x \prec t \implies x \in I$

and $I$ is convex by definition.

$\Box$

### Right Half-Open Interval

Let $I = \hointr a b$ be a right half-open interval:

$I = \set {x \in S: a \preceq x \prec b}$

Let $s, t, x \in I$ such that $s \prec x \prec t$.

Then by definition:

$a \preceq s \prec x$

and:

$x \prec t \prec b$

and so:

$a \preceq x \prec b$

and $x \in I$.

Thus we have:

$\forall s, t, x, \in I: s \prec x \prec t \implies x \in I$

and $I$ is convex by definition.

$\Box$

### Closed Interval

Let $I = \closedint a b$ be a closed interval:

$I = \set {x \in S: a \preceq x \preceq b}$

Let $s, t, x \in I$ such that $s \prec x \prec t$.

Then by definition:

$a \preceq s \prec x$

and:

$x \prec t \preceq b$

and so:

$a \preceq x \preceq b$

and $x \in I$.

Thus we have:

$\forall s, t, x, \in I: s \prec x \prec t \implies x \in I$

and $I$ is convex by definition.

$\blacksquare$