Who could have believed that the world was flat? Or that it sits fixed in space, while the cosmos revolves around it? Anyone with two eyes, that’s who. It takes a leap of imagination to contemplate the alternative — that we are standing atop a rapidly spinning sphere, hurtling through space.

Albert Einstein, like Nicolaus Copernicus and Galileo Galilei before him, redefined our understanding of the universe, and he did so thanks to a knack for keeping his thoughts clear of unnecessary information. In fact, he conducted experiments on the basis of thought alone, playing them out in something like the construct from The Matrix — a completely empty space populated with only items essential to his experiments. A clock. A train. A beam of light. An observer or two. An elevator. “Imagine a large portion of empty space, so far removed from stars and other appreciable masses,” said Einstein, describing his mental construct.

Using these ingredients, plus some basic physical principles, Einstein came to mind-boggling yet unavoidable conclusions that overturned all of physics. With special relativity, he showed that time and space are intertwined, not demarcated by the same gridlines and tick-tock regularity for everyone. A decade later with general relativity, he found that gravity actually distorts space and time.

It all started when, at the young age of 16, Einstein conjured up a vivid thought: What would it be like to race alongside a beam of light? The idea seems innocuous enough; if I race alongside a motorist on the freeway and match its speed, we come to a relative standstill. I could say that it is the outside scenery scrolling backward past us, as if we were playing an arcade racing game. Einstein wondered if the same would hold true for the light beam. If he drove fast enough, could he pull neck and neck with the beam, bringing it to a virtual halt? What would the world look like to such a light-speed traveler?

It was Einstein’s imagination that allowed him to take leaps and make connections that his contemporaries could not. He explained his insights by analogy: “When a blind beetle crawls over the surface of a curved branch, it doesn’t notice that the track it has covered is indeed curved. I was lucky enough to notice what the beetle didn’t notice.”

Galileo’s Ship Einstein’s thought experiments are part of a greater tradition in physics. “Einstein didn’t invent the thought experiment, of course,” says Ben Schumacher, a physicist at Kenyon College. “You can find them back at least to Galileo, and I think Einstein was in some ways inspired by Galileo.”

In the 17th century, the Italian Renaissance man used a thought experiment to explain why, even as Earth speeds around the sun, we don’t feel that motion. He imagined being locked inside a windowless cabin of a smoothly sailing ship and conducting various experiments: tossing a ball with a shipmate, or watching the trajectories of pet fish swimming in a tank inside the cabin. Galileo realized these experiments could not tell you if the ship was in motion or not. You wouldn’t have to toss the ball any different to get it to your friend, whether the ship was traveling or anchored in the harbor.

Only by peering outside, and getting a point of reference, could you determine if the ship was moving. So it is on Earth’s surface: As it rotates and revolves, everything goes along for the ride — trees, oceans, air, us. We don’t notice Earth’s motion except by looking at our position relative to the sun or the stars.

Einstein felt that Galileo’s thought experiment had much deeper implications. Schumacher explains: “The laws of physics wouldn’t tell you whether you were moving or not. That was the lesson that he read out of Galileo.” In other words, it isn’t just tossing a ball that would fail to inform you of the ship’s speed. Einstein believed that no experiment — conducted within the windowless cabin and without reference to the outside world — could detect the ship’s motion.

One such law of physics was the recently discovered speed of light. In the 1860s, James Clerk Maxwell developed a theory of electricity and magnetism, describing how changes in an electric field give rise to a magnetic field and vice versa. Combined, these undulating fields are known as electromagnetic waves, and give us visible light, as well as invisible radio waves, microwaves and X-rays. Einstein was particularly interested in the part of Maxwell’s theory that predicted that a beam of light travels at 671 million mph, commonly known as the speed of light.

So Einstein decided to add the speed of light to Galileo’s thought experiment. “Even if you didn’t just do experiments on balls and fish, and you also did experiments with light, then you wouldn’t be able to tell that the ship was moving,” says Schumacher of Einstein’s thought process.

First, Einstein updated Galileo’s ship to a more suitable option for the 1900s: the train. Imagine that a train passenger — to honor the Italian scientist, let’s call her “Gail” — turns on a flashlight and measures the speed at which the light travels. Maxwell’s theory told Einstein that Gail should calculate 671 million mph. And Galileo’s thought experiment demonstrated that she should get exactly that result no matter how fast the train traveled. So far, so good. But what does “Leo,” a bystander on the train platform, see?

Everyday experience would lead you astray: You’d think that Leo would measure the light traveling at 671 million mph plus the speed of the train. Since the time of Isaac Newton, both common experience and the mathematics of physics suggested that velocities simply add: If Gail throws a ball at 30 mph in the direction the train is traveling, Leo measures the total speed of the ball as 30 mph plus the train’s speed. But Maxwell’s theory requires that the light travel at exactly 671 million mph, no more and no less, regardless of the train’s speed. This apparent contradiction puzzled Einstein.

