Tutorials › Topology (Undergraduate) › Set Membership and Set-Builder Notation

Sets, Functions and Relations for Topology · Tutorial 1 of 799

Set Membership and Set-Builder Notation

Translate between verbal descriptions, set-builder notation, and precise statements about whether an element belongs to a set.

Beginner 9 min read

What You'll Learn

  • Interpret the symbols \(\in\) and \(\notin\) in membership statements.
  • Read a set-builder expression as a condition on elements of a specified domain.
  • Translate interval notation into inequalities and test endpoint membership.
  • Decide membership in a finite set by checking its listed elements.
  • Recognize when a condition describes the empty set.
  • Avoid confusing a domain restriction with a condition on the variable.

Elements, Membership, and Conditions

A set can be described by listing its elements or by specifying a condition that its elements satisfy. Set-builder notation gives a concise way to write the second description. To use it reliably, read each expression as a membership test: an object belongs to the set exactly when it comes from the stated domain and satisfies the stated condition.

We use \(\in\) to mean “is an element of” and \(\notin\) to mean “is not an element of.” For example, \(3\in\{1,3,5\}\), while \(2\notin\{1,3,5\}\). The notation \(\mathbb{R}\) denotes the real numbers, \(\mathbb{Z}\) the integers, and \(\mathbb{N}=\{1,2,3,\ldots\}\) the positive integers.

Definition: If \(D\) is a set and \(P(x)\) is a condition that can be true or false for each \(x\in D\), then \[ \{x\in D:P(x)\} \] denotes the set of all elements \(x\) of \(D\) for which \(P(x)\) is true. The set \(D\) is the domain of the variable in this description, and \(P(x)\) is its condition.

Read the notation from left to right: “the set of all \(x\) in \(D\) such that \(P(x)\).” The symbol \(x\) is a placeholder for an element of \(D\). It is the condition, not the particular letter, that matters. Thus \(\{x\in\mathbb{R}:x>0\}\) and \(\{t\in\mathbb{R}:t>0\}\) describe the same positive real numbers.

The domain is important. The condition \(x>2\) describes different collections when \(x\) is required to be real, integer, or natural. A complete set-builder description includes the domain explicitly, or makes it clear from context.

The Membership Test for Set-Builder Notation

Theorem: For a set \(D\), a condition \(P\), and any object \(a\), \[ a\in\{x\in D:P(x)\} \quad\text{if and only if}\quad a\in D\text{ and }P(a)\text{ is true}. \]

Proof. By the definition of \(\{x\in D:P(x)\}\), its elements are exactly those elements \(x\) that belong to \(D\) and satisfy \(P(x)\). Substituting \(a\) for the variable \(x\), the statement that \(a\) is an element of this set means precisely that \(a\in D\) and \(P(a)\) is true. Conversely, if both \(a\in D\) and \(P(a)\) is true, then \(a\) meets the defining condition for membership in the set, so \(a\in\{x\in D:P(x)\}\). \(\square\)

This theorem turns reading a set-builder expression into a two-part check: first verify that the proposed element is in the domain, then evaluate the condition. If either part fails, the element does not belong to the described set.

Worked Example: Testing Membership in an Interval

Consider \(A=\{x\in\mathbb{R}:-2<x\le 3\}\). Decide whether \(-2\), \(-1\), \(3\), and \(4\) belong to \(A\), and express \(A\) using interval notation.

Every candidate listed is real, so the domain test is satisfied in each case. For \(-2\), the condition requires \(-2<-2\le3\). The first inequality is false, so \(-2\notin A\). For \(-1\), we have \(-2<-1\) and \(-1\le3\), so both parts hold and \(-1\in A\). For \(3\), we have \(-2<3\) and \(3\le3\); equality is allowed by the second inequality, so \(3\in A\). For \(4\), the first inequality \(-2<4\) holds, but \(4\le3\) is false, so \(4\notin A\).

The left endpoint is excluded because the inequality at that end is strict; the right endpoint is included because its inequality allows equality. Therefore \(A=(-2,3]\).

Check: In the interval \((-2,3]\), the left parenthesis excludes \(-2\), and the right bracket includes \(3\). This agrees with the original condition: \(-2<-2\) is false, while \(-2<3\le3\) is true.

Proposition: For real numbers \(a<b\), the interval \((a,b]\) is exactly the set \(\{x\in\mathbb{R}:a<x\le b\}\). In particular, \(a\) does not belong to this interval and \(b\) does.

Proof. By the definition of the interval notation \((a,b]\), a real number \(x\) belongs to \((a,b]\) precisely when it is strictly greater than \(a\) and less than or equal to \(b\). These are exactly the two inequalities in the set-builder condition. At \(x=a\), the required inequality \(a<a\) is false, so \(a\) is excluded. At \(x=b\), the inequalities become \(a<b\le b\); the first holds by the hypothesis \(a<b\), and the second holds by equality, so \(b\) is included. \(\square\)

Describing Finite Sets

A finite set can be written by listing its elements inside braces, or by giving a condition that selects exactly those elements from a domain. For a roster such as \(\{2,5,8\}\), membership means that the proposed element equals at least one of the listed entries. Repeated entries do not create additional elements: the set records which elements occur, not how many times they are written.

Proposition: For any objects \(a_1,\ldots,a_n\), an object \(y\) belongs to the finite set \(\{a_1,\ldots,a_n\}\) if and only if \(y=a_1\), or \(y=a_2\), or, continuing through the list, \(y=a_n\).

