If $A$ and $B$ are bounded subsets of $\mathbb{R}$, I need to show that, $\sup{A} = \inf{B} \iff \forall \epsilon > 0, \, \exists a \in A, \, b \in B \, : \, b - a < \epsilon$.

I have begun the proof in the "$\implies$" direction for now, but I am finding there are many cases. I ended up giving up a few times before I decided to ask here for help. Here is my proof so far.

$A$, $B$ bounded $\implies$ $\inf{A}$ and $\sup{B}$ exist. Also let $c = \sup{A} = \inf{B}$.

Without loss of generality, suppose $c - \inf{A} \leq \sup{B} - c$. That is, the "length" of $A$ is smaller than or equal to the "length" of $B$.[![enter image description here](https://i.stack.imgur.com/XTBCx.png)](https://i.stack.imgur.com/XTBCx.png)

We will consider three cases for $\epsilon > 0$.

1. $\epsilon / 3 < c - \inf{A}$
2. $c - \inf{A} \leq \epsilon / 3 < \sup{B} - c$
3. $\epsilon / 3 \geq \sup{B} - c$.

---

For case 1., let $a = c - \epsilon / 3 \in A$. Then let $b = c + \epsilon / 3 \in B$.

Then, $b - a = (2/3) \epsilon < \epsilon$.

---

For case 2., let $a \in A$ be fixed, and let $b = a + \epsilon / 3 \in B$.

Then, $b - a = \epsilon / 3 < \epsilon$.

---

I am unsure how to go about case 3.

---

As you can see, case 3 is the difficult one to think about. If anybody could help me thinking of an $a \in A$ and $b \in B$ for case 3 that satisfied $b - a < \epsilon$ it would be greatly appreciated. Or... If someone can think of a better/more elegant proof, feel free to share.

Thanks.