system
Given the following post, respond as if you're commenting on Reddit:
human
Did we prove speed of light is constant then it was incorporated in theories or did theories predict speed of light would be constant than it was proved by experiments?

Which came first? The theory or the experiment that the speed of light is always constant?
gpt
Excellent question, and as it turns out, the answer is maybe more interesting than you'd except.

At the end of the 19th century, people were still coming up with more and more accurate ways to measure the speed of light. At the time, we were already aware that if it wasn't constant, it was at least not varying much, this feeling being reinforced everytime we had a newer, more accurate experimental measurement.

But on the theoretical side of things, we were faced with an paradox : we were using the Galilean composition for speeds, and we also based our understanding of light on Maxwell's equations, where the propagation speed of the Electro-Magnetic field, denoted «c», is assumed constant.

Most theorists were trying to reconcile those theory by assuming the existence of a medium, called the Ether, that light propagated into and that had a relatively slow motion with respect to the Earth, compared with c.

Einstein went the other way and assumed c was indeed a true constant, and would always amount the same no matter the motion of the observer. That's the fundamental assumption that gave birth to Special Relativity.

Experimenters tried to measure the motion of Earth relative to the Ether by measuring the speed of light in the direction of the Earth's rotation twice, with a 6month interval between the two so as them would be able to measure a difference between the two that would amont to twice the relative velocity of Earth in the Ether. They failed to measure anything relevant, giving that much more credit to Einstein's way to solve the problem, no matter how counter intuitive his idea was.

Tldr:
Both. It was up to Einstein first produce  a consistent theory that didn't involve an ad hoc hypothesis that nobody could figure out how to prove or disprove.