Intersection of two closed intervals

elementary-set-theoryreal-analysis

I was solving a question on leetcode. I noticed that they defined the intersection of two closed intervals as so:

$$[a,b]\cap [c,d] = \left[\max(a,c), \min(b,d)\right]$$

The leetcode question can be found here. I am wondering if there is a formal proof for this? I know that the intersection of two closed intervals yields a closed interval in what I have studied in real analysis but I never came across (or don't remember) this definition.

Any suggestions or references are appreciated.

Best Answer

The proof is as easy as filling in the definitions:

\begin{align} x\in[a,b]\quad&\text{if and only if}\quad a\leq x\text{ and }x\leq b\\ x\in[c,d]\quad&\text{if and only if}\quad c\leq x\text{ and }x\leq d\\ &\quad\Downarrow\\ x\in[a,b]\cap[c,d]\quad&\text{if and only if}\quad a\leq x\text{ and }c\leq x\text{, and }x\leq b\text{ and }x\leq d\\ &\text{if and only if}\quad \max\{a,c\}\leq x\text{ and }x\leq \min\{b,d\}\\ &\text{if and only if}\quad x\in[\max\{a,c\},\min\{b,d\}]\\ \end{align}