The following text is from the book Abstract Algebra by T. W. Judson :
Let $X = {\{1,2,3,4,6,8,12,24}\}$ be the set of divisors of $24$ with the partial order defined by $a\preceq b$ if $a | b$. ... Let $Y = {\{2, 3, 4, 6}\}$ be contained in the set $X$. Then $Y$ has upper bounds $12$ and $24$, with $12$ as a least upper bound. The only lower bound is $1$; hence, it must be a greatest lower bound.
In real analysis greatest lower bound and lowest upper bound of ${\{2, 3, 4, 6}\}$ is $2$ and $6$, respectively. Why they can't be elements of the set itself in abstract algebra?
$\endgroup$ 11 Answer
$\begingroup$The g.l.b. and l.u.b. from analysis that you mention are with respect to the usual partial order (in fact, total order) $\leq$. Indeed, we have $2 \leq 3 \leq 4 \leq 6$, so the g.l.b. w.r.t. $\leq$ is $2$ and the l.u.b. is $6$.
The problem at hand specifies a different partial order, namely $\preceq$ (or $\mid$). In this case, we have, for example, neither $3 \preceq 4$ nor $4 \preceq 3$. The only elements $x \in X$ such that $2 \preceq x$, $3 \preceq x$, $4 \preceq x$, and $6 \preceq x$ are $12$ and $24$, and $12 \preceq 24$, so $12$ is a l.u.b. for $\{2, 3, 4, 6\}$. (Like you note, $12$ is not an element of that subset!)
On the set $\Bbb Z_+$ of positive integers, again endowed with the divisibility partial order, the g.l.b. of a finite set of integers $A \subset \Bbb Z_+$ is, by definition, the greatest common divisor of the elements of $A$, and likewise the l.u.b. of $A$ is the least common multiple.
$\endgroup$