I'm not a set theorist, but I feel like I've been taught all my life that I can write sets with repeating elements but those repeats are sort of degenerate and not counted as separate. So $\{a, b, a\} = \{a, b\}$. This always fit nicely with the fact that I could only check if two sets are equal by asking if they are subsets of one another. But a (computer science with math background) colleague of mine got into a long debate with me on whether I'm ever allowed to do this without referring to some multiset. For a moment I said, OK, maybe I've just not been careful. But now I'm seeing this issue pop up everywhere. Below is a recent example from notes I was writing for my students.
Can anyone help me with a reference to the fact that $\{a, b, a\} = \{a, b\}$ is definitely OK or not OK??
Example: For a group $G$ and an element $a \in G$, define $$\langle a \rangle := \{ a^n \in G \vert n \in \mathbb{Z} \}$$
Of course if the group is finite then for some $n \ne m$ we have $a^n = a^m$ and I feel like this is used a lot to describe this fairly reasonable set. In some sense it has repeating elements but if you take the approach above it's not an issue at all. What am I missing?
I believe the best reference would include the reason why duplicate elements are extraneous.
It's due to the Axiom of Extentionality.
From Kunen's, Set Theory: An Introduction to Independence Proofs
Axiom of Extentionality
$$\forall x\forall y[\forall z(z\in x\iff z\in y) \iff x=y]$$
In English, two sets are equal if and only if they have the same elements.
So, $\{a,b,c\}= \{a,a,b,b,c,c\}$ by the Axiom.
On page 12, you see the explicit example that $\{x,x\} = \{x\}$.
To see why this generalizes (from a different perspective)
Notice that by the Axiom of Extentionality,
$$\forall x(z\in x\Rightarrow x\cup\{z\} =x)$$
So, adding elements to a set, that are already in it- doesn't change the set.