OctoInform Beta

OpenAI preprint, September 2026 · §1. Introduction

§1 (setting): iterated matrix multiplication and homogeneous depth-five circuits: Defining IMMn,n\mathrm{IMM}_{n,n}, syntactically homogeneous ΣΠΣΠΣ\Sigma\Pi\Sigma\Pi\Sigma circuits, formal degrees, gate evaluation, and circuit size over a commutative semiring

Iterated matrix multiplication and homogeneous depth-five circuits.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The setting

Iterated matrix multiplication asks for the (1,1)(1,1) entry of a product of nn independent n×nn \times n matrices of distinct commuting variables, regarded as a polynomial of degree nn in all n3n^3 ambient matrix-entry variables. To study the arithmetic complexity of this polynomial in depth five, one considers syntactically homogeneous ΣΠΣΠΣ\Sigma\Pi\Sigma\Pi\Sigma circuits: five alternating layers of weighted addition gates and multiplication gates built over scalar and variable leaves, with every addition gate combining inputs of equal formal degree. Arbitrary finite fan-in, fan-out, and gate sharing are permitted, bottom linear forms may have arbitrary support, and circuit size counts every gate in all five layers together with the leaves.

Variable matrices

Let KK be a commutative semiring and let n∈ℕn \in \mathbb{N}. Let X={xi,j(t):1≤t,i,j≤n}X = \{x^{(t)}_{i,j} : 1 \le t, i, j \le n\} be a set of n3n^3 distinct commuting variables, and let K[X]K[X] denote the multivariate polynomial ring over KK in the variables XX. For each layer index 1≤t≤n1 \le t \le n, the variable matrix layer X(t)X^{(t)} is the n×nn \times n matrix over K[X]K[X] whose (i,j)(i,j) entry is the variable xi,j(t)x^{(t)}_{i,j}.✦

Homogeneous depth-five circuits

A circuit leaf ℓ\ell over KK in the variables XX is either a scalar a∈Ka \in K or a variable xi,j(t)∈Xx^{(t)}_{i,j} \in X.✦ A scalar leaf aa has leaf degree deg⁡(ℓ)=0\deg(\ell) = 0 and leaf polynomial f(0)(ℓ)=a∈K[X]f^{(0)}(\ell) = a \in K[X], while a variable leaf xi,j(t)x^{(t)}_{i,j} has leaf degree deg⁡(ℓ)=1\deg(\ell) = 1 and leaf polynomial f(0)(ℓ)=xi,j(t)∈K[X]f^{(0)}(\ell) = x^{(t)}_{i,j} \in K[X].

A syntactically homogeneous depth-five circuit CC over KK in the variables XX consists of five nonnegative integers s0,s1,s2,s3,s4∈ℕs_0, s_1, s_2, s_3, s_4 \in \mathbb{N} counting the leaves, bottom sum gates, lower product gates, middle sum gates, and upper product gates, together with a tuple of leaves ℓ1,…,ℓs0\ell_1, \dots, \ell_{s_0}, a collection of finite input lists for the five gate layers, and formal-degree assignments for the three sum layers.✦ Each bottom sum gate 1≤i≤s11 \le i \le s_1 carries a finite list Ii(1)I^{(1)}_i of weighted leaf inputs (c,r)∈K×{1,…,s0}(c, r) \in K \times \{1, \dots, s_0\} and a formal degree di(1)∈ℕd^{(1)}_i \in \mathbb{N}; each lower product gate 1≤i≤s21 \le i \le s_2 carries a finite list Ii(2)I^{(2)}_i of indices in {1,…,s1}\{1, \dots, s_1\}; each middle sum gate 1≤i≤s31 \le i \le s_3 carries a finite list Ii(3)I^{(3)}_i of weighted inputs (c,j)∈K×{1,…,s2}(c, j) \in K \times \{1, \dots, s_2\} and a formal degree di(3)∈ℕd^{(3)}_i \in \mathbb{N}; each upper product gate 1≤i≤s41 \le i \le s_4 carries a finite list Ii(4)I^{(4)}_i of indices in {1,…,s3}\{1, \dots, s_3\}; and the single output sum gate carries a finite list I(5)I^{(5)} of weighted inputs (c,j)∈K×{1,…,s4}(c, j) \in K \times \{1, \dots, s_4\} and a formal degree d(5)∈ℕd^{(5)} \in \mathbb{N}. These data satisfy the syntactic homogeneity conditions deg⁡(ℓr)=di(1)for all (c,r)∈Ii(1),∑k∈Ij(2)dk(1)=di(3)for all (c,j)∈Ii(3),∑k∈Ij(4)dk(3)=d(5)for all (c,j)∈I(5),\begin{aligned} \deg(\ell_r) &= d^{(1)}_i \quad \text{for all } (c, r) \in I^{(1)}_i, \\ \sum_{k \in I^{(2)}_j} d^{(1)}_k &= d^{(3)}_i \quad \text{for all } (c, j) \in I^{(3)}_i, \\ \sum_{k \in I^{(4)}_j} d^{(3)}_k &= d^{(5)} \quad \text{for all } (c, j) \in I^{(5)}, \end{aligned}(1) where each sum over an input list is taken with multiplicity, and satisfy the empty-input conditions di(1)=0d^{(1)}_i = 0 whenever Ii(1)I^{(1)}_i is empty, di(3)=0d^{(3)}_i = 0 whenever Ii(3)I^{(3)}_i is empty, and d(5)=0d^{(5)} = 0 whenever I(5)I^{(5)} is empty.

