Variables and Sets

Chapter 1: Sentential Logic

Learning objectives

  • Read and write set-builder notation {xP(x)}\{x \mid P(x)\} fluently
  • Decide set membership using \in and \notin over the standard number systems
  • Identify the standard number sets N,Z,Q,R\mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R} and the chain of inclusions between them
  • Distinguish free from bound variables and recognize when a formula is a statement

What is a set, and why is it the right starting point for all of mathematics? A set is just a collection of objects, with one rule: any object is either in the set or it is not — no partial memberships, no duplicates. That apparent triviality is the foundation that lets us talk about everything we want to talk about: numbers, points, functions, propositions, even other sets. Once you can write down a set, you can quantify over it, build operations on it, and reason about it precisely. In this section we cover the notation (membership, set-builder, the standard number systems) and the all-important distinction between free and bound variables — a distinction that decides whether a formula is a statement at all.

Membership and set-builder notation

If AA is a set, we write xAx \in A for "xx is an element of AA" and xAx \notin A for "xx is not an element of AA." A small set can be listed in roster notation: A={2,3,5,7}A = {2, 3, 5, 7}. Larger or infinite sets are described by a defining property using set-builder notation:

{xP(x)}\{x \mid P(x)\}

Read aloud: "the set of all xx such that P(x)P(x)." The bar \mid separates the dummy variable from the defining property. Often we restrict the dummy variable to a known set first: {xZx>0}{x \in \mathbb{Z} \mid x > 0} is the set of positive integers.

The standard number systems

Four number systems appear so often they get reserved blackboard-bold names:

N={0,1,2,3,}\mathbb{N} = {0, 1, 2, 3, \ldots} — the natural numbers. Some authors start at 1; Velleman starts at 0.

Z={,2,1,0,1,2,}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}

— the integers (German Zahlen).

Q\mathbb{Q} — the rational numbers, ratios a/ba/b with a,bZa, b \in \mathbb{Z} and b0b \neq 0.

R\mathbb{R} — the real numbers, every point on the number line.

They sit in a tidy chain of inclusions: NZQR\mathbb{N} \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R}. Each inclusion is strict: 1Z-1 \in \mathbb{Z} but 1N-1 \notin \mathbb{N}; 12Q\tfrac{1}{2} \in \mathbb{Q} but 12Z\tfrac{1}{2} \notin \mathbb{Z}; 2R\sqrt{2} \in \mathbb{R} but 2Q\sqrt{2} \notin \mathbb{Q}.

Free vs. bound variables

A variable in a formula is bound if it is captured by a quantifier or by a set-builder; otherwise it is free. In {xx>y}{x \mid x > y} the dummy variable xx is bound (its scope is the entire set definition) while yy is free — the meaning of the expression depends on what value of yy you have in mind. Renaming a bound variable does not change the set: {xx>y}{x \mid x > y} and {tt>y}{t \mid t > y} are exactly the same set.

A formula with no free variables is a statement: it has a definite truth value (true or false). A formula with free variables is sometimes called a predicate or an open sentence — its truth value depends on what values you plug into the free slots. So x2=4x^2 = 4 is not a statement (its truth depends on xx), but xR,x20\forall x \in \mathbb{R}, x^2 \geq 0 is a statement (it is true, period).

Set VennInteractive figure — enable JavaScript to interact.

Pause and think: In the formula yZ,y>x\exists y \in \mathbb{Z}, y > x, which variable is free and which is bound? If you replaced xx with the number 55, would the result be a statement? (Hint: bound variables are absorbed by the quantifier; only free variables show up in the truth-condition.)

Try it

  • Before listing: predict how many elements are in {xZ3x4}{x \in \mathbb{Z} \mid -3 \leq x \leq 4}. Then write them all out and check your count.
  • Classify each by free/bound: in {nNn2<k}{n \in \mathbb{N} \mid n^2 < k}, name the bound variable, the free variable, and decide whether the formula is a statement.
  • Predict first: is 9\sqrt{9} in N\mathbb{N}? Is it in Z\mathbb{Z}? Is it in Q\mathbb{Q}? Now verify by computing 9\sqrt{9}.
  • Translate into set-builder notation: "all integers whose absolute value is less than 10." Then translate "the set of rational numbers strictly between 00 and 11."
  • Pick a value of xx for which x2<5x^2 < 5 is true and one for which it is false. The formula itself is not a statement — explain why.

A trap to watch for

A surprisingly common mistake is treating set-builder notation as if it described a list rather than a set. Sets do not record order or multiplicity: {1,2,2,3}={1,2,3}={3,1,2}{1, 2, 2, 3} = {1, 2, 3} = {3, 1, 2}. So when you write {xZx24}{x \in \mathbb{Z} \mid x^2 \leq 4}, you describe {2,1,0,1,2}{-2, -1, 0, 1, 2} — not five separate items in a particular order, just five members of one set. If a problem cares about order or repetition, you want a sequence or a tuple, not a set; that distinction will matter once you start studying ordered pairs in Chapter 4.

What you now know

You can read and write set-builder notation, navigate the chain NZQR\mathbb{N} \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R}, and tell whether a formula is a statement by spotting its free variables. The next section combines pairs of sets with operations — union, intersection, complement — that mirror the logical connectives ,,¬\vee, \wedge, \neg you learned in §1.1.

References

  • Velleman, D. J. (2019). How to Prove It: A Structured Approach (3rd ed.). Cambridge University Press, ch. 1.
  • Halmos, P. R. (1960). Naive Set Theory. Van Nostrand, §§1–2.
  • Enderton, H. B. (1977). Elements of Set Theory. Academic Press, ch. 2.
  • Kunen, K. (2009). The Foundations of Mathematics. College Publications, ch. 1.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.