Second isomorphism theorem for semigroups Let $S$ be a semigroup. If $S$ has a zero element, define $S^0 = S$. Otherwise define $S^0$ as $S$ with a zero element adjoined. A subset $I$ of $S$ is an ideal if it is closed under left and right multiplication by every $s \in S$. The Rees quotient $S/I$ is the quotient semigroup $S/\sim_I$ where $a \sim_I b \iff a = b \lor (a \in I \land b \in I)$.
Here is an exercise in my book:

Let $I$ be an ideal and $H$ be a subsemigroup of a semigroup $S$. Then $H \cup I$ is a subsemigroup of $S$, $I$ is an ideal of $H \cup I$, $I \cap H$ is an ideal of $H$, and $H \cup I / I = H / H \cap I$

I think this is incorrect. If $I$ is nonempty and $H \cap I = \varnothing$, $H \cup I / I$ is not $H / H \cap I$ but with a zero element adjoined. So the correct statement should be $H \cup I / I = (H / H \cap I)^0$. Is this right?
Edit: This holds only if $I$ is nonempty. If $I$ is empty this also doesn't hold. Then what would be the general correct statement?

The exercise should be slightly modified as follows, avoiding at the same time introducing $S^0$:

Let $I$ be an ideal and $H$ be a subsemigroup of a semigroup $S$. Then $H \cup I$ is a subsemigroup of $S$, $I$ is an ideal of $H \cup I$, $I \cap H$ is an ideal of $H$, and if $I \cap H$ is nonempty, then $(H \cup I) / I = H / (H \cap I)$.

The proof is immediate, since both semigroups have support
$$
\bigl((H \cup I) - I\bigr)\cup \{0\} = (H - I) \cup \{0\} = \bigl(H - (H \cap I)\bigr)\cup \{0\}
$$
with product $*$ defined, for all $x,y \in (H - I) \cup \{0\}$ by
$$
x * y = \begin{cases}
xy&\text{if $x, y, xy \in H - I$}\\
0&\text{otherwise}
\end{cases}
$$
