Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Convolution ⊆ attention: a look-up table a(xu,xv)=cuva(x_u,x_v)=c_{uv}a(xu​,xv​)=cuv​

Proved
GeometricDL.WL.conv_eq_attn_of_lookup

by mikedeng1 · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

geometric-deep-learninggraph-neural-networksweisfeiler-lehman

Let c:H×H→Rc:H\times H\to\mathbb Rc:H×H→R be a look-up table of coefficients indexed by the states of the two endpoints. For every finite graph G=(V,E)G=(V,E)G=(V,E), node states h:V→Hh:V\to Hh:V→H, node uuu, message map ψ\psiψ, aggregator ⨁\bigoplus⨁ and update φ\varphiφ, the convolutional layer (33) with cuv=c(hu,hv)c_{uv}=c(h_u,h_v)cuv​=c(hu​,hv​) equals the attentional layer (34) with attention a:=ca:=ca:=c:

φ(hu,⨁v∈Nuc(hu,hv) ψ(hv))=φ(hu,⨁v∈Nua(hu,hv) ψ(hv)).\varphi\Big(h_u,\bigoplus_{v\in N_u}c(h_u,h_v)\,\psi(h_v)\Big)=\varphi\Big(h_u,\bigoplus_{v\in N_u}a(h_u,h_v)\,\psi(h_v)\Big).φ(hu​,v∈Nu​⨁​c(hu​,hv​)ψ(hv​))=φ(hu​,v∈Nu​⨁​a(hu​,hv​)ψ(hv​)).

This is the first half of the containment convolution ⊆\subseteq⊆ attention ⊆\subseteq⊆ message passing.

Differences from the source:

  • reading: "a look-up table a(x_u, x_v) = c_uv" → the convolutional coefficient is c(h_u, h_v), a function of the endpoints' states; reason: a look-up table indexed by (x_u, x_v) can only represent such coefficients; a degree-dependent c_uv = 1/√(d_u d_v) is not one layer of (34) (a featureless node of degree 2 whose neighbours have degree 1 vs 2 gets √2 vs 1, while (34) sees the same features), and such coefficients reach the goal through the milestone on local layers instead
  • encoding: node features x_u of one layer → the current states h of a stack of layers; reason: Lean convention; the first layer has h = x
  • encoding: permutation-invariant aggregator ⊕ → an arbitrary function of the multiset of messages, messages in a real vector space; reason: every function of a multiset is permutation-invariant and every permutation-invariant aggregator factors through the multiset
  • encoding: graph E ⊆ V×V with neighbourhood (11) → a relation E on a finite type, neighbourhood symmetrised, loops allowed; reason: Lean convention; same instances
Preamble
import Mathlib
import Definitions.Def_GeometricDL_WL_convLayer
import Definitions.Def_GeometricDL_WL_attnLayer
Formal statement
namespace GeometricDL.WL

/-- **Containment convolution ⊆ attention: an attention look-up table `a(x_u, x_v) = c_uv`.**
Bronstein, Bruna, Cohen & Veličković, *Geometric Deep Learning*, arXiv:2104.13478v2, §5.3,
printed p. 79 (PDF p. 83): "One important thing to note is a representational containment between
these approaches: convolution ⊆ attention ⊆ message-passing. Indeed, attentional GNNs can represent
convolutional GNNs by an attention mechanism implemented as a look-up table a(x_u, x_v) = c_uv,"

For every coefficient table `c : H → H → ℝ` indexed by the two endpoints' states, every `ψ`,
aggregator `agg` and update `φ`, every finite graph `(V, E)`, state `h` and node `u`, the
convolutional layer (33) with `c_uv = c(h_u, h_v)` equals the attentional layer (34) with `a := c`.

**Formalization Note.** The look-up table indexes `c_uv` by the endpoint features (states), as the
paper's `a(x_u, x_v) = c_uv` does; a degree-dependent coefficient is not of this form. -/
theorem conv_eq_attn_of_lookup {V : Type*} [Fintype V] {H M A H' : Type*} [AddCommMonoid M]
    [Module ℝ M] (c : H → H → ℝ) (ψ : H → M) (agg : Multiset M → A) (φ : H → A → H')
    (E : V → V → Prop) [DecidableRel E] (h : V → H) (u : V) :
    convLayer (fun hu hv _ _ => c hu hv) ψ agg φ E h u = attnLayer c ψ agg φ E h u := by sorry

end GeometricDL.WL
Source
Bronstein, Bruna, Cohen & Veličković, Geometric Deep Learning, arXiv:2104.13478v2, §5.3, printed p. 79 (PDF p. 83) ("Indeed, attentional GNNs can represent convolutional GNNs by an attention mechanism implemented as a look-up table a(x_u, x_v) = c_uv")

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me