The Heisenberg Lie algebra (HA) plays an important role in mathematics with Fourier transforms, as well as for the foundations of quantum theory where it expresses the operators of space-time, X, and their commutation rules with the momentum operators, D, that execute infinitesimal translations in X. Yet it is known that space-time is curved and thus the D operators must interfere thus giving “structure constants” that vary with location which suggests a mathematical generalization of the concept of a Lie algebra to allow for “structure constants” that are functions of X. We here investigate the mathematics of such a “generalized Heisenberg algebra” (GHA) which has “structure constants” that are functions of X and thus are in the enveloping algebra rather than constants. As expected, the Jacobi identity no longer holds globally but only in small regions of space-time where the [D, X] commutator can be considered locally constant and thus where one has a true Lie algebra. We show that one is able to reframe Riemannian geometry in this GHA. As an example, it is then shown that one can express the Einstein equations of general relativity as commutation rules. If one requires that the GHA commutator reduces to the HA of quantum theory in the limit of no curvature, then there are observable effects for quantum theory in this curved space time.