Trouble understanding solution to abstract algebra problem I'm currently reading John B. Fraleigh's 'A First Course In Abstract Algebra'.
I got stuck on question $47$, section $10$. First I tried sitting with it for a few ours, and sadly didn't get very far, so I went and looked up the solution.
Now, the problem is that I don't believe that I quite understand everything in it.
The excercise goes:
Let $G$ be a finite group. Show that if for each positive integer $m$ the number of solutions $x$ of the equations $x^m=e$ in $G$ is at most $m$, then $G$ is cyclic.
The answer goes:
Let $d$ be a divisor of $n=|G|$. Now if $G$ contains a subgroup of order $d$, then each element of that subgroup satisﬁes the equation $x^d=e$. $\rm \color{purple}{By\ the\ hypothesis\ that}$ $x^m=e$ $\rm \color{purple}{has\ at\ most}$ $m$ $\rm \color{purple}{solutions\ in}$ $G$, $\rm \color{purple}{we\ see\ that\ there\ can\ be\ at\ most\ one\ subgroup\ of\ each\ order}$ $d$ $\rm \color{purple}{dividing}$ $n$. Now each $a\in G$ has some order $d$ dividing $n$, and $\langle a \rangle$ has exactly $ϕ(d)$ generators. Because $\langle a \rangle$ must be the only subgroup of order d, we see that the number of elements of order d for each divisor d of n cannot exceed $ϕ(d)$.
Thus we have $$n = \sum_{d|n} (number\; of\; elements\; of\; G\; of\; order\; d) \le \sum_{d|n} \phi(d)=n$$ 
This shows that $G$ must have exactly $ϕ(d)$ elements of each order $d$ dividing $n$, $\rm \color{purple}{and\ thus\ must\ have}$ $ϕ(n) \ge 1$ $\rm \color{purple}{elements\ of\ order}$ $n$. Hence $G$ is cyclic.
The things that I have trouble understanding are the written in purple.
Thank you very much.
 A: A) x^0=e, x^1, x^2,...x^(d-1) are d distinct elements of G and they are solutions of X^d=e, hence  (by the hypothesis), they are ALL the solutions in G. If there was another sub-group of order d, there would be more solution, hence, there is only one sub-group of order d, as claimed.  
B) 
A: For the first part that you've highlighted in purple, suppose that $H_1$ and $H_2$ are two subgroups of order $m$. By Langrange's theorem, $x \in H_i \implies x^{|H_i|}=x^m=e$. Now suppose that $H_1 \neq H_2$. Then $|H_1 \cup H_2|>m$ , and $H_1 \cup H_2 \subset \{y \in G : y^m=e\}$. This contradicts that at most $m$ elements have order dividing $m$.
For the second part, let $N_d=\#(\text{elements of $G$ order $d$})$. It's straightforward to verify that we have an equality
$$n=\sum_{d|n} N_d=\sum_{d|n}\phi(d).\,\,\,(*)$$
Since $N_d \leq \phi(d)$ for all $d|n$, it's clear that $(*)$ cannot hold if $N_d < \phi(d)$ for any $d$ dividing $n$, including $n$ itself. This forces $N_n=\phi(n) \geq 1$ for all $d|n$.
It seems that, while the statements made in the solution are correct, the way that they are put together is slightly misleading. In particular, when the author writes

Thus we have $$n = \sum_{d|n} (number\; of\; elements\; of\; G\; of\; order\; d) \ge \sum_{d|n} \phi(d)=n$$ 

"Thus" makes it seem as though the equation is a consequence of previous arguments in the proof. This is not the case. The equation is a separate observation, needed in conjunction with the fact that $N_d \leq \phi(d)$ to finish the problem.
