# Filter (mathematics)

The powerset lattice of the set ${\displaystyle \{1,2,3,4\},}$ with the upper set ${\displaystyle \uparrow \{1,4\}}$ colored dark green. It is a filter, and even a principal filter. It is not an ultrafilter, as it can be extended to the larger nontrivial filter ${\displaystyle \uparrow \{1\},}$ by including also the light green elements. Since ${\displaystyle \uparrow \{1\}}$ cannot be extended any further, it is an ultrafilter.

In mathematics, a filter or order filter is a special subset of a partially ordered set (poset). Filters appear in order and lattice theory, but can also be found in topology, from which they originate. The dual notion of a filter is an order ideal.

Filters on sets were introduced by Henri Cartan in 1937[1][2] and as described in the article dedicated to filters in topology, they were subsequently used by Nicolas Bourbaki in their book Topologie Générale as an alternative to the related notion of a net developed in 1922 by E. H. Moore and Herman L. Smith. Order filters are generalizations of this notion from sets to the more general setting of partially ordered sets. For information on order filters in the special case where the poset consists of the power set ordered by set inclusion, see the article Filter (set theory).

## Motivation

1. Intuitively, a filter in a partially ordered set (poset), ${\displaystyle P,}$ is a subset of ${\displaystyle P}$ that includes as members those elements that are large enough to satisfy some given criterion. For example, if ${\displaystyle x}$ is an element of the poset, then the set of elements that are above ${\displaystyle x}$ is a filter, called the principal filter at ${\displaystyle x.}$ (If ${\displaystyle x}$ and ${\displaystyle y}$ are incomparable elements of the poset, then neither of the principal filters at ${\displaystyle x}$ and ${\displaystyle y}$ is contained in the other one, and conversely.)

Similarly, a filter on a set contains those subsets that are sufficiently large to contain some given thing. For example, if the set is the real line and ${\displaystyle x}$ is one of its points, then the family of sets that include ${\displaystyle x}$ in their interior is a filter, called the filter of neighbourhoods of ${\displaystyle x.}$ The thing in this case is slightly larger than ${\displaystyle x,}$ but it still does not contain any other specific point of the line.

The above interpretations explain conditions 1 and 3 in the section General definition: Clearly the empty set is not "large enough", and clearly the collection of "large enough" things should be "upward-closed". However, they do not really, without elaboration, explain condition 2 of the general definition. For, why should two "large enough" things contain a common "large enough" thing?

2. Alternatively, a filter can be viewed as a "locating scheme": When trying to locate something (a point or a subset) in the space ${\displaystyle X,}$ call a filter the collection of subsets of ${\displaystyle X}$ that might contain "what is looked for". Then this "filter" should possess the following natural structure:

1. A locating scheme must be non-empty in order to be of any use at all.
2. If two subsets, ${\displaystyle E}$ and ${\displaystyle F,}$ both might contain "what is looked for", then so might their intersection. Thus the filter should be closed with respect to finite intersection.
3. If a set ${\displaystyle E}$ might contain "what is looked for", so does every superset of it. Thus the filter is upward-closed.

An ultrafilter can be viewed as a "perfect locating scheme" where each subset ${\displaystyle E}$ of the space ${\displaystyle X}$ can be used in deciding whether "what is looked for" might lie in ${\displaystyle E.}$

From this interpretation, compactness (see the mathematical characterization below) can be viewed as the property that "no location scheme can end up with nothing", or, to put it another way, "always something will be found".

The mathematical notion of filter provides a precise language to treat these situations in a rigorous and general way, which is useful in analysis, general topology and logic.

3. A common use for a filter is to define properties that are satisfied by "almost all" elements of some topological space ${\displaystyle X.}$[3] The entire space ${\displaystyle X}$ definitely contains almost-all elements in it; if some ${\displaystyle E\subseteq X}$ contains almost all elements of ${\displaystyle X,}$ then any superset of it definitely does; and if two subsets, ${\displaystyle E}$ and ${\displaystyle F,}$ contain almost-all elements of ${\displaystyle X,}$ then so does their intersection. In a measure-theoretic terms, the meaning of "${\displaystyle E}$ contains almost-all elements of ${\displaystyle X}$" is that the measure of ${\displaystyle X\smallsetminus E}$ is 0.

## General definition: Filter on a partially ordered set

