In order to include electromagnetism into the geometry of general relativity, Hermann Weyl worked to generalize the Riemannian geometry upon which general relativity is based. His idea was to create a more general infinitesimal geometry. He noted that in addition to a metric field there could be additional degrees of freedom along a path between two points in a manifold, and he tried to exploit this by introducing a basic method for comparison of local size measures along such a path, in terms of a gauge field. This geometry generalized Riemannian geometry in that there was a vector field Q, in addition to the metric g, which together gave rise to both the electromagnetic and gravitational fields. This theory was mathematically sound, albeit complicated, resulting in difficult and high-order field equations. The critical mathematical ingredients in this theory, the Lagrangians and curvature tensor, were worked out by Weyl and colleagues. Then Weyl carried out an extensive correspondence with Einstein and others as to its physical validity, and the theory was ultimately found to be physically unreasonable. However, Weyl's principle of gauge invariance was later applied in a modified form to quantum field theory.