I am practicing writing proofs over regular expressions. Here is the question:
Show that $(r\cup \varepsilon)^*= r^*$, where $r$ is a string.
Intuitively, the left hand side is the concatenation of zero or more concatenation of $r$ or $\varepsilon$, but for concatenation: $r\varepsilon = r$. Which is essentially the same with the right hand side. Now, I am trying to formalized it.
Proof: Using double inclusion to show equality. First, we do one direction: show that $(r \cup \varepsilon) \subseteq r^*$, let $w \in (r\cup \varepsilon)^*$, thus, $w$ is the concatenation of either $r$ or $\varepsilon$ for $n$ times, where $n \in \mathbb{Z}, n\geq 0$.
Now, I have a hard time to say that $w$ is the same with $r$, using subsets notations. I'd appreciate if you can hint me so that I can formalize the word .
Using subset notation is not essential. If you can give a clear proof using mainly words, that is often better than a highly technical algebraic proof. To prove that ${\rm LHS}\subseteq{\rm RHS}$ I would suggest something like this.
Let $w$ be a word which matches $(r\cup \varepsilon)^*$. Then by definition $w$ can be written $$w=w_1w_2\cdots w_n\ ,$$ where $n\ge0$ and every $w_k$ is either $r$ or $\varepsilon$. Suppose that $m$ of these words $w_k$ are $r$ (and the rest are $\varepsilon$). Then $$w=r^m$$ which matches $r^*$. Therefore $w$ matches the ${\rm RHS}$, and this shows that ${\rm LHS}\subseteq{\rm RHS}$.
Comment. I am more used to working with regular languages than regular expressions, though there is no great difference. You might need to change some of my notation to fit the way you do it.