In mathematics, especially in order theory, a maximal element of a subset S of some partially ordered set (poset) is an element of S that is not smaller than any other element in S. A minimal element of a subset S of some partially ordered set is defined dually as an element of S that is not greater than any other element in S.
The notions of maximal and minimal elements are weaker than those of greatest element and least element which are also known, respectively, as maximum and minimum. The maximum of a subset S of a partially ordered set is an element of S which is greater than or equal to any other element of S, and the minimum of S is again defined dually. While a partially ordered set can have at most one each maximum and minimum it may have multiple maximal and minimal elements. For totally ordered sets, the notions of maximal element and maximum coincide, and the notions of minimal element and minimum coincide.
As an example, in the collection
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.