# Where Does the Energy Come From in this Example?

I can't figure out where the energy comes from for the work in a video I found about how the pyramids could have been made. (I do not have enough rep to post the link of it as well as the picture but it is titled "Building the Pyramids of Egypt ...a detailed step by step guide.")

I know that this is quite similar to other questions such as the perpetual motion machine problem like this but this one involves locks and the column of water is not surrounded by water.

The basic idea is that something positively buoyant can be floated above the water level by the use of a column of water like a cup.

To submerge the matchsticks(or any positively buoyant object) and make them float I would have to fight against the pressure where the red arrow is and then move them to below the cup at the green arrow. Is the pressure different at the green arrow compared to the red arrow? It would make sense because there is more water above where the green arrow is from the cup. If so, then is there a pressure change right at the white dotted line? Do I do more work by moving the matchsticks across that line than by moving it around other places in the water?

Additionally where does the energy come from when there are locks or valves?

I only have to do the work to submerge the matchsticks against the pressure from the water up until the closed lock but when I open the lock the matchsticks can keep on floating so where does the energy to do that extra work come from? Is it from me opening the lock?