# Question about Einstein's formulation of his tensor equation

I understand that all physical laws essentially codify mathematically observed behavior. Newton codified Kepler and Brahe data, for example. Quantum Mechanics codifies observed particle behavior at relatively low speeds, etc. But Einstein had no empirical data to work from… So, I do not understand how it was possible for him to “invent” something that ended up working empirically… I know he was a genius, but was he also “simply” lucky?