GNNTheory: A Lean 4 Formalization of Graph Neural Network Theory

3.1 Concrete Real-Valued Neural Architectures

Definition 3.1 Linear-activation MPNN layer (Morris et al.)

Let \(\sigma : \mathbb {R}\to \mathbb {R}\) be a scalar activation function (e.g. \(\operatorname {sgn}\) or \(\operatorname {ReLU}\)). A linear-activation MPNN layer from \(\mathbb {R}^p\) to \(\mathbb {R}^q\) is parameterized by weight matrices \(W_1, W_2 \in \mathbb {R}^{p \times q}\) and a bias vector \(b \in \mathbb {R}^q\), implementing the update

\[ f^{(t)}(v) = \sigma \! \Big(f^{(t-1)}(v) W_1 + \sum _{w \in N^G(v)} f^{(t-1)}(w) W_2 + b\Big), \]

where \(\sigma \) is applied coordinate-wise. (Morris et al., arXiv:1810.02244, §3.3, Eq. (1) / eq:basicgnn.)

Definition 3.2 Graph Isomorphism Network (GIN) layer

A GIN layer from \(\mathbb {R}^p\) to \(\mathbb {R}^q\) is parameterized by a scalar \(\varepsilon \in \mathbb {R}\) and a combination map \(\varphi : \mathbb {R}^p \to \mathbb {R}^q\) (realized in practice by an MLP), implementing

\[ h_v^{(t)} = \varphi \! \Big((1 + \varepsilon ) h_v^{(t-1)} + \sum _{w \in N^G(v)} h_u^{(t-1)}\Big). \]

(Xu et al., arXiv:1810.00826, §4.1, Eq. (4.1) / GIN-agg.)