MATH-005 // FORMAL PROOF + WASM
AlphaTensor Rank-47 4x4 Matrix Multiplication over F_2 (2022)
Interactive 3D tensor decomposition explorer executing Fawzi et al.'s 47-multiplication 4x4 algorithm over F_2 and verifying every product against naive 64-mul exact arithmetic.
Fawzi, Balog, Huang, Hubert, Romera-Paredes, Barekatain, Novikov, Ruiz, Schrittwieser, Swirszcz, Silver, Hassabis & Kohli (2022), Nature 610, 47-53
Steps: 0
Invariant: OK
Metric: 0.0
Formal Theorem Statement
Order-3 Tensor Rank-47 Bilinear Decomposition over F_2
Structured Proof Tree
- Setup (Multiplication Tensor): Encode 4x4 matrix product C = AB over F_2 as a sparse 16x16x16 tensor T_{4,4,4} with 64 nonzeros.
- Step (RL TensorGame Decomposition): AlphaTensor constructs 47 rank-1 bilinear factors (u^(r), v^(r), w^(r)) in F_2^{16} reducing residual S_47 to 0.
- Lemma (Bilinear Basis Completeness): Verifying all 16x16 = 256 canonical basis pairs (E_p, E_q) establishes identity over all F_2^{4x4} pairs.
- Theorem (Sub-Strassen Rank-47): Complexity drops from 64 naive (or 49 recursive Strassen) to 47 multiplications (-26.6%).
Formal Excerpt & Upstream Reference
# Exhaustive F_2 tensor verification (github.com/google-deepmind/alphatensor)
# factorizations_f2.npz['4,4,4'] -> U, V, W in F_2^{16 x 47}
for p in 0..16:
for q in 0..16:
assert alphatensor_47(e_p, e_q) == naive_64(e_p, e_q) # 4,096 / 4,096 exactVerification Contract & Executable Receipt
pv contract MATH-005: all 47 rank-1 F_2 factors reproduce every one of the 4,096 coordinates of T_{4,4,4} mod 2 with 0 mismatches vs naive 64-mul exact arithmetic.
metadata:
version: "1.0.0"
kind: pattern
description: "AlphaTensor rank-47 4x4 matrix multiplication tensor contract over F_2"
references:
- "Fawzi et al. (2022), Discovering faster matrix multiplication algorithms with RL, Nature"
equations:
tensor_rank:
formula: "R_F2(4, 4, 4) <= 47"
proof_obligations:
- id: PO-MATH-005
type: invariant
property: "Rank-47 bilinear product matches naive 64-mul exact arithmetic on all 4,096 tensor coordinates"
falsification_tests:
- id: FALSIFY-MATH-005
rule: "alphatensor_4096_exact_match"
prediction: "tensor_mismatches == 0 across all 256 basis pairs"
if_fails: "Rank-47 decomposition fails to reconstruct T_{4,4,4} mod 2"
const FACTORS: [(u16, u16, u16); 47] = [
(0x0004, 0x0100, 0x0013), (0x0064, 0x0890, 0x0018), (0x0054, 0x0405, 0x0014),
(0x0044, 0x0d95, 0x0010), (0x0001, 0x0001, 0x0105), (0x0101, 0x039b, 0x0100),
(0x0501, 0x0302, 0x0102), (0x0367, 0x0090, 0x0008), (0x3002, 0x0045, 0x1004),
(0x6002, 0x0320, 0x1002), (0x2002, 0x0375, 0x1000), (0x3057, 0x0005, 0x0004),
(0x6507, 0x0300, 0x0002), (0x1000, 0x3046, 0x5400), (0x9008, 0x3002, 0x7602),
(0x8008, 0x7402, 0x7420), (0x0301, 0x0098, 0x0108), (0x9a08, 0x3000, 0xa602),
(0x0a08, 0x3020, 0xab02), (0x0808, 0xb820, 0x8b20), (0x0020, 0x58c0, 0x8090),
(0x00a8, 0x5040, 0xc0d4), (0xc008, 0x5400, 0x7064), (0xc058, 0x0400, 0x0064),
(0x4828, 0x5820, 0x8020), (0x0400, 0x9a02, 0x0320), (0x0088, 0xd048, 0x84d0),
(0x0098, 0x9008, 0x0cd8), (0x6a08, 0x0020, 0xa002), (0xc0a8, 0x5000, 0xc064),
(0x0008, 0x1000, 0x7bdf), (0x0c08, 0x9800, 0x0ba8), (0x1110, 0x000e, 0x0400),
(0x30a8, 0x0040, 0xc004), (0x8880, 0xe000, 0x8420), (0x0c68, 0x0800, 0x00a8),
(0x4440, 0x0e00, 0x0020), (0x2220, 0x00e0, 0x8000), (0x0002, 0x0010, 0x1009),
(0x0c98, 0x9000, 0x0ca8), (0x4000, 0x5620, 0x3020), (0x0010, 0x940c, 0x0450),
(0x0398, 0x0008, 0x0c08), (0x1288, 0x3048, 0x8400), (0x0200, 0x30a8, 0x8900),
(0x8418, 0x9402, 0x0420), (0x9508, 0x0002, 0x0602),
];
fn main() {
for p in 0..16_u16 {
for q in 0..16_u16 {
let (a, b) = (1_u16 << p, 1_u16 << q);
let mut c47 = 0_u16;
for &(u, v, w) in &FACTORS {
if ((a & u).count_ones() & 1) & ((b & v).count_ones() & 1) != 0 {
c47 ^= w;
}
}
let mut c64 = 0_u16;
for i in 0..4_u16 {
for j in 0..4_u16 {
let mut s = 0_u16;
for k in 0..4_u16 {
s ^= ((a >> (i * 4 + k)) & 1) & ((b >> (k * 4 + j)) & 1);
}
c64 |= s << (i * 4 + j);
}
}
assert_eq!(c47, c64);
}
}
println!("MATH-005 PASS rank=47 mismatches=0/4096");
}