- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in Mathlib
Let \(\mathcal{X}\) be a countable type and \(N \in \mathbb {N}\). There exists \(f : \mathcal{X} \to \mathbb {R}\) such that for every irrational \(\varepsilon \in \mathbb {R}\setminus \mathbb {Q}\), the map
is injective on \(\mathcal{X} \times \{ M \in \mathcal{M}_{\mathrm{fin}}(\mathcal{X}) \mid |M| \le N\} \). (Xu et al., arXiv:1810.00826, Corollary 6 / lemma:gin-wl.)
Two colourings \(\chi _1 : \alpha \to C_1\) and \(\chi _2 : \alpha \to C_2\) are equivalent (\(\chi _1 \equiv \chi _2\)) if \(\chi _1 \preceq \chi _2\) and \(\chi _2 \preceq \chi _1\). (Grohe, arXiv:2104.14624, §4.)
GNNTheory/Spec/Graph.lean:L83–L84Pending AuditApprove SpecDisputedef ColorEquiv {α C₁ C₂ : Type} (χ₁ : α → C₁) (χ₂ : α → C₂) : Prop :=
Refines χ₁ χ₂ ∧ Refines χ₂ χ₁Given colourings \(\chi _1 : \alpha \to C_1\), \(\chi '_1 : \beta \to C_1\) and \(\chi _2 : \alpha \to C_2\), \(\chi '_2 : \beta \to C_2\), we say \((\chi _1, \chi '_1)\) cross-refines \((\chi _2, \chi '_2)\) if for all \(x \in \alpha \) and \(y \in \beta \), \(\chi _1(x) = \chi '_1(y) \implies \chi _2(x) = \chi '_2(y)\). (Grohe, arXiv:2104.14624, Theorem 8.1.)
GNNTheory/Spec/Graph.lean:L88–L90Pending AuditApprove SpecDisputedef CrossRefines {α β C₁ C₂ : Type}
(χ₁ : α → C₁) (χ₁' : β → C₁) (χ₂ : α → C₂) (χ₂' : β → C₂) : Prop :=
∀ (x : α) (y : β), χ₁ x = χ₁' y → χ₂ x = χ₂' yA 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
(Xu et al., arXiv:1810.00826, §4.1, Eq. (4.1) / GIN-agg.)
A graph invariant (or \(0\)-ary invariant) on \(L\)-labelled finite graphs with codomain \(Y\) is a function \(\xi \) assigning to each finite \(L\)-labelled graph \(G\) a value \(\xi (G) \in Y\) such that \(\xi (G) = \xi (H)\) whenever \(G \simeq _{\ell } H\). (Grohe, arXiv:2104.14624, §4.)
GNNTheory/Spec/Graph.lean:L54–L58Pending AuditApprove SpecDisputedef IsGraphInvariant {L Y : Type}
(ξ : ∀ {V : Type} [Fintype V], LabelledGraph V L → Y) : Prop :=
∀ {V W : Type} [Fintype V] [Fintype W]
(G : LabelledGraph V L) (H : LabelledGraph W L),
(G ≃ₗ H) → ξ G = ξ HAn isomorphism \(f : G \simeq _{\ell } H\) between two \(L\)-labelled graphs \(G = (V, E_G, \ell _G)\) and \(H = (W, E_H, \ell _H)\) is a bijection \(f : V \to W\) such that \(uv \in E_G \iff f(u)f(v) \in E_H\) for all \(u, v \in V\), and \(\ell _H(f(v)) = \ell _G(v)\) for all \(v \in V\). (Grohe, arXiv:2104.14624, §2.)
GNNTheory/Spec/Graph.lean:L38–L40Pending AuditApprove SpecDisputestructure Iso {V W L : Type} (G : LabelledGraph V L) (H : LabelledGraph W L) where
toGraphIso : G.graph ≃g H.graph
map_label' : ∀ v : V, H.label (toGraphIso v) = G.label vA vertex-labelled graph \(G = (V, E, \ell )\) consists of a simple undirected graph \((V, E)\) on a vertex set \(V\) together with a vertex labelling function \(\ell : V \to L\) into a label space \(L\). When \(V\) is finite, \(G\) is a finite vertex-labelled graph. (Grohe, arXiv:2104.14624, §2; Morris et al., arXiv:1810.02244, §3.1.)
GNNTheory/Spec/Graph.lean:L19–L34Pending AuditApprove SpecDisputestructure LabelledGraph (V L : Type) where
graph : SimpleGraph V
label : V → L
def Adj {V L : Type} (G : LabelledGraph V L) (x y : V) : Prop :=
G.graph.Adj x y
noncomputable def neighborFinset {V L : Type} [Fintype V]
(G : LabelledGraph V L) (v : V) : Finset V := by
classical
exact G.graph.neighborFinset vGiven a vertex mapping \(\xi (G, \cdot ) : V(G) \to C\), its derived graph-level multiset readout is \(\hat{\xi }(G) := \bigl\{ \! \! \bigl\{ \xi (G, v) \mid v \in V(G)\bigr\} \! \! \bigr\} \). (Grohe, arXiv:2104.14624, §4.)
GNNTheory/Spec/Graph.lean:L71–L74Pending AuditApprove SpecDisputedef liftVertexInvariant {L C : Type}
(ξ : ∀ {V : Type} [Fintype V], LabelledGraph V L → V → C)
{V : Type} [Fintype V] (G : LabelledGraph V L) : Multiset C :=
Finset.univ.val.map (ξ G)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
where \(\sigma \) is applied coordinate-wise. (Morris et al., arXiv:1810.02244, §3.3, Eq. (1) / eq:basicgnn.)
A \(d\)-layer MPNN on \(L\)-labelled graphs with graph-level output space \(Y\) consists of input and output feature spaces \(\alpha , \beta \), a label-encoding map \(\operatorname {init} : L \to \alpha \), a \(d\)-layer stack \((L^{(1)}, \dots , L^{(d)})\) from \(\alpha \) to \(\beta \), and a permutation-invariant graph readout \(\operatorname {readout} : \mathcal{M}_{\mathrm{fin}}(\beta ) \to Y\). (Grohe, arXiv:2104.14624, §7.1; Xu et al., arXiv:1810.00826, §2.)
GNNTheory/Spec/MPNN.lean:L45–L50Pending AuditApprove SpecDisputestructure MPNN (L Y : Type) (d : ℕ) where
InFeat : Type
OutFeat : Type
init : L → InFeat
layers : MPNNLayers InFeat OutFeat d
readoutFn : Multiset OutFeat → YAn MPNN layer from feature space \(\alpha \) to feature space \(\beta \) consists of an intermediate message space \(M\), an aggregation function \(\operatorname {agg} : \mathcal{M}_{\mathrm{fin}}(\alpha ) \to M\) operating on finite multisets of neighbor features, and a combination function \(\operatorname {comb} : \alpha \times M \to \beta \). (Grohe, arXiv:2104.14624, §7.1; Xu et al., arXiv:1810.00826, §2.)
GNNTheory/Spec/MPNN.lean:L19–L22Pending AuditApprove SpecDisputestructure MPNNLayer (α β : Type) where
Msg : Type
agg : Multiset α → Msg
comb : α → Msg → βApplied to a finite graph \(G\) and a feature map \(\zeta : V(G) \to \alpha \), an MPNN layer \(\Lambda = (M, \operatorname {agg}, \operatorname {comb})\) produces the feature map \(\eta : V(G) \to \beta \) defined by \(\eta (v) := \operatorname {comb}\! \bigl(\zeta (v), \operatorname {agg}(\{ \! \! \{ \zeta (w) \mid w \in N^G(v)\} \! \! \} )\bigr)\). (Grohe, arXiv:2104.14624, §7.1, Eq. (2).)
GNNTheory/Spec/MPNN.lean:L26–L28Pending AuditApprove SpecDisputenoncomputable def MPNNLayer.apply {V L α β : Type} [Fintype V]
(layer : MPNNLayer α β) (G : LabelledGraph V L) (h : V → α) (v : V) : β :=
layer.comb (h v) (layer.agg ((G.neighborFinset v).val.map h))A \(d\)-layer MPNN stack from \(\alpha \) to \(\beta \) is a sequence of \(d\) MPNN layers \((L^{(1)}, \dots , L^{(d)})\) with matching intermediate feature spaces \(\alpha = \alpha _0 \to \alpha _1 \to \dots \to \alpha _d = \beta \). (Grohe, arXiv:2104.14624, §7.1.)
GNNTheory/Spec/MPNN.lean:L32–L41Pending AuditApprove SpecDisputeinductive MPNNLayers : Type → Type → ℕ → Type 1
| nil {α : Type} : MPNNLayers α α 0
| snoc {α β γ : Type} {d : ℕ} :
MPNNLayers α β d → MPNNLayer β γ → MPNNLayers α γ (d + 1)
noncomputable def MPNNLayers.run {V L α β : Type} [Fintype V] {d : ℕ} :
MPNNLayers α β d → LabelledGraph V L → (V → α) → (V → β)
| .nil, _, h => h
| .snoc prev last, G, h => last.apply G (prev.run G h)On a finite \(L\)-labelled graph \(G\), a \(d\)-layer MPNN \(N\) computes node embeddings \(\zeta ^{(d)} : V(G) \to \beta \) by applying its \(d\) layers to \(\zeta ^{(0)}(v) := \operatorname {init}(\ell _G(v))\), and graph-level readout \(N(G) := \operatorname {readout}\! \bigl(\{ \! \! \{ \zeta ^{(d)}(v) \mid v \in V(G)\} \! \! \} \bigr)\). (Grohe, arXiv:2104.14624, §7.1; Xu et al., arXiv:1810.00826, §2.)
GNNTheory/Spec/MPNN.lean:L53–L61Pending AuditApprove SpecDisputenoncomputable def MPNN.nodeEmbed {V L Y : Type} [Fintype V] {d : ℕ}
(N : MPNN L Y d) (G : LabelledGraph V L) : V → N.OutFeat :=
N.layers.run G (N.init ∘ G.label)
noncomputable def MPNN.readout {V L Y : Type} [Fintype V] {d : ℕ}
(N : MPNN L Y d) (G : LabelledGraph V L) : Y :=
N.readoutFn (liftVertexInvariant (fun G => N.nodeEmbed G) G)A recurrent MPNN on \(L\)-labelled graphs with output space \(Y\) consists of a single feature space \(\alpha \), an initial encoding \(\operatorname {init} : L \to \alpha \), a single layer \(\Lambda : \alpha \to \alpha \) iterated \(t\) times to obtain \(\zeta ^{(t)}\), and a multiset readout \(\operatorname {readout} : \mathcal{M}_{\mathrm{fin}}(\alpha ) \to Y\). (Grohe, arXiv:2104.14624, §7.1.)
GNNTheory/Spec/MPNN.lean:L65–L80Pending AuditApprove SpecDisputestructure RecurrentMPNN (L Y : Type) where
Feat : Type
init : L → Feat
layer : MPNNLayer Feat Feat
readoutFn : Multiset Feat → Y
noncomputable def RecurrentMPNN.nodeEmbed {V L Y : Type} [Fintype V]
(R : RecurrentMPNN L Y) (G : LabelledGraph V L) : ℕ → V → R.Feat
| 0 => R.init ∘ G.label
| t + 1 => R.layer.apply G (R.nodeEmbed G t)
noncomputable def RecurrentMPNN.readout {V L Y : Type} [Fintype V]
(R : RecurrentMPNN L Y) (G : LabelledGraph V L) (t : ℕ) : Y :=
R.readoutFn (liftVertexInvariant (fun G => R.nodeEmbed G t) G)A colouring \(\chi _1 : \alpha \to C_1\) refines a colouring \(\chi _2 : \alpha \to C_2\) (written \(\chi _1 \preceq \chi _2\)) if for all \(x, y \in \alpha \), \(\chi _1(x) = \chi _1(y) \implies \chi _2(x) = \chi _2(y)\). (Grohe, arXiv:2104.14624, §4; Morris et al., arXiv:1810.02244, §4.)
GNNTheory/Spec/Graph.lean:L78–L79Pending AuditApprove SpecDisputedef Refines {α C₁ C₂ : Type} (χ₁ : α → C₁) (χ₂ : α → C₂) : Prop :=
∀ x y : α, χ₁ x = χ₁ y → χ₂ x = χ₂ yA vertex invariant (or equivariant node mapping) on \(L\)-labelled finite graphs with codomain \(C\) associates with every finite \(L\)-labelled graph \(G\) a map \(\xi (G, \cdot ) : V(G) \to C\) such that for all isomorphic \(G \simeq _{\ell } H\) via \(f\) and all \(v \in V(G)\), \(\xi (G, v) = \xi (H, f(v))\). (Grohe, arXiv:2104.14624, §4.)
GNNTheory/Spec/Graph.lean:L62–L67Pending AuditApprove SpecDisputedef IsVertexInvariant {L C : Type}
(ξ : ∀ {V : Type} [Fintype V], LabelledGraph V L → V → C) : Prop :=
∀ {V W : Type} [Fintype V] [Fintype W]
(G : LabelledGraph V L) (H : LabelledGraph W L)
(e : G ≃ₗ H) (v : V),
ξ G v = ξ H (e v)For a label space \(L\) and round \(t \in \mathbb {N}\), the canonical \(1\)-WL colour space \(C_t(L)\) is defined recursively by \(C_0(L) := L\) and \(C_{t+1}(L) := C_t(L) \times \mathcal{M}_{\mathrm{fin}}(C_t(L))\), where \(\mathcal{M}_{\mathrm{fin}}(X)\) denotes finite multisets over \(X\). (Grohe, arXiv:2104.14624, §5.)
GNNTheory/Spec/WL.lean:L17–L19Pending AuditApprove SpecDisputedef WLColor (L : Type) : ℕ → Type
| 0 => L
| t + 1 => WLColor L t × Multiset (WLColor L t)Two finite \(L\)-labelled graphs \(G\) and \(H\) are 1-WL equivalent (\(G \equiv _{\mathrm{WL}} H\)) if \(\widehat{\operatorname {cr}}^{(t)}(G) = \widehat{\operatorname {cr}}^{(t)}(H)\) for all \(t \in \mathbb {N}\). (Grohe, arXiv:2104.14624, §5; Xu et al., arXiv:1810.00826, §2.)
GNNTheory/Spec/WL.lean:L44–L46Pending AuditApprove SpecDisputedef WLEquiv {V W L : Type} [Fintype V] [Fintype W]
(G : LabelledGraph V L) (H : LabelledGraph W L) : Prop :=
∀ t : ℕ, WLEquivAt t G HTwo finite \(L\)-labelled graphs \(G\) and \(H\) are 1-WL equivalent at round \(t\) (written \(G \equiv _{\mathrm{WL}}^{(t)} H\)) if \(\widehat{\operatorname {cr}}^{(t)}(G) = \widehat{\operatorname {cr}}^{(t)}(H)\). (Grohe, arXiv:2104.14624, §5.)
GNNTheory/Spec/WL.lean:L38–L40Pending AuditApprove SpecDisputedef WLEquivAt {V W L : Type} [Fintype V] [Fintype W]
(t : ℕ) (G : LabelledGraph V L) (H : LabelledGraph W L) : Prop :=
wlHist G t = wlHist H tThe round-\(t\) \(1\)-WL colour histogram of a finite \(L\)-labelled graph \(G\) is the multiset \(\widehat{\operatorname {cr}}^{(t)}(G) := \bigl\{ \! \! \bigl\{ \operatorname {cr}^{(t)}(G, v) \mid v \in V(G)\bigr\} \! \! \bigr\} \). (Grohe, arXiv:2104.14624, §4–§5.)
GNNTheory/Spec/WL.lean:L32–L34Pending AuditApprove SpecDisputenoncomputable def wlHist {V L : Type} [Fintype V]
(G : LabelledGraph V L) (t : ℕ) : Multiset (WLColor L t) :=
liftVertexInvariant (fun G => wlColor G t) GFor a finite \(L\)-labelled graph \(G\), the round-\(t\) \(1\)-WL (colour refinement) colouring \(\operatorname {cr}^{(t)}(G, \cdot ) : V(G) \to C_t(L)\) is defined by \(\operatorname {cr}^{(0)}(G, v) := \ell _G(v)\) and \(\operatorname {cr}^{(t+1)}(G, v) := \bigl(\operatorname {cr}^{(t)}(G, v), \bigl\{ \! \! \bigl\{ \operatorname {cr}^{(t)}(G, w) \mid w \in N^G(v)\bigr\} \! \! \bigr\} \bigr)\). (Grohe, arXiv:2104.14624, §5; Morris et al., arXiv:1810.02244, §3.2.)
GNNTheory/Spec/WL.lean:L25–L28Pending AuditApprove SpecDisputenoncomputable def wlColor {V L : Type} [Fintype V]
(G : LabelledGraph V L) : (t : ℕ) → V → WLColor L t
| 0, v => G.label v
| t + 1, v => (wlColor G t v, (G.neighborFinset v).val.map (wlColor G t))For any finite labelled graph \((G, \ell )\), define the modified refinement \(\tilde{c}^{(0)} := \ell \) and \(\tilde{c}^{(t+1)}(v) := \bigl(\ell (v), \{ \! \! \{ \tilde{c}^{(t)}(w) \mid w \in N^G(v) \} \! \! \} \bigr)\) (retaining the initial label \(\ell (v)\) rather than \(\tilde{c}^{(t)}(v)\)). Then \(\tilde{c}^{(t)} \equiv \operatorname {cr}^{(t)}(G)\) for all \(t \in \mathbb {N}\). (Morris et al., arXiv:1810.02244, Appendix §11.1–§11.2, Lemmas 1–2.)
Let \(D \in \mathbb {Z}^{s \times r}\) have pairwise distinct rows with entries in \(\{ 0, \dots , n-1\} \). Then there exists a matrix \(X \in \mathbb {R}^{r \times s}\) such that \(\operatorname {sgn}(D X - J) \in \mathbb {R}^{s \times s}\) (where \(J\) is the all-\(1\) matrix) is nonsingular (and similarly with \(\operatorname {ReLU}\) in place of \(\operatorname {sgn}\)). (Morris et al., arXiv:1810.02244, Appendix §11, Lemma lem:dist2lu and §11.3.)
Let \(\Lambda \) be an MPNN layer, \(f : G \simeq _{\ell } H\) an isomorphism of finite labelled graphs, and \(\zeta _G, \zeta _H\) feature maps satisfying \(\zeta _G(v) = \zeta _H(f(v))\) for all \(v \in V(G)\). Then the updated feature maps satisfy \((\Lambda (G, \zeta _G))(v) = (\Lambda (H, \zeta _H))(f(v))\) for all \(v \in V(G)\). (Grohe, arXiv:2104.14624, §7.1.)
GNNTheory/Spec/MPNN.lean:L86–L92 · Proved in GNNTheory/Proofs/MPNN.lean:L20–L23Pending AuditApprove SpecDisputedef mpnn_layer_equivariant_stmt : Prop :=
∀ {V W L α β : Type} [Fintype V] [Fintype W]
(layer : MPNNLayer α β)
(G : LabelledGraph V L) (H : LabelledGraph W L)
(e : G ≃ₗ H) (hG : V → α) (hH : W → α),
(∀ v : V, hG v = hH (e v)) →
∀ v : V, layer.apply G hG v = layer.apply H hH (e v)If the initial label space \(L\) is countable, then the round-\(t\) canonical colour space \(C_t(L)\) is countable for every \(t \in \mathbb {N}\). (Xu et al., arXiv:1810.00826, Lemma 4 / §3.)
GNNTheory/Spec/WL.lean:L82–L83 · Proved in GNNTheory/Proofs/WL.lean:L157–L164Pending AuditApprove SpecDisputedef wl_color_countable_stmt : Prop :=
∀ {L : Type} [Countable L] (t : ℕ), Countable (WLColor L t)For all finite \(L\)-labelled graphs \(G, H\) and every round \(t \in \mathbb {N}\), \((\operatorname {cr}^{(t+1)}(G), \operatorname {cr}^{(t+1)}(H))\) cross-refines \((\operatorname {cr}^{(t)}(G), \operatorname {cr}^{(t)}(H))\). In particular, \(\operatorname {cr}^{(t+1)}(G) \preceq \operatorname {cr}^{(t)}(G)\). (Grohe, arXiv:2104.14624, §5.)
GNNTheory/Spec/WL.lean:L59–L62 · Proved in GNNTheory/Proofs/WL.lean:L43–L45Pending AuditApprove SpecDisputedef wl_refines_prev_stmt : Prop :=
∀ {V W L : Type} [Fintype V] [Fintype W]
(G : LabelledGraph V L) (H : LabelledGraph W L) (t : ℕ),
CrossRefines (wlColor G (t + 1)) (wlColor H (t + 1)) (wlColor G t) (wlColor H t)Let \(\mathcal{X}\) be a countable type and \(N \in \mathbb {N}\) a cardinality bound. Then there exists a function \(f : \mathcal{X} \to \mathbb {R}\) such that the sum map \(M \mapsto \sum _{x \in M} f(x)\) is injective on all multisets \(M \in \mathcal{M}_{\mathrm{fin}}(\mathcal{X})\) of cardinality \(|M| \le N\). Consequently, every function \(g\) on multisets of size at most \(N\) factors as \(g(M) = \phi \! \bigl(\sum _{x \in M} f(x)\bigr)\) for some \(\phi : \mathbb {R}\to Y\). (Xu et al., arXiv:1810.00826, Lemma 5 / theorem:sum; Grohe, arXiv:2104.14624, Lemma 8.5 / lem:sum.)
Let \(\operatorname {wl}_{1}^{(t)}\) denote the variant of \(1\)-WL that counts both neighbors and non-neighbors in each colour class (Grohe, arXiv:2104.14624, §5, Proposition 5.1 / prop:cr1wl). Then for all \(t \in \mathbb {N}\) and all finite \(L\)-labelled graphs \(G, H\), \(G\) and \(H\) are distinguished by \(\operatorname {cr}^{(t)}\) if and only if they are distinguished by \(\operatorname {wl}_{1}^{(t)}\). Moreover, within any single graph \(G\), \(\operatorname {cr}^{(t)}(G) \equiv \operatorname {wl}_{1}^{(t)}(G)\).
Let \(n \in \mathbb {N}\) and let \(L\) be a finite label space. There exists a recurrent sum-aggregation MPNN \(R\) (with real-valued features) such that for all \(t \le n\), all \(L\)-labelled graphs \(G, H\) of order at most \(n\), and all \(v \in V(G), w \in V(H)\),
Consequently, with an injective multiset readout, \(R\) distinguishes every pair of \(1\)-WL-distinguishable graphs of order at most \(n\) in \(n\) iterations. (Grohe, arXiv:2104.14624, Theorem 8.4 / theo:gnn-lower and Corollary 8.6 / cor:lower1.)
Let \((G, \ell )\) be a finite labelled graph of order \(n = |V(G)|\) with an initial encoding \(f^{(0)} : V(G) \to \mathbb {R}^d\) that is consistent with \(\ell \) and maps distinct labels to linearly independent vectors. Then for every \(t \in \mathbb {N}\), there exists a \(t\)-layer linear-activation MPNN (with activation \(\operatorname {sgn}\) or \(\operatorname {ReLU}\) and width at most \(n\)) whose node embeddings \(f^{(t)}\) satisfy \(f^{(t)} \equiv \operatorname {cr}^{(t)}(G)\). (Morris et al., arXiv:1810.02244, Theorem 2 / equal.)
For every \(d\)-layer MPNN \(N\), the node embedding map \(G \mapsto \zeta ^{(d)}_G\) is a vertex invariant (equivariant under isomorphisms of \(L\)-labelled graphs). (Grohe, arXiv:2104.14624, §7.1.)
GNNTheory/Spec/MPNN.lean:L96–L98 · Proved in GNNTheory/Proofs/MPNN.lean:L41–L45Pending AuditApprove SpecDisputedef mpnn_equivariant_stmt : Prop :=
∀ {L Y : Type} {d : ℕ} (N : MPNN L Y d),
IsVertexInvariant (fun G => N.nodeEmbed G)For every \(d\)-layer MPNN \(N\), the graph-level readout \(G \mapsto N(G)\) is a graph invariant. (Grohe, arXiv:2104.14624, §7.1.)
GNNTheory/Spec/MPNN.lean:L102–L104 · Proved in GNNTheory/Proofs/MPNN.lean:L51–L54Pending AuditApprove SpecDisputedef mpnn_readout_invariant_stmt : Prop :=
∀ {L Y : Type} {d : ℕ} (N : MPNN L Y d),
IsGraphInvariant (fun G => N.readout G)For every \(d \in \mathbb {N}\), every \(d\)-layer MPNN \(N\), and all finite \(L\)-labelled graphs \(G, H\), if \(G \equiv _{\mathrm{WL}} H\) then \(N(G) = N(H)\). (Grohe, arXiv:2104.14624, Corollary 8.3; Morris et al., arXiv:1810.02244, Theorem 1; Xu et al., arXiv:1810.00826, Lemma 2.)
GNNTheory/Spec/MPNN.lean:L124–L127 · Proved in GNNTheory/Proofs/MPNN.lean:L99–L101Pending AuditApprove SpecDisputedef mpnn_le_wl_stmt : Prop :=
∀ {V W L Y : Type} [Fintype V] [Fintype W] {d : ℕ}
(N : MPNN L Y d) (G : LabelledGraph V L) (H : LabelledGraph W L),
WLEquiv G H → N.readout G = N.readout HFor every \(d \in \mathbb {N}\), every \(d\)-layer MPNN \(N\), and all finite \(L\)-labelled graphs \(G, H\), if \(G \equiv _{\mathrm{WL}}^{(d)} H\) then \(N(G) = N(H)\). (Grohe, arXiv:2104.14624, §8; Xu et al., arXiv:1810.00826, Lemma 2.)
GNNTheory/Spec/MPNN.lean:L116–L119 · Proved in GNNTheory/Proofs/MPNN.lean:L90–L93Pending AuditApprove SpecDisputedef mpnn_le_wl_at_stmt : Prop :=
∀ {V W L Y : Type} [Fintype V] [Fintype W] {d : ℕ}
(N : MPNN L Y d) (G : LabelledGraph V L) (H : LabelledGraph W L),
WLEquivAt d G H → N.readout G = N.readout HFor every \(d \in \mathbb {N}\), every \(d\)-layer MPNN \(N\), all finite \(L\)-labelled graphs \(G, H\), and all vertices \(v \in V(G), w \in V(H)\), \(\operatorname {cr}^{(d)}(G, v) = \operatorname {cr}^{(d)}(H, w) \implies \zeta ^{(d)}_N(G, v) = \zeta ^{(d)}_N(H, w)\). (Grohe, arXiv:2104.14624, Theorem 8.1; Morris et al., arXiv:1810.02244, Theorem 1; Xu et al., arXiv:1810.00826, Lemma 2.)
GNNTheory/Spec/MPNN.lean:L109–L112 · Proved in GNNTheory/Proofs/MPNN.lean:L82–L84Pending AuditApprove SpecDisputedef mpnn_le_wl_vertex_stmt : Prop :=
∀ {V W L Y : Type} [Fintype V] [Fintype W] {d : ℕ}
(N : MPNN L Y d) (G : LabelledGraph V L) (H : LabelledGraph W L),
CrossRefines (wlColor G d) (wlColor H d) (N.nodeEmbed G) (N.nodeEmbed H)For every recurrent MPNN \(R\), all finite \(L\)-labelled graphs \(G, H\), and every iteration count \(t \in \mathbb {N}\): (1) \((\operatorname {cr}^{(t)}(G), \operatorname {cr}^{(t)}(H))\) cross-refines \((\zeta ^{(t)}_R(G), \zeta ^{(t)}_R(H))\); (2) within \(G\), vertices indistinguishable by \(\operatorname {cr}^{(s)}\) for all \(s\) receive equal embeddings \(\zeta ^{(t)}_R(G)\); (3) \(G \equiv _{\mathrm{WL}} H \implies R(G, t) = R(H, t)\). (Grohe, arXiv:2104.14624, Corollaries 8.2–8.3.)
GNNTheory/Spec/MPNN.lean:L132–L138 · Proved in GNNTheory/Proofs/MPNN.lean:L137–L150Pending AuditApprove SpecDisputedef recurrent_mpnn_le_wl_stmt : Prop :=
∀ {V W L Y : Type} [Fintype V] [Fintype W]
(R : RecurrentMPNN L Y) (G : LabelledGraph V L) (H : LabelledGraph W L) (t : ℕ),
CrossRefines (wlColor G t) (wlColor H t) (R.nodeEmbed G t) (R.nodeEmbed H t) ∧
(∀ v₁ v₂ : V, (∀ s : ℕ, wlColor G s v₁ = wlColor G s v₂) →
R.nodeEmbed G t v₁ = R.nodeEmbed G t v₂) ∧
(WLEquiv G H → R.readout G t = R.readout H t)Two finite \(L\)-labelled graphs \(G\) and \(H\) are \(1\)-WL equivalent (\(G \equiv _{\mathrm{WL}} H\)) if and only if they have the same colour histogram at round \(|V(G)|\): \(G \equiv _{\mathrm{WL}}^{(|V(G)|)} H\). (Grohe, arXiv:2104.14624, §5; Morris et al., arXiv:1810.02244, §3.2.)
GNNTheory/Spec/WL.lean:L75–L78 · Proved in GNNTheory/Proofs/WL.lean:L113–L151Pending AuditApprove SpecDisputedef wl_equiv_iff_card_stmt : Prop :=
∀ {V W L : Type} [Fintype V] [Fintype W]
(G : LabelledGraph V L) (H : LabelledGraph W L),
WLEquiv G H ↔ WLEquivAt (Fintype.card V) G HFor every round \(t \in \mathbb {N}\), the \(1\)-WL colouring \(\operatorname {cr}^{(t)}\) is a vertex invariant (equivariant under isomorphisms of \(L\)-labelled graphs), and the colour histogram \(\widehat{\operatorname {cr}}^{(t)}\) is a graph invariant. (Grohe, arXiv:2104.14624, §5.)
GNNTheory/Spec/WL.lean:L52–L55 · Proved in GNNTheory/Proofs/WL.lean:L31–L37Pending AuditApprove SpecDisputedef wl_equivariant_stmt : Prop :=
∀ {L : Type} (t : ℕ),
IsVertexInvariant (fun G => wlColor (L := L) G t) ∧
IsGraphInvariant (fun G => wlHist (L := L) G t)For every finite nonempty \(L\)-labelled graph \(G\), there exists \(t {\lt} |V(G)|\) such that \(\operatorname {cr}^{(t+1)}(G) \equiv \operatorname {cr}^{(t)}(G)\). Moreover, whenever \(\operatorname {cr}^{(t+1)}(G) \equiv \operatorname {cr}^{(t)}(G)\), we have \(\operatorname {cr}^{(s)}(G) \equiv \operatorname {cr}^{(t)}(G)\) for all \(s \ge t\). (Grohe, arXiv:2104.14624, §5; Morris et al., arXiv:1810.02244, §3.2.)
GNNTheory/Spec/WL.lean:L67–L71 · Proved in GNNTheory/Proofs/WL.lean:L55–L103Pending AuditApprove SpecDisputedef wl_stabilizes_stmt : Prop :=
∀ {V L : Type} [Fintype V] [Nonempty V] (G : LabelledGraph V L),
(∃ t : ℕ, t < Fintype.card V ∧ ColorEquiv (wlColor G (t + 1)) (wlColor G t)) ∧
(∀ t : ℕ, ColorEquiv (wlColor G (t + 1)) (wlColor G t) →
∀ s : ℕ, t ≤ s → ColorEquiv (wlColor G s) (wlColor G t))Let \(N\) be a \(d\)-layer MPNN whose initial encoding \(\operatorname {init} : L \to \alpha _0\), every layer’s aggregation \(\operatorname {agg}^{(k)}\) and combination \(\operatorname {comb}^{(k)}\), and graph-level readout \(\operatorname {readout}\) are injective (on the domains reached on finite graphs). Then:
For all finite \(L\)-labelled graphs \(G, H\) and \(v \in V(G), w \in V(H)\), \(\zeta ^{(d)}_N(G, v) = \zeta ^{(d)}_N(H, w) \iff \operatorname {cr}^{(d)}(G, v) = \operatorname {cr}^{(d)}(H, w)\).
For all finite \(L\)-labelled graphs \(G, H\), \(N(G) = N(H) \iff G \equiv _{\mathrm{WL}}^{(d)} H\).
In particular, if \(d \ge \max (|V(G)|, |V(H)|)\), then \(N(G) = N(H) \iff G \equiv _{\mathrm{WL}} H\).
(Xu et al., arXiv:1810.00826, Theorem 3 / theorem:condition.)