Generalization of Feynman's derivation of the formula for gravitational potential energy in FLP volume I In the Feynman Lectures on Physics, Feynman derives the formula for gravitational potential energy by applying a line of reasoning he borrowed from Carnot on reversible weight lifting machines (FLP I, chapter 4–2 Gravitational potential energy).
I mostly understand his argument there, I follow the line of reasoning without a problem up until the point where he says 

The generalization is clear: one pound falls a certain distance in operating a reversible machine; then the machine can lift $p$ pounds this distance divided by $p$. Another way of putting the result is that three pounds times the height lifted, which in our problem was $X$, is equal to one pound times the distance lowered, which is one foot in this case.

Fair enough. But then he loses me:

If we take all the weights and multiply them by the heights at which they are now, above the floor, let the machine operate, and then multiply all the weights by all the heights again, there will be no change. (We have to generalize the example where we moved only one weight to the case where when we lower one we lift several different ones—but that is easy.)

Can anyone explain how he arrives to the conclusions in the second quote? How we can generalize the example to different weights? (He claims that's easy but to me, it isn't :))
 A: I've had the same problem reading this and seeing that no one seems to have explicitly explained it I set out to do it in this answer.
What has been derived so far is that for a reversible machine which drops one unit of weight (UW) a distance $h_{down}$ and raises p units of weight a distance $h_{up}$ the following holds:
$$
1\,\mathrm{UW} \cdot h_{down} = p\cdot 1\,\mathrm{UW}\cdot h_{up}
$$
Strictly speaking, this has been shown to be true for $p=3$ but it is obvious that the same line of reasoning can be applied for any $p$.
Let us define the initial and final heights of the weight that is going down and the $p$ weights that are going up as $h_{initial, down}, h_{final, down}, h_{initial, up\ 1}, h_{final, up\ 1} \dots h_{initial, up\ p}, h_{final, up\ p}$. Now we can substitute the differences in height in terms of absolute differences (note that both distances are positive), whereby we write out the multiplication on the RHS of the equation as a sum of p terms:
$$
1\,\mathrm{UW} \cdot (h_{initial, down}-h_{final,down}) = \sum_{i=1}^p 1\,\mathrm{UW}\cdot (h_{final, up\ i}-h_{initial, up\ i})
$$
We can rearrange this equation to have "initial" and "final" terms on separate sides:
$$
1\,\mathrm{UW} \cdot h_{initial, down} + \sum_{i=1}^p 1\,\mathrm{UW}\cdot h_{initial, up\ i} = 1\,\mathrm{UW} \cdot h_{final,down} + \sum_{i=1}^p 1\,\mathrm{UW}\cdot h_{final, up\ i}
$$
It is now tempting to write (and this is what Feynman is trying to get at)
$$
\sum_i W_i\cdot h_{initial,i} = \sum_i W_i\cdot h_{final,i},
$$
but this is more general than what has so far been derived and Feynman in trying to be rigorous notes that in the remark

We have to generalize the example where we moved only one weight to the case where when we lower one we lift several different ones.

Crucially, we have only shown this equation to hold for the "1 down, p up" machine, but there are clearly many more variants! Firstly, we notice that the choice of units is arbitrary, so "1 down, p up" becomes "$x$ down, $px$ up". Because the machine is reversible, also "$px$ down, $x$ up holds" and it now seems that it has been shown for any "$a$ down, $b$ up" one could think of.
But alas, we have only only taken into consideration Feynman's initial configuration where the weights to be raised are of equal weight and equally spaced in the vertical direction. This then by itself proves nothing about the machine that drops one unit weight and raises two level unit weights. This is an easy exercise (I can't use CorelDraw so this will be text-only for time being): assume again that the unit weight is dropped from 1 ft height ant that the weights to be raised finish at the height $X$. Then use the machine that takes two level unit weight and lifts one a distance $X$ and at the same time drops another the same distance - symmetry considerations should guarantee this machine's plausibility. Then we are left with two unit weights on the floor and one at the height $2X$ which by reversibility considerations must coincide with 1 ft. Thus the proposed engine satisfies the equation.
If we go directly by Feynman's words, we should consider the case when "we lift several different ones [weights]". Consider then the machine that drops 1 UW weight from 1 ft and lifts from the floor a 1 UW weight alongside with a 2 UW weight. We again use another machine to lower the 2 UW weight a distance $X$ and lift the 1 UW weight a further $2X$. Reversibility considerations demand that 1 ft coincide with $X + 2X = 3X$ with again is in accordance with the proposed equation.
I believe these are the considerations Feynman had in mind but I welcome any comments.
