When Equality Fails as a Rewrite Principle: Provenance and Definedness for Measurement-Bearing Expressions
This paper presents a unified formal semantics for measurement-bearing expressions that tracks provenance and definedness to establish sound one-way rewriting and interchangeability judgments, demonstrating that ordinary algebraic equality fails as a rewrite principle due to issues like observation reuse and division-induced domain differences, with all results formalized in Lean 4.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a chef trying to perfect a recipe. You have a set of rules for simplifying your instructions: "If you add salt and then subtract the same amount of salt, you can just write '0 salt'." In a perfect, mathematical world, this rule always works.
But in the real world of measurements (like cooking with a slightly shaky hand, or measuring ingredients with a ruler that has a tiny bit of wiggle room), this simple rule can lead to disaster.
This paper is about why mathematical equality is a dangerous guide when you are dealing with real-world data, and how to build a better set of rules that doesn't break your experiment.
Here is the breakdown using simple analogies:
1. The Two Traps of Measurement
The authors say there are two main reasons why you can't just swap one measurement formula for another, even if they look the same on paper.
Trap #1: The "Copy-Paste" vs. "Two Different Cups" Problem (Provenance)
Imagine you have a cup of water.
- Scenario A: You pour the water into a bowl, then pour it back into the cup. If you calculate "Water in bowl minus Water in cup," you get zero. This is safe because it's the same water (same "token").
- Scenario B: You have two identical cups of water. You pour Cup 1 into a bowl, then pour Cup 2 into the bowl. If you calculate "Water from Cup 1 minus Water from Cup 2," you cannot assume the result is zero. Even if both cups say "250ml," one might actually be 250.1ml and the other 249.9ml.
The Lesson: In math, . In measurements, if and come from two different observations (even if they look identical), is not necessarily zero. You need to track the "ID card" (provenance) of every measurement to know if they are the same object or just look-alikes.
Trap #2: The "Divide by Zero" Trap (Definedness)
Imagine a rule that says: "Divide any number by itself, and you get 1."
- If you have a number like 5, . Safe.
- But what if your measurement could potentially be zero? If you write , and happens to be 0, the math breaks (division by zero).
- The number 1 is safe everywhere. But the formula is dangerous if can be zero.
The Lesson: You can safely replace a dangerous formula () with a safe one ($1$) to fix a problem. But you cannot replace a safe formula ($1$) with a dangerous one () just because they look equal. The "safety zone" (where the math works) has changed.
2. The New "Safety Rules"
The authors propose a new way to think about these formulas using two concepts:
- The "Token" (The ID Card): Every measurement gets a unique ID. If you see the same ID twice, the computer knows it's the exact same hidden value. If you see two different IDs, even if they look the same, the computer treats them as potentially different.
- The "Admissible Domain" (The Safety Zone): Before you simplify a formula, you must check: "Does this new formula work in every situation where the old one worked?"
- If the old formula worked when the temperature was 0°C, and the new formula crashes at 0°C, you cannot make the swap.
- If the old formula crashed at 0°C, and the new one works there, you can make the swap (you are making it safer).
3. Why This Matters (The "Chef's Dilemma")
The paper uses a specific example: Measuring a signal, subtracting a background noise, and dividing by a reference.
- If you don't track the "ID cards," you might accidentally think you can cancel out noise that was actually measured twice separately.
- If you don't check the "Safety Zone," you might simplify a formula that works fine for most temperatures into one that explodes if the temperature hits zero.
4. The "Strictness" Discovery
The authors found something surprising: Simplification is often a one-way street.
- You can simplify a complex, dangerous formula into a simple, safe one.
- But you often cannot go back. Once you remove the "danger" (the singularity), you lose the information about where the danger used to be. It's like taking a warning label off a box; the box is still there, but you've forgotten it might explode.
5. The "Proof" (The Computer Check)
The authors didn't just write this down; they built a massive digital proof system (using a tool called Lean 4) that checks every single step of their logic. They proved that:
- If you ignore the "ID cards" (provenance), you get wrong answers.
- If you ignore the "Safety Zones" (definedness), you get wrong answers.
- You need both to be safe.
The Big Takeaway
In the world of science and engineering, mathematical equality is not enough. Two formulas might look identical, but if one relies on a specific measurement being reused, or if one crashes under specific conditions, they are not interchangeable.
To write safe software for scientists, we need a system that asks two questions before simplifying anything:
- "Are these the same physical object, or just look-alikes?" (Provenance)
- "Does this new formula work in all the places the old one worked?" (Definedness)
If you can't answer "Yes" to both, you must leave the formula alone.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.