In the mathematical field of general topology, a meagre set (also called a meager set or a set of first category) is a subset of a topological space that is small or negligible in a precise sense detailed below. A set that is not meagre is called nonmeagre, or of the second category. See below for definitions of other related terms.
The meagre subsets of a fixed space form a σ-ideal of subsets; that is, any subset of a meagre set is meagre, and the union of countably many meagre sets is meagre.
Meagre sets play an important role in the formulation of the notion of Baire space and of the Baire category theorem, which is used in the proof of several fundamental results of functional analysis.
Throughout, will be a topological space.
The definition of meagre set uses the notion of a nowhere dense subset of that is, a subset of whose closure has empty interior. See the corresponding article for more details.
A subset of is called meagre in a meagre subset of or of the first category in if it is a countable union of nowhere dense subsets of . Otherwise, the subset is called nonmeagre in a nonmeagre subset of or of the second category in  The qualifier "in " can be omitted if the ambient space is fixed and understood from context.
A topological space is called meagre (respectively, nonmeagre) if it is a meagre (respectively, nonmeagre) subset of itself.
A subset of is called comeagre in or residual in if its complement is meagre in . (This use of the prefix "co" is consistent with its use in other terms such as "cofinite".) A subset is comeagre in if and only if it is equal to a countable intersection of sets, each of whose interior is dense in
Remarks on terminology
The notions of nonmeagre and comeagre should not be confused. If the space is meagre, every subset is both meagre and comeagre, and there are no nonmeagre sets. If the space is nonmeager, no set is at the same time meagre and comeager, every comeagre set is nonmeagre, and there can be nonmeagre sets that are not comeagre, that is, with nonmeagre complement. See the Examples section below.
As an additional point of terminology, if a subset of a topological space is given the subspace topology induced from , one can talk about it being a meagre space, namely being a meagre subset of itself (when considered as a topological space in its own right). In this case can also be called a meagre subspace of , meaning a meagre space when given the subspace topology. Importantly, this is not the same as being meagre in the whole space . (See the Properties and Examples sections below for the relationship between the two.) Similarly, a nonmeagre subspace will be a set that is nonmeagre in itself, which is not the same as being nonmeagre in the whole space. Be aware however that in the context of topological vector spaces some authors may use the phrase "meagre/nonmeagre subspace" to mean a vector subspace that is a meagre/nonmeagre set relative to the whole space.
The terms first category and second category were the original ones used by René Baire in his thesis of 1899. The meagre terminology was introduced by Bourbaki in 1948.
The empty set is always a closed nowhere dense (and thus meagre) subset of every topological space.
In the nonmeagre space the set is meagre. The set is nonmeagre and comeagre.
In the nonmeagre space the set is nonmeagre. But it is not comeagre, as its complement is also nonmeagre.
A countable T1 space without isolated point is meagre. So it is also meagre in any space that contains it as a subspace. For example, is both a meagre subspace of (that is, meagre in itself with the subspace topology induced from ) and a meagre subset of
The Cantor set is nowhere dense in and hence meagre in But it is nonmeagre in itself, since it is a complete metric space.
The set is not nowhere dense in , but it is meagre in . It is nonmeagre in itself (since as a subspace it contains an isolated point).
The line is meagre in the plane But it is a nonmeagre subspace, that is, it is nonmeagre in itself.
The set is a meagre subset of even though its meagre subset is a nonmeagre subspace (that is, is not a meagre topological space). A countable Hausdorff space without isolated points is meagre, whereas any topological space that contains an isolated point is nonmeagre. Because the rational numbers are countable, they are meagre as a subset of the reals and as a space—that is, they do not form a Baire space.
Any topological space that contains an isolated point is nonmeagre (because no set containing the isolated point can be nowhere dense). In particular, every nonempty discrete space is nonmeagre.
There is a subset of the real numbers that splits every nonempty open set into two nonmeagre sets. That is, for every nonempty open set , the sets and are both nonmeagre.
In the space of continuous real-valued functions on with the topology of uniform convergence, the set of continuous real-valued functions on that have a derivative at some point is meagre. Since is a complete metric space, it is nonmeagre. So the complement of , which consists of the continuous real-valued nowhere differentiable functions on is comeagre and nonmeagre. In particular that set is not empty. This is one way to show the existence of continuous nowhere differentiable functions.
Every nonempty Baire space is nonmeagre. In particular, by the Baire category theorem every nonempty complete metric space and every nonempty locally compact Hausdorff space is nonmeagre.
Every nonempty Baire space is nonmeagre but there exist nonmeagre spaces that are not Baire spaces. Since complete (pseudo)metric spaces as well as Hausdorff locally compact spaces are Baire spaces, they are also nonmeagre spaces.
Any subset of a meagre set is a meagre set, as is the union of countably many meagre sets. If is a homeomorphism then a subset is meagre if and only if is meagre.
Every nowhere dense subset is a meagre set. Consequently, any closed subset of whose interior in is empty is of the first category of (that is, it is a meager subset of ).
The Banach category theorem states that in any space the union of any family of open sets of the first category is of the first category.
All subsets and all countable unions of meagre sets are meagre. Thus the meagre subsets of a fixed space form a σ-ideal of subsets, a suitable notion of negligible set. Dually, all supersets and all countable intersections of comeagre sets are comeagre. Every superset of a nonmeagre set is nonmeagre.
Suppose where has the subspace topology induced from The set may be meagre in without being meagre in However the following results hold:
And correspondingly for nonmeagre sets:
In particular, every subset of that is meagre in itself is meagre in Every subset of that is nonmeagre in is nonmeagre in itself. And for an open set or a dense set in being meagre in is equivalent to being meagre in itself, and similarly for the nonmeagre property.
A topological space is nonmeagre if and only if every countable intersection of dense open sets in is nonempty.
A nonmeagre locally convex topological vector space is a barreled space.
Every nowhere dense subset of is meagre. Consequently, any closed subset with empty interior is meagre. Thus a closed subset of that is of the second category in must have non-empty interior in  (because otherwise it would be nowhere dense and thus of the first category).
If is of the second category in and if are subsets of such that then at least one is of the second category in
There exist nowhere dense subsets (which are thus meagre subsets) that have positive Lebesgue measure.
A meagre set in need not have Lebesgue measure zero, and can even have full measure. For example, in the interval fat Cantor sets, like the Smith–Volterra–Cantor set, are closed nowhere dense and they can be constructed with a measure arbitrarily close to The union of a countable number of such sets with measure approaching gives a meagre subset of with measure 
Dually, there can be nonmeagre sets with measure zero. The complement of any meagre set of measure in (for example the one in the previous paragraph) has measure and is comeagre in and hence nonmeagre in since is a Baire space.
Here is another example of a nonmeagre set in with measure :
Just as a nowhere dense subset need not be closed, but is always contained in a closed nowhere dense subset (viz, its closure), a meagre set need not be an set (countable union of closed sets), but is always contained in an set made from nowhere dense sets (by taking the closure of each set).
Dually, just as the complement of a nowhere dense set need not be open, but has a dense interior (contains a dense open set), a comeagre set need not be a set (countable intersection of open sets), but contains a dense set formed from dense open sets.
Meagre sets have a useful alternative characterization in terms of the Banach–Mazur game. Let be a topological space, be a family of subsets of that have nonempty interiors such that every nonempty open set has a subset belonging to and be any subset of Then there is a Banach–Mazur game In the Banach–Mazur game, two players, and alternately choose successively smaller elements of to produce a sequence Player wins if the intersection of this sequence contains a point in ; otherwise, player wins.
Theorem — For any meeting the above criteria, player has a winning strategy if and only if is meagre.
Many arguments about meagre sets also apply to null sets, i.e. sets of Lebesgue measure 0. The Erdos–Sierpinski duality theorem states that if the continuum hypothesis holds, there is an involution from reals to reals where the image of a null set of reals is a meagre set, and vice versa. In fact, the image of a set of reals under the map is null if and only if the original set was meagre, and vice versa.