basis (topology)
Specifying a topology by listing every open set is usually hopeless — on the real line there are uncountably many. A basis is a small, manageable stock of open sets from which every open set can be reassembled by taking unions, the way the open intervals (a, b) generate all open subsets of the line. You hand over the building blocks; unions do the rest.
Formally, a basis B for a topology on X is a collection of subsets of X such that (i) every point of X lies in at least one basis element, and (ii) whenever a point p lies in the intersection of two basis elements B1 and B2, there is a basis element B3 with p in B3 and B3 inside B1 ∩ B2. The topology generated by B then declares a set open exactly when it is a union of basis elements.
Conversely, given any topology, a basis for it is any subcollection of open sets such that every open set is a union of members of the subcollection. Bases make topology economical: to check continuity, or to compare two topologies, it is enough to test against the basis elements rather than against all open sets.
The open intervals (a, b) with a < b form a basis for the standard topology on the real line. Every open set, however complicated — say the union (0, 1) ∪ (2, 5) ∪ (e, pi) — is just a union of such intervals. The even smaller family of intervals with rational endpoints is also a basis, and being countable it shows the line is second-countable.
Open intervals generate the line's topology; using rational endpoints gives a countable basis.