In The World As Will And Representation, Arthur Schopenhauer says Immanuel Kant's idea that space is not a material object can first be found in Pierre Maupertuis.
In Volume II, Chapter IV, Schopenhauer writes:
But what are we to say when we find Kant's most important and brilliant doctrine, that of the ideality of space and of the merely phenomenal existence of the corporeal world, expressed already thirty years previously by Maupertuis? ... Maupertuis expresses this paradoxical doctrine so decidedly, and yet without the addition of proof, that it must be supposed that he also obtained it from somewhere else. It is very desirable that the matter should be further investigated, and as this would demand tiresome and extensive researches, some German Academy might very well make the question the subject of a prize essay.Well it turns out Schopenhauer was right. It wasn't Kant or Maupertuis's original idea. It was Leibniz's and he may have gotten it from Descartes and Aristotle.
"Space without matter is something imaginary." -- Gottfried W. Leibniz, polymath, 1689
"There is no vacuum." -- Gottfried W. Leibniz, polymath, 1689
Leibniz has always been the antidote to Newton as Leibniz thought Newton's gravity hypothesis was utterly absurd (probably because it is).
"Like Huygens, Leibniz never accepted Newtonian gravitation." -- Ezio Vailati, philosopher, 1997
And Leibniz stated General Relativity in 1689 with no need for gravity:
"Since we have already proved through geometrical considerations the equivalence of all hypotheses with respect to the motions of any bodies whatsoever, however numerous, moved only by the collision with other bodies, it follows that not even an angel could determine with mathematical rigor which of the many bodies of that sort is at rest, and which is the center of motion for the others." -- Gottfried W. Leibniz, polymath, 1689
"To summarize my point, since space without matter is something imaginary, motion, in all mathematical rigor, is nothing but a change in the position [situs] of bodies with respect to one another, and so, motion is not something absolute, but consists in relation. This already follows from the Aristotelian definition of place, for motion is the change of place, and place is the surface of the surrounding body, so when this changes, motion occurs, and either the surrounding body or the thing in the place can be assumed to have moved away, leaving the other at rest." -- Gottfried W. Leibniz, polymath, 1689
"When formerly I regarded space as an immovable real place, possessing extension alone, I had been able to define absolute motion as change of this real space. But gradually I began to doubt whether there is in nature such an entity as is called space; whence it followed that a doubt might arise about absolute motion." -- Gottfried W. Leibniz, polymath, 1695 (quoted by Russell 1900)
"...to establish it [gravity] as original or primitive in certain parts of matter is to resort either to miracle or an imaginary occult quality." -- Gottfreid W. Leibniz, polymath, July 1710
Leibniz, G.W., On Copernicanism and the Relativity of Motion, 1689
Leibniz, G.W., First Letter To Hartsoeker, 1710
Schopenhauer, A., The World as Will and Idea, Volume II, 1819
Russell, B., A Critical Exposition of the Philosophy of Leibniz, 1900
Jolley, N., The Cambridge Companion to Leibniz, 1995
Vailati, E., Leibniz & Clarke: A Study of Their Correspondence, 1997
Schönfeld, M., The Philosophy of the Young Kant, 2000