A basis B for a topology is a collection of open sets such that every open set is a union of basis sets. Bases provide economical specifications of topologies without listing all open sets.
You've already learned that a topology on a set X is a collection of open sets satisfying certain axioms — closed under arbitrary unions and finite intersections. But specifying a topology directly by listing all its open sets is impractical. A space like ℝ has uncountably many open sets, yet you can describe the standard topology on ℝ perfectly well using just the open intervals (a, b). That's the idea behind a basis: a smaller, manageable collection from which the entire topology can be reconstructed.
Formally, a collection B of subsets of X is a basis for a topology if two conditions hold: (1) every point of X belongs to at least one basis element, and (2) if a point x belongs to the intersection of two basis elements B₁ and B₂, there is a third basis element B₃ containing x and contained in B₁ ∩ B₂. These conditions ensure that when you take all possible unions of basis elements, the result actually satisfies the topology axioms. The topology generated by B is then τ = {all unions of elements of B}, plus the empty set.
The analogy to linear algebra is instructive. A spanning set for a vector space generates all vectors via linear combinations; a basis does the same but with minimal redundancy. Topological bases generate all open sets via unions, with the conditions above playing the role of spanning without collapse. Just as you can describe all of ℝ² by linear combinations of two vectors, you can describe all standard open sets in ℝ by unions of open intervals — and the intervals are far easier to reason about than arbitrary open sets.
Why does this matter in practice? Different bases for the same topology offer different computational advantages. The standard topology on ℝ can be generated by all open intervals, or equivalently by all open intervals with rational endpoints — a countable basis. The existence of a countable basis is the property called second countability, which you'll encounter when studying manifolds. Two different-looking bases might generate the same topology (the "same" space with different descriptions), so a key skill is comparing bases: B and B' generate the same topology if and only if each basis element of B is a union of elements of B', and vice versa. Checking this criterion is far more tractable than comparing topologies directly.