In mathematics, the term dense has at least two different meanings.

  • A subset A of a topological space X is said to be dense if the only closed subset of X containing A is X itself. This can also be expressed by saying that the closure of A is X. Equivalently, every nonempty open subset of X intersects A, or in other words: the interior of the complement of A is empty. As an example, the set of rational numbers is a dense subset of the real numbers.

  • A partial order on a set S is said to be dense if, for all x and y in S for which x < y, there is a z in S such that x < z < y. The rational numbers with the ordinary ordering are a densely ordered set in this sense, as are the real numbers.

  • A subset B of a partially ordered set A is dense in A if for any x < y in A, there is some z in B such that x < z < y. In case the order is a linear order, then B is dense in A in the present sense if and only if B is dense in the order topology on A. Hence the first two meanings above are related.

Note that the first notion of "dense" depends on the surrounding space, while the second notion is completely internal to the ordered set. The rationals in [0,1] for instance are dense as an ordered set and they are dense in the space [0,1] but they are not dense in the real numbers.

See also density in physics.