In mathematics, a subset of a topological space is called nowhere dense or rare if its closure has empty interior. In a very loose sense, it is a set whose elements are not tightly clustered (as defined by the topology on the space) anywhere. For example, the integers are nowhere dense among the reals, whereas an open ball is not.
A countable union of nowhere dense sets is called a meagre set. Meagre sets play an important role in the formulation of the Baire category theorem, which is used in the proof of several fundamental result of functional analysis.
Density nowhere can be characterized in different (but equivalent) ways. The simplest definition is the one from density:
A subset of a topological space is said to be dense in another set if the intersection is a dense subset of is nowhere dense or rare in if is not dense in any nonempty open subset of
Expanding out the negation of density, it is equivalent to require that each nonempty open set contains a nonempty open subset disjoint from  It suffices to check either condition on a base for the topology on In particular, density nowhere in is often described as being dense in no open interval.
The second definition above is equivalent to requiring that the closure, cannot contain any nonempty open set. This is the same as saying that the interior of the closure of is empty; that is,
Alternatively, the complement of the closure must be a dense subset of  in other words, the exterior of is dense in
The notion of nowhere dense set is always relative to a given surrounding space. Suppose where has the subspace topology induced from The set may be nowhere dense in but not nowhere dense in Notably, a set is always dense in its own subspace topology. So if is nonempty, it will not be nowhere dense as a subset of itself. However the following results hold:
A set is nowhere dense if and only if its closure is.
Every subset of a nowhere dense set is nowhere dense, and a finite union of nowhere dense sets is nowhere dense. Thus the nowhere dense sets form an ideal of sets, a suitable notion of negligible set. In general they do not form a 𝜎-ideal, as meager sets, which are the countable unions of nowhere dense sets, need not be nowhere dense. For example, the set is not nowhere dense in
The boundary of every open set and of every closed set is closed and nowhere dense. A closed set is nowhere dense if and only if it is equal to its boundary, if and only if it is equal to the boundary of some open set (for example the open set can be taken as the complement of the set). An arbitrary set is nowhere dense if and only if it is a subset of the boundary of some open set (for example the open set can be taken as the exterior of ).
A nowhere dense set is not necessarily negligible in every sense. For example, if is the unit interval not only is it possible to have a dense set of Lebesgue measure zero (such as the set of rationals), but it is also possible to have a nowhere dense set with positive measure.
For one example (a variant of the Cantor set), remove from all dyadic fractions, i.e. fractions of the form in lowest terms for positive integers and the intervals around them: Since for each this removes intervals adding up to at most the nowhere dense set remaining after all such intervals have been removed has measure of at least (in fact just over because of overlaps) and so in a sense represents the majority of the ambient space This set is nowhere dense, as it is closed and has an empty interior: any interval is not contained in the set since the dyadic fractions in have been removed.
Generalizing this method, one can construct in the unit interval nowhere dense sets of any measure less than although the measure cannot be exactly 1 (because otherwise the complement of its closure would be a nonempty open set with measure zero, which is impossible).
For another simpler example, if is any dense open subset of having finite Lebesgue measure then is necessarily a closed subset of having infinite Lebesgue measure that is also nowhere dense in (because its topological interior is empty). Such a dense open subset of finite Lebesgue measure is commonly constructed when proving that the Lebesgue measure of the rational numbers is This may be done by choosing any bijection (it actually suffices for to merely be a surjection) and for every letting
A set is nowhere dense if it is dense in no interval; although note that Oxtoby later gives the interior-of-closure definition on page 40.
A subset of is said to be nowhere dense in if no nonempty open set of is contained in