Yes, Hilbert formulated the equations (or at least the Hilbert action from which the Einstein field equations follow) at about the same time, a brilliant mathematician that he was, he only needed a few hints and he was familiar with Riemann’s differential geometry. The idea that differential geometry could be useful for the description of gravity as a field had been known since at least 1913, after Grossmann, Einstein’s classmate with whom Einstein had been collaborating on and off for a few years prior, since maybe 1907, published his paper on the topic. I don’t know the full history, but I was under the impression that Einstein was the main driving force behind trying to come up with incorporating Lorentz invariance into a new theory of gravity.
Yes, Hilbert formulated the equations (or at least the Hilbert action from which the Einstein field equations follow) at about the same time, a brilliant mathematician that he was, he only needed a few hints and he was familiar with Riemann’s differential geometry. The idea that differential geometry could be useful for the description of gravity as a field had been known since at least 1913, after Grossmann, Einstein’s classmate with whom Einstein had been collaborating on and off for a few years prior, since maybe 1907, published his paper on the topic. I don’t know the full history, but I was under the impression that Einstein was the main driving force behind trying to come up with incorporating Lorentz invariance into a new theory of gravity.