Why is it valid to treat units as variables?

360 Views Asked by At

I've always taken for granted the fact that units can be treated as variables in mathematical expressions. If you have an object that travels $10m$ in $2s$, you can simply divide the length by the time and get $5m/s$.

This works well and all, but I have started to get a bit uncomfortable with just accepting these mathematical manipulations as valid. It feels similar to treating $dy/dx$ as a fraction in calculus, it does the job most of the time, but it's not quite right.

To try and make sense of it, I went back to the definition of the division: $n/m$ means "how many times can $m$ fit in $n$". If we apply this to the velocity example above, we get: "how many times does $2s$ fit into $10m$". Not super helpful... I've tried a couple of different avenues and nothing really convinces me that treating units as variables is a valid concept. In other words, I would love to be able to understand why dividing $10m$ by $2s$ gives us a velocity. Not only from intuition but by using rigorous mathematical notions.

Just to be clear, I am not confused about how it works. I am aware that if an object travels $10m$ in $2s$ (without any acceleration), then after a single second, 5 meters would have been traveled, thus telling us that the object is traveling at $5m/s$. What confuses me is why we can treat units as mathematical variables (Edit: Variables that are only valid under multiplication/division).

Any help and or references to works discussing these matters would be greatly appreciated!

Edit: Here are some posts about this question that unfortunately have not fully answered my questions.

Why do units (from physics) behave like numbers?

Why does it make sense to multiply/divide units?

May I treat units (e.g. joules, grams, etc.) in equations as variables?

2

There are 2 best solutions below

6
On

Because it works well, and tells you what you can and can't do. For example, if you multiplied $7$ and $2m$, intuitively that means a length that is 7 times longer than 2 meters. If you do it algebraically, treating m as a variable, you get $7(2m)=14m$, which is correct. However, if you did $7m*2m$, you don't want a 1 dimensional value. You want a 2d value, in meters squared. If you do the algebra, $7m(2m)=14m^2$, which is, again, correct. As to the $m\overs$ intuition, I like to think of it as "how many meters can you move in one second?".

5
On

The following is a possible formalization of units as used in the natural sciences.

It does not by any means give physical intuitions on what it means to divide units. It does say though why we can treat them like variables. The question might be ill-posed (and not just that it could be clarified further) and a tldr would simply be "why couldn't we treat them like variables". Still I hope this formalization makes you feel more at home with the concept.

As Von Neumann said,

Young man, in mathematics you don't understand things. You just get used to them.

With this in mind, let's begin.


Intro:

Given a commutative ring ---such as the real numbers--- you can consider a new kind of "number system" called a polynomial ring. Usually we call that system $\mathbb R[x]$ for $x$ the name of our variable.

As with the complex numbers where you have a distinguished element $i$ such that $i^2=-1$, here you can have a distinguished element called $m$ (for meters) and you add no restrictions as with the complex numbers, so $m^2$ doesn't reduce to anything, nor does $m^3$, etc.

In this case it would be $\mathbb R[m]$ instead.

So $m$ is just a name in this case and operations work properly as one would expect. e.g:

$$(a+bm)(x+ym) = ax + (ay+bx)m + bym^2$$

and so on.


Formal variables vs usual variables:

Polynomial rings behave just as polynomials. (In $\mathbb R$ it's the same. More generally you'd have to consider a quotient, but it's almost there.)

Most importantly you have for each real number $a$, an "evaluation morphism" $: \mathbb R[m] \rightarrow \mathbb R$ that "evaluates". It's usually called $\varepsilon_a$. The $\varepsilon$ is just for evaluation: $\varepsilon$ is like a greek e.

So for instance $\varepsilon_2\ (1+3m+2m^2) = 1+3\cdot2+2\cdot2^2 = 15$.

In this way, the formal variable $m$ behaves like a variable in the usual sense.


More than one unit:

You can do this with as many variables as you want. You can have one for each unit.

So now we can have also $s$ for seconds. (Again, it's just a name.) And with this you can have elements like $3ms+1$ where you don't give any condition on multiplying or adding the different variable names so they just stay like that, the same way $m^2$ didn't reduce to anything before.

This number system would be written as $\mathbb R[m,s]$ or $\mathbb R[m][s]$.

Note, you can write $2m+3s$ but that doesn't reduce further. Addition of different units can be interpreted as having the two quantities separately. Formally if you forget multiplication, the sum $am+bs$ is equivalent to the vector $(a,b)$.


Division:

Finally we need a way to divide these variables. For this, we use the notion of localization of a ring.

Now we can do everything we want. We can have $\frac ms$ or more complicated stuff like $3\frac ms + 2\frac{m^2}s - \frac{10\frac ms}{5 s}$ and it works just like you'd expect.

And there you have it. Units are variables. (Or they behave like so, but in modern math behaving the same is being the same.)