Unpacking notation with $\inf$, $\sup$ as part of proof of open set $\mathbb{R}$ can be written as countable union of disjoint open intervals Here is a Proposition from my real analysis book.

Proposition. Suppose $G \subset \mathbb{R}$ is open. Then $G$ can be written as the countable union of disjoint open intervals.

The proof begins with the following.

Let $G$ be an open subset of the real line and for each $x \in G$, let$$A_x = \inf\{a : \text{there exists }b\text{ such that }x \in (a, b) \subset G\}$$and$$B_x = \sup\{d : \text{there exists }c \text{ such that }x \in (c, d) \subset G\}.$$Let $I_x = (A_x, B_x)$.

I just realized I don't really get what this beginning part is saying. Can somebody explain it to me/add some more detail? Thanks in advance!
 A: Intuitively, since $G$ is open, we know that every point in $G$ is covered by some (possibly very small) open interval that completely fits inside $G$. However, many of these open intervals will overlap with each other. The goal here is to merge together the open intervals until they are as large as possible without overflowing outside of $G$. We're trying to argue that if we greedily express $G$ as a union of only the biggest possible open intervals, then we can get away with covering $G$ with only countably many open intervals instead of uncountably many.
For example, consider the open set $G = \{x \in \mathbb R \mid 1 < x < 2 \text{ or } 3 < x < 7\}$ and $x = 4$. Notice that there are many open intervals that cover $4$ and yet still fit inside $G$; for example:
$$
(3.999, 4.001), (3.8, 4.2), (3.5, 4.5), (3.5, 5.5), (3.001, 4.001), (3.999, 6.999)
$$
However, the largest one is certainly $(3, 7)$. Indeed, we have that:
$$
I_4 = (A_4, B_4) = (3, 7)
$$
Notice that $I_{3.001} = I_{3.5} = I_4 = I_5 = I_{6.9} = I_{6.9999} = (3, 7)$. Likewise, notice that $I_{1.001} = I_{1.3} = I_{1.999} = (1, 2)$. So instead of redundantly expressing $G$ with something silly like:
$$
G = (1, 1.002) \cup (1.001, 1.003) \cup (1.002, 1.004)  \cup \cdots \cup (2.998, 3) \cup (3, 5) \cup (4, 7)
$$
we can be as efficient as possible by expressing it simply as:
$$
G = (1, 2) \cup (3, 7)
$$
A: I think it might be easier to understand if it were written as
$$A_x = \inf\{ a : (a,x) \subset G\}$$
$$B_x = \sup\{ d : (x,d) \subset G\}$$
Basically, $A_x$ is the left endpoint of the largest open interval containing $x$ and $B_x$ is the corresponding right endpoint.
