initial revisions to finite.3

This commit is contained in:
queue-miscreant 2025-07-18 01:16:06 -05:00
parent 72e2489e3c
commit b0ce5e8f83
5 changed files with 23682 additions and 536 deletions

View File

@ -1,7 +1,7 @@
--- ---
title: "Exploring Finite Fields, Part 2: Matrix Boogaloo" title: "Exploring Finite Fields, Part 2: Matrix Boogaloo"
description: | description: |
"How to do arithmetic when there are a finite number of numbers" "..."
format: format:
html: html:
html-math-method: katex html-math-method: katex

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

View File

@ -1,155 +1,199 @@
--- ---
title: "Exploring Finite Fields, Part 3: Roll a d20"
description: |
"..."
format: format:
html: html:
html-math-method: katex html-math-method: katex
jupyter: python3 jupyter: python3
date: "2024-02-03"
date-modified: "2025-07-16"
categories:
- algebra
- finite field
- haskell
--- ---
<style> <style>
.red { .red {
color: red; color: red;
} }
.green {
color: green;
}
.blue {
color: blue;
}
.orange { .orange {
color: orange; color: orange;
} }
.yellow { .yellow {
color: yellow; color: yellow;
} }
.green {
color: green;
}
.blue {
color: blue;
}
.purple { .purple {
color: purple; color: purple;
} }
</style> </style>
Exploring Finite Fields, Part 3: Roll a d20 In the [previous post](../2), we focused on constructing finite fields using *n*×*n* matrices.
=========================================== These matrices came from from primitive polynomials of degree *n* over GF(*p*),
and could be used to do explicit arithmetic over GF(*p*^*n*^).
In the [previous post](), we focused on constructing finite fields using *n*×*n* matrices. These matrices came from from primitive polynomials of degree *n* over GF(*p*), and could be used to do explicit arithmetic over GF(*p*^*n*^). In this post, we'll look at a way to apply this in describing certain groups. In this post, we'll look at a way to apply this in describing certain groups.
Weakening the Field Weakening the Field
------------------- -------------------
Recall the way we defined GF(4) in the first post. We took the irreducible polynomial *p*(*x*) = *x*^2^ + *x* + 1, called its root *α*, and created addition and multiplication tables spanning the four elements. After the second post, we can do this more cleverly by mapping *α* to the companion matrix *C*~*p*~ over GF(2). Recall the way we defined GF(4) in the first post.
We took the irreducible polynomial *p*(*x*) = *x*^2^ + *x* + 1, called its root *α*,
and created addition and multiplication tables spanning the four elements.
After the second post, we can do this more cleverly by mapping *α*
to the companion matrix *C*~*p*~ over GF(2).
$$ $$
\begin{gather*}
f : \mathbb{F_4} \longrightarrow \mathbb{F}_2 {}^{2 \times 2} f : \mathbb{F_4} \longrightarrow \mathbb{F}_2 {}^{2 \times 2}
\\ ~ \\ \\[10pt]
0 \mapsto \left(\begin{matrix} 0 \mapsto \left(\begin{matrix}
0 & 0 \\ 0 & 0 0 & 0 \\
0 & 0
\end{matrix}\right) \end{matrix}\right)
\quad \quad
1 \mapsto \left(\begin{matrix} 1 \mapsto \left(\begin{matrix}
1 & 0 \\ 0 & 1 1 & 0 \\
0 & 1
\end{matrix}\right) = I \end{matrix}\right) = I
\quad \quad
\alpha \mapsto \left(\begin{matrix} \alpha \mapsto \left(\begin{matrix}
0 & 1 \\ 1 & 1 0 & 1 \\
1 & 1
\end{matrix}\right) = C_p \end{matrix}\right) = C_p
\\ ~ \\ \\ \\
\textcolor{red}{\alpha} + \textcolor{blue}{1} = \alpha^2 \mapsto \textcolor{red}{\alpha} + \textcolor{blue}{1} = \alpha^2 \mapsto
\left(\begin{matrix} \left(\begin{matrix}
1 & 1 \\ 1 & 0 1 & 1 \\
1 & 0
\end{matrix}\right) = \end{matrix}\right) =
\textcolor{red} { \textcolor{red} {
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 1 & 1 0 & 1 \\
1 & 1
\end{matrix}\right) \end{matrix}\right)
} }
+ + \textcolor{blue}{
\textcolor{blue}{
\left(\begin{matrix} \left(\begin{matrix}
1 & 0 \\ 0 & 1 1 & 0 \\
0 & 1
\end{matrix}\right) \end{matrix}\right)
}\mod 2 }\mod 2
\end{gather*}
$$ $$
In the images of *f*, the zero matrix has determinant 0 and all other elements have determinant 1. Therefore, the product of any two nonzero matrices always has determinant 1, and a nonzero determinant means the matrix is invertible. This means that the non-zero elements of the field form their own group with respect to multiplication. Here, they form a cyclic group of order 3, since *C*~*p*~^3^ = *I* mod 2. This is also true using symbols, and we've already agreed that *α*^3^ = 1. In the images of *f*, the zero matrix has determinant 0 and all other elements have determinant 1.
Therefore, the product of any two nonzero matrices always has determinant 1,
and a nonzero determinant means the matrix is invertible.
This means that the non-zero elements of the field form their own group with respect to multiplication.
Here, they form a cyclic group of order 3, since *C*~*p*~^3^ = *I* mod 2.
This is also true using symbols, and we've already agreed that *α*^3^ = 1.
### Other Matrices ### Other Matrices
Essentially, this means we can extend a polynomial into new structures by evaluating it in certain ways: However, there are more 2×2 matrices over GF(2) than just these.
There are two possible values in four locations, so there are 24 = 16 matrices,
However, there are more 2×2 matrices over GF(2) than just these. There are two possible values in four locations, so there are 24 = 16 matrices, or 12 more than we've identified. or 12 more than we've identified.
$$ $$
\begin{array}{c|c} \begin{array}{c|c}
\#\{a_{ij} = 1\} & \det = 0 & \det = 1 \\ \#\{a_{ij} = 1\} & \det = 0 & \det = 1
\hline \\ \hline
1 & 1 &
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 0 & 0 0 & 1 \\
0 & 0
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
1 & 0 \\ 0 & 0 1 & 0 \\
0 & 0
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
0 & 0 \\ 0 & 1 0 & 0 \\
0 & 1
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
0 & 0 \\ 1 & 0 0 & 0 \\
1 & 0
\end{matrix}\right) \end{matrix}\right)
\\ \\
2 & 2 &
\left(\begin{matrix} \left(\begin{matrix}
1 & 1 \\ 0 & 0 1 & 1 \\
0 & 0
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
0 & 0 \\ 1 & 1 0 & 0 \\
1 & 1
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 0 & 1 0 & 1 \\
0 & 1
\end{matrix}\right) \end{matrix}\right)
\quad \quad
\left(\begin{matrix} \left(\begin{matrix}
1 & 1 \\ 0 & 0 1 & 1 \\
0 & 0
\end{matrix}\right) \end{matrix}\right)
& \textcolor{red}{ & \textcolor{red}{
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 1 & 0 0 & 1 \\
1 & 0
\end{matrix}\right) \end{matrix}\right)
} }
\\ \\
3 & & 3 & &
\textcolor{red}{ \textcolor{red}{
\left(\begin{matrix} \left(\begin{matrix}
1 & 1 \\ 0 & 1 1 & 1 \\
0 & 1
\end{matrix}\right) \end{matrix}\right)
} }
\quad \quad
\textcolor{red}{ \textcolor{red}{
\left(\begin{matrix} \left(\begin{matrix}
1 & 0 \\ 1 & 1 1 & 0 \\
1 & 1
\end{matrix}\right) \end{matrix}\right)
} }
\\ \\
4 & 4 &
\left(\begin{matrix} \left(\begin{matrix}
1 & 1 \\ 1 & 1 1 & 1 \\
1 & 1
\end{matrix}\right) \end{matrix}\right)
\end{array} \end{array}
$$ $$
The matrices in the right column (in red) have determinant 1, which means they can *also* multiply with our field-like elements without producing a singular matrix. This forms a larger group, of which our field's multiplication group is a subgroup. However, it is *not* commutative, since matrix multiplication is not commutative in general. The matrices in the right column (in red) have determinant 1, which means they can *also* multiply
with our field-like elements without producing a singular matrix.
This forms a larger group, of which our field's multiplication group is a subgroup.
However, it is *not* commutative, since matrix multiplication is not commutative in general.
The group of all six matrices of determinant 1 is called the [*general linear group*](https://en.wikipedia.org/wiki/General_linear_group) of degree 2 over GF(2), written GL(2, 2). We can sort the elements into classes by their order, or the number of times we have to multiply them before getting to the identity matrix (mod 2): The group of all six matrices of determinant 1 is called the
[*general linear group*](https://en.wikipedia.org/wiki/General_linear_group)
of degree 2 over GF(2), written GL(2, 2).
We can sort the elements into classes by their order, or the number of times we have
to multiply them before getting to the identity matrix (mod 2):
$$ $$
\begin{array}{} \begin{array}{}
\text{Order 1} & \text{Order 2} & \text{Order 3} \\ \text{Order 1} & \text{Order 2} & \text{Order 3}
\hline \\ \hline
\left(\begin{matrix} \left(\begin{matrix}
1 & 0 \\ 1 & 0 \\
0 & 1 0 & 1
@ -186,14 +230,20 @@ $$
\end{array} \end{array}
$$ $$
If you've studied enough group theory, you know that there are two groups of order 6: the cyclic group of order 6, *C*~6~, and the symmetric group on three elements, *S*~3~. Since the former group has order-6 elements, this group must be isomorphic to the latter. Since the group is small, it's not too difficult to construct an isomorphism between the two. Writing the elements of *S*~3~ in [cycle notation](), we have: If you've studied enough group theory, you know that there are two groups of order 6:
the cyclic group of order 6, *C*~6~, and the symmetric group on three elements, *S*~3~.
Since the former group has order-6 elements, this group must be isomorphic to the latter.
Since the group is small, it's not too difficult to construct an isomorphism between the two.
Writing the elements of *S*~3~ in [cycle notation](), we have:
<!-- TODO: permutations link -->
$$ $$
\begin{gather*}
e \mapsto \left(\begin{matrix} e \mapsto \left(\begin{matrix}
1 & 0 \\ 1 & 0 \\
0 & 1 0 & 1
\end{matrix}\right) \end{matrix}\right)
\\ ~ \\ \\ \\
(1 ~ 2) \mapsto \left(\begin{matrix} (1 ~ 2) \mapsto \left(\begin{matrix}
1 & 1 \\ 1 & 1 \\
0 & 1 0 & 1
@ -208,7 +258,7 @@ e \mapsto \left(\begin{matrix}
0 & 1 \\ 0 & 1 \\
1 & 0 1 & 0
\end{matrix}\right) \end{matrix}\right)
\\ ~ \\ \\ \\
(1 ~ 2 ~ 3) \mapsto \left(\begin{matrix} (1 ~ 2 ~ 3) \mapsto \left(\begin{matrix}
0 & 1 \\ 0 & 1 \\
1 & 1 1 & 1
@ -218,22 +268,30 @@ e \mapsto \left(\begin{matrix}
1 & 1 \\ 1 & 1 \\
1 & 0 1 & 0
\end{matrix}\right) \end{matrix}\right)
\end{gather*}
$$ $$
Bigger Linear Groups Bigger Linear Groups
-------------------- --------------------
Of course, there is nothing special about GF(2) in this definition. For any field *K*, the general linear group GL(*n*, *K*) is composed of invertible *n*×*n* matrices under matrix multiplication. Of course, there is nothing special about GF(2) in this definition.
For any field *K*, the general linear group GL(*n*, *K*) is composed of invertible
*n*×*n* matrices under matrix multiplication.
For fields other than GF(2), a matrix can have a determinant other than 1. Since the determinant is multiplicative, the product of two determinant 1 matrices also has determinant 1. Therefore, the general linear group has a subgroup, the [*special linear group*](https://en.wikipedia.org/wiki/Special_linear_group) SL(*n*, *K*), consisting of these matrices. For fields other than GF(2), a matrix can have a determinant other than 1.
Since the determinant is multiplicative, the product of two determinant 1 matrices also has determinant 1.
Therefore, the general linear group has a subgroup,
the [*special linear group*](https://en.wikipedia.org/wiki/Special_linear_group)
SL(*n*, *K*), consisting of these matrices.
<details> <details>
<summary> <summary>
Haskell implementation of GL and SL for prime fields Haskell implementation of GL and SL for prime fields
</summary> </summary>
This implementation will be based on the `Matrix` type from the first post. Assume we have already defined matrix multiplication and addition. This implementation will be based on the `Matrix` type from the first post.
Assume we have already defined matrix multiplication and addition.
```{.haskell} ```{.haskell}
data Matrix a = Mat { unMat :: Array (Int, Int) a } data Matrix a = Mat { unMat :: Array (Int, Int) a }
@ -258,7 +316,9 @@ fromMatrix :: Matrix a -> [[a]]
fromMatrix (Mat m) = let (_,(_,n)) = bounds m in reshape (n+1) $ elems m fromMatrix (Mat m) = let (_,(_,n)) = bounds m in reshape (n+1) $ elems m
``` ```
With helper functions out of the way, we can move on to generating all matrices (mod *n*) before filtering for matrices with nonzero determinant (in the case of GL) and determinant 1 (in the case of SL). With helper functions out of the way, we can move on to generating all matrices (mod *n*)
before filtering for matrices with nonzero determinant (in the case of GL) and determinant 1
(in the case of SL).
```{.haskell} ```{.haskell}
allMatrices :: Int -> Int -> Matrix Int allMatrices :: Int -> Int -> Matrix Int
@ -283,28 +343,37 @@ mSL m n = map fst $ filter (\(x,d) -> d == 1) $ matsWithDets' m n
### Projectivity ### Projectivity
Another important matrix group is the [*projective general linear group*](https://en.wikipedia.org/wiki/Projective_linear_group), PGL(*n*, *K*). In this group, two matrices are considered equal if one is a scalar multiple of the other. Equivalently, the elements *are* these equivalence classes, and the product of two classes is the set of all possible products of items from one class with items from the other. Another important matrix group is the
[*projective general linear group*](https://en.wikipedia.org/wiki/Projective_linear_group),
PGL(*n*, *K*).
In this group, two matrices are considered equal if one is a scalar multiple of the other.
Equivalently, the elements *are* these equivalence classes, and the product of two classes is
the set of all possible products of items from one class with items from the other.
Both this and the determinant 1 constraint can apply at the same time, forming the *projective special linear group*, PSL(*n*, *K*). Both this and the determinant 1 constraint can apply at the same time,
forming the *projective special linear group*, PSL(*n*, *K*).
For GF(2), all of these groups are the same, since the only nonzero determinant and scalar multiple is 1. Therefore, it's beneficial to contrast SL and PGL with another example. For GF(2), all of these groups are the same, since the only nonzero determinant and scalar multiple is 1.
Therefore, it's beneficial to contrast SL and PGL with another example.
Let's arbitrarily examine GL(2, 5). Since 4 squares to 1 (mod 5) and we're working with 2×2 matrices, the determinant is unchanged when a matrix is scalar-multiplied by 4. These multiples are identified in PSL. On the other hand, in PGL, there are classes of matrices with determinant 2 and 3, which do not square to 1. These classes are exactly the ones which are "left out" of PSL. Let's arbitrarily examine GL(2, 5).
Since 4 squares to 1 (mod 5) and we're working with 2×2 matrices, the determinant is unchanged
when a matrix is scalar-multiplied by 4.
These multiples are identified in PSL.
On the other hand, in PGL, there are classes of matrices with determinant 2 and 3, which do not square to 1.
These classes are exactly the ones which are "left out" of PSL.
$$ $$
\begin{matrix} \begin{matrix}
\boxed{ \boxed{ \begin{gather*}
\begin{gather*}
\large \text{GL}(2, 5) \large \text{GL}(2, 5)
\\ \\
\underset{\det = 4}{ \underset{\det = 4}{
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 0 & 1 \\
1 & 1 1 & 1
\end{matrix} \right) \end{matrix} \right) },
}, \textcolor{red}{ \underset{\det = 1}{
\textcolor{red}{
\underset{\det = 1}{
\left(\begin{matrix} \left(\begin{matrix}
0 & 2 \\ 0 & 2 \\
2 & 2 2 & 2
@ -323,16 +392,13 @@ $$
\end{matrix} \right) \end{matrix} \right)
}, },
... ...
\end{gather*} \end{gather*} }
}
& \twoheadrightarrow & & \twoheadrightarrow &
\boxed{ \boxed{ \begin{gather*}
\begin{gather*}
\large \text{PGL}(2,5) \large \text{PGL}(2,5)
\\ \\
\underset{\det = 1, ~4}{ \underset{\det = 1, ~4}{
\textcolor{red}{ \textcolor{red}{\left\{
\left\{
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 0 & 1 \\
1 & 1 1 & 1
@ -346,8 +412,7 @@ $$
}} }}
\\ \\
\underset{\det = 2, ~ 3}{ \underset{\det = 2, ~ 3}{
\left\{ \left\{ \left(\begin{matrix}
\left(\begin{matrix}
1 & 0 \\ 1 & 0 \\
0 & 2 0 & 2
\end{matrix} \right), \end{matrix} \right),
@ -357,13 +422,13 @@ $$
\end{matrix} \right), \end{matrix} \right),
... ...
\right\} \right\}
} \\ }
\\
... ...
\end{gather*} \end{gather*}
} }
\\ ~ \\ \\ \\
\boxed{ \boxed{ \begin{gather*}
\begin{gather*}
\large \text{SL}(2,5) \large \text{SL}(2,5)
\\ \\
\textcolor{red}{ \textcolor{red}{
@ -377,15 +442,12 @@ $$
3 & 3 3 & 3
\end{matrix} \right), \end{matrix} \right),
... ...
\end{gather*} \end{gather*} }
}
& \twoheadrightarrow & & \twoheadrightarrow &
\boxed{ \boxed{ \begin{gather*}
\begin{gather*}
\large \text{PSL}(2,5) \large \text{PSL}(2,5)
\\ \\
\textcolor{red}{ \textcolor{red}{ \left\{
\left\{
\left(\begin{matrix} \left(\begin{matrix}
0 & 2 \\ 0 & 2 \\
2 & 2 2 & 2
@ -395,11 +457,9 @@ $$
3 & 3 3 & 3
\end{matrix} \right), \end{matrix} \right),
... ...
\right\} \right\} }
}
... ...
\end{gather*} \end{gather*} }
}
\end{matrix} \end{matrix}
$$ $$
@ -407,7 +467,10 @@ $$
<summary> <summary>
Haskell implementation of PGL and PSL for prime fields Haskell implementation of PGL and PSL for prime fields
</summary> </summary>
PGL and PSL require special equality. It's certainly possible to write a definition which makes the classes explicit, as its own new type. We could then define equality on this type through `Eq`. This is rather inefficient, though, so I'll choose to work with the representatives instead. PGL and PSL require special equality.
It's certainly possible to write a definition which makes the classes explicit, as its own new type.
We could then define equality on this type through `Eq`.
This is rather inefficient, though, so I'll choose to work with the representatives instead.
```{.haskell} ```{.haskell}
import Data.List (nubBy) import Data.List (nubBy)
@ -430,39 +493,55 @@ mPSL m n = nubBy (projEq n) $ mSL m n
### Exceptional Isomorphisms ### Exceptional Isomorphisms
When *K* is a finite field, the smaller PSLs turn out specify some interesting groups. We've studied the case of PSL(2, 2) being isomorphic to *S*~3~ already, but it is also the case that: When *K* is a finite field, the smaller PSLs turn out specify some interesting groups.
We've studied the case of PSL(2, 2) being isomorphic to *S*~3~ already, but it is also the case that:
$$ $$
\begin{align*} \begin{align*}
&\text{PSL}(2,3) \cong A_4 & & \text{(order 24)} &\text{PSL}(2,3) \cong A_4 & & \text{(order 24)}
\\ ~ \\ \\ \\
&\text{PSL}(2,4) \cong \text{PSL}(2,5) \cong A_5 & & \text{(order 60)} &\text{PSL}(2,4) \cong \text{PSL}(2,5) \cong A_5 & & \text{(order 60)}
\\ ~ \\ \\ \\
&\text{PSL}(2,7) \cong \text{PSL}(3,2) & & \text{(order 168)} &\text{PSL}(2,7) \cong \text{PSL}(3,2) & & \text{(order 168)}
\end{align*} \end{align*}
$$ $$
These relationships can be proven abstractly (and frequently are!). However, I always found myself wanting. For PSL(2, 3) and *A*~4~, it's trivial to assign elements to one another by hand. But *A*~5~ is getting untenable, to say nothing of PSL(2, 7). In these circumstances, it's a good idea to leverage the computer. These relationships can be proven abstractly (and frequently are!).
However, I always found myself wanting.
For PSL(2, 3) and *A*~4~, it's trivial to assign elements to one another by hand.
But *A*~5~ is getting untenable, to say nothing of PSL(2, 7).
In these circumstances, it's a good idea to leverage the computer.
Warming Up: *A*~5~ and PSL(2, 5) Warming Up: *A*~5~ and PSL(2, 5)
-------------------------------- --------------------------------
*A*~5~, the alternating group on 5 elements, is composed of the [even](https://en.wikipedia.org/wiki/Parity_of_a_permutation) permutations of 5 elements. It also happens to describe the rotations of an icosahedron. Within the group, there are three kinds of elements: *A*~5~, the alternating group on 5 elements, is composed of the
[even](https://en.wikipedia.org/wiki/Parity_of_a_permutation) permutations of 5 elements.
It also happens to describe the rotations of an icosahedron.
Within the group, there are three kinds of elements:
- The product of two 2-cycles, such as a = (1 2)(3 4) - The product of two 2-cycles, such as *a* = (1 2)(3 4)
- On an icosahedron, this corresponds to a 180 degree rotation (or more precisely, 1/2 of a turn) about an edge - On an icosahedron, this corresponds to a 180 degree rotation
- 5-cycles, such as b = (1 2 3 4 5) (or more precisely, 1/2 of a turn) about an edge
- This corresponds to a 72 degree rotation (1/5 of a turn) around the center of a face - 5-cycles, such as *b* = (1 2 3 4 5)
- 3-cycles, such as ab = (2 4 5) - This corresponds to a 72 degree rotation (1/5 of a turn)
- This corresponds to a 120 degree rotation (1/3 of a turn) around a vertex around the center of a face
- 3-cycles, such as *ab* = (2 4 5)
- This corresponds to a 120 degree rotation (1/3 of a turn)
around a vertex
It happens to be the case that all elements of the group can be expressed as a product between *a* and *b* -- they generate the group. It happens to be the case that all elements of the group can be expressed
as a product between *a* and *b* -- they generate the group.
### Mapping to Matrices ### Mapping to Matrices
To create a correspondence with PSL(2, 5), we need to identify permutations with matrices. Obviously, the identity permutation goes to the identity matrix. Then, since *a* and *b* generate the group, we can search for two matrices which obey the same relations (under projective equality, since we're working in PSL). One such correspondence is: To create a correspondence with PSL(2, 5), we need to identify permutations with matrices.
Obviously, the identity permutation goes to the identity matrix.
Then, since *a* and *b* generate the group, we can search for two matrices which
obey the same relations (under projective equality, since we're working in PSL).
One such correspondence is:
$$ $$
\begin{array}{} \begin{array}{}
@ -538,6 +617,7 @@ $$
<summary> <summary>
Haskell implementation using B as a generator to find candidates for A Haskell implementation using B as a generator to find candidates for A
</summary> </summary>
```{.haskell} ```{.haskell}
orderWith :: Eq a => (a -> a -> a) -> (a -> Bool) -> a -> Int orderWith :: Eq a => (a -> a -> a) -> (a -> Bool) -> a -> Int
-- Repeatedly apply f to p, until the predicate z -- Repeatedly apply f to p, until the predicate z
@ -577,33 +657,37 @@ psl25_gen_A_candidates = filter ((==3) . orderPSL25 . (psl25_gen_B |*|)) \
-- [0,3] -- [0,3]
``` ```
If you're unsatisfied with starting from *B*, realize that we could have filtered out only the order 5 elements of PSL(2, 5) (`filter ((==5) . psl25Order) $ mPSL 2 5`), and picked any element from this list to start. If you're unsatisfied with starting from *B*, realize that we could have filtered out
only the order 5 elements of PSL(2, 5) (`filter ((==5) . psl25Order) $ mPSL 2 5`),
and picked any element from this list to start.
</details> </details>
We now have a correspondence between three elements of *A*~5~ and PSL(2, 5). We can "run" both sets of the generators until we associate all elements to one another. This is most visually appealing to see as a Cayley graph: We now have a correspondence between three elements of *A*~5~ and PSL(2, 5).
We can "run" both sets of the generators until we associate all elements to one another.
This is most visually appealing to see as a Cayley graph:
::: {} ![
![]()
Cayley graph showing an isomorphism between A5 and PSL(2, 5). <br> Cayley graph showing an isomorphism between A5 and PSL(2, 5). <br>
Order-2 elements are red, order-3 elements are green, and order-5 elements are blue. <br> Order-2 elements are red, order-3 elements are green, and order-5 elements are blue. <br>
Purple arrows are order-5 generators, orange arrows are order-2 generators. Purple arrows are order-5 generators, orange arrows are order-2 generators.
::: ](./a5_psl25_cayley.png)
PSL(2, 4) PSL(2, 4)
--------- ---------
We could do the same for PSL(2, 4), but we can't just work modulo 4 -- remember, the elements of GF(4) are 0, 1, *α*, and *α*^2^. It follows that GL(2, 4) is composed of (invertible) matrices of those elements, and SL(2, 4) is composed of matrices with determinant 1. We could do the same for PSL(2, 4), but we can't just work modulo 4
-- remember, the elements of GF(4) are 0, 1, *α*, and *α*^2^.
It follows that GL(2, 4) is composed of (invertible) matrices of those elements,
and SL(2, 4) is composed of matrices with determinant 1.
$$ $$
\begin{matrix} \begin{matrix}
\boxed{ \boxed{ \begin{gather*}
\begin{gather*}
\large \text{GL}(2, 4) \large \text{GL}(2, 4)
\\ \\
\textcolor{red}{ \textcolor{red}{ \underset{\det = 1}{
\underset{\det = 1}{
\left(\begin{matrix} \left(\begin{matrix}
0 & 1 \\ 0 & 1 \\
1 & 1 1 & 1
@ -629,11 +713,9 @@ $$
\end{matrix} \right) \end{matrix} \right)
}}, }},
... ...
\end{gather*} \end{gather*} }
} \\ \\
\\ ~ \\ \boxed{ \begin{gather*}
\boxed{
\begin{gather*}
\large \text{SL}(2,4) \large \text{SL}(2,4)
\\ \\
\textcolor{red}{ \textcolor{red}{
@ -649,14 +731,16 @@ $$
\end{matrix} \right) \end{matrix} \right)
}, },
... ...
\end{gather*} \end{gather*} }
}
\end{matrix} \end{matrix}
$$ $$
Scalar multiplication by *α* multiplies the determinant by *α*^2^; by *α*^2^ multiplies the determinant by *α*^4^ = *α*. Thus, SL(2, 4) is also PSL(2, 4), since no scalar multiple has determinant 1. Scalar multiplication by *α* multiplies the determinant by *α*^2^;
by *α*^2^ multiplies the determinant by *α*^4^ = *α*.
Thus, SL(2, 4) is also PSL(2, 4), since no scalar multiple has determinant 1.
Let's start by looking at an order-5 matrix over PSL(2, 4). We'll call this matrix *B*' to correspond with our order-5 generator in PSL(2, 5). Let's start by looking at an order-5 matrix over PSL(2, 4).
We'll call this matrix *B*' to correspond with our order-5 generator in PSL(2, 5).
$$ $$
\begin{gather*} \begin{gather*}
@ -684,7 +768,7 @@ $$
1 & 0 \\ 1 & 0 \\
0 & 1 0 & 1
\end{matrix}\right) \end{matrix}\right)
\\ ~ \\ \\ \\
\det B' = 0\alpha^2 - \alpha^3 = 1 \det B' = 0\alpha^2 - \alpha^3 = 1
\end{gather*} \end{gather*}
$$ $$
@ -697,16 +781,25 @@ We need to be able to do three things over GL(2, 4) on a computer:
- compute their determinant, and - compute their determinant, and
- be able to systematically write down all of them - be able to systematically write down all of them
It would then follow for us to repeat what we did with with SL(2, 5). But as I've said, working symbolically is hard for computers, and the methods described for prime fields do not work in general with prime power fields. Fortunately, we're amply prepared to find a solution. It would then follow for us to repeat what we did with with SL(2, 5).
But as I've said, working symbolically is hard for computers, and the methods described for prime fields
do not work in general with prime power fields.
Fortunately, we're amply prepared to find a solution.
### Bootstrapping Matrices ### Bootstrapping Matrices
Recall that the elements of GF(4) can also be written as the zero matrix, the identity matrix, *C*~*p*~, and *C*~*p*~^2^ (where *C*~*p*~ is the companion matrix of *p*(x) and again, *p*(x) = *x*^2^ + *x* + 1). This means we can also write elements of GL(2, 4) as matrices *of matrices*. Arithmetic works exactly the same as it does symbolically -- we just replace all instances of *α* in *B*' with *C*~*p*~. Recall that the elements of GF(4) can also be written as the zero matrix, the identity matrix,
*C*~*p*~, and *C*~*p*~^2^ (where *C*~*p*~ is the companion matrix of *p*(x)
and again, *p*(x) = *x*^2^ + *x* + 1).
This means we can also write elements of GL(2, 4) as matrices *of matrices*.
Arithmetic works exactly the same as it does symbolically
-- we just replace all instances of *α* in *B*' with *C*~*p*~.
$$ $$
\begin{gather*}
f^* : \mathbb{F}_4 {}^{2 \times 2} \rightarrow (\mathbb{F}_2 {}^{2 \times 2})^{2 \times 2} f^* : \mathbb{F}_4 {}^{2 \times 2} \rightarrow (\mathbb{F}_2 {}^{2 \times 2})^{2 \times 2}
\\ ~ \\ \\ \\
\begin{align*} \begin{align*}
\bar {B'} = f^*(B') &= \left(\begin{matrix} \bar {B'} = f^*(B') &= \left(\begin{matrix}
f(0) & f(\alpha) \\ f(0) & f(\alpha) \\
@ -735,35 +828,61 @@ f^* : \mathbb{F}_4 {}^{2 \times 2} \rightarrow (\mathbb{F}_2 {}^{2 \times 2})^{2
\end{matrix} \right) = \end{matrix} \right) =
f^*((\bar B')^2) f^*((\bar B')^2)
\end{align*} \end{align*}
\end{gather*}
$$ $$
Make no mistake, this is *not* a [block matrix](https://en.wikipedia.org/wiki/Block_matrix), at least not a typical one. Namely, the layering means that the determinant (which signifies its membership in SL) is another matrix: Make no mistake, this is *not* a [block matrix](https://en.wikipedia.org/wiki/Block_matrix),
at least not a typical one.
Namely, the layering means that the determinant (which signifies its membership in SL) is another matrix:
$$ $$
\begin{align*} \begin{align*}
\det( f^*(B') ) &= {\bf 0} (C_p {}^2) - (C_p)(C_p {}^2) \\ \det( f^*(B') ) &= {\bf 0} (C_p {}^2) - (C_p)(C_p {}^2)
&= \\
\left(\begin{matrix} 0 & 0 \\ 0 & 0 \end{matrix} \right) &= \left(\begin{matrix}
\left(\begin{matrix} 1 & 1 \\ 1 & 0 \end{matrix} \right) - 0 & 0 \\
\left(\begin{matrix} 0 & 1 \\ 1 & 1 \end{matrix} \right) 0 & 0
\left(\begin{matrix} 1 & 1 \\ 1 & 0 \end{matrix} \right) \\ \end{matrix} \right)
&= \left(\begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right) \mod 2 \\ \left(\begin{matrix}
1 & 1 \\
1 & 0
\end{matrix} \right)
- \left(\begin{matrix}
0 & 1 \\
1 & 1
\end{matrix} \right)
\left(\begin{matrix}
1 & 1 \\
1 & 0 \end{matrix}
\right)
\\
&= \left(\begin{matrix}
1 & 0 \\
0 & 1
\end{matrix} \right) \mod 2
\\
&= I = f(\det(B')) &= I = f(\det(B'))
\end{align*} \end{align*}
$$ $$
Since *B*' is in SL(2, 4), the determinant is unsurprisingly *f*(1) = I. The (matrix) determinants of *f*\* applied to other elements of GL(2, 4) could just as well be *f*(*α*) = *C*~*p*~ or *f*(*α*^2^) = *C*~*p*~^2^. Since *B*' is in SL(2, 4), the determinant is unsurprisingly *f*(1) = I.
The (matrix) determinants of *f*\* applied to other elements of GL(2, 4)
could just as well be *f*(*α*) = *C*~*p*~ or *f*(*α*^2^) = *C*~*p*~^2^.
### Implementation ### Implementation
Using this method, we can implement PSL(2, 4) directly. All we need to do is find all possible 4-tuples of **0**, *I*, *C*~*p*~, and *C*~*p*~^2^, then arrange each into a 2x2 matrix. Multiplication follows from the typical definition and the multiplicative identity is just *f*\*(*I*). Using this method, we can implement PSL(2, 4) directly.
All we need to do is find all possible 4-tuples of **0**, *I*, *C*~*p*~, and *C*~*p*~^2^,
then arrange each into a 2x2 matrix.
Multiplication follows from the typical definition and the multiplicative identity is just *f*\*(*I*).
<details> <details>
<summary> <summary>
Haskell implementation of PSL(2, 4) Haskell implementation of PSL(2, 4)
</summary> </summary>
```{.haskell} ```{.haskell}
import Data.List (findIndex) import Data.List (findIndex)
@ -797,12 +916,15 @@ mPSL24 = filter ((==one_f4) . (fmap (`mod` 2)) . laplaceDet) $ f4_matrices
``` ```
</details> </details>
Now that we can generate the group, we can finally repeat what we did with PSL(2, 5). All we have to do is filter out order-2 elements, then further filter for those which have an order-3 product with *B*'. Now that we can generate the group, we can finally repeat what we did with PSL(2, 5).
All we have to do is filter out order-2 elements, then further filter
for those which have an order-3 product with *B*'.
<details> <details>
<summary> <summary>
Haskell implementation using *B*' as a generator to find candidates for *A*' Haskell implementation using *B*' as a generator to find candidates for *A*'
</summary> </summary>
```{.haskell} ```{.haskell}
-- Order with respect to PSL(2, 4): using matrix multiplication (mod 2) -- Order with respect to PSL(2, 4): using matrix multiplication (mod 2)
-- and projective equality to the identity matrix -- and projective equality to the identity matrix
@ -852,7 +974,7 @@ $$
0 & 1 0 & 1
\end{matrix}\right) \end{matrix}\right)
\end{gather*} \end{gather*}
\\ ~ \\ \hline \\ \\ \\ \hline \\
\begin{gather*} \begin{gather*}
A'B' = A'B' =
\left(\begin{matrix} \left(\begin{matrix}
@ -879,22 +1001,30 @@ $$
Then, we can arrange them on a Cayley graph in the same way as PSL(2, 5): Then, we can arrange them on a Cayley graph in the same way as PSL(2, 5):
::: {} ![
![]()
Cayley graph showing an isomorphism between *A*^5^ and PSL(2, 4). <br> Cayley graph showing an isomorphism between *A*^5^ and PSL(2, 4). <br>
Colors indicate the same thing as in the previous diagram. Colors indicate the same thing as in the previous diagram.
::: ](./a5_psl24_cayley.png)
Closing Closing
------- -------
This post addresses my original goal in implementing finite fields, namely computationally finding an explicit map between *A*^5^ and PSL(2, 4). I believe the results are a little more satisfying than attempting to wrap your head around group-theoretic proofs. That's not to discount the power and astounding amount of work that goes into the latter method. It does tend to leave things rather opaque, however. This post addresses my original goal in implementing finite fields,
namely computationally finding an explicit map between *A*^5^ and PSL(2, 4).
I believe the results are a little more satisfying than attempting to wrap your head
around group-theoretic proofs.
That's not to discount the power and astounding amount of work that goes into the latter method.
It does tend to leave things rather opaque, however.
If you'd prefer a more interactive diagram showing the above isomorphisms, I've gone to the liberty of creating a hoverable SVG: If you'd prefer a more interactive diagram showing the above isomorphisms,
I've gone to the liberty of creating a hoverable SVG:
![]() ![](./a5_psl24_psl25_isomorphism.svg)
This post slightly diverts our course from the previous one's focus on fields. The [next one]() will focus on more results regarding the treatment of layered matrices. The algebraic consequences of this structure are notable in and of themselves, and are entirely obfuscated by the usual interpretation of block matrices. This post slightly diverts our course from the previous one's focus on fields.
The [next one](../4) will focus on more results regarding the treatment of layered matrices.
The algebraic consequences of this structure are notable in and of themselves,
and are entirely obfuscated by the usual interpretation of block matrices.
Diagrams created with Geogebra and Inkscape. Diagrams created with Geogebra and Inkscape.