Show that $\langle X\rangle$ is a subgroup of $G$ Let $G$ a group and $X\subseteq G$ show that $\langle X\rangle=\left\{x_{1}^{r_{1}} x_{2}^{r_{2}} \ldots x_{n}^{r_{n}} \mid n \geq 1, x_{i} \in X, r_{i} \in \mathbb{Z}\right\}$ is a subgroup of G
How $0 \in \mathbb{Z}$ then exist $x\in \langle X\rangle$ such that $x=x_{i}^0=e$ then $e\in\langle X\rangle$
Let $x=x_{1}^{r_1}...x_{n}^{r_n}$ and  $y=y_{1}^{s_1}...x_{k}^{s_k}$ elements in $x\in \langle X\rangle$
then $xy=x_{1}^{r_1}...x_{n}^{r_n}y_{1}^{s_1}...x_{k}^{s_k}$ but i dont know  how to justify xy is in $\langle X\rangle$
 A: This is somwhere between an answer and a comment: So are you assuming $x_1, \ldots, x_n$ are different elements of $X$? Or can the $x_i$ repeat. From your question I took it to mean the former.
Unless you know anything further about the structure of $G$, there is no guarantee that each $x\in \langle X \rangle$ can be written as a word of length no more than $|X|$, where the letters are $x^m$; $x \in X$ and $m$ a positive integer. Indeed, there are large groups $G$ with a set $X$ of 2 generators $a$ and $b$; $a$ and $b$ of low order; where most elements $y$ in $G$ require a word of length $\log |G|$ i.e., $y=a^{m_1}b^{m_2}a^{m_3}b^{m_4} a^{m_5} \ldots a^{m_{2r+1}}$ where $r$ is $\log |G|$, and there is no more succinct way to write $y$ from $a$ and $b$.
If you are allowing words of any length and $G$ is finite, note that for each $x \in X$, the element $x^{-1}$ is in $X$; indeed $x^{|G|} = e$ so $x^{|G|-1} = x^{-1}$. So you can use this to see that $\langle X \rangle$ is closed under inversion.
A: Since $x$ and $y$ are finite products of elements in $X$, so is $xy$, so $xy\in\langle X\rangle$.
The identity and inverses are clearly in $\langle X\rangle$, being the empty product and elementwise inversion respectively, so $\langle X\rangle$ is a group.
A: The subgroup criterion is that $S\ne\emptyset$ and $x,y\in S\implies xy^{-1}\in S$.
We need $X\ne\emptyset$.
For the first part, let $x\in X$. Then $e=x^0\in \langle X\rangle$.
Secondly, given $x,y\in\langle X\rangle$, we have $x=x_1^{r_1}\dots x_n^{r_n},y=y_1^{s_1}\dots y_m^{s_m}$. Then $xy^{-1}=x_1^{r_1}\dots x_n^{r_n}y_m^{-s_m}\dots y_1^{-s_1}\in\langle X\rangle$.
$\langle X\rangle$ is the smallest subgroup containing $X$.
