Frattini subgroup is set of nongenerators The Frattini subgroup $\Phi(G)$ is the intersection of all maximal subgroups of $G$. (If there are none, then $\Phi(G)=G$.) We say that an element $g\in G$ is a nongenerator if whenever $\langle X\cup \{g\}\rangle = G$, we have $\langle X\rangle = G$ for subsets $X\subseteq G$. 

If $G$ is finite, show that $\Phi(G)$ is the set of nongenerators of $G$.

So I want to start by assuming that $g\in G$ is in all maximal subgroups of $G$, and $\langle X\cup\{g\}\rangle = G$, and to prove that $\langle X\rangle = G$. At first I thought if $\langle X\cup\{g\}\rangle = G$, then $\langle X\rangle$ might be a maximal subgroup itself, but it seems that this is not necessarily the case. (For example $G$ is a cyclic group of order $4$ generated by $g$, and $X$ is the trivial subgroup.)
 A: Suppose that $\langle X\cup\{g\}\rangle=G$, but $\langle X\rangle\neq G$. Because $\langle X\rangle$ is not all of $G$, it is contained in some maximal subgroup $M\subset G$... 

but so is $\{g\}$, so you'd have to have $\langle X\cup\{g\}\rangle\subseteq M$, which is a contradiction.

A: Let $g\in\Phi(G)$ and suppose that $g$ is not a  non-generator for the group. Then there exists a subset $X$ of $G$ such that $G=\langle X,g\rangle$ and $G\neq \langle X\rangle$. Then $g\notin \langle X\rangle$, otherwise $\langle X,g\rangle=\langle X\rangle=G$, contradicting our assumptions. Let $\mathscr{S}$ be the set of all subgroups of $G$ containing $\langle X\rangle$ and not containing $g$. First of all, $\mathscr{S}$ is not the empty set, because $\langle X\rangle$ belongs to it. Moreover $(\mathscr{S},\subseteq)$ is an ordered set. If we take a chain of elements of $\mathscr{S}$, and do their insiemistic union, this union also belongs to  $\mathscr{S}$ and evidently is an upper bound for the elements in the chain. By Zorn's Lemma we get that $\mathscr{S}$ has a maximal element, call it $M$. Suppose $M<H\leq G$. Then $g\in H$ and $H=G$ (since $G=\langle X,g\rangle\leq \langle H,g\rangle=\langle H\rangle =H$). It follows that $M$ is a maximal subgroup of $G$, not containing  $g$ , and this is absurd since we've taken $g$ in $\Phi(G)$. So $g\in \Phi(G)\leq M$, thus $G=\langle g,X\rangle=M$, absurd. We conclude that $g$ must be a non-generator of the group.
Conversely, suppose that $g$ is a  non-generator and that $g$ is not an element of Frattini subgroup of $G$. Then there exists a maximal subgroup $M$ of $G$ that does not contain the element $g$. It follows that $M\neq \langle g,M\rangle$ and so, by maximality of $M$ that $G=\langle g,M\rangle$. But $g$ is a non-generator, so that $G=M$, contradicting hypothesis saying that $M$ is a maximal (hence proper) subgroup of $G$
