Geometric Deep Learning III: An n × n Matrix Commutes with the Cyclic Shift S if and only if It Is Circulant, So Convolution Is Shift EquivarianceTextbook
Why convolution, and why the shift
Convolutional neural networks process images, audio and time series with layers whose weights are shared across positions. The Geometric Deep Learning programme of Bronstein, Bruna, Cohen and Veličković (arXiv:2104.13478v2) explains this architecture by symmetry: on a grid the relevant symmetry is translation, and a linear layer that respects translations is forced to be a convolution. Section 4.2 of the book makes this precise in the simplest setting, a one-dimensional periodic grid, and then derives the discrete Fourier transform from the same symmetry, as the common eigenbasis of all convolution operators. The material is classical in signal processing (see the tutorial of Bamieh, arXiv:1805.05533), and the book uses it as the template that the later chapters generalise to groups, graphs and manifolds; for example, graph signal processing (Sandryhaila and Moura, arXiv:1210.4752) replaces the shift by an adjacency matrix.
This mission formalises the characterisation the book calls the basis of "the overall philosophy of Geometric ML": a matrix is circulant if and only if it commutes with the shift (§4.2, p. 37). It is the third mission of a series on the book. The book numbers no theorems, lemmas or definitions; every item is cited by section, equation or position, and printed page.
Setting
Fix and the ring graph with nodes , arithmetic taken modulo . A signal is a vector with entries in a commutative ring , for instance .
- The circulant matrix of a vector is : each row is the previous one shifted circularly by one position.
- The circular convolution of a signal with a filter is .
- The right shift is the circulant matrix of . It moves a vector one position to the right, .
- Over , the discrete Fourier basis is for . The Fourier matrix has the as columns, and is its conjugate transpose.
In Lean the index set is ZMod n with [NeZero n], is Mathlib's Matrix.circulant θ, and the mission's definitions GeomDL.Grids.conv, GeomDL.Grids.shift, GeomDL.Grids.fourierVec and GeomDL.Grids.fourierMatrix are the four objects above.
Formalization targets
Goal: commuting with the shift characterises circulant matrices
For every matrix over a commutative ring ,
The book states the converse direction tentatively ("the opposite direction appears to be true as well"); it is a theorem, and it is stated here without the hedge.
Milestones, in attack order
- Circulant matrices are convolutions, , and shifts right, (p. 37).
- The left shift is , and (side-note, p. 37).
- Shift equivariance of convolution, (p. 37).
- The Fourier basis vectors are eigenvectors of : , with eigenvalues that are -th roots of unity (p. 38 and side-note).
- These eigenvalues are pairwise distinct (side-note, p. 37).
- (side-note, p. 38).
Companion: the Convolution Theorem
With ,
The book prints this with in place of , which is off by a factor for ; the corrected identity is stated. The transform form of the Convolution Theorem, with Mathlib's ZMod.dft, is already Proved on the platform as IntMul.HvdH.dft_cyclic_conv and is included as a reference item.
Significance
The goal identifies the space of linear translation-equivariant maps on with the convolutions, an -dimensional space parametrised by the filter . This is the statement that lets the book define convolution as a translation-equivariant linear operation, and it is the grid case of the general principle the book develops in §4.3 and §5: a linear map that commutes with a group action is a group convolution. Milestones 4–6 and the companion are the other half of §4.2: the shift has distinct eigenvalues, so every matrix commuting with it is diagonal in the shift's eigenbasis, and that eigenbasis is the Fourier basis; hence the Fourier transform diagonalises every convolution.
Mathlib contains circulant matrices, their commutativity (Matrix.circulant_mul_comm) and the discrete Fourier transform on ZMod n, but neither the converse characterisation nor the diagonalisation of circulant matrices by the normalised Fourier matrix. The mission adds these, in a form that later missions of the series (group convolutions, graph Fourier transforms) can be compared against.
Difficulty
The direction "" is a one-line consequence of the commutativity of circulant matrices. The content is "": the equation is an equation between matrices, and it has to be turned into the statement that the entries of are constant along every cyclic diagonal, with the indices handled modulo . The spectral argument of the book (commuting matrices with a common eigenbasis) only applies over a field containing the -th roots of unity in which is invertible; over a general commutative ring, such as or , the goal has to be proved without it. For the Fourier statements the work is in the geometric sums of roots of unity and in the bookkeeping between the representatives used in the exponents and the arithmetic of .
Formalization scope
- Indices live in
ZMod nwith[NeZero n], so and matrices are finite; no lower bound is needed (for , and every matrix is circulant, so the goal holds). Exponents use the representativesZMod.val, as on the page. - The goal and milestones 1–3 are stated over an arbitrary commutative ring ; milestones 4–6 and the companion are over .
- "Circulant" means equal to
Matrix.circulant θfor someθ. Defining a matrix to be circulant when it commutes with would make the goal true by definition; the mission does not do that. A sanity file checks that the shift moves vectors to the right on and that on does not commute with . - The side-note on p. 38 calls "orthogonal"; the property it writes, with the conjugate transpose, is unitarity, and that is what is stated.
- The Fourier normalisation is the book's in ; the eigenvalues in the companion use Mathlib's unnormalised
ZMod.dft, and the factor is written out in its statement.
No new infrastructure beyond Mathlib is required. Proofs of any item, and proofs of the goal that avoid the spectral argument, are welcome; the shift and Fourier lemmas are reusable for the graph Fourier transform later in the book.
Selected references
- M. M. Bronstein, J. Bruna, T. Cohen, P. Veličković, Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges, arXiv preprint, 2021 (v2). §4.2, pp. 35–38. https://arxiv.org/abs/2104.13478
- B. Bamieh, Discovering Transforms: A Tutorial on Circulant Matrices, Circular Convolution, and the Discrete Fourier Transform, arXiv preprint, 2018. https://arxiv.org/abs/1805.05533
- A. Sandryhaila, J. M. F. Moura, Discrete Signal Processing on Graphs, IEEE Transactions on Signal Processing, 2013. https://arxiv.org/abs/1210.4752
- D. Harvey, J. van der Hoeven, Integer multiplication in time O(n log n), Annals of Mathematics, 2021 (source of the platform's proved
IntMul.HvdH.dft_cyclic_conv). https://hal.science/hal-02070778