Slowing Time, Shrinking Space He ended up figuring out the contradiction — and revolutionizing physics — by revisiting the idea of chasing a light beam. According to Newton, you should be able to pull up alongside the light beam if you could travel fast enough. But in Einstein’s empty mental construct, without landmarks to help gauge how fast you move, pulling alongside the light beam would be tantamount to measuring the light’s speed to be 0 mph, in direct conflict with Maxwell’s laws. Einstein realized that it was impossible to catch up to the front of the beam.

The outcome of the light beam race is therefore “a bit of an anticlimax,” admits Dennis Lehmkuhl, the scientific editor of the Einstein Papers Project, which provides annotated versions of Einstein’s manuscripts. “In a way, that’s exactly the big outcome of the experiment — that it doesn’t work.” Armed with this realization, Einstein could finally make sense of the Gail/Leo thought experiment, but only after redefining our everyday notions of space and time.

We tend to think of time and space as completely separate entities. We move about in the three dimensions of space and all the while time marches inexorably forward. We also assume that space and time are the same to everyone, everywhere. A mile is a mile, and an hour is an hour.

Questioning these basic assumptions is where Einstein’s imagination really kicked in. He realized that in order for a fast-moving observer to measure the same speed for light as a stationary observer, notions of universally agreed-upon space and time go out the window. “There is no audible tick-tock everywhere in the world that could be considered as time,” said Einstein. Two people in relative motion will experience time differently.

From Leo’s perspective on the platform, Gail will experience a slowing of time. Her wristwatch will, to him, run slow. Not that there is anything wrong with Gail’s watch. It is time itself that slows down for her. In fact, any time-keeping device on the train will run slow, even a beating heart. That’s right — Gail will age more slowly than Leo.

And don’t forget the lesson of Galileo: From her seat on the train, Gail can’t tell whether she is in motion or not. That means she is perfectly justified in saying that Leo has zoomed backward past her, and that it is his watch that’s running slow since he’s the one moving. If you insist that Gail is the one in motion, try the thought experiment again in Einstein’s construct, with Gail and Leo floating in empty, featureless space. Either of them can accurately assert that it was the other who drifted past. Gail now claims that Leo ages more slowly, and Leo swears the opposite. This situation — known as the twin paradox — can be resolved when one of the two parties reverses direction in order to reunite and conclusively compare ages.

To wrap your mind around the concept of time slowing down, imagine a specialized clock where a beam of light bounces between two mirrors, one suspended above the other. Each time the beam makes a round trip, the clock “ticks.” We give such a light clock to both Gail and Leo. From Leo’s vantage point on the station platform, Gail’s light beam isn’t tracing a purely up-and-down path. During each journey between the mirrors, the train moves forward a bit. So Leo sees Gail’s light beam tracing out a longer diagonal path to reach the next mirror — in other words, Gail’s clock ticks slower. (And again, Gail would see the same happening to Leo’s clock.)

The weirdness doesn’t end there. Leo will also see that the train, and everything moving along with it, contracts. To him, it becomes shorter. Don’t worry, Gail’s fine. It’s just that space isn’t the immutable, rigid structure that we assume. Unfortunately, there’s no simple way to wrap your mind around this one, but time slowing and length contraction are two sides of the same coin. In order for all observers to get the same answer for the light’s speed — remember, speed is simply distance divided by time — the two effects must coexist.

As outlandish as it seems that Gail’s clock runs slower, or that she and the train are compressed, special relativity has passed every experimental test thrown at it since its publication in 1905. It has become a pillar of physics. The behavior of high-speed particles — whether the result of physicists’ colliders or the sun’s nuclear furnace — only makes sense with special relativity.

It Gets Crazier Nevertheless, the scope of special relativity was limited, hence the name special relativity — it worked only when objects move at constant speeds. Einstein wasn’t satisfied. He wanted a theory that encompassed all motion, whether the speed is constant or variable.

Just as special relativity was seeded by a simple thought (the light beam race), so too was general relativity. One day in 1907, the story goes, Einstein was working at his job at a patent office in Bern, Switzerland, when he imagined a person in free fall, as if a workman fell off a tall scaffold. The lightbulb went off. What if, while falling, he dropped an object — say, an apple?

Again, Einstein’s imagination cleared away all of the encumbering details of the nearby scaffolding and approaching ground. He realized that after letting go of the apple, the falling workman would see it sit there, hovering where he left it, because they were both falling at the same speed.

It’s not that gravity has “turned off.” Since all objects fall at the same rate, and there were no other cues in Einstein’s mental construct, the workman would feel like he was floating in empty space. (We have a vicarious sense of this “zero-g” situation today from footage of space station astronauts, who are not outside of Earth’s gravitational field, but actually in free fall as they orbit Earth.) Einstein would later describe this thought experiment of the falling workman as “the happiest thought of my life,” because it provided the necessary jump-start for his general theory of relativity.

