Cardinality of Integer Interval

From ProofWiki
Jump to navigation Jump to search



Theorem

Let $a, b \in \Z$ be integers.

Let $\left[{a \,.\,.\, b}\right]$ denote the integer interval between $a$ and $b$.


Then $\left[{a \,.\,.\, b}\right]$ is finite and its cardinality equals:

$\begin{cases}

b - a + 1 & : b \ge a - 1 \\ 0 & : b \le a - 1 \end{cases}$


Proof

Let $b < a$.

Then $\left[{a \,.\,.\, b}\right]$ is empty.

By Empty Set is Finite, $\left[{a \,.\,.\, b}\right]$ is finite.

By Cardinality of Empty Set, $\left[{a \,.\,.\, b}\right]$ has cardinality $0$.

Let $b \ge a$.

By Translation of Integer Interval is Bijection, there exists a bijection between $\left[{a \,.\,.\, b}\right]$ and $\left[{0 \,.\,.\, b - a}\right]$.

Thus $\left[{a \,.\,.\, b}\right]$ is finite of cardinality $b - a + 1$.

$\blacksquare$