Prove that sup $f(x)$ $\le$ inf $g(y)$. (proof verification) I saw this proof, but I don't understand one point.

$f(x) \le g(y)$ for $x,y \in D$ 

$\rightarrow$ sup$f(x)$ $\le$ $g(y)$    

$\rightarrow$sup$f(x)$ $\le$ inf$g(y)$

I think from the second line to third line of proof, it assumes that inf$g(y)$ $\in$ $g(D)$. 

But, how can we prove this? 

Thanks in advance.
The property that they use is let $a \in \mathbb{R}$. Then $\forall y, a \le g(y) \implies  a \le \inf_y g(y)$. 

$a$ is a lower bound for the set $\{ g(y): y \in D\}$, but remember that the infimum is the greatest lower bound, hence we have $a \le \inf_y g(y)$.

Here $a$ is $\sup f(x)$.
Since $f(x)\le g(y)$ for $x$,$y\in D$

$g(y)$ is an upper bound for $f(x)$, so the least upper bound is less than or equal $g(y)$

Thus  $\sup f(x) \le g(y)$.
That implies $\sup f(x)$ is a lower bound for $g(y)$ so the greatest lower bound  of $g(y)$ is greater than  or equal to sup $f(x)$. 

That is: 

$\sup f(x) \le \inf g(y)$