Hernan and Robins provide a proof for the equivalency of inverse probability weights and standardization for estimating the potential outcome mean that I am struggling to follow (technical point 2.3, page 24 of the first edition, excerpts pasted below).
There are two steps that I don't understand.
(1) Why is it that we can they rewrite the first term as the second, specifically replacing the f[A|L] with f[a|l]. And then, why is it that we can replace the indicator function in the numerator with the expected value (i.e. (I(A=a)Y) with E[Y[A=a, L=l] now that they are summing over l)? Canceling f(a|l) from the numerator and denominator I understand.
(2) In the second line of this proof, again, I don't understand the implications of f[A|L] as compared to f[a|L], though I understand it's made possible by conditioning on L. And similarly, why is it that we can "move" Y(a) out of the first expectation and multiply by E[Y(a)|L] because of conditional exchangeability?
Hernan/Robins discuss f[A|L] as compared to f[a|l] in technical point 2.2, which helps somewhat, but, i'm not sure I understand what it means to evaluate A and L at random arguments as opposed to fixed arguments.
Any help with the intuition, or the mathematical properties of expectations that make these steps possible would be greatly appreciated.