Continuing the thought a bit further, imagine the workman is now safely in a windowless capsule in space. The ship’s engines fire, and its floor quickly rises to meet him. The workman-turned-astronaut now finds himself pressed to the floor, much the way you are currently pressed to your seat. If he drops his apple now, he sees it fall to the floor. The acceleration of the spacecraft restores his sensation of gravity.

These two thoughts — free fall feels the same as being at rest in gravity-free space, and accelerating upward through space feels the same as sitting at rest in a gravitational field — form what is known as the equivalence principle. With it, Einstein realized that the effects of acceleration and gravity are equivalent.

Warped Space and Time Einstein’s main insight from special relativity was to take Galileo’s mechanics experiments and try them with light. So, he used the same strategy with the equivalence principle. “It is known that a gravitational field influences the movement of bodies,” Einstein began. “We obtain a new result of fundamental importance when we carry out the analogous consideration for a ray of light.”

Imagine you are now a lonely astronaut floating through the empty void of Einstein’s mental construct. You decide to send out an SOS signal with your suit’s built-in laser pointer. Just as you begin sending out the rays of light, a spaceship zooms up, accelerating past you. You hope they caught a glimpse of your signal.

From your point of view, the beam of light emitted from your suit travels straight ahead. As the ship zooms past, the light luckily hits a window. But as the light makes its way through the ship, the ship continues to accelerate. When the light finally strikes the back wall of the ship, it hits a spot lower than where it entered the window. So, from within the ship, the beam you saw travel in a straight line instead appears to have curved.

Remember: What’s true for acceleration is true for gravity. Passengers aboard the accelerating ship see that the light from your distress signal traversed a curved arc on its way through the ship. So with the equivalence principle, Einstein realized that gravity must bend light! More accurately, gravity warps space itself. And light, like a marble rolled across a warped trampoline, follows the curvature of space. In 1919, astronomers directly observed the bending of light around the sun during a solar eclipse.

In another thought experiment, Einstein used the equivalence principle to show that gravity also warps time. He imagined a clock positioned on the perimeter of a spinning disc. That’s not exactly a contraption we often encounter, so we can instead picture a carnival ride where you stand inside a large barrel, back against the wall. The barrel begins to spin, pinning you strongly to the outer wall. Again, that force is equivalent to the gravity that keeps you seated in your chair. But at the same time, special relativity already showed that clocks in motion run slower, so as you zoom around, time for you will appear to an outside bystander to run slow, just as it did for Gail on the train. In fact, the faster the carnival ride spins, the slower your watch will tick. Because of that equivalence principle, then, the same must be true for gravity: As a gravitational field grows stronger, time slows even more.

This warping of time has everyday consequences, since Earth’s gravity affects GPS satellites in orbit. Because they are far from Earth’s center, they experience weaker gravity than we do on the ground, so their clocks run just a bit faster. However, the satellites are also orbiting at very high speeds, which means that due to special relativity, their clocks will run slower too. The two effects don’t quite cancel out, so altogether, the satellite’s onboard clock runs about 38 microseconds too fast each day. Without taking special and general relativity into account, a GPS-determined location veers off-course by as much as 6.2 miles a day.

A Legacy of Thoughts “Almost every one of Einstein’s advances in relativity had a thought experiment at the back of it,” says Schumacher, the Kenyon College physicist. Even the famous equation E = mc2 was derived not from direct measurements, but from mental imagery. “It’s a ridiculous example — a train car being pushed around by light,” says Schumacher, describing the simplicity of the experiment.

Imagine an enclosed train car resting on a track. Suddenly, the back wall emits a single particle of light toward the front. This causes the train car to recoil backward, much like if you walked from the back to the front of a floating canoe: The canoe slides backward in the water. When the particle of light strikes the front wall of the train car, it brings the car’s backward motion to a halt. In the process, the car has moved backward a bit. Einstein knew that train cars don’t spontaneously move down the tracks, so the backward motion was only possible if some of the car’s mass had moved from the back wall to the front — just like your mass shifting to the front of the canoe. That meant the light energy absorbed by the front wall had been converted to mass.

This key insight — energy and mass are themselves equivalent — lies at the heart of nuclear power and nuclear weapons. The equation tells us the specifics: that energy is equal to mass times the speed of light squared. Since the speed of light is a huge number (recall, 671 million mph), even the tiniest mass can create an unbelievable amount of energy.

All this, from the empty construct in Einstein’s mind. In 1916, he wrote a popular account of his relativity theories. “The original title, if you translate it directly, would be ‘Special and General Relativity: To Be Understood by the Common Man,’ ” says Lehmkuhl, the Einstein Papers Project editor. But Einstein recognized that even he might not have been able to make his teachings very accessible, joking that “the common man might not be that common.” So don’t despair if you feel you haven’t yet mastered the thought experiment — it took Einstein to make them look easy.

[This article originally appeared in print as "All in His Head."]