Rational frame projectors and the deferred auxiliary readout edge
DefinitionIntMul_Kappa_DeferredReadoutProjectorsinteger-multiplicationlinear-algebra
For the integer-multiplication readouts, the ambient vector space has 23 rational coordinates. The bilinear form is represented here by the integer matrix , where is the all-ones matrix. For a nondegenerate frame , its projector maps onto along its -orthogonal complement. A finite certificate for nondegeneracy gives a vector and a positive integer such that on . The frame-projector definition uses zero on a degenerate subspace. The staircase assertion verifies nondegeneracy for every scheduled frame.
For a triple of coordinates with indicator , let project onto its line. At a deferred readout the edge on the tensor-square space is
Targets are triples in lexicographic order. The chronological list retains repeated frames.
Definition code
import Definitions.Def_IntMul_Kappa_DeferredReadoutCertificates
import Mathlib.LinearAlgebra.BilinearForm.Orthogonal
import Mathlib.LinearAlgebra.Matrix.DotProduct
import Mathlib.LinearAlgebra.Matrix.Kronecker
import Mathlib.LinearAlgebra.Matrix.ToLin
import Mathlib.LinearAlgebra.Projection
namespace IntMul.Kappa.DeferredReadout
open Matrix
open scoped Kronecker
abbrev V := VectorQ 23
abbrev Subspace := Submodule ℚ V
abbrev Mat := Matrix (Fin 23) (Fin 23) ℚ
def total : V →ₗ[ℚ] ℚ where
toFun x := ∑ i, x i
map_add' x y := by simp [Finset.sum_add_distrib]
map_smul' c x := by simp [Finset.mul_sum]
/-- Nine times Jain's form G = I - J/9. Scaling preserves orthogonal complements. -/
def gramForm : LinearMap.BilinForm ℚ V :=
(9 : ℚ) • dotProductBilin ℚ ℚ - total.smulRight total
/-- One exact vector in the frame represents the coordinate-sum functional
for the restricted Gram form. This suffices to rule out a radical. -/
structure GramCertificate where
den : Nat
terms : List (Nat × Int)
vector : Array Int
deriving Inhabited
def GramCertificate.coord (c : GramCertificate) (i : Fin 23) : Int :=
c.vector[i.val]?.getD 0
def GramCertificate.ok (c : GramCertificate) (tbl : RowTable) (B : Frame) : Bool :=
decide (0 < c.den) && c.terms.all (fun v => B.contains v.1) &&
(List.finRange 23).all (fun i => c.coord i == combination tbl c.terms i.val) &&
B.all (fun r =>
let u := fun i : Fin 23 => tbl r i.val
let s := ∑ i, u i
9 * (∑ i, u i * c.coord i) - s * (∑ i, c.coord i) == (c.den : Int) * s)
noncomputable def project (U : Subspace) : Mat := by
classical
exact if h : IsCompl U (gramForm.orthogonal U) then
LinearMap.toMatrix' (U.projection _ h) else 0
def aux (frame target : Mat) : Matrix (Fin 23 × Fin 23) (Fin 23 × Fin 23) ℚ :=
1 - (1 - frame) ⊗ₖ target
def targetCovector (t : V) : V := fun i => 9 * t i - total t
/-- The rank-one G-orthogonal projector along a nonisotropic target direction. -/
def targetProjector (t : V) : Mat :=
let v := targetCovector t
vecMulVec t ((v ⬝ᵥ t)⁻¹ • v)
def targetTriples : Array (Nat × Nat × Nat) :=
((List.range 23).flatMap fun i => (List.range 23).flatMap fun j =>
((List.range 23).filter fun k => i < j && j < k).map fun k => (i,j,k)).toArray
def targetDirection (t : Fin 1771) : V :=
let tri := targetTriples[t.val]?.getD (0,0,0)
fun j => if j.val = tri.1 ∨ j.val = tri.2.1 ∨ j.val = tri.2.2 then 1 else 0
def gramChecks (d : Block) (cs : Array GramCertificate) : Bool :=
(List.range d.frames.size).all fun i => (cs[i]?.getD default).ok d.entry (d.basis i)
def eventFrameBounds (d : Block) : Bool :=
d.targets.toList.all fun es => es.all fun e => decide (e.frame < d.frames.size)
/-- Ordered auxiliary readouts in the 23 × 23 network coordinate space. -/
noncomputable def readoutEdges (fs : List Subspace) (t : V) :=
fs.map (fun U => aux (project U) (targetProjector t))
end IntMul.Kappa.DeferredReadout
Source