I'm reading Algebra 2e by Michael Artin. I'd be grateful for any guidance on 2 closely-related questions from Section 2.2, Groups and Subgroups, p. 42, excerpted below. First, I can understand the purpose and effect of the three rules listed, but I don't understand where they came from. Second, and similarly, I can see how the six elements of $S_{3}$ are non-overlapping and distinct, but I don't understand how they were derived. Where does the cancellation law fit in? (I'm going to press my luck and also ask how $x^{-1}$ in the first equation at the bottom is equal to $x^2$ in the second, by applying the first two rules). I am hoping these are simple and closely-enough related to hang together. If not, I would be glad to remove this and repost over a longer period. Cheers! Text:
To describe [$S_{3}$], we pick two particular permutations in terms of which we can write all others. We take the cyclic permutations ($\mathbf{1\ 2\ 3}$), and the transposition ($\mathbf{1\ 2}$), and label them as $x$ and $y$, respectively. The rules $x^3 = 1,\ y^2 = 1,\ yx = x^2y$ are easy to verify. Using the cancellation law, one sees that the six elements $1,\ x,\ x^2,\ y,\ xy,\ x^2y$ are distinct. So they are the six elements of the group: $S_{3} = \{1,\ x,\ x^2,\ y,\ xy,\ x^2y\}$. [...]
The rules [above] suffice for computation. Any product of the elements $x$ and $y$ and of their inverses can be shown to be equal to one of the products by applying the rules repeatedly. To do so, we move all occurrences of $y$ to the right side using the last rule, and we use the first two rules to keep the exponents small. For instance,
$x^{-1}y^3x^2y = x^2yx^2y = x^2(yx)xy = x^2(x^2y)xy = xyxy = x(x^2y)y = 1$.