In set theory, the **Baire space** is the set of all infinite sequences of natural numbers with a certain topology. This space is commonly used in descriptive set theory, to the extent that its elements are often called "reals". It is denoted **N**^{N}, ^{ω}ω, by the symbol or also ω^{ω}, not to be confused with the countable ordinal obtained by ordinal exponentiation.

The Baire space is defined to be the Cartesian product of countably infinitely many copies of the set of natural numbers, and is given the product topology (where each copy of the set of natural numbers is given the discrete topology). The Baire space is often represented using the tree of finite sequences of natural numbers.

The Baire space can be contrasted with Cantor space, the set of infinite sequences of binary digits.

The product topology used to define the Baire space can be described in one of two equivalent ways: in terms of a basis consisting of cylinder sets, or of a basis of trees.

The basic open sets of the product topology are cylinder sets. These can be characterized as:

- If any finite set of natural number coordinates I={
*i*} is selected, and for each*i*a particular natural number value*v*_{i}is selected, then the set of all infinite sequences of natural numbers that have value*v*_{i}at position*i*is a basic open set. Every open set is a countable union of a collection of these.

Using more formal notation, one can define the individual cylinders as

for a fixed integer location *n* and integer value *v*. The cylinders are then the generators for the cylinder sets: the cylinder sets then consist of all intersections of a finite number of cylinders. That is, given any finite set of natural number coordinates and corresponding natural number values for each , one considers the finite intersection of cylinders

This intersection is called a *cylinder set*, and the set of all such cylinder sets provides a basis for the product topology. Every open set is a countable union of such cylinder sets.

An alternative basis for the product topology can be given in terms of trees. The basic open sets can be characterized as:

- If a finite sequence of natural numbers {
*w*_{i}:*i*<*n*} is selected, then the set of all infinite sequences of natural numbers that have value*w*_{i}at position*i*for all*i*<*n*is a basic open set. Every open set is a countable union of a collection of these.

Thus a basic open set in the Baire space is the set of all infinite sequences of natural numbers extending a common finite initial segment *σ*. This leads to a representation of the Baire space as the set of all infinite paths passing through the full tree ω^{<ω} of finite sequences of natural numbers ordered by extension. Each finite initial segment *σ* is a **node** of the tree of finite sequences. Each open set is determined by a countable union *S* of nodes of that tree. A point in Baire space is in an open set if and only if its path goes through one of the nodes in its determining union. Conversely, each open set corresponds to a subtree *S* of the full tree ω^{<ω}, consisting of at most a countable number of nodes.

The representation of the Baire space as paths through a tree also gives a characterization of closed sets as complements of subtrees defining the open sets. Every point in Baire space passes through a sequence of nodes of ω^{<ω}. Closed sets are complements of open sets. This defines a subtree *T* of the full tree ω^{<ω}, in which the nodes of *S* defining the open set are missing. The subtree *T* consists of all nodes in ω^{<ω} that are not in *S*. This subtree *T* defines a closed subset *C* of Baire space such that any point *x* is in *C* if and only if *x* is a path through *T*. Conversely, for any closed subset *C* of Baire space there is a subtree *T* which consists of all of ω^{<ω} with at most a countable number of nodes removed.

Since the full tree ω^{<ω} is itself countable, this implies the closed sets correspond to any subtree of the full tree, including finite subtrees. Thus, the topology consists of clopen sets. This implies that the Baire space is zero-dimensional with respect to the small inductive dimension (as are all spaces whose base consists of clopen sets.)

The above definitions of open and closed sets provide the first two sets and of the boldface Borel hierarchy.

Cartesian products also have an alternate topology, the box topology. This topology is much finer than the product topology as it does not limit the indicator set to be finite. Conventionally, Baire space does not refer to this topology; it only refers to the product topology.

The above definition of the Baire space generalizes to one where the elements of the countably infinite sequence are chosen from a set of cardinality . Such a space is called a **Baire space of weight ** and can be denoted as .^{[1]} With this definition, the Baire spaces of finite weight would correspond to the Cantor space. The first Baire space of infinite weight is then ; it is homeomorphic to defined above.

Given two sequences and , a metric may be defined as where is the least integer such that With this metric, the basic open sets of the tree basis are balls of radius .

A metric space embeds into the Baire space if and only if poses a base of clopen sets, where the cardinality of is less than or equal to .^{[2]}^{[3]}

The Baire space has the following properties:

- It is a perfect Polish space, which means it is a completely metrizable second countable space with no isolated points. As such, it has the same cardinality as the real line and is a Baire space in the topological sense of the term.
- It is zero-dimensional and totally disconnected.
- It is not locally compact.
- It is universal for Polish spaces in the sense that it can be mapped continuously onto any non-empty Polish space. Moreover, any Polish space has a dense G
_{δ}subspace homeomorphic to a G_{δ}subspace of the Baire space. - The Baire space is homeomorphic to the product of any finite or countable number of copies of itself.
- It is the automorphism group of a countably infinite saturated model of some complete theory .

The Baire space is homeomorphic to the set of irrational numbers when they are given the subspace topology inherited from the real line. A homeomorphism between Baire space and the irrationals can be constructed using continued fractions. That is, given a sequence of natural numbers , we can assign a corresponding irrational number greater than 1

Using we get another homeomorphism from to the irrationals in the open unit interval and we can do the same for the negative irrationals. We see that the irrationals are the topological sum of four spaces homeomorphic to the Baire space and therefore also homeomorphic to the Baire space.

From the point of view of descriptive set theory, the fact that the real line is connected causes technical difficulties. For this reason, it is more common to study Baire space. Because every Polish space is the continuous image of Baire space, it is often possible to prove results about arbitrary Polish spaces by showing that these properties hold for Baire space and are preserved by continuous functions.

ω^{ω} is also of independent, but minor, interest in real analysis, where it is considered as a uniform space. The uniform structures of ω^{ω} and **Ir** (the irrationals) are different, however: ω^{ω} is complete in its usual metric while **Ir** is not (although these spaces are homeomorphic).

The shift operator on Baire space, when mapped to the unit interval of the reals, becomes the Gauss–Kuzmin–Wirsing operator . That is, given a sequence , the shift operator *T* returns . Likewise, given the continued fraction , the Gauss map returns . The corresponding operator for functions from Baire space to the complex plane is the Gauss–Kuzmin–Wirsing operator; it is the transfer operator of the Gauss map.^{[4]} That is, one considers maps from Baire space to the complex plane . This space of maps inherits a topology from the product topology on Baire space; for example, one may consider functions having uniform convergence. The shift map, acting on this space of functions, is then the GKW operator.

The Haar measure of the shift operator, that is, a function that is invariant under shifts, is given by the Minkowski measure . That is, one has that , where *T* is the shift ^{[5]} and *E* any measurable subset of ω^{ω}.