A pulley is pulled with external force $F$. $x$ and $y$ denote the displacement of two ends of strings of the pulley and $z$ is the displacement of the pulley.
Prove That $$z = \dfrac{x+y}{2}$$
My teacher stated it in class without providing a proof. I think that it is valid for ideal conditions (massless pulley and string) and only with certain kinds of forces, but he says it is valid in all cases.
Can anyone help me with the general proof? Thanks in advance.