Has my understanding of a generating set been wrong this entire time?

The book definition works with infinite groups, too. In the finite case, if you have $g$, then $g^{-1}=g^{|G|-1}$, so you don't need to specifically add inverses to the generation process.


Firstly you seem to have confused two things a "generating set" and the "subgroup generated by". In my opinion the correct definition of each is as follows: A subset $S$ of a group $G$ is a generating set of $G$ if for any subgroup $H$ of $G$ if $S \subseteq H$ then $H=G$. While if $S$ is a subset of a group $G$, the subgroup generated by $S$, often denoted $\langle S\rangle$, is the smallest subgroup of $G$ containing $S$.

The two concepts are related of course. A subset $S$ is a generating set for $G$ if and only if the subgroup generated by $S$ is $G$.

Finally one might be interested in constructing the subgroup generated by $S$. Trivially $\langle S\rangle = \cap\{H|S\subseteq H \leq G\}$. If one prefers one can build it inductively $S_0=\{e\}\cup S$, $S_n = \{x^{-1}y\,|\,x,y \in S_{n-1}\} \cup S_{n-1}$, then $\langle S \rangle = \cup \{S_i|i\in \mathbb{N}\}$ or one of many other equivalent ways. However as mentioned in the answer by Thomas Andrews above when $G$ is finite one can simply take $S_0=S$, $S_n=\{xy\,|\,x\in S,y\in S_{n-1}\}\cup S_{n-1}$ and then $\langle S\rangle = S_{|G|}$ corresponding to what you described above.


Here is an example to show you why it matters to include inverses of elements of $S$ when describing the generated subgroup.

If you took $(\Bbb Z,+)$ and take $S=\{1\}$, the set of finite products (read sums since the operation is written additively) would only get you $\Bbb N$. (You would still get $0$ as an empty sum of $1$'s.)

When you only use the elements of $S$ and the operation to generate a subset of a subgroup, you are only guaranteed to get the monoid generated by $S$. You've got to throw in inverses in order to get the rest.