# Filter (mathematics)

In mathematics, a filter or order filter is a special subset of a partially ordered set (poset), describing "large" or "eventual" elements. Filters appear in order and lattice theory, but also topology, whence they originate. The notion dual to a filter is an order ideal.
Special cases of filters include ultrafilters, which are filters that cannot be enlarged, and describe nonconstructive techniques in mathematical logic.
Filters on sets were introduced by Henri Cartan in 1937. Nicolas Bourbaki, in their book Topologie Générale, popularized filters as an alternative to E. H. Moore and Herman L. Smith's 1922 notion of a net; order filters generalize this notion from the specific case of a power set under inclusion to arbitrary partially ordered sets. Nevertheless, the theory of power-set filters retains interest in its own right, in part for substantial applications in topology.

## Motivation

Fix a partially ordered set (poset) P. Intuitively, a filter F is a subset of P whose members are elements large enough to satisfy some criterion. For instance, if x ∈ P, then the set of elements above x is a filter, called the principal filter at x. (If x and y are incomparable elements of P, then neither the principal filter at x nor y is contained in the other.)
Similarly, a filter on a set S contains those subsets that are sufficiently large to contain some given thing. For example, if S is the real line and x ∈ S, then the family of sets including x in their interior is a filter, called the neighborhood filter at x. The thing in this case is slightly larger than x, but it still does not contain any other specific point of the line.
The above considerations motivate the upward closure requirement in the definition below: "large enough" objects can always be made larger.
To understand the other two conditions, reverse the roles and instead consider F as a "locating scheme" to find x. In this interpretation, one searches in some space X, and expects F to describe those subsets of X that contain the goal. The goal must be located somewhere; thus the empty set ∅ can never be in F. And if two subsets both contain the goal, then should "zoom in" to their common region.
An ultrafilter describes a "perfect locating scheme" where each scheme component gives new information (either "look here" or "look elsewhere"). Compactness is the property that "every search is fruitful," or, to put it another way, "every locating scheme ends in a search result."
A common use for a filter is to define properties that are satisfied by "generic" elements of some topological space. This application generalizes the "locating scheme" to find points that might be hard to write down explicitly.

## Definition

A subset F of a partially ordered set (P, ≤) is a filter or dual ideal if the following are satisfied:

### Nontriviality

    The set F is non-empty.

### Downward directed

    For every x, y ∈ F, there is some z ∈ F such that z ≤ x and z ≤ y.

### Upward closure

    For every x ∈ F and p ∈ P, the condition x ≤ p implies p ∈ F.
If, additionally, F ≠ P, then F is said to be a proper filter. Authors in set theory and mathematical logic often require all filters to be proper; this article will eschew that convention. An ultrafilter is a proper filter contained in no other proper filter except itself.

### Filter bases

A subset S of F is a base or basis for F if the upper set generated by S (i.e., the smallest upwards-closed set containing S) is equal to F. Since every filter is upwards-closed, every filter is a base for itself.
Moreover, if B ⊆ P is nonempty and downward directed, then B generates an upper set F that is a filter (for which B is a base). Such sets are called prefilters, as well as the aforementioned filter base/basis, and F is said to be generated or spanned by B. A prefilter is proper if and only if it generates a proper filter.
Given p ∈ P, the set {x : p ≤ x} is the smallest filter containing p, and sometimes written ↑ p. Such a filter is called a principal filter; p is said to be the principal element of F, or generate F.

#### Refinement

Suppose B and C are two prefilters on P, and, for each c ∈ C, there is a b ∈ B, such that b ≤ c. Then we say that B is finer than (or refines) C; likewise, C is coarser than (or coarsens) B. Refinement is a preorder on the set of prefilters. In fact, if C also refines B, then B and C are called equivalent, for they generate the same filter. Thus passage from prefilter to filter is an instance of passing from a preordering to associated partial ordering.

## Special cases

Historically, filters generalized to order-theoretic lattices before arbitrary partial orders. In the case of lattices, downward direction can be written as closure under finite meets: for all x, y ∈ F, one has x ∧ y ∈ F.

### Linear filters

A linear (ultra)filter is an (ultra)filter on the lattice of vector subspaces of a given vector space, ordered by inclusion. Explicitly, a linear filter on a vector space X is a family B of vector subspaces of X such that if A, B ∈ B and C is a vector subspace of X that contains A, then A ∩ B ∈ B and C ∈ B.
A linear filter is proper if it does not contain {0}.

### Filters on a set; subbases

