Skip to content

Commit eaa8648

Browse files
committed
Merge #62: math companion: minor cleanup
e17630b fixes for roconnor (Andrew Poelstra) 42394f9 try again to reword affine stuff; drop "affine subspace" (Andrew Poelstra) bc84006 replace "affine relation" with "affine subspace" (Andrew Poelstra) befbffa clarify jump from "preserves affine relations" to "preserves BCH codes" (Andrew Poelstra) 9d2c5e6 Minor cleanup (Elliott Jin) Pull request description: Backport of apoelstra/volvelle-math-companion#1 to this repo, which seems to have diverged but not included some of Elliott's fixes. Top commit has no ACKs. Tree-SHA512: d84c67016a17131b444ec664c11b2d6a4748f26675b10706ee2f4345b80ea10635fe5ee4f8fdf27128dc1d9e2b05c56fa157d8efd53d3383bf70ca861a91f0a0
2 parents 171c7df + e17630b commit eaa8648

File tree

1 file changed

+61
-48
lines changed

1 file changed

+61
-48
lines changed

mathematical-companion/main.tex

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ \subsection{Fields and $\ftwo$}
4747
\item The set is closed under addition; addition is associative, commutative,
4848
has an identity element 0, and all elements have additive inverses. In other
4949
words it is an \textbf{abelian group} under addition.
50-
\item Similarly it is an abelian group under multiplication, with identity 1.
50+
\item Similarly, the nonzero elements form an abelian group under multiplication, with identity 1.
5151
\item The \textbf{distributive law} holds, which means that $a(b + c)$ always
5252
equals $ab + ac$.
5353
\end{enumerate}
@@ -69,7 +69,8 @@ \subsection{Polynomial Rings}
6969
\[ \left\{ \sum_{i=0}^n a_{i}x^i : n\in\mathbb{N}\cup\{0\}, a_i\in \ftwo \right\} \]
7070

7171
A ring, for our purposes, is defined the same way as a field except that we do
72-
not require multiplication to be invertible. It is easy to check that the
72+
not require multiplication to be invertible. In particular, we will only consider
73+
commutative rings. It is easy to check that the
7374
polynomial ring, endowed with addition and multiplication in the obvious ways,
7475
is in fact a ring.
7576

@@ -81,8 +82,9 @@ \subsection{Polynomial Rings}
8182
also a fact that a polynomial has a multiplicative inverse, i.e.~it is a
8283
\textbf{unit}, if and only if it is nonzero constant.
8384

84-
If whenever a polynomial $r$ is written as the product of two polynomials $r=pq$,
85-
either $p$ or $q$ is a unit (i.e.~degree 0), then we say $r$ is \textbf{irreducible}.
85+
A polynomial $r$ is \textbf{irreducible} if, whenever it is written as the product
86+
of two polynomials $r=pq$, either $p$ or $q$ is a unit (i.e.~degree 0). Otherwise,
87+
$r$ is \textbf{reducible}.
8688

8789
\subsection{Quotient Fields}
8890

@@ -96,7 +98,7 @@ \subsection{Quotient Fields}
9698
and multiplication are defined in the obvious way.
9799

98100
Just like in the integer case, if our polynomial $p$ can be factored into
99-
nonconstant polynomials as $p=p_1p_2$, their images in the quotient ring will
101+
nonconstant polynomials as $p=p_1p_2$, then the images of $p_1$ and $p_2$ in the quotient ring will
100102
be nonzero but satisfy $p_1p_2 = 0$. In other words they are \textbf{zero
101103
divisors} and imply that multiplication in the ring is not invertible.
102104

@@ -125,8 +127,8 @@ \subsection{Quotient Fields}
125127
can use these terms unambiguously.
126128

127129
It is a fact that, for this specific polynomial, that $\alpha$ is a
128-
\textbf{generator} of the quotient field, meaning that the field in its entirety
129-
is equal to
130+
\textbf{generator} of the multiplicative group of the quotient field, meaning
131+
that the field in its entirety is equal to
130132
\[ \left\{ \alpha^i : i \in \{0,1,\ldots,30\} \right\} ~\cup~ \left\{ 0 \right\}. \]
131133

