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:

\{\,\underbrace{x}_{\text{variable}} \;\underbrace{:}_{\text{"such that"}}\; \underbrace{x > 0}_{\text{condition(s)}}\,\}

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.

The set of positive reals drawn the same way under two notationsA single number line with a hollow circle at 0 and a thick accent segment extending rightward from 0 with an arrow at the far right. Above the number line, on the left side, the label set-builder notation x greater than 0 is written. On the right side, the label interval notation 0 to infinity is written. An equals sign connects the two labels. {x : x > 0} = (0, ∞) 0 → ∞
Same set, same picture, two names. Set-builder spells out the admission rule in words and symbols; interval notation compresses it into two brackets and two endpoints.

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.

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

\{x \in \mathbb{Z} : 0 \le x \le 10\}

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

\{\,x \in U : P(x)\,\}

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

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.