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.

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 (where a nowhere dense set is a set whose closure has empty interior).^{[1]} The qualifier "in " can be omitted if the ambient space is fixed and understood from context.

A subset that is not meagre in is called **nonmeagre in ** a **nonmeagre subset of ** or of the **second category in **^{[1]}

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

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.^{[2]}

The terms *first category* and *second category* were the original ones used by René Baire in his thesis of 1899.^{[3]} The *meagre* terminology was introduced by Bourbaki in 1948.^{[4]}^{[5]}

Every nowhere dense subset of is meagre. Consequently, any closed subset with empty interior is meagre. Thus a closed nonmeagre subset of must have nonempty interior.

(1) Any subset of a meagre set is meagre; (2) any countable union of meagre sets is meagre. Thus the meagre subsets of a fixed space form a σ-ideal of subsets, a suitable notion of negligible set. And, equivalently to (1), any superset of a nonmeagre set is nonmeagre.

Dually, (1) any superset of a comeagre set is comeagre; (2) any countable intersection of comeagre sets is comeagre.

Suppose where has the subspace topology induced from The set may be meagre in without being meagre in However the following results hold:^{[5]}

- If is meagre in then is meagre in
- If is open in then is meagre in if and only if is meagre in
- If is dense in then is meagre in if and only if is meagre in

And correspondingly for nonmeagre sets:

- If is nonmeagre in then is nonmeagre in
- If is open in then is nonmeagre in if and only if is nonmeagre in
- If is dense in then is nonmeagre in if and only if is nonmeagre in

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.

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.

A topological space is nonmeagre if and only if every countable intersection of dense open sets in is nonempty.^{[6]}

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.

**Banach category theorem:**^{[7]} In any topological space the union of an arbitrary family of meagre open sets is a meagre set.

A meagre set in need not have Lebesgue measure zero, and can even have full measure. For example, in the interval fat Cantor sets 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 ^{[8]}

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 :

where is a sequence that enumerates the rational numbers.

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.

The empty set is a 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 T_{1} 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 space (with the topology induced from ) is meagre. Its meagre subset is nonmeagre in itself.

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.^{[9]}^{[10]} 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.

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.^{[11]} 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.^{[12]}