Explanation of an explanation of Turing's proof to the halting problem?
P should take two arguments: a TM M and a string x. P accepts if M halts on input x, otherwise rejects. Definition of P:

P(M, x): execute M on x and if it halts, go to the accepting state. If M doesn't halt on x, go to the reject state.

The language of the words accepted by P is Turing recognizable but not decidable. So you can define P, but the machine won't stop for all the inputs, and this is what you're trying to demonstrate.

You don't need to know the code source of P to produce P'. P' can be seen as:

P'(Q):
execute P(Q, 'Q'), where 'Q' is the encoding of the TM Q, and if P accepts then don't halt, else halt.

The point is: if you suppose that a machine P that decides the Halting Problem exists, you're going to get a contraddiction. In fact you can produce a machine P' for the complement (you can do this because we are presuming the Halting Problem is decidable), so that it stops if the machine given in input doesn't and viceversa. If you try to use P' on P', then you get an antinomy.

I'm not sure this answer to your questions..