4. Multivariate: Base Multinumbers
To go beyond one variable, Wildberger introduces base multinumbers — a family of primitive elements, one for each natural number index:
Each is just a tag — a box holding the natural number . Polynomials in multiple variables are formed by taking products and sums of these tags with natural number coefficients. So where ordinary algebra writes and , box arithmetic writes and (or any two distinct indices).
A polynumber term in several variables is a product of base multinumbers:
In boxmath, exponents[i] is the power of :
| Polynumber | Exponent vector |
|---|---|
| (constant) | [] |
[0, 1] | |
[0, 2] | |
[0, 0, 1, 0, 1] | |
[0, 2, 0, 1] |
new Polynumber(2n, [0,0,0,1]) is — the exponent vector says which variables appear and at what power; the first argument is the natural number coefficient. So encodes as:
new Multinumber([
new Polynumber(1n, []), // 1
new Polynumber(2n, [0,0,0,1]), // 2e₃
new Polynumber(1n, [0,0,1,0,1]), // e₂e₄
]);
Wildberger states explicitly: "adding or removing final 0 entries does not change the representation." The reason is that for any — an exponent of zero contributes nothing to the product. So [0,0,0,1] and [0,0,0,1,0] are the same polynumber term (). The library respects this: Polynumber.evaluate only multiplies when exponents[i] > 0, and Polynumber.extent finds the last nonzero index and ignores everything after it.
Wildberger's worked example (PDF §3.5)
"If and then ."
The product is every pairwise combination of a term from with a term from — terms total:
import { Polynumber, Multinumber } from 'boxmath';
const B = new Multinumber([
new Polynumber(1n, []), // 1
new Polynumber(1n, [0,0,0,1]), // e₃
new Polynumber(1n, [0,0,1,0,1]), // e₂e₄
]);
const C = new Multinumber([
new Polynumber(1n, [0,2]), // e₁²
new Polynumber(1n, [0,0,1,0,1]), // e₂e₄
]);
const BC = B.multiply(C);
BC.terms.length; // 6
BC.terms.map(t => t.toString(['e0','e1','e2','e3','e4']));
// ['e1^2', 'e2e4', 'e1^2e3', 'e2e3e4', 'e1^2e2e4', 'e2^2e4^2']
The exponent vectors add component-wise under multiply — the box product rule.