A subset ${\displaystyle F}$ of a partially ordered set ${\displaystyle (P,\leq )}$ is an order filter or dual ideal if the following conditions hold:

1. ${\displaystyle F}$ is non-empty.
2. ${\displaystyle F}$ is downward directed: For every ${\displaystyle x,y\in F,}$ there is some ${\displaystyle z\in F}$ such that ${\displaystyle z\leq x}$ and ${\displaystyle z\leq y.}$
3. ${\displaystyle F}$ is an upper set or upward-closed: For every ${\displaystyle x\in F}$ and ${\displaystyle p\in P,}$ ${\displaystyle x\leq p}$ implies that ${\displaystyle p\in F.}$

${\displaystyle F}$ is said to be a proper filter if in addition ${\displaystyle F}$ is not equal to the whole set ${\displaystyle P.}$ Depending on the author, the term filter is either a synonym of order filter or else it refers to a proper order filter. This article uses the term filter to mean order filter.

While the above definition is the most general way to define a filter for arbitrary posets, it was originally defined for lattices only. In this case, the above definition can be characterized by the following equivalent statement: A subset ${\displaystyle F}$ of a lattice ${\displaystyle (P,\leq )}$ is a filter, if and only if it is a non-empty upper set that is closed under finite infima (or meets), that is, for all ${\displaystyle x,y\in F,}$ it is also the case that ${\displaystyle x\wedge y\in F.}$[4] A subset ${\displaystyle S}$ of ${\displaystyle F}$ is a filter basis if the upper set generated by ${\displaystyle S}$ is all of ${\displaystyle F.}$ Note that every filter is its own basis.

The smallest filter that contains a given element ${\displaystyle p\in P}$ is a principal filter and ${\displaystyle p}$ is a principal element in this situation. The principal filter for ${\displaystyle p}$ is just given by the set ${\displaystyle \{x\in P:p\leq x\}}$ and is denoted by prefixing ${\displaystyle p}$ with an upward arrow: ${\displaystyle \uparrow p.}$

The dual notion of a filter, that is, the concept obtained by reversing all ${\displaystyle \,\leq \,}$ and exchanging ${\displaystyle \,\wedge \,}$ with ${\displaystyle \,\vee ,}$ is ideal. Because of this duality, the discussion of filters usually boils down to the discussion of ideals. Hence, most additional information on this topic (including the definition of maximal filters and prime filters) is to be found in the article on ideals. There is a separate article on ultrafilters.

Applying these definitions to the case where ${\displaystyle X}$ is a vector space and ${\displaystyle P}$ is the set of all vector subspaces of ${\displaystyle X}$ ordered by inclusion ${\displaystyle \,\subseteq \,}$ gives rise to the notion of linear filters and linear ultrafilters. Explicitly, a linear filter on a vector space ${\displaystyle X}$ is a family ${\displaystyle {\mathcal {B}}}$ of vector subspaces of ${\displaystyle X}$ such that if ${\displaystyle A,B\in {\mathcal {B}}}$ and if ${\displaystyle C}$ is a vector subspace of ${\displaystyle X}$ that contains ${\displaystyle A,}$ then ${\displaystyle A\cap B,C\in {\mathcal {B}}.}$[5] A linear filter is called proper if it does not contain ${\displaystyle \{0\};}$ a linear ultrafilter on ${\displaystyle X}$ is a maximal proper linear filter on ${\displaystyle X.}$[5]

## Filter on a set

### Definition of a filter

There are two competing definitions of a "filter on a set", both of which require that a filter be a dual ideal.[6] One definition defines "filter" as a synonym of "dual ideal" while the other defines "filter" to mean a dual ideal that is also proper.

Warning: It is recommended that readers always check how "filter" is defined when reading mathematical literature.

A dual ideal[6] on a set ${\displaystyle S}$ is a non-empty subset ${\displaystyle F}$ of ${\displaystyle \wp (S)}$ with the following properties:

1. ${\displaystyle F}$ is closed under finite intersections: If ${\displaystyle A,B\in F,}$ then so is their intersection.
• This property implies that if ${\displaystyle \varnothing \not \in F}$ then ${\displaystyle F}$ has the finite intersection property.
2. ${\displaystyle F}$ is upward closed/isotone:[7] If ${\displaystyle A\in F}$ and ${\displaystyle A\subseteq B,}$ then ${\displaystyle B\in F,}$ for all subsets ${\displaystyle B\subseteq S.}$
• This property entails that ${\displaystyle S\in F}$ (since ${\displaystyle F}$ is a non-empty subset of ${\displaystyle \wp (S)}$).

