Explain Example on Maximal Element with sets I am trying to understand maximal element and I cannot understand this example from Wikipedia

As an example, in the collection
$$S = \{\{d, o\}, \{d, o, g\}, \{g, o, a, d\}, \{o, a, f\}\}$$
ordered by containment, the element $\{d, o\}$ is minimal, the element $\{g, o, a, d\}$ is maximal, the element $\{d, o, g\}$ is neither, and the element $\{o, a, f\}$ is both minimal and maximal. By contrast, neither a maximum nor a minimum exists for $S$.

where I cannot understand
What does the order by containment really mean?


*

*why is $\{d,o\}$ minimal?


*why is $\{g,o,a,d\}$ maximal?


*why is $\{d,o,g\}$ nor maximal nor minimal?


*why is $\{o,a,f\}$ both minimal and maximal?

 A: "Ordered by containment" means that if we are considering subsets of a set $S$ where $X\subset S$ and $Y\subset S$ then we say that $X\le Y$ (that is, "$X$ is less than $Y$" or "$X$ comes before $Y$") if $X\subset Y$ (that is, $X$ is contained in $Y$, equivalently $X$ is a subset of $Y$).
This is not a total order, so there may be no smallest (or minimum) element $X$ in the sense that $X\le Y$ for all $Y\subset S$. Instead we have a concept of a minimal element $X$ where $X\le Y$ for all those $Y$ for which $X\le Y$ or $Y\le X$. This is not the same thing as a minimum element, since for some $Y\subset S$ we may have that neither $X\subset Y$ nor $Y\subset X$.
The test for minimality can be stated as follows:


*

*We are given a set $P$ with a partial order $\le$ defined on it. We choose $x\in P$. Is $x$ minimal?

*Look at $Q=\{y\in P|x\le y\vee y\le x\}\subset P$. This set $Q$ is the set of all elements which are comparable to $x$ using $\le$.

*For each $z\in Q$ check that $x\le z$.

*If you found some $z\in Q$ such that $z\le x$ in the last step then $x$ is not minimal. Maybe $z$ is minimal, maybe not. If you did not find any $z\in Q$ such that $z\le x$ in the last step, then $x$ is minimal.
A: 
This is easy to show with Hasse diagram. I will first demonstrate a pedagocal example and then this example.
Example
I use Hasse diagram to describe a poset $(S_2,\geq)$ with a set $$S_2=\{\{d\},\{d,o\},\{d,o,a\},\{d,a\},\{d,a,g\},\{g,o,a,d\}\}$$

where $\{g,o,a,d\}$ is the maximal while $\{d\}$ is the minimal by the containment, here I think they are also the maximum and the minimum, respectivily ordered by the containment (or set inclusion): $\{d\}\subseteq S_i$ while $\{g,o,a,d\}\not\subset S_i$ unless the same set. The $\{d,o\}$ and the $\{d,a\}$ are incomparable elements.
Example in the question
The latter example is very similar to your given example with 
$$S = \{\{d, o\}, \{d, o, g\}, \{g, o, a, d\}, \{o, a, f\}\}$$
where I could not understand why $\{g,o,a,d\}$ is maximal and $\{o,a,f\}$ is nor maximal neither minimal: I think $\{o,a,f\}$ is incomparable to any set in $S$ so it is both maximal and minimal

where $\{o\}\not\subset S_i$. So $\{d,o,g\}\geq\{d,o\}$ and $\{g,o,a,d\}\geq\{d,o\}$ but $\{d,o,g\}\not\geq \{o,a,f\}$. So I would say that $\{g,o,a,d\}$ and $\{o,a,f\}$ are maximal elements. The minimal elements are $\{o,a,f\}$ and $\{d,o\}$

and as a matter of fact, this conclusion is the same as in the Wikipedia, now explained with Hasse diagram, hurray!

Further reading


*

*Wikipedia on Comparability

*Wikipedia on Comparability Graphs (Hasse diagrams and comparability graphs here)

*For learning Tikz, a small demo on generating the lattices and learning.
