A conceptual problem. Suppose we have a spring whose stiffness constant is $k$. The spring is attached to a wall and the other end is fastened to a block. If we pull the block by an external force without changing its kinetic energy and increase the length of spring by $x$, then which of the following statement should be correct:
$\to$ The potential energy of spring increases by $\frac{1}{2}kx^2$
$\to$ The potential energy of spring+wall+block system increases by $\frac{1}{2}kx^2$.
I think the latter statement is correct because if we leave either of block or wall or both free then they use this potential energy stored to convert it into kinetic energy. However, the first statement also doesn't seem wrong as we can say that spring applies force on the block when we leave it doing positive work on it and thus giving its stored potential energy to the block in form of kinetic energy
Are both correct?
What is the difference between the two or are they both equivalent?