Prove Halting on all Inputs is not in RE simulation I don't understand why when proving if Halting on all inputs problem si not in RE using the complement of the halting problem, I have to take a turing machine and simulate the machine M(the machine that the halting problem receives as input) on w(the word received as input) for n steps.

Can somebody explain to me who is n and why do we need to simulate M for n steps? Why not only once?

For proving that halting on all inputs problem is not in RE, the complement of halting problem is used. Supposed we take M(w) as the turing machine used for halting problem, I get the next simulation:

M'= simulate M(w) for n steps;
        if M(w) halts, make it loop
        else, stop.

I don't understand why do I have to make M' simulate M(w) for N STEPS. Why can't I just simulate it one and that's it?

N stands for the length of the word. I don't understand the simulation for a number of steps. Why is that?
What is the Halting on all inputs problem?

It is the problem about the language $TOTAL=\{⟨M⟩\mid M \text{ is a TM and }M\text{ halts on all inputs} \}$.

What are all inputs? Let us fix $\Sigma$, the set of input symbols for Turing machines. The set of all inputs is $\Sigma^*$, the Kleene star of $\Sigma$. Let $E$ be a Turing machine that computes a one-one correspondence $cor$ from $\Sigma^*$ to nonnegative numbers.



In order to specify the behavior of a Turing machine $M$ whose language/encoding is in $TOTOAL$, we will just specify its behavior when the input is a nonnegative integer $n$ with the understanding that we are actually specify its behavior on the input that corresponds to $n$ under $E$.

What is the complement of the halting Halting problem?

It is the problem about the language $\overline{HALT}= \{⟨M, w⟩\mid M \text{ is a TM and }M\text{ does not halt on input } w\}$. 

Given a word $⟨M, w⟩$ where $M$ is a Turing machine and $w$ is a input word, how can we construct a new Turing machine related to the way how $TOTAL$ is specified?


  $M'$ = simulate $M(w)$ for $n$ steps; if $M(w)$ halts, make it loop else, stop.


The above quotation of a construction is too brief to be understood correctly easily. Here is a more detailed construction that should be easier to understand.


  $M' = $ "On input $x$, use $E$ to compute $cor(x)$. Simulate $M$ with input $w$ as long as possible but for no more than $cor(x)$ steps. If the simulation halts, continue to loop forever; otherwise, halt."


Now you should be able to check that 
$$⟨M, w⟩\in\overline{HALT} \Longleftrightarrow M'\in TOTAL.$$ 

The too-brief version equates $x$ with $cor(x)=n$, which could be very confusing for beginners although acceptable for users experienced in the theory of computability. 


  I don't understand why do I have to make M' simulate M(w) for N STEPS. Why can't I just simulate it one and that's it?


The "N" in "N STEPS" is/represents/encodes the input to $M'$. It is a variable independent of $M'$.