Towers of Binary Fields
Binius uses key mathematical objects called towers of binary fields. These are integral to everything we do. In this page, we explain them in some mathematical detail. This page should be viewed as a mathematical counterpart to the datatypes page in our frontend site area.
We recall from that page that our fundamental datatypes are bitstrings of power-of-two width. Under the hood, these power-of-two-width binary strings actually represent elements of algebraic objects called binary towers. These towers are mathematical sets called fields. Indeed, each tower is isomorphic as a field to , the field of order . Importantly, though, we construct these fields in a special way, which gives them a "nested" structure and makes everything work nicely.
Background
Here, we sketch a bit of mathematical background, though we can't even pretend to be comprehensive.
Fields
A field is a set equipped with addition and multiplication operations, which satisfy the associative, commutative and distributive laws. It also contains additive and multiplicative identities 0 and 1. Finally, every nonzero element is invertible. This is obviously an absurdly abbreviated definition, and there is a huge amount to say about these objects. For our purposes now, we leave it at this.
Field extensions
Here, we sketch algebraic extensions, working throughout in characteristic 2. Let's start with the simplest possible field, —the field with just the elements and , equipped with the XOR and AND operations. Given some extension degree , it is a classical technique to construct the field extension . Usually, the way we do this is by fixing a degree- irreducible polynomial . Our field is then given as the quotient ring ; that is, as the set of univariate polynomials over modulo the ideal generated by the irreducible polynomial . Concretely, elements of this ring can be represented as polynomials over of degree less than . Addition is just componentwise -addition (i.e., XOR). To multiply two elements, we multiply them as binary polynomials, and then reduce the result modulo .
In practice, we will represent elements of the ring as -bit binary strings, by writing down their coefficients. In slightly fancier terms, this amounts to picking an -basis for this ring (here, we're simultaneously viewing it also as -vector space). Which basis? Well, the obvious one: the set of monomials .
Towers of Extensions
In Binius, we take a different approach. Starting as before with , we take just a degree- extension:
As a field, is clearly just .
On the other hand, blackboxing the definition of —i.e., forgetting for now that it's in its own right a quotient ring—we can repeat this process:
We state without proof for now that is irreducible over . Thus, is also a field—namely, isomorphic to .
We can continue this process by writing, for each ,
In this way, we get a chain, or tower, of extensions , and so on.
Elements of look like linear polynomials over —whose coefficients are themselves polynomials over , and so on. Unwinding this process, we get a kind of recursive, tree-like composition of elements. At the bottom of the tree are the bits. Indeed, this also shows that has an -basis given by the multilinear monomials in the indeterminates (there are such monomials). We will call this the multilinear monomial basis.
Relative Bases
There is a further very important idea hidden here. To explain it, we fix two different tower subfields . Elements of look like linear polynomials over , whose coefficients are linear polynomials over , and so on. We can perform the same unwinding we just did above, but stop at the intermediate height . In this way, we can express each given -element as a multilinear polynomials in the indeterminates , whose coefficients come from . We thus see that the multilinear monomials in give us a basis for over its nontrivial subfield . (This is a generalization of what we just did above, in which the ground field can be something intermediate, as opposed to itself.) We will also refer to this as the multilinear monomial basis of over .