A subset $F$ of a poset $L$ is called a filter if it is upward-closed and downward-directed; that is:
Sometimes the term ‘filter’ is used for an upper set, that is any set satisfying axiom (1). (Ultimately this connects with the use of ‘ideal’ in monoid theory.)
In a lattice, one can use these alternative axioms:
Here, (1) is equivalent to the previous version; the others, which here say that the lattice is closed under finite meets, are equivalent given (1). (These axioms look more like the axioms for an ideal of a ring.)
You can also interpret these axioms to say that, if you think of $F$ as a function from $L$ to the set $TV$ of truth values, then $F$ is a homomorphism of meet-semilattices.
A filter of subsets of a given set $S$ is a filter in the power set of $S$. One also sees filters of open subsets, filters of compact subsets, etc, especially in topology.
A filter $F$ is proper if there exists an element $A$ of $L$ such that $A \notin F$. A filter in a lattice is proper iff $\bot \notin F$; in particular, a filter of subsets of $S$ is proper iff $\empty \notin F$. In constructive mathematics, however, one usually wants a stronger (but classically equivalent) notion: a filter $F$ of subsets of $S$ is proper if every element of $F$ is inhabited. If $A \in F$ for every $A$ (in particular if $\empty \in F$), then we have the improper filter. Compare proper subset and improper subset.
Filters are often assumed to be proper by default in analysis and topology, where proper filters correspond to nets. However, we will try to remember to include the adjective ‘proper’.
If the complement of a filter is an ideal, then we say that the filter is prime (and equivalently that the ideal is prime). A prime filter is necessarily proper; a proper filter in a lattice is prime iff, whenever $A \vee B \in F$, either $A \in F$ or $B \in F$. In other words, $F: L \to TV$ must be a homomorphism of lattices. The generalisation to arbitrary joins gives a completely prime filter.
A filter is an ultrafilter, or maximal filter, if it is maximal among the proper filters. (See that article for alternative formulations and applications.) In a distributive lattice, every ultrafilter is prime; the converse holds in a Boolean lattice. In this case, we can say that $F: L \to TV$ is a homomorphism of Boolean lattices.
Given an element $x$ of $S$, the principal ultrafilter (of subsets of $S$) at $x$ consists of every subset of $S$ to which $x$ belongs. A principal ultrafilter is also called a fixed ultrafilter; more generally, a filter of subsets is fixed if its intersection is inhabited. In contrast, if $F$ is an filter whose meet (of all elements) exists and is a bottom element (the empty set for a filter of subsets), then we call $F$ free.
Free ultrafilters on Boolean algebras are important in nonstandard analysis and model theory.
A subset $F$ of a lattice $L$ is a filterbase if it becomes a filter when closed under axiom (1). Equivalently, a filterbase is any downward-directed subset. Any subset of a meet-semilattice may be used as a filter subbase; form a filterbase by closing under finite meets.
A filterbase $F$ of sets is proper (that is, it generates a proper filter of sets) iff each set in $F$ is inhabited. A filter subbase of sets is proper iff it satisfies the finite intersection property (well known in topology from a criterion for compact spaces): every finite collection from the subfilter has inhabited intersection.
If $f:L_1\to L_2$ is a monotone? map and $F\subseteq L_1$ a filter, then $\lbrace f(A) \mid A\in F\rbrace\subseteq L_2$ is a filter base. Let $f_\ast(F)$ be the filter generated by this filter base. The set of filters $Filters(L)$ is a poset in its own right w.r.t. inclusion and $f_\ast: (Filters(L_1),\subseteq)\to(Filters(L_2),\subseteq)$ is monotone. Therefore $L\mapsto Filters(L), f\mapsto f_\ast$ is a functor from the category of posets to itself.
If $f$ satisfies stronger properties than mere monotony, then $f_\ast$ will be better behaved as well:
If $L$ is a meet-semilattice, then $Filters(L)$ is a complete join-semilattice: $\bigvee_{i\in I} F_i = \left\langle \bigwedge_{j\in J} A_j \mid J\subseteq I\text{ finite}, A_j\in F_j\right\rangle$. If $f:L_1\to L_2$ respects finite meets, then $f_\ast$ respects all joins. If $f$ is merely monotone, then $f_\ast$ respects all filtered joins.
If $L$ has all $|I|$-fold joins for some indexing set $I$, then $Filters(L)$ has $|I|$-fold meets: $\bigwedge_{i\in I} F_i = \lbrace \bigvee_{i\in I} A_i \mid A_i\in F_i\rbrace$. If $f$ respects $|I|$-fold joins, then $f_\ast$ respects $|I|$-fold meets.
If $L$ is a distributive lattice, then $Filters(L)$ is a frame, i.e. the infinite distributive law $F \wedge \bigvee_{i\in I} G_i = \bigvee_{i\in I} (F\wedge G_i)$ holds. The other distributive law also holds for finite meets: $F \vee \bigwedge_{i\in I} G_i = \bigwedge_{i\in I} (F\vee G_i)$ if $I$ is finite. It holds more generally if $L$ has all $|I|$-fold meets, the $|I|$-fold distributive law $A\wedge \bigvee_{i\in I} B_i = \bigvee_{i\in I} (A\wedge B_i)$ holds in $L$ and $F$ is closed under $|I|$-fold meets.
If $L$ is a complete join-semilattice, then $Filters(L)$ is a complete lattice. If $f$ respects all joins, then $f_\ast$ respects all meets. In this case $f_\ast$ has a left adjoint $f^\ast: L_2\to L_1$ which is given by $f^\ast(G) = \bigwedge \lbrace F | G\subseteq f_\ast(F)\rbrace$ so that $f^\ast(G)\subseteq F \iff G\subseteq f_\ast(F)$ holds. As a left adjoint $f^\ast$ respects all joins.
If $(f,g)$ is an adjoint pair between $L_1$ and $L_2$, that is f$: L_1 \to L_2$, $g: L_2\to L_1$ monotone and $f(x) \leq y \iff x\leq g(y)$ for all $x\in L_1$, $y\in L_2$, then $(g_\ast,f_\ast)$ is an adjoint pair between $Filters(L_2)$ and $Filters(L_1)$. Note that the push-forward turns left adjoints into right adjoint and vice versa.
Every net $\nu: I \to S$ defines an eventuality filter $E_\nu$: let $A$ belong to $E_\nu$ if, for some index $k$, for every $l \geq k$, $\nu_l \in A$. (That is, $\nu$ is eventually in $A$.) Note that $E_\nu$ is proper; conversely, any proper filter $F$ has a net whose eventuality filter is $F$ (as described at net). Everything below can be done for nets as well as for (proper) filters, but filters often lead to a cleaner theory.
In a topological space $S$, a filter $F$ on $S$ converges to a point $x$ of $S$ if every neighbourhood of $x$ belongs to $F$. A filter $F$ clusters at a point $x$ if every neighbourhood of $x$ intersects every element of $F$. With these definitions, the improper filter converges to every point and clusters at no point; a proper filter, however, clusters at every point that it converges to.
The concepts of continuous function and such conditions as compactness and Hausdorffness may be defined quite nicely in terms of the convergence relation. In fact, everything about topological spaces may be defined in terms of the convergence relation, although not always nicely. This is because topological spaces form a full subcategory of the category of convergence spaces, where the convergence relation is the fundamental concept. More details are there.
In a metric space $S$, a filter $F$ on $S$ is Cauchy if it has elements of arbitrarily small diameter. Then a sequence is a Cauchy sequence iff its eventuality filter is Cauchy. (This can be generalised to uniform spaces.) The concept of completion of a metric space may be defined quite nicely in terms of the Cauchy filters, although not every property (not even every uniform property) of metric spaces can be defined in this way. As for convergence, there is a general notion of Cauchy space, but the forgetful functors from metric and uniform spaces are now not full.