Given that I know nothing about martingales, take this with a little bit of salt:

(1)

(2)

(3)

(4)

(5)

To go from (2) to (3), notice that conditionally the stuff we factored out is a constant, and is exactly equal to . To go from (3) to (4), we notice that is independent of the rest of the data, so that it is independent of a function of the rest of the data, so we can get rid of the conditional part of the expectation. To go from (4) to (5), we just grind out that which is really easy to do by working with the pdf.