Given a set ${\displaystyle S,}$ a canonical partial ordering ${\displaystyle \,\subseteq \,}$ can be defined on the powerset ${\displaystyle \wp (S)}$ by subset inclusion, turning ${\displaystyle (\wp (S),\subseteq )}$ into a lattice. A "dual ideal" is just a filter with respect to this partial ordering. Note that if ${\displaystyle S=\varnothing }$ then there is exactly one dual ideal on ${\displaystyle S,}$ which is ${\displaystyle \wp (S)=\{\varnothing \}.}$

A filter on a set may be thought of as representing a "collection of large subsets".[8]

#### Filter definitions

The article uses the following definition of "filter on a set".

Definition as a dual ideal: A filter on a set ${\displaystyle S}$ is a dual ideal on ${\displaystyle S.}$ Equivalently, a filter on ${\displaystyle S}$ is just a filter with respect the canonical partial ordering ${\displaystyle (\wp (S),\subseteq )}$ described above.

The other definition of "filter on a set" is the original definition of a "filter" given by Henri Cartan, which required that a filter on a set be a dual ideal that does not contain the empty set.

Original/Alternative definition as a proper dual ideal: A filter[6] on a set ${\displaystyle S}$ is a dual ideal on ${\displaystyle S}$ with the following additional property:

1. ${\displaystyle F}$ is proper[9]/non-degenerate:[10] The empty set is not in ${\displaystyle F}$ (i.e. ${\displaystyle \varnothing \not \in F}$).

The only non-proper filter on ${\displaystyle S}$ is ${\displaystyle \wp (S).}$ Much mathematical literature, especially that related to topology, defines "filter" to mean a non-degenerate dual ideal.

### Filter bases, subbases, and comparison

Filter bases and subbases

A subset ${\displaystyle B}$ of ${\displaystyle \wp (S)}$ is called a prefilter, filter base, or filter basis if ${\displaystyle B}$ is non-empty and the intersection of any two members of ${\displaystyle B}$ is a superset of some member(s) of ${\displaystyle B.}$ If the empty set is not a member of ${\displaystyle B,}$ we say ${\displaystyle B}$ is a proper filter base.

Given a filter base ${\displaystyle B,}$ the filter generated or spanned by ${\displaystyle B}$ is defined as the minimum filter containing ${\displaystyle B.}$ It is the family of all those subsets of ${\displaystyle S}$ which are supersets of some member(s) of ${\displaystyle B.}$ Every filter is also a filter base, so the process of passing from filter base to filter may be viewed as a sort of completion.

For every subset ${\displaystyle T}$ of ${\displaystyle \wp (S)}$ there is a smallest (possibly non-proper) filter ${\displaystyle F}$ containing ${\displaystyle T,}$ called the filter generated or spanned by ${\displaystyle T.}$ Similarly as for a filter spanned by a filter base, a filter spanned by a subset ${\displaystyle T}$ is the minimum filter containing ${\displaystyle T.}$ It is constructed by taking all finite intersections of ${\displaystyle T,}$ which then form a filter base for ${\displaystyle F.}$ This filter is proper if and only if every finite intersection of elements of ${\displaystyle T}$ is non-empty, and in that case we say that ${\displaystyle T}$ is a filter subbase.

Finer/equivalent filter bases

If ${\displaystyle B}$ and ${\displaystyle C}$ are two filter bases on ${\displaystyle S,}$ one says ${\displaystyle C}$ is finer than ${\displaystyle B}$ (or that ${\displaystyle C}$ is a refinement of ${\displaystyle B}$) if for each ${\displaystyle B_{0}\in B,}$ there is a ${\displaystyle C_{0}\in C}$ such that ${\displaystyle C_{0}\subseteq B_{0}.}$ For filter bases ${\displaystyle A,}$ ${\displaystyle B,}$ and ${\displaystyle C,}$ if ${\displaystyle A}$ is finer than ${\displaystyle B}$ and ${\displaystyle B}$ is finer than ${\displaystyle C}$ then ${\displaystyle A}$ is finer than ${\displaystyle C.}$ Thus the refinement relation is a preorder on the set of filter bases, and the passage from filter base to filter is an instance of passing from a preordering to the associated partial ordering.

