What does it mean for a number to be in a set?

Frustratingly my book gives me several examples of a number in a set but offers no explanation at all.

Anyways what is going on here? According to the book $2$ is not an element of these sets:

$$\{\{2\},\{\{2\}\}\}$$

$$\{\{2\},\{2,\{2\}\}\}$$

$$\{\{\{2\}\}\}$$

What is going on? Clearly $2$ is in all of those sets. Or are they saying that $2$ isn't in any of these sets but a set is in all these sets and in that set is $2$? Which really seems like a logical fallacy because $2$ is in those sets contained in a set means the set has $2$ even if it is behind a layer of sets.

For example you wouldn't say that there are no cars in a neighborhood if all the cars in in a garage, so why does math take this approach?

• 2 is not an element in these sets containing the element 2 is the element is 1 and 2 – MRK Sep 7 '13 at 21:36
• List the elements of $S = \{\{2\},\{\{2\}\}\}$: They are $\{2\}$, $\{\{2\}\}$. None of them is $2$. So $2 \notin S$. – k.stm Sep 7 '13 at 21:40
• The objects $2,\{2\},\{\{2\}\},\{2,\{2\}\}$ are all different. Math takes this approach because we need to be able to talk about sets in this way, as often in nature we have to be able to distinguish between a set, a number, etc. Sets are intended to model what they actually do model, not neighborhoods and cars in physical space. – anon Sep 7 '13 at 21:40
• Ask yourself why parking enforcement doesn't take that approach. :) Mark Bennet has the best answer here. – Dan Brumleve Sep 7 '13 at 22:37
• Computers are the same way. For example the file /usr/bin/grep is not in /usr. – Kaz Sep 8 '13 at 6:28

It's an interesting question you raise.

Practically speaking, we (as mathematicians) would never run into this problem because we never mix numbers and "sets of numbers", or different types in the same collection (edit from comment: set theory does this, so this comment is about "higher levels" of abstraction in mathematics than set theory)

Anyway, we would prove statements of the form: "Let $\mathcal{S}$ be a collection of sets. Then for $S,T \in \mathcal{S}, \ldots$", etc. As a sanity check, you would be sure that $\mathcal{S}$ would not contain a single number, and so mathematically we wouldn't say that $2 \in \mathcal{S}$ even if one set of $\mathcal{S}$ contains $2$, right?

Even to disambiguate "sets of sets" from sets, we use the term "collection of sets".

That being said, this concept is very important when you go to computer science because you really need to keep such structures straight, they are used to organize data (lists of lists, etc). There you might run into the same question of, "how do you determine if $2$ is in my structure or not", but that is a different question entirely.

• In the usual constructions of ZFC, everything is a set. Including those things we call numbers. – user61527 Sep 7 '13 at 21:48
• yes, I knew i should have included set theory in my parenthetical :P – Evan Sep 7 '13 at 21:48
• It is much easier for me to see this from a computer science perspective, something like layers of abstraction comes to mind where you keep different levels separate. As in that set does not have access to a 2 but it's sets might. – Paul the Pirate Sep 7 '13 at 21:49
• @PaulthePirate Yes, but mathematically we have a strict definition of what a set is. So we distinguish "a set contains two" with " a set contains some other set that contains two" (or even deeper...) – Evan Sep 7 '13 at 21:50
• +1 for mentioning the concrete applications in computer science. – Boluc Papuccuoglu Sep 8 '13 at 10:36

When we say "$2$ is in a set," we mean that $2$ is an element of the set. In the first case, there are exactly two elements of $\{\{2\}, \{\{2\}\}\}$, namely

$$\{2\}$$ and $$\{\{2\}\}$$

In general, one can find the elements of a given set by erasing the outermost braces.

Neither of these are the number $2$; the first one is a set containing $2$ as an element, and the other is a set containing the set $\{2\}$ as an element.

If we wanted to have $2$ be an element of the set, we'd need either $2 = \{2\}$ or $2 = \{\{2\}\}$, neither of which is true.

Here is a non mathematical explanation in case it helps.

Think of a Russian Doll.

There are two ways of thinking about what is inside the outside (largest) doll. Perhaps the most obvious is to say "all the little dolls". But when a child opens the first doll, all they see is the next one "there's another doll inside".

When we are dealing with sets, we say $x\in X$, if we see $x$ when we take the first layer off and look inside. There may be other things to find, but they are buried deeper, and can only be found if we are allowed to take more layers off.

You can think of 'is an element of' as stripping off a single layer of set braces.

$2$ is not an element of $\{\{2\}\}$, because removing one layer of braces, you get $\{2\}$, the set containing $2$, which is different from $2$.

Also, if this wasn't the case, then there would be no way to distinguish between, for example, $$\{\{2\}, \{2,3\}\} \text{ and } \{\{2,3\}\},$$

which are clearly different sets, even though each of their elements only contain $2$s and $3$s.

It might be a good idea to start with something maybe slightly more basic:

What is the difference between these two things: $\emptyset$ and $\{\emptyset\}$.

The first is just the empty set (which has no elements)

The second is a set with exactly one element - which is the empty set.

Think about this for a while, and it should become clearer.

