This question came to my mind while trying to get the Eigen linear algebra library to play nicely with the Boost Units library; nevertheless, this is a question about mathematics, not about programming.
I'd like, for an application I'm developing, to be able to do some math over dimensioned numbers -- e.g. instead of adding 5 + 5
, I want to make it explicit in the program's type system that I'm adding 5 meters plus 5 meters. Otherwise, I might accidentally try to add meters to seconds or something, and get a nonsensical answer. This is the use-case which Boost Units supports.
However, some of the arithmetic I want to do involves matrices -- for example, I have two three-dimensional vectors, both over meters, and I need to find the quaternion that represents the rotation between them, and then rotate other matrices by the same quaternion, etc etc. This is the use-case that Eigen supports.
It's been tricky trying to get these two libraries to play nicely together, and this morning I think I realized one reason that might be. Technically, I think what I want isn't linear algebra.
See, I want something that acts like linear algebra. But I can't really, in a purely mathematical sense, create a matrix over the set of lengths (in meters) -- because lengths aren't closed under multiplication. If you multiply a length by a length, you don't get a length - you get an area. In the same manner, if I multiply a matrix of lengths times a matrix of lengths, I expect to get a matrix of areas. (I don't know what physical sense that makes; I'm a programmer, not a physicist.)
In any case, now I'm curious. It seems like the thing-which-I-want is a thing that it makes sense to have -- linear algebra which isn't defined over a field, but which is defined over... I guess at least a set of abelian groups $S_n$, over which is defined a scalar multiplication function $S_n \times \mathbb{R} \rightarrow S_n$ and a multiplication function $S_n \times S_n \rightarrow S_{2n}$. (Actually it's more complicated than that, because I want to handle not only lengths but also times, masses, etc.)
Is this a thing which it makes mathematical sense to have? Is this a structure which already exists, and is known and studied? Are there any assumptions of linear algebra that break down, if multiplication isn't closed anymore?