If also ${\displaystyle B}$ is finer than ${\displaystyle C,}$ one says that they are equivalent filter bases. If ${\displaystyle B}$ and ${\displaystyle C}$ are filter bases, then ${\displaystyle C}$ is finer than ${\displaystyle B}$ if and only if the filter spanned by ${\displaystyle C}$ contains the filter spanned by ${\displaystyle B.}$ Therefore, ${\displaystyle B}$ and ${\displaystyle C}$ are equivalent filter bases if and only if they generate the same filter.

### Examples

See the image at the top of this article for a simple example of filters on a finite set ${\displaystyle \wp (\{1,2,3,4\})}$ partially ordered by set inclusion.

A filter in a poset can be created using the Rasiowa–Sikorski lemma, which is often used in forcing. Other filters include club filters and generic filters.

The set ${\displaystyle \{\{N,N+1,N+2,\dots \}:N\in \mathbb {N} \}}$ is called a filter base of tails of the sequence of natural numbers ${\displaystyle (1,2,3,\dots ).}$ A filter base of tails can be made of any net ${\displaystyle \left(x_{\alpha }\right)_{\alpha \in A}}$ using the construction ${\displaystyle \left\{\left\{x_{\alpha }:\alpha \in A,\alpha _{0}\leq \alpha \right\}:\alpha _{0}\in A\right\},}$ where the filter that this filter base generates is called the net's eventuality filter. Therefore, all nets generate a filter base (and therefore a filter). Since all sequences are nets, this holds for sequences as well.

Let ${\displaystyle S}$ be a set and ${\displaystyle C}$ be a non-empty subset of ${\displaystyle S.}$ Then ${\displaystyle \{C\}}$is a filter base. The filter it generates (that is, the collection of all subsets containing ${\displaystyle C}$) is called the principal filter generated by ${\displaystyle C.}$ A filter is said to be a free filter if the intersection of all of its members is empty. A proper principal filter is not free. Since the intersection of any finite number of members of a filter is also a member, no proper filter on a finite set is free, and indeed is the principal filter generated by the common intersection of all of its members. A nonprincipal filter on an infinite set is not necessarily free. The Fréchet filter on an infinite set ${\displaystyle S}$ is the set of all subsets of ${\displaystyle S}$ that have finite complement. A filter on ${\displaystyle S}$ is free if and only if it includes the Fréchet filter. More generally, if ${\displaystyle (X,\mu )}$ is a measure space for which ${\displaystyle \mu (X)=\infty ,}$ the collection of all ${\displaystyle A\subseteq X}$ such that ${\displaystyle \mu (X\smallsetminus A)<\infty }$ forms a filter. The Fréchet filter is the case where ${\displaystyle X=S}$ and ${\displaystyle \mu }$ is the counting measure.

Every uniform structure on a set ${\displaystyle X}$ is a filter on ${\displaystyle X\times X.}$

## Filters in model theory

For every filter ${\displaystyle F}$ on a set ${\displaystyle S}$ the set function defined by

${\displaystyle m(A)\quad ={\begin{cases}1&{\text{if }}A\in F\\0&{\text{if }}S\smallsetminus A\in F\\{\text{is undefined}}&{\text{otherwise}}\end{cases}}}$
is finitely additive — a "measure" if that term is construed rather loosely. Therefore, the statement
${\displaystyle \left\{\,x\in S:\varphi (x)\,\right\}\in F}$
can be considered somewhat analogous to the statement that ${\displaystyle \varphi }$ holds "almost everywhere". That interpretation of membership in a filter is used (for motivation, although it is not needed for actual proofs) in the theory of ultraproducts in model theory, a branch of mathematical logic.

## Filters in topology

In topology and analysis, filters are used to define convergence in a manner similar to the role of sequences in a metric space. Both nets and filters provide very general contexts to unify the various notions of limit to arbitrary topological spaces. A sequence is usually indexed by the natural numbers ${\displaystyle \mathbb {N} ,}$ which are a totally ordered set. Nets generalize the notion of a sequence by requiring the index set simply be a directed set. If working only with certain categories of topological spaces, such as first-countable spaces for instance, sequences suffice to characterize most topological properties, but this is not true in general. However, filters (as well as nets) do always suffice to characterize most topological properties. An advantage to using filters is that they do not involve any set other than ${\displaystyle X}$ (and its subsets) whereas sequences and nets rely on directed sets that may be unrelated to ${\displaystyle X.}$ Moreover, the set of all filters on ${\displaystyle X}$ is a set whereas the class of all nets valued in ${\displaystyle X}$ is not (it is a proper class).

