Lemma 1: If L is undecidable then so is the complement of L.
We know that the halting problem, $H_{TM}$ is undecidable. Therefore, according to Lemma 1 complement of halting problem, $H_{TM}^c$ too is undecidable.
$H_{TM}$ = $ \{\langle M, x \rangle { }\mid \text{ M is a TM and M halts on input x } \} $
$H_{TM}^c$ = $ \{\langle M, x \rangle { }\mid \text{ M is a TM and M loops on input x } \} $
$E_{TM}$ = $ \{\langle M \rangle { }\mid \text{ M is a TM and L(M) = } \emptyset \} $
Assume that $E_{TM}$ is decidable. We will reduce $H_{TM}^c$ to $E_{TM}$ – in other words we will show how to construct a Turing Machine $M_{H_{TM}^c}$ that decides $H_{TM}^c$ using the TM, $M_{E_{TM}}$ that decides $E_{TM}$. This gives us a contradiction, because we know that $H_{TM}^c$ is undecidable, and so $M_{H_{TM}^c}$ cannot exist.
The word “reduce” simply means solving a given problem by converting it into another problem which we already know to solve.
So, the Turing Machine for $H_{TM}^c$ can be constructed as follows:
$M_{H_{TM}^c}$ = “on input $\langle M,x \rangle$
$\qquad$ 1. Construct the code for a TM, $M_1$ that does the following:
$\qquad$ $\quad$ $M_1$ = "on input $w$
$\qquad$ $\quad$ 1. Simulate $M$ on $x$.
$\qquad$ $\quad$ 2. Accept if $M$ halts."
$\qquad$ 2. Run $M_{E_{TM}}$ on $\langle M_1 \rangle$
$\qquad$ 3. Accept if $M_{E_{TM}}$ accepts, reject otherwise."
It is crucial to understand that the TM $M_1$ is never actually simulated
– such simulation could go into an infinite loop. All we are doing is constructing the code for $M_1$.
$M_1$ is constructed such that on any input $w$ given to it, it will simulate $M$ with input $x$. $M$ can halt or loop on $x$ and hence there can be two cases:
$\quad$ 1. $M_1$ accepts all inputs $w$ if $M$ halts on $x$. $M_{E_{TM}}$ will reject $M_1$ as $L(M_1) \neq \emptyset$.
$\quad$ 2. If $M$ loops on $x$, $M_1$ will also loop for every input $w$ given to it. Anyway, as $M_{E_{TM}}$ is a $\quad$decider it will reject and halt on input $M_1$ as $L(M_1) = \emptyset$.
$Correctness$: Since $M_{E_{TM}}$ always halts (by our assumption), $M_{H_{TM}^c}$ also always halts. $M_{H_{TM}^c}$ accepts if $M_{E_{TM}}$ accepts, that is if $L(M_1) = \emptyset$ which happens if $M$ loops on $x$.
$M_{H_{TM}^c}$ rejects if $M_{E_{TM}}$ rejects that is $L(M_1) \neq \emptyset$ which happens if $M$ halts on $x$. Thus, $M_{H_{TM}^c}$ decides $H_{TM}^c$ which is a contradiction as $H_{TM}^c$ is undecidable.
$Nb: $
Let R be the reduction from $H_{TM}^c$ to $E_{TM}$.
The reduction gives:
i) $\langle M, x \rangle \in H_{TM}^c \Leftrightarrow R(\langle M,x \rangle) \in E_{TM}$
$\qquad$ M loops on input x iff the language recognised by $R(\langle M,x \rangle)$ accepts nothing
ii) $\langle M, x \rangle \notin H_{TM}^c \Leftrightarrow R(\langle M,x \rangle) \notin E_{TM}$
$\qquad$ M halts on input x iff the language recognised by $R(\langle M,x \rangle)$ accepts something