# Are the elements of this set distinct? Can it be considered a set if they are not?

I'm currently reading Book of Proof by Richard Hammack. In the chapter on sets, he gives this as an example:

X = { n2 : n ∈ Z }

If n can be any integer and (-n)2 = (n)2, are the elements of this set distinct? If they are not, is this a set?

To my understanding, sets cannot have repeated elements. However, on the wikipedia page for sets it defines a set as

a collection of distinct objects, considered as an object in its own right

but later says

In an extensional definition, a set member can be listed two or more times, for example, {11, 6, 6}.

So can sets have repeated elements?

Think of it like this: an element $$x$$ of a set $$A$$ can be mentioned in the notation of the set more than once.

Here $$\{11,6,6\}$$ is a notation of the unique set that only has the elements $$6$$ and $$11$$ (and is completely determined by that fact) and in this notation element $$6$$ is mentioned twice. That is allowed.

That's all.

• So how would I distinguish a set that mentions an element multiple times and a multiset that contains multiple identical objects that are separate elementst? – Copeland Corley Dec 4 '18 at 14:36
• By paying attention to the context that you are working in, I would say. Multisets and sets are distinct mathematical objects. Also see here where is mentioned e.g."...to distinguish between sets and multisets, a notation that incorporates square brackets is sometimes used: the multiset $\{a,a,b\}$ can be denoted as $[a, a, b]$...". I assure you that if you once work with multisets then you will certainly be aware of that too :-). In your question you only mention sets and not multisets. – drhab Dec 4 '18 at 14:58
• One final question. Since {11, 6} and {11, 6, 6} are the same set, do they have the same cardinality? – Copeland Corley Dec 4 '18 at 15:33
• Yes, they do. The cardinality is $2$ as you will understand. – drhab Dec 4 '18 at 16:40

Yes, it is a set. Note that $$\{1,1\}$$ and $$\{1\}$$ are the same set. So$$X=\{1,1,4,4,9,9,16,16,\ldots\}=\{1,4,9,16,\ldots\}$$

• Okay, so if I have the set {1,1} and the multiset {1,1}, they are not equal, right? – Copeland Corley Dec 4 '18 at 14:39
• I have no experience whatsoever with multisets. – José Carlos Santos Dec 4 '18 at 14:40

The notation allows to repeat the elements, but as they are identical, they "count once" only. So, strictly,

$$\{11,6,6\}=\{11,6\}.$$

True replication requires a multiset.

• How would I know that I am dealing with a set instead of a multiset? Is it supposed to be inferred from the context? – Copeland Corley Dec 4 '18 at 14:37
• @CopelandCorley: of course. Multisets aren't so often met. – Yves Daoust Dec 4 '18 at 14:55