The octonion product from the Fano plane, and the flow matrix
DefinitionOctonionD8_flowWrite for the standard basis of , and label the imaginary unit () by the Fano point . For each line (mod ) of the Fano plane, orient the product cyclically along :
(unit indices mod in ), with reversed products negative, and the identity. Extend bilinearly to a product on .
For let and be the matrices of and (column is the image of ). For real the flow matrix is
the matrix of .
Formalization Note octTable i j k is the coefficient of in ; it is built from the published RolesForceSeven.fanoLine. omul is the product, Rmat/Lmat the multiplication matrices, and flowMat c s the flow matrix.
import Mathlib
import Definitions.Def_RolesForceSeven_fano
namespace OctonionD8
open Polynomial RolesForceSeven
/-- The Fano point labelling the imaginary unit `e_i` (`i = 1, …, 7` ↦ point `i - 1`). -/
def fanoPoint (i : Fin 8) : Fin 7 := ⟨(i.val + 6) % 7, Nat.mod_lt _ (by norm_num)⟩
/-- Structure constants of the octonion product on ℝ⁸ (index 0 = the real unit),
from mission 5's Fano lines {i, i+1, i+3} (mod 7), oriented cyclically:
e_{i+1} e_{i+2} = e_{i+4}, with e_k² = −1 and anticommuting distinct units.
`octTable i j k` is the coefficient of `e_k` in `e_i e_j`. -/
def octTable (i j k : Fin 8) : ℤ :=
if i = 0 then (if j = k then 1 else 0)
else if j = 0 then (if i = k then 1 else 0)
else if i = j then (if k = 0 then -1 else 0)
else if k = 0 then 0
else if ∃ l : Fin 7, fanoLine l = {fanoPoint i, fanoPoint j, fanoPoint k} ∧
((fanoPoint i = l ∧ fanoPoint j = l + 1) ∨ (fanoPoint i = l + 1 ∧ fanoPoint j = l + 3) ∨
(fanoPoint i = l + 3 ∧ fanoPoint j = l)) then 1
else if ∃ l : Fin 7, fanoLine l = {fanoPoint i, fanoPoint j, fanoPoint k} then -1
else 0
/-- The octonion product. -/
def omul (p q : Fin 8 → ℝ) : Fin 8 → ℝ :=
fun k => ∑ i, ∑ j, p i * q j * (octTable i j k : ℝ)
/-- Matrix of p ↦ p · a (right multiplication by a). -/
def Rmat (a : Fin 8 → ℝ) : Matrix (Fin 8) (Fin 8) ℝ :=
fun k j => omul (Pi.single j 1) a k
/-- Matrix of p ↦ b · p (left multiplication by b). -/
def Lmat (b : Fin 8 → ℝ) : Matrix (Fin 8) (Fin 8) ℝ :=
fun k j => omul b (Pi.single j 1) k
/-- The two-generator flow for a = e₁, b = c·e₁ + s·e₂. -/
def flowMat (c s : ℝ) : Matrix (Fin 8) (Fin 8) ℝ :=
Rmat (Pi.single 1 1) + Lmat (fun i => if i = 1 then c else if i = 2 then s else 0)
end OctonionD8
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Conventions and imported definitions. Indices range over (the type of 8 elements); write for the standard basis of (the vector with a in coordinate and elsewhere is ). The imported Fano plane uses points with arithmetic mod 7, and for the line (a finite set). These seven sets are pairwise distinct, each has 3 elements, and every two distinct points lie on exactly one of them. The structure fano built from them is not used by the definitions below; only is.
fanoPoint. For ,
So for , and also . This map is not injective, but is never consulted by octTable (see below), because every case involving index is settled before the Fano test.
octTable. An integer for , defined by the first applicable case:
- if : if , and otherwise;
- else if : if , and otherwise;
- else if (both nonzero): if , and otherwise;
- else if : ;
- else (, all of nonzero): if there is an with as sets and equal to one of , or . Otherwise if some equals . Otherwise .
In case 5, the set can only equal a line if it has three elements, which means . The ordered pair gets when it follows the cyclic order of its line and for the reverse order. With read as the coefficient of in , the table says that is a two-sided identity, that for , and that for distinct , with the unique third index on their line. Using , the lines correspond to the index triples (indices taken mod 7 in ), and the products are exactly
that is, and its cyclic shifts. Reversing the order of the factors in any of these gives the negative (for example ). All other coefficients are .
omul. For (arbitrary real 8-tuples, with no normalisation), is defined coordinatewise by
with cast from to . This is the -bilinear product on whose values on basis vectors are , as listed above.
Rmat. For , is the real matrix with rows and columns indexed by and entries
Column is the coordinate vector of , so for column vectors we have . In other words, is the matrix of right multiplication by in the standard basis.
Lmat. For , is the matrix with (row , column ). Column is , so . In other words, is the matrix of left multiplication by in the standard basis.
flowMat. For arbitrary reals (with no constraint such as ; they may be any real numbers, including ),
where is the vector with coordinate equal to , coordinate equal to , and all others . So is the matrix, acting on column vectors in the standard basis, of the linear map
Here are the basis vectors in positions 1 and 2, the first two imaginary units, not . Its columns (the images of ), obtained by expanding with the table above, are
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.