Heh, no worries about the color, I saw your first remark already. I didn't mean to push you with that repeated remark or anything.
I'd imagine that, at least if it is done like I suggested, this binary-type implementation would kinda break down:
For a short (a single byte), you'd have your eight bits:
_ _ _ _ _ _ _ _
1 in this would be something like
0 0 0 0 0 0 0 1
-1, meanwhile, using the implicit 1, would look like
1 0 0 0 0 0 0 0
and -2 would be
1 0 0 0 0 0 0 1
and it could build numbers from 127 to -128. (or alternatively, you could get a signed 0 where 0 0 0 0 0 0 0 0 = +0 and 1 0 0 0 0 0 0 0 = -0)
More than plenty, except for two problems:
- I am asking for infinitely many dimensions of which, however, only finitely many are used, so this basic format will most definitely fail (gotta use a sparse representation instead)
- since two different numbers use at least one bit twice, you'd have to somehow differentiate between the two extra. As long as you do not multiply any together, it's no problem, but what would you do with
? This obviously can't quite work.
Though that kind of concept, at least for now, goes way past the scope of your implementation here anyway. Something like that could be tried later down the line.
Btw, note that this doesn't mean that there are negative dimensions. It's
many dimensions. And while some of them would get a "negative name", all of them would still behave like positive dimensions.
An alternative approach could be to only use natural numbers, and have even dimension be negativeand odd ones positive. Then you'd have:
etc.
That would have the advantage, on one hand, that you could implement this with your binary representation just fine, but on the other, it'd still have the problem of being infinite in size and thus, ultimately, requiring sparse represenation instead.
There is also the issue of not having an idempotent / pseudoscalar in such an infinite dimensional case. At least not a well-definable one.
For instance, in 2 dimensions, you have
1 x y xy=I
Ix = xyx = -y
xI = xxy = y
Iy = xyy = x
yI = yxy = -x
so I anticommutes with x and y.
Meanwhile, in 3D, you have
x y z and xyz = I
Ix = xyzx = - xyxz = xxyz = yz
xI = xxyz = yz
Iy = xyzy = - xyyz = -xz = zx
yI = yxyz = - yyxz = -xz = zx
Iz = xyzz = xy
zI = zxyz = -xzyz = xyzz = yx
Here, I commutes.
This pattern continues for higher dimensions depending on whether I is an even- or odd-dimensioned space.
In case of an infinite dimensional algebra, it's undefined whether it is even or odd.
If that were no problem, it would be easy to define things like a join and a meet in this space, even with a sparse representation. A sparse dual would simply be the opposite of a sparse vector. Instead of a limited number of 1s, there would be a limited number of 0s. So even there, multiplication should not be a problem.
But because of this even/odd problem, it's not as straight-forward to define this.
Of course, for any finite-dimensional subspace, you could define any given operation just fine.