Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§5.3, pp. 79–80 — representational containment: convolution ⊆ attention ⊆ message passing

Proved
GeomDL.EGNN.conv_subset_att_subset_mp

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

attentiongeometric-deep-learninggraph-neural-networkp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Fix a graph with adjacency matrix A\mathbf AA and neighbourhoods Nu\mathcal N_uNu​, node features xu\mathbf x_uxu​, an update ϕ\phiϕ, a feature map ψ\psiψ and an aggregator ⨁\bigoplus⨁. Then:

  1. for every attention mechanism aaa, the attentional layer (34) equals the message-passing layer (35) with messages ψ′(xu,xv)=a(xu,xv)ψ(xv)\psi'(\mathbf x_u,\mathbf x_v) = a(\mathbf x_u,\mathbf x_v)\psi(\mathbf x_v)ψ′(xu​,xv​)=a(xu​,xv​)ψ(xv​);
  2. if the features identify the nodes (u↦xuu\mapsto\mathbf x_uu↦xu​ injective), then for every coefficient matrix (cuv)(c_{uv})(cuv​) there is an attention mechanism aaa (a look-up table with a(xu,xv)=cuva(\mathbf x_u,\mathbf x_v) = c_{uv}a(xu​,xv​)=cuv​) for which the convolutional layer (33) equals the attentional layer (34);
  3. under the same hypothesis, for every (cuv)(c_{uv})(cuv​) there is a message function ψ′\psi'ψ′ (with ψ′(xu,xv)=cuvψ(xv)\psi'(\mathbf x_u,\mathbf x_v) = c_{uv}\psi(\mathbf x_v)ψ′(xu​,xv​)=cuv​ψ(xv​)) for which (33) equals (35).

In symbols, writing Convc\mathrm{Conv}_cConvc​, Atta\mathrm{Att}_aAtta​, MPψ′\mathrm{MP}_{\psi'}MPψ′​ for the three layers on the same input,

Atta=MPaψ,x injective  ⟹  ∃a, Convc=Atta  and  ∃ψ′, Convc=MPψ′.\mathrm{Att}_a = \mathrm{MP}_{a\psi}, \qquad \mathbf x \text{ injective} \implies \exists a,\ \mathrm{Conv}_c = \mathrm{Att}_a \ \text{ and } \ \exists \psi',\ \mathrm{Conv}_c = \mathrm{MP}_{\psi'}.Atta​=MPaψ​,x injective⟹∃a, Convc​=Atta​  and  ∃ψ′, Convc​=MPψ′​.

This is the book's "convolution ⊆ attention ⊆ message-passing": the message-passing flavour is the most expressive of the three.

Formalization Note The injectivity hypothesis in parts 2 and 3 is added and is necessary: an attention mechanism or message function sees only features, so if two nodes u≠u′u \neq u'u=u′ have equal features but cuv≠cu′v′c_{uv}\neq c_{u'v'}cuv​=cu′v′​ for xv=xv′\mathbf x_v=\mathbf x_{v'}xv​=xv′​, no look-up table a(xu,xv)=cuva(\mathbf x_u,\mathbf x_v)=c_{uv}a(xu​,xv​)=cuv​ exists (a two-node counterexample is checked in Lean). Part 1 needs no hypothesis. The coefficients act on the messages through a scalar multiplication SMul ℝ M.

Preamble
import Mathlib
import Definitions.Def_GeomDL_EGNN_Defs
Formal statement
namespace GeomDL.EGNN

/-- §5.3, pp. 79–80: the containment "convolution ⊆ attention ⊆ message-passing".
(1) Every attentional layer (34) is the message-passing layer (35) with messages
`ψ(x_u, x_v) = a(x_u, x_v) ψ(x_v)`. (2) On features that identify the nodes (`u ↦ x_u`
injective), the convolutional layer (33) with coefficients `c_{uv}` equals an attentional layer
whose attention is a look-up table `a(x_u, x_v) = c_{uv}`, and (3) equals a message-passing
layer with messages `ψ'(x_u, x_v) = c_{uv} ψ(x_v)`. -/
theorem conv_subset_att_subset_mp {n : ℕ} {α M M' β : Type*} [SMul ℝ M]
    (φ : α → M' → β) (agg : Multiset M → M') (ψ : α → M) (X : Fin n → α)
    (A : Matrix (Fin n) (Fin n) ℝ) :
    (∀ a : α → α → ℝ,
        attLayer φ agg a ψ X A = mpLayer φ agg (fun xu xv => a xu xv • ψ xv) X A) ∧
    (Function.Injective X → ∀ c : Matrix (Fin n) (Fin n) ℝ,
        ∃ a : α → α → ℝ, convLayer φ agg c ψ X A = attLayer φ agg a ψ X A) ∧
    (Function.Injective X → ∀ c : Matrix (Fin n) (Fin n) ℝ,
        ∃ ψ' : α → α → M, convLayer φ agg c ψ X A = mpLayer φ agg ψ' X A) := by sorry

end GeomDL.EGNN
Source
Bronstein et al., Geometric Deep Learning (arXiv:2104.13478v2), §5.3, pp. 79–80, "convolution ⊆ attention ⊆ message-passing", eqs. (33)–(35)
Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 21, 2026

    Confirmed by the mission captain (proposal self-audit).

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