Neighbourhood bases

Let ${\displaystyle {\mathcal {N}}_{x}}$ be the neighbourhood filter at point ${\displaystyle x}$ in a topological space ${\displaystyle X.}$ This means that ${\displaystyle {\mathcal {N}}_{x}}$ is the set of all topological neighbourhoods of the point ${\displaystyle x.}$ It can be verified that ${\displaystyle {\mathcal {N}}_{x}}$ is a filter. A neighbourhood system is another name for a neighbourhood filter. A family ${\displaystyle {\mathcal {N}}}$ of neighbourhoods of ${\displaystyle x}$ is a neighbourhood base at ${\displaystyle x}$ if ${\displaystyle {\mathcal {N}}}$ generates the filter ${\displaystyle {\mathcal {N}}_{x}.}$ This means that each subset ${\displaystyle S}$ of ${\displaystyle X}$ is a neighbourhood of ${\displaystyle x}$ if and only if there exists ${\displaystyle N\in {\mathcal {N}}}$ such that ${\displaystyle N\subseteq S.}$

Convergent filters and cluster points

We say that a filter base ${\displaystyle B}$ converges to a point ${\displaystyle x,}$ written ${\displaystyle B\to x,}$ if the neighbourhood filter ${\displaystyle {\mathcal {N}}_{x}}$ is contained in the filter ${\displaystyle F}$ generated by ${\displaystyle B;}$ that is, if ${\displaystyle B}$ is finer than ${\displaystyle {\mathcal {N}}_{x}.}$ In particular, a filter ${\displaystyle F}$ (which is a filter base that generates itself) converges to ${\displaystyle x}$ if ${\displaystyle {\mathcal {N}}_{x}\subseteq F.}$ Explicitly, to say that a filter base ${\displaystyle B}$ converges to ${\displaystyle x}$ means that for every neighbourhood ${\displaystyle U}$ of ${\displaystyle x,}$ there is a ${\displaystyle B_{0}\in B}$ such that ${\displaystyle B_{0}\subseteq U.}$ If a filter base ${\displaystyle B}$ converges to a point ${\displaystyle x,}$ then ${\displaystyle x}$ is called a limit (point) of ${\displaystyle B}$ and ${\displaystyle B}$ is called a convergent filter base.

A filter base ${\displaystyle B}$ on ${\displaystyle X}$ is said to cluster at ${\displaystyle x}$ (or have ${\displaystyle x}$ as a cluster point) if and only if each element of ${\displaystyle B}$ has non-empty intersection with each neighbourhood of ${\displaystyle x.}$ Every limit point is a cluster point but the converse is not true in general. However, every cluster point of an ultrafilter is a limit point.

By definition, every neighbourhood base ${\displaystyle {\mathcal {N}}}$ at a given point ${\displaystyle x}$ generates ${\displaystyle {\mathcal {N}}_{x},}$ so ${\displaystyle {\mathcal {N}}}$ converges to ${\displaystyle x.}$ If ${\displaystyle C}$ is a filter base on ${\displaystyle X}$ then ${\displaystyle C\to x}$ if ${\displaystyle C}$ is finer than any neighbourhood base at ${\displaystyle x.}$ For the neighborhood filter at that point, the converse holds as well: any basis of a convergent filter refines the neighborhood filter.

## Notes

1. ^
2. ^
3. ^ Igarashi, Ayumi; Zwicker, William S. (16 February 2021). "Fair division of graphs and of tangled cakes". arXiv:2102.08560 [math.CO].
4. ^ Davey, B. A.; Priestley, H. A. (1990). Introduction to Lattices and Order. Cambridge Mathematical Textbooks. Cambridge University Press. p. 184.
5. ^ a b
6. ^ a b c Dugundji 1966, pp. 211–213.
7. ^ Dolecki & Mynard 2016, pp. 27–29.
8. ^
9. ^ Goldblatt, R. Lectures on the Hyperreals: an Introduction to Nonstandard Analysis. p. 32.
10. ^ Narici & Beckenstein 2011, pp. 2–7.