Science and Magic

I recently came across a worldbuilding stackexchange question asking for thoughts on a fundamental "theory of magic". As a result I decided to figure out what the difference between magic and science is. Turns out there is a single theory so fundamental everyone forgets about it and assumes it to be true.

The universe can be described by the same set of rules everywhere.

This is called "uniformitarianism" and is as much a philosophical theory as a scientific one.

200 years ago it was thought that mass would be conserved always. When Einstein did his E=mc2 thing, it was to describe a way that mass could be transferred into energy. It is now assumed that this applies always (AFAIK). For another example consider the speed of light. It is constant throughout the universe, right? Or even if it wasn't, surely someone will come up with some more fundamental rule that governs how it changes?

Even more esoteric things that require probabilistic descriptions fall into this category. As far as I understand, nearly all quantum theory is built on probabilities rather than direct relations. Saying something will occur x% of the time following formula y is still a uniform universal rule.

You can some of derive fundamental physics from uniformatism. Conservation of mass/energy only works in a universe where rules can be applied uniformly.

Thus the theory that the universe can be described through mathematical rules, and that these rules can be applied anywhere is the foundation of all science ever.

For magic to not be a form of science, magic has to "break" uniformitarianism - otherwise it's just poorly understood science. As such the founding principle of all magic is:

The universe has things that cannot be described by a single set of rules

I can't even really conceive of something that follows this rule. You quickly hit the realm of paradoxes. What I would suggest for narrative purposes is to bind rules to people/entities instead of to the universe. The problem is that this requires a different magic system for every person people. Consider:

The solution is:

This means that every magic school in existence is not "teaching spells" but instead has to teach some means of self-discovery. The problem is that every student will necessarily be completely different to the last, and the outcome is completely unpredictable. For some meditation will result in spawning fireballs. For others juggling crystal balls while whistling pop-goes-the-weasel will destroy the moon.

I wish magic teachers good luck.

For the sake of simplicity, most fiction goes with the "magic is just poorly understood science"....