You flip open one textbook and it writes the positive real numbers as (0, \infty). You flip open another and the same set is written \{x : x > 0\}. They look unrelated. Are they?
For this case, yes — they are exactly equal. Both notations describe the same set: every real number strictly greater than 0.
So why do two notations exist? Because each is good at a different job. Interval notation is short and visual — ideal when your set is a connected stretch of the number line. Set-builder notation is a full sentence — ideal when your set has structure that "interval notation" was never designed to express. Authors pick based on what the next line of the argument needs.
The two notations, side by side
Set-builder notation has a fixed grammar:
Read aloud: "the set of all x such that x is greater than 0." The colon : is sometimes written as a vertical bar | — both mean "such that." Everything left of the colon names the element; everything right of the colon is the admission criterion.
Interval notation is terser: (0, \infty) names the same set by two numbers and two brackets. Round bracket ( = endpoint excluded. \infty = no upper bound.
| Set-builder | Interval | Picture |
|---|---|---|
| \{x : x > 0\} | (0, \infty) | hollow dot at 0, ray right |
| \{x : 0 \le x \le 1\} | [0, 1] | filled dots at 0 and 1, segment |
| \{x : x \ne 3\} | (-\infty, 3) \cup (3, \infty) | line with a hole at 3 |
| \{x : x^2 < 4\} | (-2, 2) | hollow dots at \pm 2, segment |
For these rows, the two columns are interchangeable. Same set, two handwritings.
Why interval notation exists at all — and where it runs out
Interval notation is a shorthand for one specific shape: a connected piece of the real line. If your set is such a piece, interval notation is unbeatable — four characters say everything.
But what if your set is not a connected piece of the real line? Then interval notation either contorts itself (union of several intervals) or gives up entirely. Here is where set-builder becomes non-negotiable.
Sets interval notation cannot name directly
Consider these perfectly reasonable sets. Try to write each one in interval notation alone. You cannot.
- \{x : \sin x > 0\} — infinitely many disjoint intervals: (0, \pi) \cup (2\pi, 3\pi) \cup (4\pi, 5\pi) \cup \ldots and mirrored on the negative side. Interval notation technically applies but demands dot-dot-dot. Set-builder says it in six symbols.
- \{x \in \mathbb{Q} : x^2 < 2\} — the rational numbers whose square is less than 2. This is not an interval at all, because it is missing \sqrt{2} and every other irrational between -\sqrt{2} and \sqrt{2}. It is full of holes — an interval has none. Interval notation literally cannot describe it.
- \{x : x \text{ is prime}\} — the set of primes. Discrete, unordered-looking, no "stretch" at all.
- \{x : x = 1/n \text{ for some positive integer } n\} — the set \{1, 1/2, 1/3, 1/4, \ldots\}. Countably many isolated points converging to 0 but never reaching it. Not an interval.
- \{(x, y) : x^2 + y^2 \le 1\} — the closed unit disc in the plane. Not a subset of the real line at all; interval notation simply does not apply.
Set-builder handles every one of these without strain, because its vocabulary is "any predicate you can write." Interval notation's vocabulary is "two endpoints and a bracket on each."
When each notation is the right tool
Here is the decision, in one sentence: use interval notation when your set is a single connected stretch (or a small finite union), and use set-builder whenever the defining rule does not collapse into endpoints.
| Situation | Better notation | Why |
|---|---|---|
| x > 5 | (5, \infty) | One ray; endpoints tell the whole story. |
| -1 \le x \le 3 | [-1, 3] | Single connected segment; brackets are perfect. |
| Solution set of |x-4| > 2 | (-\infty, 2) \cup (6, \infty) | Two rays; union of two intervals is still compact. |
| Domain of \sqrt{\sin x} | \{x : \sin x \ge 0\} | Interval version would be an infinite union. |
| Rationals with x^2 < 2 | \{x \in \mathbb{Q} : x^2 < 2\} | Not an interval; interval notation cannot reach it. |
| Integer solutions of x^2 \le 9 | \{x \in \mathbb{Z} : -3 \le x \le 3\} | Restricting the universe matters; interval notation has no place to say "integer." |
| Domain of 1/(x-2) | \{x : x \ne 2\} or (-\infty, 2) \cup (2, \infty) | Either works; set-builder is one symbol shorter. |
A useful habit: if you are writing interval notation with more than one \cup symbol, ask whether set-builder would be clearer. If you are writing set-builder whose condition is a simple pair of inequalities like a \le x \le b, ask whether interval notation would be shorter. Both directions matter.
The "element-of" refinement
Set-builder has a feature interval notation lacks: the universe it draws elements from. When you write
you are not describing the real interval [0, 10] — you are describing \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}. The \in \mathbb{Z} restricts the universe to integers before the condition is applied. Interval notation has nowhere to put this restriction.
The pattern is
where U is the universe (commonly \mathbb{R}, \mathbb{Z}, \mathbb{Q}, \mathbb{N}, \mathbb{C}) and P(x) is the predicate. If the universe is "obviously" \mathbb{R} from context, authors often drop it and write \{x : P(x)\} — which is what is happening in \{x : x > 0\}.
Textbook style, not mathematical disagreement
Different authors prefer different notations for the same reasons writers prefer different sentence styles. A calculus book writing the domain of \ln x as \{x : x > 0\} is emphasising the defining rule ("the positive reals, i.e., the inputs for which the rule makes sense") — the next line probably cares about the inequality. A real-analysis book writing the same thing as (0, \infty) is emphasising topology ("an open half-line") — the next line probably cares about openness or compactness.
Both are correct. Neither is "more rigorous" than the other. They are the same set in two dialects, and fluent readers translate between them at sight.
Quick self-check
- Same set, two names? Yes — (0, \infty) = \{x : x > 0\} describe identical collections of real numbers.
- Can interval notation describe every set of real numbers? No — only those that are connected stretches or finite unions of stretches. A set like \{1/n : n \in \mathbb{N}\} has no interval form.
- When should I prefer set-builder? When the universe is not \mathbb{R}, when the condition is more complex than "between a and b," or when the set is not a small number of intervals.
- When should I prefer interval notation? When the set is a single interval, a ray, or the union of a few of these.
For the next step — dragging endpoints between open and closed to watch both notations update live — open Interval Builder: Drag Endpoints, Toggle Open-Closed, Watch the Notation. For the full interval toolkit, return to Intervals and Inequalities Preview.