• What is the difference between an empty set and a set with the empty set? – Paul the Pirate Sep 7 '13 at 21:44
• The empty set has zero elements, but the set whose only element is the empty set has exactly one element (the empty set). – Old John Sep 7 '13 at 21:47
• Maybe it would help to think about this question: "What are the elements of the set $\{\emptyset, \{\emptyset\}\}$?". Stripping out the outside pair of curly brackets, we see that it has exactly two elements which are $\emptyset$ and $\{\emptyset\}$. – Old John Sep 7 '13 at 22:37
• – Old John Sep 7 '13 at 22:43
• @Paul: the elements of a set are just the top-level things inside its outermost curly braces — not the things further in. So the set $\{\ x,\ y,\ \{z\}\ \}$ has three elements: $x$ and $y$, and $\{z\}$. Note that doesn’t have $z$ as an element, because $z$ isn’t one of those three items I just listed. It appears inside one of them, but it isn’t itself one of them. This is why the empty set is not an element of $\{x\}$: the set $\{x\}$ has just one element, $x$, and this element isn’t the empty set. – Peter LeFanu Lumsdaine Sep 8 '13 at 0:21

2 is not an element in these sets

the set containing the element 2 is the element in 1 and 2

remember you must have an independent 2 in the elements for 2 to be part of the set as an element

Part of your confusion comes from using the preposition "in" to designate set membership. In everyday use "in" is a transitive relation: I am in my house which is situated in my home town, so I am in my home town. However sets are defined by what are their members, and it would be very restrictive to consider only sets for membership is transitive: whenever $x$ is a member of $y$, it would be impossible to construct a set that has $y$ as member without also including $x$ as member (as well as any members that $x$ might have, and so forth). So instead whenever $x\neq y$, the questions of whether some set$~S$ has $x$ as member and whether $S$ has $y$ as member are completely independent.

There is a different, though related, notion that is transitive: the subset relation (inclusion). The integers include the even numbers, which include the set $\{4,144,1026\}$, so certainly the integers include the set $\{4,144,1026\}$. By definition $X$ includes $Y$ is every member of $Y$ is also member of $X$. Confusingly "contains" can refer both to membership and to inclusion, but they are quite different relations; in practice it is almost always clear which meaning of "contains" is meant in any concrete situation where it is used.

In fact in everyday life membership is not a transitive relation. My sister's left arm is not a member of my family, although it is a member of a member of my family (excuse the bad pun, but it is not so easy to find an everyday example of a collection of sets; one might think of something like an association of sports teams).

• Puns on “member” could certainly have been worse. – Carsten S Sep 8 '13 at 16:22

The elements of the set $\{\{2\},\{\{2\}\}\}$ are $\{2\}$ (which is a set, not a number) and $\{\{2\}\}$ (which is a set that contains another set, but it's not a number). The same for the other two sets. Even if the elements of your sets are sets that contain number 2, they're not number 2, so this sets don't contain 2 as an element.

Let's not over-think this too much, unless this is your homework for real or complex analysis or something like that.

{2} != 2 just as A != B

If you would say that C contains A, that doesn't leave you to say that it either contains B also, or B alone.

There was another angle I thought of.

Suppose that the 2 references the end of an open interval, say from 0:2. Open intervals do not contain their limit points. Thusly, that interval would contain all fractions up to but not including 2.

I doubt that is the case. From what you are asking, you have simple answer to give. Evan said it.

• "uppose that the 2 references the end of an open interval, say from 0:2. Open intervals do not contain their limit points. Thusly, that interval would contain all fractions up to but not including 2." This is really fundamentally different from what the question is asking about, and misleading. – user61527 Sep 8 '13 at 3:27
• I certainly agree that $\{2\}\ne2$, but I have no idea if $A=B$, because I do not know what $A$ and $B$ are. – Carsten S Sep 8 '13 at 16:21

For example you wouldn't say that there are no cars in a neighborhood if all the cars in in a garage, so why does math take this approach?

There's a difference between a car parked on a street and a car parked in a garage. It is often useful to be able to tell the difference.

For the sorts of things we use sets for, we almost always want to be able to tell the difference. For the rare times we don't, we speak of the "transitive closure".

What you have in mind is a partition of a set, rather than a set containing other sets. A partition of a set $X$ is a family of subsets $P_i \subseteq X$ such every element of $X$ is in exactly one of the $P_i$'s. This is the sort of thing you have in mind: you are imagining each garage to be one of the groups in the partition, the street to be another group, and so forth. And when you take their union, you get "the set of all cars in the neighborhood".

I remember that my professor used this analogy before:

Think of the set $\{\{2\},\{\{2\}\}\}$ as the folder that contains 2 folders. The first folder $\{2\}$ contains a file called $2$ and the second folder $\{\{2\}\}$ contains a folder that contains a file $\{2\}$.

There might be some computer problems with this analogy, as I think a file is determined by its location as well. However, I think this will give you a better feeling for what's going on.

• A better analogy: the folder {{2}) contains a folder {2} which contains the file 2. Interestingly, this is how I understand the file structure on conputers. I learned computers after I learned set theory! – scaaahu Sep 8 '13 at 10:00