132134
We observe that the order of the multiplicative group is 31, a prime, and therefore
@@ -171,8 +173,8 @@ \subsection{Lagrange Interpolation and Shamir's Secret Sharing\label{sec:sss}}
171173
\emph{Leçons Elémentaires sur les Mathématiques}}\footnote{Both citations taken
172174
from Wikipedia's ``Lagrange Interpolation'' page, March 2023.},
173175
it is actually possible to compute
174-
the value of a polynomial at a field element $x$ explicitly in terms of
175-
its values at $n$ given distinct points $x_i$.
176+
the value of a degree $n$ polynomial at a field element $x$ explicitly in terms of
177+
its values at $n + 1$ given distinct points $x_i$.
176178

177179
Specifically, suppose that $p(x_i) = y_i$. Then
178180
\begin{equation}
@@ -240,20 +242,30 @@ \subsection{Lagrange Interpolation and Shamir's Secret Sharing\label{sec:sss}}
240242
evaluation point in a fixed place in your sequence, then Lagrange interpolation
241243
will interpolate the polynomial $p(x) = x$ here and place the correct value
242244
of $x$ in the correct place for all shares.
243-
\item Going even further, suppose for each initial share $F_x=\{f_i\}$, some fixed
244-
affine relation holds among the $f_i$'s, e.g.
245-
\[ \sum_i \alpha_i f_i = \beta \]
246-
for fixed $\beta,\alpha_i\in \mathbb{F}$. Then this fixed affine relation
247-
\emph{will continue to hold for all derived shares}!
248-
249-
This is not immediately obvious but can be shown by direct computation and
250-
using the fact that Lagrange interpolation is an affine combination of $f_i$'s.
245+
\item Going even further, suppose that for each initial share $F_x=\{f_i\}$,
246+
a particular character can be described as a particular \textbf{affine
247+
transformation} of the others, like
248+
\[ f_j = \sum_{i\neq j} \alpha_i f_i + \beta \]
249+
for a fixed index $j$ and fixed $\beta,\alpha_i\in \mathbb{F}$.
250+
251+
Then \emph{all derived shares will satisfy the same equation}!
252+
253+
This is not immediately obvious but can be shown by interpolating the polynomial
254+
\[ q(x) = \sum_{i\neq j} \alpha_i p_i(x) + \beta - p_j(x). \]
255+
By assumption, this polynomial is zero at each evaluation point $x$ and is
256+
therefore zero everywhere.
251257
\end{itemize}
252258

253259
This fact is so important that we term it the \textbf{Fundamental Theorem of
254-
Computing SSSS with Volvelles}. The Fundamental Theorem implies that if we
255-
apply any checksum derived from a linear code (or a linear code plus a
256-
constant) to our initial shares, that the derived shares will automatically
260+
Computing SSSS with Volvelles}.
261+
262+
Error correcting codes can be characterized in terms of affine transformations.
263+
For example, the codex32 error correcting code is computed by adding
264+
thirteen extra ``checksum'' characters to our data, each of which is a particular
265+
affine transformation of the other characters.
266+
267+
The Fundamental Theorem therefore implies that if we apply any checksum derived from
268+
such a code to our initial shares, that the derived shares will automatically
257269
be checksummed as well.
258270

259271
For more information about volvelles, see the next two sections.
@@ -276,7 +288,8 @@ \subsection{The Bech32 Alphabet}
276288

277289
The previous section indicated that if $\beta\in\fttwo$, then we can write
278290
\[ \beta = b_4\alpha^4 + b_3\alpha^3 + b_2\alpha^2 + b_1\alpha + b_0 \]
279-
where each $b_i\in\{0, 1\}$. We can therefore encode $\beta$ as a 5-bit
291+
where each $b_i\in\{0, 1\}$ and the choices for $b_i$ are unique.
292+
We can therefore encode $\beta$ as a 5-bit
280293
number by directly encoding the bits $b_i$. Alternately, since there are
281294
only 32 such $\beta$s, we assign them all alphanumeric symbols, with four
282295
symbols to spare. This is the premise behind the \textbf{bech32 alphabet},
@@ -446,7 +459,6 @@ \subsection{The Addition Wheel}
446459

447460
\begin{center}\includegraphics[scale=0.25]{images/addition-wheel.jpg}\end{center}
448461

449-
450462
This volvelle computes addition in $\fttwo$. To compute $x+y$, rotate so that
451463
the pointer is pointing at either $x$ or $y$, then look up the other one on
452464
the front page. It is instructive to observe that the expected symmetries are
@@ -466,39 +478,39 @@ \subsection{The Addition Wheel}
466478
Why not? Well, observe that the way to reduce symbols is to have two windows at
467479
the same radius from the center of the volvelle. Then on the bottom sheet, a
468480
single circle of values would provide the revealed symbols for both windows.
469-
Let's say that one window is labeled $x\to$, and the other labeled $y\to$. Then
481+
Let's say that one window is labeled $y\to$, and the other labeled $z\to$. Then
470482
since the windows are at a fixed angle $\theta$ from each other (being printed
471483
on the same solid sheet of paper), we would require the bottom circle of values
472-
to satisify
473-
\[ \textnormal{for all } z\in\fttwo:\qquad x + z \textnormal{ and } y+z \textnormal{ are at angle $\theta$ to each other} \]
474-
Now, $x+z$ and $y+z$ differ by the fixed quantity $x+y$ (recall we are in
475-
characteristic 2), so this can be restated as
476-
\[ \textnormal{for all } z\in\fttwo:\qquad z \textnormal{ and } z+(x+y) \textnormal{ are at angle $\theta$ to each other} \]
477-
Then observing that $(x+y) + (x+y) = 0$, two applications of the above equation
478-
give us
479-
\[ \textnormal{for all } z\in\fttwo:\qquad z \textnormal{ is at angle $2\theta$ from itself} \]
480-
It is now clear that if we either need to repeat characters (defeating the goal
484+
to satisfy
485+
\[ \textnormal{for all } x\in\fttwo:\qquad x + y \textnormal{ and } x + z \textnormal{ are at angle $\theta$ to each other} \]
486+
Note that if $x$ ranges over all values in $\fttwo$ then so does $x + y$. Furthermore,
487+
we have $x + z = (x + y) + (y + z)$ (recall we are in characteristic 2).
488+
Thus substituting $x + y$ in place of $x$ gives us
489+
\[ \textnormal{for all } x\in\fttwo:\qquad x \textnormal{ and } x + (y + z) \textnormal{ are at angle $\theta$ to each other} \]
490+
Since $x + (y + z) + (y + z) = x$, two applications of the above condition gives us
491+
\[ \textnormal{for all } x\in\fttwo:\qquad x \textnormal{ is at angle $2\theta$ from itself} \]
492+
It is now clear that we either need to repeat characters (defeating the goal
481493
of reducing the amount of symbols on the bottom wheel) or have $\theta=180^\circ$.
482494

483495
Okay, so perhaps we can get a 50\% reduction in density for the bottom wheel, by
484496
setting $\theta=180^\circ$ and having the windows on opposite sides of the top
485497
wheel be at the same radius and use the same set of bottom-wheel symbols.
486498

487-
Let's play this out. Take, for example, the \vc{A} and \vc{T} windows on the
488-
addition volvelle. These differ by \vc{K}, so we require that on the bottom
489-
wheel, symbols at this radius differ from their opposite symbol by \vc{K}.
490-
If the top wheel is pointing at some symbol $a$, and we turn it $180^\circ$
491-
to $b$, we have simply exchanged the values in these windows, i.e.~added
492-
\vc{K} to both. But this implies that $a+b=\vc{K}$.
499+
Let's play this out. Suppose we place the \vc{A} and \vc{T} windows at the
500+
same radius on opposite sides of the top wheel. Note that \vc{A} and \vc{T}
501+
differ by \vc{K}. Now suppose that when the pointer is at some arbitrary symbol $x$,
502+
the two opposite windows at \vc{A} and \vc{T} show $x + A = y$ and $x + T = z$.
503+
Adding these two equations gives $y + z = A + T = K$.
493504

494-
In other words, for this compression to work, we need every pair of opposing
505+
In other words, for this compression to work with the choice of \vc{A} and \vc{T}
506+
windows being at the same radius, we need every pair of opposing
495507
symbols to add to \vc{K}; i.e.~we need to take the sixteen 2-element cosets
496508
obtained by modding out by \vc{K} and then order the symbols so that each
497509
coset's members appear opposite each other.
498510

499511
It can be seen, by modding out by every possible symbol, and trying various
500512
orderings of the resulting cosets, that no such choice will lead to a
501-
``natural'' ordering\footnote{There are 16 cosets, so $15\approxeq2^{40}$
513+
``natural'' ordering\footnote{There are 16 cosets, so $15!\approxeq2^{40}$
502514
different arrangements around a circle. Then you can exchange the members
503515
in each coset, for another $2^{15}$ possibilities. So an exhaustive search
504516
would require about $2^{55}$ work. I did not do an exhaustive search, so I
@@ -539,14 +551,14 @@ \subsection{The Fusion-Translation Wheel}
539551

540552
Now, we have 31 nonzero elements, so a volvelle would naively have $31^2=961$
541553
entries. Can we do better? Using the same reasoning as with the addition volvelle,
542-
if we wanted two windows $x\to$ and $y\to$ to share a radius, we'd need that
543-
\[ \textnormal{for all } z\in\fttwo:\qquad xz \textnormal{ and } yz \textnormal{ are at angle $\theta$ to each other} \]
544-
We have a group under multiplication with 31 elements in it. It is then a fact
554+
if we wanted two windows $y\to$ and $z\to$ to share a radius, we'd need that
555+
\[ \textnormal{for all } x\in\fttwo:\qquad xy \textnormal{ and } xz \textnormal{ are at angle $\theta$ to each other} \]
556+
We have a group under multiplication with 31 elements in it. Since 31 is prime, it is then a fact
545557
that if we choose any element $\alpha\in\fttwo^*$ except 1, that $\alpha$
546-
\textbf{generates} the group. Meaning that every element $z$, including 1,
547-
can be written as $z=\alpha^{i_z}$ where $i_z$ is some integer modulo 31. So we
558+
\textbf{generates} the group. Meaning that every element $x$, including 1,
559+
can be written as $z=\alpha^{i_x}$ where $i_x$ is some integer modulo 31. So we
548560
may write
549-
\[ \textnormal{for all } \alpha^{i_z}\in\fttwo:\qquad \alpha^{i_x}\alpha^{i_z} = \alpha^{i_x+i_z} \textnormal{ and } \alpha^{i_y}\alpha^{i_z} = \alpha^{i_y+i_z} \textnormal{ are at angle $\theta$ to each other} \]
561+
\[ \textnormal{for all } \alpha^{i_x}\in\fttwo:\qquad \alpha^{i_x}\alpha^{i_y} = \alpha^{i_x+i_y} \textnormal{ and } \alpha^{i_x}\alpha^{i_z} = \alpha^{i_x+i_z} \textnormal{ are at angle $\theta$ to each other} \]
550562

551563
By squinting at this for a moment, you can observe that if $\theta$ is one 31th
552564
of a full rotation, and we make sure that each $\alpha^i$ on the front wheel is
@@ -1060,8 +1072,9 @@ \subsection{SSSS and Checksumming}
10601072
and the share index is produced by interpolating the polynomial $f(x) = x$.
10611073

10621074
What is more mathematically impressive is that the last 13 symbols of the polynomial
1063-
will constitute a valid checksum for the resulting share. This is a consequence of
1064-
the Fundamental Theorem, which says that any affine relationships will be preserved.
1075+
will constitute a valid checksum for the resulting share. This is because each checksum
1076+
symbol is defined as an affine transformation of the other characters, and the
1077+
Fundamental Theorem says that any such relationships will be preserved.
10651078

10661079
In fact, in a complete Checksum Worksheet, \emph{every single cell} that the user
10671080
fills in is an affine function of the share data. This means that if you pick an

0 commit comments

Comments
 (0)