Families ${\mathcal {F}}$ of sets over $\Omega$ vte :
| Is necessarily true of ${\mathcal {F}}\colon$ or, is ${\mathcal {F}}$ closed under: | Directed by $\,\supseteq$ | $A\cap B$ | $A\cup B$ | $B\setminus A$ | $\Omega \setminus A$ | $A_{1}\cap A_{2}\cap \cdots$ | $A_{1}\cup A_{2}\cup \cdots$ | $\Omega \in {\mathcal {F}}$ | $\varnothing \in {\mathcal {F}}$ | F.I.P. |
| π-system | | | | | | | | | | |
| Semiring | | | | | | | | | | Never |
| Semialgebra (Semifield) | | | | | | | | | | Never |
| Monotone class | | | | | | only if $A_{i}\searrow$ | only if $A_{i}\nearrow$ | | | |
| 𝜆-system (Dynkin System) | | | | only if $A\subseteq B$ | | | only if $A_{i}\nearrow$ or they are disjoint | | | Never |
| Ring (Order theory) | | | | | | | | | | |
| Ring (Measure theory) | | | | | | | | | | Never |
| δ-Ring | | | | | | | | | | Never |
| 𝜎-Ring | | | | | | | | | | Never |
| Algebra (Field) | | | | | | | | | | Never |
| 𝜎-Algebra (𝜎-Field) | | | | | | | | | | Never |
| Dual ideal | | | | | | | | | | |
| Filter | | | | Never | Never | | | | $\varnothing \not \in {\mathcal {F}}$ | |
| Prefilter (Filter base) | | | | Never | Never | | | | $\varnothing \not \in {\mathcal {F}}$ | |
| Filter subbase | | | | Never | Never | | | | $\varnothing \not \in {\mathcal {F}}$ | |
| Open Topology | | | | | | | (even arbitrary $\cup$) | | | Never |
| Closed Topology | | | | | | (even arbitrary $\cap$) | | | | Never |
| Is necessarily true of ${\mathcal {F}}\colon$ or, is ${\mathcal {F}}$ closed under: | directed downward | finite intersections | finite unions | relative complements | complements in $\Omega$ | countable intersections | countable unions | contains $\Omega$ | contains $\varnothing$ | Finite Intersection Property |
| Additionally, a semiring is a π-system where every complement $B\setminus A$ is equal to a finite disjoint union of sets in ${\mathcal {F}}.$ A semialgebra is a semiring where every complement $\Omega \setminus A$ is equal to a finite disjoint union of sets in ${\mathcal {F}}.$ $A,B,A_{1},A_{2},\ldots$ are arbitrary elements of ${\mathcal {F}}$ and it is assumed that ${\mathcal {F}}\neq \varnothing .$ |||||||||||
Given a set S, the power set P(S) is partially ordered by set inclusion; filters on this poset are often just called "filters on S," in an abuse of terminology. For such posets, downward direction and upward closure reduce to:

#### Closure under finite intersections

    If A, B ∈ F, then so too is A ∩ B ∈ F.

#### Isotony

    If A ∈ F and A ⊆ B ⊆ S, then B ∈ F.
A proper/non-degenerate filter is one that does not contain ∅, and these three conditions (including non-degeneracy) are Henri Cartan's original definition of a filter. It is common — though not universal — to require filters on sets to be proper (whatever one's stance on poset filters); we shall again eschew this convention.
Prefilters on a set are proper if and only if they do not contain ∅ either.
For every subset T of P(S), there is a smallest filter F containing T. As with prefilters, T is said to generate or span F; a base for F is the set U of all finite intersections of T. The set T is said to be a filter subbase when F (and thus U) is proper.
Proper filters on sets have the finite intersection property.
If S = ∅, then S admits only the improper filter {∅}.

#### Free filters

A filter is said to be a free filter if the intersection 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. But a nonprincipal filter on an infinite set is not necessarily free: a filter is free if and only if it includes the Fréchet filter (see § Examples).

## Examples

