In the mathematical field of set theory, an ultrafilter on a given partially ordered set (poset) P is a maximal filter on P, that is, a filter on P that cannot be enlarged. Filters and ultrafilters are special subsets of P. If P happens to be a Boolean algebra, each ultrafilter is also a prime filter, and vice versa.
If X is an arbitrary set, its power set ℘(X), ordered by set inclusion, is always a Boolean algebra, and (ultra)filters on ℘(X) are usually called "(ultra)filters on X".Ultrafilters have many applications in set theory, model theory, and topology. An ultrafilter on a set X may be considered as a finitely additive measure. In this view, every subset of X is either considered "almost everything" (has measure 1) or "almost nothing" (has measure 0).
In order theory, an ultrafilter is a subset of a partially ordered set that is maximal among all proper filters. This implies that any filter that properly contains an ultrafilter has to be equal to the whole poset.
Formally, if P is a set, partially ordered by (≤), then
An important special case of the concept occurs if the considered poset is a Boolean algebra. In this case, ultrafilters are characterized by containing, for each element a of the Boolean algebra, exactly one of the elements a and ¬a (the latter being the Boolean complement of a):