Given a syntactically homogeneous depth-five circuit CC over KK in XX, the bottom sum gate polynomials fi(1)∈K[X]f^{(1)}_i \in K[X] (1≤i≤s11 \le i \le s_1), lower product gate polynomials fi(2)∈K[X]f^{(2)}_i \in K[X] (1≤i≤s21 \le i \le s_2), middle sum gate polynomials fi(3)∈K[X]f^{(3)}_i \in K[X] (1≤i≤s31 \le i \le s_3), and upper product gate polynomials fi(4)∈K[X]f^{(4)}_i \in K[X] (1≤i≤s41 \le i \le s_4) are defined layer by layer by fi(1)=∑(c,r)∈Ii(1)cf(0)(ℓr),fi(2)=∏k∈Ii(2)fk(1),fi(3)=∑(c,j)∈Ii(3)cfj(2),fi(4)=∏k∈Ii(4)fk(3),\begin{aligned} f^{(1)}_i &= \sum_{(c, r) \in I^{(1)}_i} c \, f^{(0)}(\ell_r), & f^{(2)}_i &= \prod_{k \in I^{(2)}_i} f^{(1)}_k, \\ f^{(3)}_i &= \sum_{(c, j) \in I^{(3)}_i} c \, f^{(2)}_j, & f^{(4)}_i &= \prod_{k \in I^{(4)}_i} f^{(3)}_k, \end{aligned}(2) where sums and products over input lists are taken with multiplicity, with an empty sum equal to 00 and an empty product equal to 11. In (1) and (2), every gate may appear arbitrarily many times across input lists, so fan-in, fan-out, and gate sharing are unrestricted.

The definition

Definition. Let KK be a commutative semiring and let n∈ℕn \in \mathbb{N}. For n≥1n \ge 1, the iterated matrix multiplication polynomial IMMn,n∈K[X]\mathrm{IMM}_{n,n} \in K[X] is the (1,1)(1,1) entry of the product of the variable matrices X(1),…,X(n)X^{(1)}, \dots, X^{(n)}, given by (3): IMMn,n=(X(1)⋯X(n))1,1=∑1≤i1,…,in−1≤nx1,i1(1)xi1,i2(2)⋯xin−1,1(n),\mathrm{IMM}_{n,n} = \bigl(X^{(1)} \cdots X^{(n)}\bigr)_{1,1} = \sum_{1 \le i_1, \dots, i_{n-1} \le n} x^{(1)}_{1, i_1} x^{(2)}_{i_1, i_2} \cdots x^{(n)}_{i_{n-1}, 1},(3)✦ with the convention that IMM1,1=x1,1(1)\mathrm{IMM}_{1,1} = x^{(1)}_{1,1} when n=1n = 1, and IMM0,0=0\mathrm{IMM}_{0,0} = 0 when n=0n = 0.

Let CC be a syntactically homogeneous depth-five circuit over KK in the variables XX. The circuit output polynomial val⁡(C)∈K[X]\operatorname{val}(C) \in K[X] is the weighted sum of its upper product gate polynomials given by (4): val⁡(C)=∑(c,j)∈I(5)cfj(4),\operatorname{val}(C) = \sum_{(c, j) \in I^{(5)}} c \, f^{(4)}_j,(4)✦ taken with multiplicity over I(5)I^{(5)} (with an empty sum equal to 00). The circuit size size⁡(C)∈ℕ\operatorname{size}(C) \in \mathbb{N} is the total count of leaves and gates given by (5): size⁡(C)=s0+s1+s2+s3+s4+1.\operatorname{size}(C) = s_0 + s_1 + s_2 + s_3 + s_4 + 1.(5)✦

In the paper, the result reads: for integers w,d≥1w, d \ge 1, the polynomial IMMw,d=(X(1)⋯X(d))1,1\mathrm{IMM}_{w,d} = (X^{(1)} \cdots X^{(d)})_{1,1} is defined for independent w×ww \times w variable matrices retaining all dw2d w^2 ambient variables, with target IMMn,n\mathrm{IMM}_{n,n}, and syntactically homogeneous ΣΠΣΠΣ\Sigma\Pi\Sigma\Pi\Sigma circuits are defined over a field KK. The Lean library specializes the target directly to w=d=nw = d = n and formulates both the polynomial and the circuit model over an arbitrary commutative semiring KK with explicit formal-degree assignments.

What is checked

The Lean library defines IMMn,n\mathrm{IMM}_{n,n}, val⁡(C)\operatorname{val}(C), and size⁡(C)\operatorname{size}(C) over an arbitrary commutative semiring KK and a natural number nn, built from the n3n^3 ambient variables, the variable matrix layers X(1),…,X(n)X^{(1)}, \dots, X^{(n)}, circuit leaves with their degrees and polynomials, and syntactically homogeneous depth-five circuits with their layered input lists, formal-degree assignments, and internal gate polynomials.