The discovery of mathematics in deep Antiquity, together with its essential pair, geometry, was an important factor shaping rationalistic tendencies of the European spirit. From Plato’s belief that “God geometrizes” through Einstein’s conviction that the goal of science is nothing else but “to discover the mind of God,” interaction between geometry and theology continued with change a changing rate and intensity.

From J. Wentzel Vrede van Huyssteen, Encyclopedia Of Science And Religion

Middle Ages through the nineteenth century

During the Middle Ages theology formed the natural environment for the sciences. For instance, the shift in theology from the understanding of God’s presence in the world in terms of “his power” to the understanding of his omnipresence in terms of “all places” fostered the gradual emergence of the modern idea of space extending to infinity. This process culminated with the French philosopher and mathematician René Descartes (1596–1650), who identified matter with only one of its attributes, extension: body is nothing but an extended thing. Descartes was doubtless inspired by his monumental discovery of analytic geometry—the first really important discovery in geometry after Euclid and Apollonius. In Descartes’s view, science, which should be done “in a geometric manner” (more geometrico), is concerned with extended bodies, thus leaving to philosophy the realm of consciousness.

In the seventeenth century a kind of fusion occurred between science and theology (called physico-theology) to an extent unheard before. This is clearly seen, for instance, in the writings of Isaac Newton (1642–1727). In creating his concept of absolute space Newton was a direct successor of former disputes on God’s omnipresence. Newtonian absolute space, which “in its own nature, without relation to anything external, remains always similar and immovable” (Principia; 1687), has three attributes: homogeneity, immobility, and infinity, which qualify it as both the universal arena for physical processes and the “sense organ” of God (sensorium Dei). The enormous successes of Newton’s physics overshadowed his theology and only the former function of the Newtonian space continued to exercise its influence on subsequent generations of thinkers.

Newton’s absolute space as an arena for physical processes constituted an inherent element of the mechanistic worldview, and it came as a shock when it turned out that Euclidean space is not the only possibility. The dispute concerning Euclid’s “fifth postulate” lasted from antiquity. The question was whether the fifth postulate has to be accepted as an independent assumption or could be deduced from other postulates. Many proofs of the fifth postulate produced during the centuries invariably turned out to fail. Around 1830, three mathematicians—Nikolai Ivanovich Lobachevsky (1793–1856), Janos Bólyay (1802–1860), and Carl Friedrich Gauss (1777–1855)—demonstrated independently but almost simultaneously that one can obtain a new geometry, a geometry that is absolutely consistent from a logical point of view, based on the negation of Euclid’s fifth postulate. This shows that Euclid was right: The fifth postulate is an independent assumption and cannot be derived from other postulates. This long expected conclusion was overshadowed, however, by the fact that a new non-Euclidean geometry was possible.