Theorem. Any Two Nondegenerate Closed Intervals Have the Same Cardinality

Let 𝑎,𝑏,𝑐,𝑑∈ℝ, with 𝑎<𝑏 and 𝑐<𝑑. Then the closed intervals [ 𝑎,𝑏 ] and [ 𝑐,𝑑 ] have the same cardinality.

Proof.

Define 𝑓:[ 𝑎,𝑏 ]→[ 𝑐,𝑑 ] by

𝑓( 𝑥 )=𝑐+𝑑−𝑐 𝑏−𝑎( 𝑥−𝑎 ).

In particular, 𝑓( 𝑎 )=𝑐 and 𝑓( 𝑏 )=𝑑. We check that 𝑓 is well-defined, injective, and surjective.

1. Well-definedness.

Let 𝑥∈[ 𝑎,𝑏 ]. Since 𝑏−𝑎>0,

𝑎≤𝑥≤𝑏⇒0≤𝑥−𝑎 𝑏−𝑎≤1.

Multiplying by 𝑑−𝑐>0 and adding 𝑐 gives

𝑐≤𝑐+𝑑−𝑐 𝑏−𝑎( 𝑥−𝑎 )≤𝑑.

Thus 𝑓( 𝑥 )∈[ 𝑐,𝑑 ], so the formula really does define a function with the required domain and codomain.

2. Injectivity (one-to-one).

Let 𝑥 1,𝑥 2∈[ 𝑎,𝑏 ] and suppose 𝑓( 𝑥 1 )=𝑓( 𝑥 2 ). Then

𝑐+𝑑−𝑐 𝑏−𝑎( 𝑥 1−𝑎 )=𝑐+𝑑−𝑐 𝑏−𝑎( 𝑥 2−𝑎 ).

Subtracting 𝑐 and dividing by the nonzero number ( 𝑑−𝑐 )/( 𝑏−𝑎 ) yields

𝑥 1−𝑎=𝑥 2−𝑎, hence 𝑥 1=𝑥 2.

Therefore, 𝑓 is injective: distinct points cannot share a partner.

3. Surjectivity (onto).

Let 𝑦∈[ 𝑐,𝑑 ] be arbitrary. Choose

𝑥=𝑎+𝑏−𝑎 𝑑−𝑐( 𝑦−𝑐 ).

Since 𝑑−𝑐>0,

𝑐≤𝑦≤𝑑⇒0≤𝑦−𝑐 𝑑−𝑐≤1.

Multiplying by 𝑏−𝑎>0 and adding 𝑎 shows that

𝑎≤𝑎+𝑏−𝑎 𝑑−𝑐( 𝑦−𝑐 )≤𝑏.

Hence 𝑥∈[ 𝑎,𝑏 ]. Substituting this choice into 𝑓 gives

𝑓( 𝑥 )=𝑐+𝑑−𝑐 𝑏−𝑎( 𝑥−𝑎 )=𝑐+𝑑−𝑐 𝑏−𝑎𝑏−𝑎 𝑑−𝑐 ( 𝑦−𝑐 )=𝑐+( 𝑦−𝑐 )=𝑦.

Thus every 𝑦∈[ 𝑐,𝑑 ] has a preimage in [ 𝑎,𝑏 ], so 𝑓 is surjective.

Since 𝑓 is both injective and surjective, it is a bijection. Therefore,

|[ 𝑎,𝑏 ]|=|[ 𝑐,𝑑 ]|.

∎

The pairing can be reversed explicitly:

𝑓 −1( 𝑦 )=𝑎+𝑏−𝑎 𝑑−𝑐( 𝑦−𝑐 ),𝑦∈[ 𝑐,𝑑 ].