Proof. The roster notation \(\{a_1,\ldots,a_n\}\) specifies the set whose elements are the objects listed. Thus if \(y\) belongs to that set, it must be one of the listed objects, which means \(y=a_i\) for at least one index \(i\) in the list. Conversely, if \(y=a_i\) for one of the listed indices, then \(y\) is one of the listed elements and so belongs to the set. This argument also covers a list with a single entry: membership then means equality with that entry. \(\square\)

Worked Example: A Finite Set in Set-Builder Notation

Let \(B=\{x\in\mathbb{Z}:x^2=9\}\). Write \(B\) as a roster, then decide whether \(-3\), \(0\), and \(3\) belong to it.

The domain requires \(x\) to be an integer. To solve the condition \(x^2=9\), note that \((-3)^2=9\) and \(3^2=9\). These are the integer values that satisfy the equation: if an integer \(x\) has square \(9\), then \((x-3)(x+3)=0\), so \(x=3\) or \(x=-3\). Hence the roster is \(B=\{-3,3\}\).

For the membership tests, \(-3\in\mathbb{Z}\) and \((-3)^2=9\), so \(-3\in B\). Also \(0\in\mathbb{Z}\), but \(0^2=0\ne9\), so \(0\notin B\). Finally \(3\in\mathbb{Z}\) and \(3^2=9\), so \(3\in B\).

Check: Testing the two roster entries in the defining condition gives \((-3)^2=9\) and \(3^2=9\). Neither listed entry has been included just because it is an integer; each satisfies the equation as well.

The restriction \(x\in\mathbb{Z}\) and the equation \(x^2=9\) play different roles. The first says which objects may be considered; the second selects which of those objects qualify. Writing both parts prevents ambiguity.

Worked Example: The Empty Set from an Impossible Condition

Let \(C=\{x\in\mathbb{N}:x<0\}\). Describe \(C\), and test the candidate values \(1\) and \(-1\).

By convention, every \(x\in\mathbb{N}\) is a positive integer, so \(x\ge1\). No such \(x\) can also satisfy \(x<0\). Therefore no element meets both the domain restriction and the condition, and \(C=\varnothing\), the empty set.

For \(1\), the domain test succeeds because \(1\in\mathbb{N}\), but the condition \(1<0\) is false, so \(1\notin C\). For \(-1\), the inequality \(-1<0\) is true, but \(-1\notin\mathbb{N}\), so \(-1\notin C\) as well. Each candidate fails at least one of the two required tests.

Check: The condition has no qualifying natural number: any \(x\in\mathbb{N}\) satisfies \(x\ge1\), which is incompatible with \(x<0\). Thus the roster of qualifying elements has no entries, as indicated by \(\varnothing\).

Proposition: For a domain \(D\) and condition \(P\), the set \(\{x\in D:P(x)\}\) is empty if and only if there is no \(x\in D\) for which \(P(x)\) is true.

Proof. Suppose first that \(\{x\in D:P(x)\}=\varnothing\). If there were an \(x\in D\) for which \(P(x)\) were true, the membership test would give \(x\in\{x\in D:P(x)\}\), contradicting that this set is empty. Conversely, suppose there is no \(x\in D\) for which \(P(x)\) is true. The membership test says that any element of \(\{x\in D:P(x)\}\) would have to be an \(x\in D\) satisfying \(P(x)\). There is no such \(x\), so the set has no elements and is \(\varnothing\). \(\square\)

Translating Words into Conditions

To convert a verbal description into set-builder notation, identify the possible elements first, then state the test they must pass. For instance, “the real numbers greater than or equal to \(4\)” has domain \(\mathbb{R}\) and condition \(x\ge4\), giving \(\{x\in\mathbb{R}:x\ge4\}\). “The integers between \(0\) and \(6\), including both endpoints” has domain \(\mathbb{Z}\) and condition \(0\le x\le6\), giving \(\{x\in\mathbb{Z}:0\le x\le6\}\).

Words about endpoints should be translated literally. “Greater than” means \(>\), so the endpoint is not included; “greater than or equal to” means \(\ge\), so equality is permitted. The same distinction applies to “less than” and “less than or equal to.” For a finite set, a phrase such as “the listed values” can often be written directly as a roster, while a shared rule for the values can be written as a condition.

Common mistake. Consider the statement “the integers greater than \(2\)” and the incorrect translation \(\{x\in\mathbb{R}:x>2\}\). This expression includes \(5/2\), because \(5/2\in\mathbb{R}\) and \(5/2>2\); but \(5/2\) is not an integer. The correction is \(\{x\in\mathbb{Z}:x>2\}\). Its domain excludes \(5/2\), while it includes \(3\), since \(3\in\mathbb{Z}\) and \(3>2\). The error was not in the inequality; it was in choosing the wrong domain.

When checking a set-builder expression, keep the two questions separate: “Is the candidate in the domain?” and “Does it satisfy the condition?” This prevents a true inequality from being mistaken for sufficient evidence of membership, and it also makes endpoint and empty-set cases easier to handle.

Check Your Understanding

For each question, use the domain and condition separately when testing membership.

  1. Write “the real numbers less than \(5\), including \(5\)” in set-builder notation. Is \(5\) included?
  2. For \(D=\{x\in\mathbb{Z}:1\le x<4\}\), write \(D\) as a roster and test whether \(4\in D\).
  3. Decide whether \(2\) belongs to \(\{x\in\mathbb{N}:x^2=4\}\), and state which parts of the membership test hold.
  4. Give a set-builder description of the real numbers \(x\) satisfying \(x<-1\), and test \(x=-1\).
  5. Explain why \(\{x\in\mathbb{Z}:x^2=-1\}\) is empty.