See the image at the top of this article for a simple example of filters on the finite poset P({1, 2, 3, 4}).
Partially order ℝ → ℝ, the space of real-valued functions on ℝ, by pointwise comparison. Then the set of functions "large at infinity,"$\left\{f:\lim _{x\to \pm \infty }{f(x)}=\infty \right\}{\text{,}}$is a filter on ℝ → ℝ. One can generalize this construction quite far by compactifying the domain and completing the codomain: if X is a set with distinguished subset S and Y is a poset with distinguished element m, then {f : f |$_S$ ≥ m} is a filter in X → Y.
The set {{k : k ≥ N} : N ∈ ℕ} is a filter in P(ℕ). More generally, if D is any directed set, then$\{\{k:k\geq N\}:N\in D\}$is a filter in P(D), called the tail filter. Likewise any net {x$_α$}$_{α∈Α}$ generates the eventuality filter {{x$_β$ : α ≤ β} : α ∈ Α}. A tail filter is the eventuality filter for x$_α$ = α.
The Fréchet filter on an infinite set X is$\{A:X\setminus A{\text{ finite}}\}{\text{.}}$If (X, μ) is a measure space, then the collection {A : μ(X ∖ A) = 0} is a filter. If μ(X) = ∞, then {A : μ(X ∖ A) < ∞} is also a filter; the Fréchet filter is the case where μ is counting measure.
Given an ordinal a, a subset of a is called a club if it is closed in the order topology of a but has net-theoretic limit a. The clubs of a form a filter: the club filter, ♣(a).
The previous construction generalizes as follows: any club C is also a collection of dense subsets (in the ordinal topology) of a, and ♣(a) meets each element of C. Replacing C with an arbitrary collection C̃ of dense sets, there "typically" exists a filter meeting each element of C̃, called a generic filter. For countable C̃, the Rasiowa–Sikorski lemma implies that such a filter must exist; for "small" uncountable C̃, the existence of such a filter can be forced through Martin's axiom.
Let P denote the set of partial orders of limited cardinality, modulo isomorphism. Partially order P by:
    A ≤ B if there exists a strictly increasing f : A → B.
Then the subset of non-atomic partial orders forms a filter. Likewise, if I is the set of injective modules over some given commutative ring, of limited cardinality, modulo isomorphism, then a partial order on I is:
    A ≤ B if there exists an injective linear map f : A → B.
Given any infinite cardinal κ, the modules in I that cannot be generated by fewer than κ elements form a filter.
Every uniform structure on a set X is a filter on X × X.

## Relationship to ideals

The dual notion to a filter — that is, the concept obtained by reversing all ≤ and exchanging ∧ with ∨ — is an order ideal. Because of this duality, any question of filters can be mechanically translated to a question about ideals and vice versa; in particular, a prime or maximal filter is a filter whose corresponding ideal is (respectively) prime or maximal.
A filter is an ultrafilter if and only if the corresponding ideal is minimal.

## In model theory

For every filter F on a set S, the set function defined by$m(A)={\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. Moreover, the measures so constructed are defined everywhere if F is an ultrafilter. Therefore, the statement$\left\{\,x\in S:\varphi (x)\,\right\}\in F$can be considered somewhat analogous to the statement that φ holds "almost everywhere." That interpretation of membership in a filter is used (for motivation, not actual proofs) in the theory of ultraproducts in model theory, a branch of mathematical logic.

## In topology

In general topology and analysis, filters are used to define convergence in a manner similar to the role of sequences in a metric space. They unify the concept of a limit across the wide variety of arbitrary topological spaces.
To understand the need for filters, begin with the equivalent concept of a net. A sequence is usually indexed by the natural numbers ℕ, which are a totally ordered set. Nets generalize the notion of a sequence by replacing ℕ with an arbitrary directed set. In certain categories of topological spaces, such as first-countable spaces, sequences characterize most topological properties, but this is not true in general. However, nets — as well as filters — always do characterize those topological properties.
Filters do not involve any set external to the topological space X, whereas sequences and nets rely on other directed sets. For this reason, the collection of all filters on X is always a set, whereas the collection of all X-valued nets is a proper class.

### Neighborhood bases

Any point x in the topological space X defines a neighborhood filter or system N$_x$: namely, the family of all sets containing x in their interior. A set N of neighborhoods of x is a neighborhood base at x if N generates N$_x$. Equivalently, S ⊆ X is a neighborhood of x if and only if there exists N ∈ N such that N ⊆ S.

#### Convergent filters and cluster points

A prefilter B converges to a point x, written B → x, if and only if B generates a filter F that contains the neighborhood filter N$_x$ — explicitly, for every neighborhood U of x, there is some V ∈ B such that V ⊆ U. Less explicitly, B → x if and only if B refines N$_x$, and any neighborhood base at x can replace N$_x$ in this condition. Clearly, every neighborhood base at x converges to x.
A filter F (which generates itself) converges to x if N$_x$ ⊆ F. The above can also be reversed to characterize the neighborhood filter N$_x$: N$_x$ is the finest filter coarser than each filter converging to x.
If B → x, then x is called a limit (point) of B. The prefilter B is said to cluster at x (or have x as a cluster point) if and only if each element of B has non-empty intersection with each neighborhood of 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.