How did Einstein generalise the Einstein elevator thought experiment to conclude with the equivalence principle?

Suppose a reference frame S1 is accelerated in the x direction with a constant acceleration g. A second frame S2 is at rest in a homogeneous gravitational field which imparts to all objects an acceleration −g in the x direction. Observationally there is no distinction in any respect between S1 and S2. All bodies are, to wit, equally accelerated in the gravitational field. By GENERALISING this mechanical equality, Einstein postulated the complete physical equivalence of a gravitational field and the corresponding acceleration of the reference frame. This is the so-called ‘equivalence principle’.

The first realisation of equality is from the Einstein Elevator thought experiment. Could someone please explain what grounds Einstein had to generalise his local observation to conclude with the equivalence principle.

Thank you.

• "Could someone please explain what grounds Einstein had to generalise his local observation to conclude with the equivalence principle." Well, you just said what they were. Physics is not a deductive science. You start with things you know, and guess a more general law that explains them. The justification for the guess is that it works. (The idea that science should be purely deductive is a mistake that led to centuries and centuries of wasted time, which apparently many philosophers still hold.) – knzhou Dec 30 '18 at 12:29