SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Proof. Let  $X = (U, \mathcal{N}_1, \ldots, \mathcal{N}_k, F)$  and  $X' = (U', \mathcal{N}_1', \ldots, \mathcal{N}_k', F')$  be two arbitrary relational structure from the domain of  $\phi_1 \circ \ldots \circ \phi_l$  and let  $l \geq t \geq 1$ . By Lemma C.1 any coloring produced by  $\psi$  refines the corresponding coloring from every AMP from  $\phi_1, \ldots, \phi_l$ . Thus,  $\psi^l(X, F|_U)$  refines  $(\phi_1 \circ \ldots \circ \phi_l)(X, F|_U)$  and  $\psi^l(X', F'|_{U'})$  refines  $(\phi_1 \circ \ldots \circ \phi_l)(X', F'|_{U'})$ . By Theorem 3.5 we can strongly simulate  $\psi$  under  $R$ . Thus, the theorem follows.
C.4 List of Strongly Simulatable Algorithms (Corollary 3.6)
We prove Corollary 3.6.
Corollary C.3. The following GNNs and variants of WL can be strongly simulated:
Proof. The proofs consist of showing that the update rule underlying the corresponding algorithms are AMP. By invoking Theorem 3.5 this proves that the algorithm is strongly simulatable. For
algorithms that have both a GNN and a WL variant we only prove this for the WL variant as for GNN the proof can be done analogously. Note that most variants of WL and GNNs contain the color of the vertex they want to update in the updated color. An example of this the color  $c_s^{t-1}$  in the definition of  $k$ -WL:  $c_s^t = \mathrm{HASH}\left(c_s^{t-1}, (C_1^t(s), \ldots, C_k^t(s))\right)$  where  $C_j^t(s) = \mathrm{HASH}\left(\left\{\left\{c_{s'}^{t-1} \mid s' \in \mathcal{N}_j(s)\right\}\right\}\right)$ . This color can be modeled by a color atom (A3). We will argue this again for the first two algorithms and will assume that this is obvious for the latter algorithms.
1.  $VV_{C}$ -GNNs [Sato et al., 2019]: Let  $\Delta$  be the maximum degree of the vertices. Suppose we are given a port numbering with functions  $p_{\mathrm{tail}}(v,i): V \times [[\Delta]] \to V \cup \{-\}$  and  $p_{\mathbf{n}}: V \times [[\Delta]] \to [[\Delta]] \cup \{-\}$ .<sup>4</sup>
The color update function for  $VV_{C}$  -GNNs is
$$
z _ {v} ^ {l + 1} = f _ {\theta} ^ {l} \left(z _ {v} ^ {l}, z _ {p _ {\text {t a i l}} (v, 1)} ^ {l}, p _ {\mathrm {n}} (v, 1), z _ {p _ {\text {t a i l}} (v, 2)} ^ {l}, p _ {\mathrm {n}} (v, 2), \dots z _ {p _ {\text {t a i l}} (v, \Delta)} ^ {l}, p _ {\mathrm {n}} (v, \Delta)\right).
$$
Let  $i \in [[\Delta]]$ . The color update function applies a function  $f_{\theta}^{l}$  (S4) to a tuple. We need to show that this tuple corresponds to tuple AMP construction (S3) by showing that each element of the tuple is AMP. The first element of the tuple is  $z_{v}^{l}$  which corresponds to an AMP (S1) atom. Each  $p_{\mathrm{n}}(v,i)$  can be seen as a constant atom (A1). Each  $z_{p_{\mathrm{tail}}(v,i)}^{l}$  can be seen as  $\{z_w^l \mid w \in \{p_{\mathrm{tail}}(v,i)\}\}$  when  $p_{\mathrm{tail}}(v,i) \neq -$  and the empty set  $\emptyset$  otherwise which defines a neighborhood function. Thus,  $\left(z_v^l, z_{p_{\mathrm{tail}}(v,1)}^l, p_{\mathrm{n}}(v,1), z_{p_{\mathrm{tail}}(v,2)}^l, p_{\mathrm{n}}(v,2), \ldots, z_{p_{\mathrm{tail}}(v,\Delta)}^l, p_{\mathrm{n}}(v,\Delta),\right)$  is an AMP tuple (S3) of a color atom (A3)  $z_{v}^{l}$ , constant atoms (A1) and aggregation AMPs (S2). Hence, the color update function is strongly simulatable.
2.  $k$ -WL [Morris et al., 2019]: Let  $W = V(G)^{k}$  be the set of  $k$ -tuples of vertices for a given graph  $G$ . Then,  $k$ -WL can be written as  $c_{s}^{t} = \mathrm{HASH}\left(c_{s}^{t-1}, (C_{1}^{t}(s), \ldots, C_{k}^{t}(s))\right)$  where  $C_{j}^{t}(s) = \mathrm{HASH}\left(\left\{\left\{c_{s'}^{t-1} \mid s' \in \mathcal{N}_{j}(s)\right\}\right\}\right)$ . Both hash functions are function application AMPs (S4) and  $c_{s}^{t-1}$  is a color atom AMP (S1). Here,  $\mathcal{N}_{j}(s)$  encodes the  $j$ -neighborhood of the  $k$ -tuple  $s$ . This means that each  $C_{1}^{t}(s)$  corresponds to an aggregation AMP (S2). Then, the combination into  $(C_{1}^{t}(s), \ldots, C_{k}^{t}(s))$  is a tuple of AMPs (S3). Hence, the color update functions is a AMP implying that  $k$ -WL is strongly simulatable.
3.  $\delta$ - $k$ -(L)WL [Morris et al., 2020]: We only show this for  $\delta$ - $k$ -WL as  $\delta$ - $k$ -LWL is a special case obtained by removing elements from the color update function of  $\delta$ - $k$ -WL. Let  $W = V(G)^{k}$  be the set of  $k$ -tuples of vertices for a given graph  $G$ . We use bold  $\mathbf{v}$  to denote a  $k$ -tuple and  $v$  to denote a vertex. For  $j \in [[k]]$ , the function  $\phi_{j}(\mathbf{v}, w)$  returns the  $k$ -tuple obtained by replacing the  $j$ -th vertex of  $\mathbf{v}$  by  $w$ . The function  $\mathrm{adj}(\mathbf{v}, \mathbf{w})$  returns 1 if the two vertices that distinguish the  $j$ -neighbors  $\mathbf{v}$  and  $\mathbf{w}$  are neighbors in  $G$  and 0 otherwise. Then,  $\delta$ - $k$ -WL can be written as  $c_{\mathbf{v}}^{t+1} = (c_{\mathbf{v}}^i, M_i^{\delta, \bar{\delta}}(\mathbf{v}))$  with
$$
\begin{array}{l} M _ {i} ^ {\delta , \bar {\delta}} (\mathbf {v}) = \left( \right.\left\{\left\{\left(c _ {\phi_ {1} (\mathbf {v}, w)} ^ {i}, \operatorname {a d j} (\mathbf {v}, \phi_ {1} (\mathbf {v}, w))\right) \mid w \in V (G) \right\}\right\}, \dots , \\ \left. \left\{\left\{\left(c _ {\phi_ {k} (\mathbf {v}, w)} ^ {i}, \operatorname {a d j} (\mathbf {v}, \phi_ {k} (\mathbf {v}, w))\right) \mid w \in V (G) \right\} \right\}\right). \\ \end{array}
$$
Let  $j \in [[k]]$  be arbitrary. Note, that  $\operatorname{adj}(\mathbf{v}, \phi_j(\mathbf{v}, w))$  is an edge constant atom  $k(\mathbf{v}, \phi_j(\mathbf{v}, w))$  (A1) and that  $c_{\phi_j(\mathbf{v}, w)}^i$  is a color atom (A3) for object  $\phi_j(\mathbf{v}, w)$ . Thus,  $\left(c_{\phi_j(\mathbf{v}, w)}^i, \operatorname{adj}(\mathbf{v}, \phi_j(\mathbf{v}, w))\right)$  is a tuple atom (A4). Furthermore, we can rewrite the aggregation by replacing  $\phi_j(\mathbf{v}, w)$  with  $\mathbf{w}$  as  $\{\left(c_{\mathbf{w}}^i, k(\mathbf{v}, \mathbf{w})\right) \mid \mathbf{w} \in \mathcal{N}_j(\mathbf{v})\}$  where  $\mathcal{N}_j(\mathbf{v}) = \{\phi_j(\mathbf{v}, w) \mid w \in V(G)\}$ . Thus, each  $\{\left(c_{\phi_j(\mathbf{v}, w)}^i, \operatorname{adj}(\mathbf{v}, \phi_j(\mathbf{v}, w))\right) \mid w \in V(G)\}$  is an aggregation AMP (S2) and  $M_i^{\delta, \bar{\delta}}(\mathbf{v})$  is a tuple AMP (S3). Thus, the update rule of  $\delta-k-WL$  is strongly simulatable.
<sup>4</sup>We think that there is a small typographical error in these functions signatures as defined by Sato et al. [2019]. There, they define them as  $p_{\mathrm{tail}}(v,i):V\times \Delta \to V\cup \{-\}$  and  $p_{\mathbf{n}}:V\times \Delta \to \Delta \cup \{-\}$ .
4.  $(k,s)$ -LWL and  $(k,s)$ -SpeqNets [Morris et al., 2022]: This algorithm is very similar to  $\delta$ - $k$ -LWL and we use the same definition of  $\phi$  as above. We prove this only for  $(k,s)$ -LWL as  $(k,s)$ -SpeqNets can be argued analogously. In what follows we use  $\# \mathrm{com}(G[\mathbf{v}])$  to denote the number of connected components in the graph induced by the  $k$ -tuple of nodes  $\mathbf{v}$  of  $G$  i.e., the subgraph of  $G$  that contains only vertices from  $\mathbf{v}$  and all edges from  $E(G)$  incident to these vertices. For  $k \geq 1$  and  $1 \leq s \leq k$ , let
$$
V (G) _ {s} ^ {k} = \left\{\mathbf {v} \in V ^ {k} \mid \# \operatorname {c o m} (G [ \mathbf {v} ]) \leq s \right\}.
$$
Similarly to  $\delta$ - $k$ -LWL,  $(k,s)$ -LWL assigns a color to  $k$ -tuples. However,  $(k,s)$ -LWL works on elements from  $V(G)_s^k$ . Hence,  $W = V(G)_s^k$ . The update function can be defined as:
$$
c _ {\mathbf {v}} ^ {i + 1} = \left(c _ {\mathbf {v}} ^ {i}, M _ {i} ^ {\delta , k, s} (\mathbf {v})\right)
$$
$$
\begin{array}{l} M _ {i} ^ {\delta , k, s} (\mathbf {v}) = \left(\left\{\left\{c _ {\phi_ {1} (\mathbf {v}, w)} ^ {i} \mid w \in \mathcal {N} (v _ {1}) \text {a n d} \phi_ {1} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\} \right\}, \dots , \right. \\ \left. \left\{\left\{c _ {\phi_ {k} (\mathbf {v}, w)} ^ {i} \mid w \in \mathcal {N} (v _ {k}) \text {a n d} \phi_ {k} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\} \right\} \right\} \\ \end{array}
$$
where  $v_{i}$  is the  $i$ -th element of  $k$ -tuple  $\mathbf{v}$ . Similar to above, we can rewrite the aggregation in all multisets. Let  $i \in [k]$ , then we define  $\mathcal{N}_i(v) = \{\phi_i(\mathbf{v}, w)) \mid w \in \mathcal{N}(v_i)$  and  $\phi_i(\mathbf{v}, w)) \in V(G)_s^k\}$ , which allows us to rewrite the multisets as  $\{\{c_{\mathbf{x}}^i \mid \mathbf{x} \in \mathcal{N}_i(v)\}\}$ . This implies that each of the multisets is an aggregation AMP (S2) and that  $M_i^{\delta, k, s}(\mathbf{v})$  is a tuple AMP (S3). With this it follows that the color update function is simulatable.
5. GSN-e and GSN-v [Bouritsas et al., 2022]: We only prove this for GSN-v as GSN-e can be argued similarly. Let  $W = V(G)$ . The update function behind GNS-v is defined as
$$
h _ {v} ^ {t + 1} = \mathrm {U P} ^ {t + 1} \left(h _ {v} ^ {t}, m _ {v} ^ {t + 1}\right)
$$
$$
m _ {v} ^ {t + 1} = M ^ {t + 1} \left(\left\{\left\{\left(h _ {v} ^ {t}, h _ {u} ^ {t}, x _ {v} ^ {V}, x _ {u} ^ {V}, e _ {u, v}\right) \mid u \in \mathcal {N} (v) \right\} \right\}\right).
$$
In this definition  $\mathrm{UP}^{t + 1}$  is an arbitrary function approximator such as an MLP and  $M^{t + 1}$  is a neighborhood aggregation function meaning an arbitrary function that operates on multisets. We can see  $M^{t + 1},\mathrm{UP}^{t + 1}$  as function applications (S4). Additionally,  $x_{v}^{V},x_{u}^{V}$  and  $e_{u,v}$  are vectors encoding subgraph isomorphism counts with respect to some set of patterns. These isomorphism counts correspond to atom constants (A1):  $k(v,v),k(u,u)$  and  $k(u,v)$ . As  $h_v^t$  and  $h_u^t$  are color atoms (A3) and  $e_{u,v}$  is a constant atom (A1) it follows that  $\left(h_v^t,h_u^t,x_v^V,x_u^V,e_u,v\right)$  is a tuple atom (A4) and  $\{\{(h_v^t,h_u^t,x_v^V,x_u^V,e_u,v)\mid u\in \mathcal{N}(v)\} \}$  is an aggregation AMP (S2). Applying the function  $M^{t + 1}$  (S4) to this AMP yields  $m_v^{t + 1}$ . Thus, the update rule is strongly simulatable.
6. DS-WL [Bevilacqua et al., 2021]: For a given graph  $G$  and a policy  $\pi$  that compute subgraphs we define the set of objects  $W$  as the disjoint union of the vertices in each subgraph  $W = \bigcup_{S \in \pi(G)} V(S)$ . We identify each object from  $W$  by its original vertex  $v \in V$  and subgraph  $S \in \pi(G)$  that created it. This means that  $e_{v,S}$  is the color of vertex  $v$  from subgraph  $S$ . Then, the update rule of DS-WL can be written as
$$
c _ {v, S} ^ {t + 1} = \operatorname {H A S H} \left(c _ {v, S} ^ {t}, \left\{\left\{c _ {x, S} ^ {t} \mid (x, S) \in \mathcal {N} (v, S) \right\} \right\}\right)
$$
where  $\mathcal{N}(v,S) = \{(x,S)\mid x\in \mathcal{N}_S(v)\}$  is the set of all neighbors of vertex  $v$  in subgraph  $S$ . Hence,  $\{\left\{c_{x,S}^t\mid (x,S)\in \mathcal{N}(v,S)\right\}\}$  is an aggregation AMP (S2) which implies that the update rule is strongly simulatable.
7.  $k$ -OSWL and  $k$ -OSANs [Qian et al., 2022]: We only argue the case of  $k$ -OSWL as the proof works similarly for  $k$ -OSANs. In what follows we use  $\mathbf{g} \in G_k$  to denote a  $k$  tuple of vertices from  $V(G)$  corresponding to  $k$ -vertex induced subgraph of  $G$ . We use  $G_k$  to denote the set of all  $k$ -vertex induced subgraphs of  $G$ . The algorithm computes colors for each
combination of a vertex with  $k$ -vertex induced subgraph combination i.e.  $W = V(G) \times G_k$ . It uses the color update function:
$$
C _ {v, \mathbf {g}} ^ {i + 1} = \operatorname {R E L A B E L} \left(C _ {v, \mathbf {g}} ^ {i}, \left\{\left\{C _ {u, \mathbf {g}} ^ {i} \mid u \in \square \right\} \right\}\right).
$$
Here,  $\square$  is either  $\mathcal{N}_G(v)$  the neighborhood relation in the graph  $G$ , or  $V(G)$  the set of all vertices. Since both neighborhoods allow us to define corresponding neighborhood functions it follows that  $\{\{C_{u,\mathbf{g}}^i \mid u \in \square\}\}$  is an aggregation AMP (S2) and thus that the color update function is strongly simulatable.
8.  $M_{k}$ -GNNs [Papp and Wattenhofer, 2022]: As Papp and Wattenhofer [2022] note, their approach is related to ESAN [Bevilacqua et al., 2021]. For a graph  $G$  with some set of marked nodes the following update rule that computes the colorings:
$$
h _ {u} ^ {t + 1} = \text {U P D A T E} \left(h _ {u} ^ {t}, a _ {u} ^ {t + 1}\right)
$$
$$
a _ {u} ^ {t + 1} = \operatorname {A G G R} _ {\text {m a r k e d}} \left(\left\{\left\{h _ {v} ^ {t} \mid v \in \mathcal {N} _ {M} (u) \right\} \right\}\right) + \operatorname {A G G R} _ {\text {m a r k e d}} \left(\left\{\left\{h _ {v} ^ {t} \mid v \in \mathcal {N} _ {U} (u) \right\} \right\}\right).
$$
Where  $\mathcal{N}_M$  and  $\mathcal{N}_U$  are the neighborhood relations referring to marked (unmarked) neighbors in the subgraphs, respectively. Thus,  $\{\{h_v^t\mid v\in \mathcal{N}_M(u)\} \}$  and  $\{\{h_v^t\mid v\in \mathcal{N}_U(u)\} \}$  are aggregation AMPs (S2). We can model  $a_{u}^{t}$  as a function  $\phi ((x,y)) = \mathrm{AGGR}_{\mathrm{marked}}(x) + \mathrm{AGGR}_{\mathrm{marked}}(y)$  with  $x = \{\{h_v^t\mid v\in \mathcal{N}_M(u)\}\}$  and  $y = \{\{h_v^t\mid v\in \mathcal{N}_U(u)\}\}$ . Hence,  $a_{u}^{t}$  is a function AMP (S4) applied to a tuple AMP (S3). Thus, the color update function is strongly simulatable.
9. GMP [Wijesinghe and Wang, 2022]: The color update function underlying GMP has the shape
$$
\begin{array}{l} m _ {a} ^ {t} = \operatorname {A G G R E G A T E} ^ {N} \left(\left\{\left\{\left(\bar {A} _ {v u}, h _ {u} ^ {t}\right) \mid u \in \mathcal {N} (v) \right\} \right\}\right), \\ m _ {v} ^ {t} = \operatorname {A G G R E G A T E} ^ {N} \left(\left\{\left\{\bar {A} _ {v u} \mid u \in \mathcal {N} (v) \right\} \right\}\right) h _ {v} ^ {t} \\ c _ {v} ^ {t + 1} = \operatorname {C O M B I N E} \left(m _ {v} ^ {t}, m _ {a} ^ {t}\right). \\ \end{array}
$$
Here,  $\bar{A}_{vu} \in \mathbb{R}$  are structural coefficients encoding local structures in the graph around  $v, u$ . Note that we can model AGGREGATE $^N$  ( $\{\{\bar{A}_{vu} \mid u \in \mathcal{N}(v)\}\}$ ) as a constant atom (A1)  $k(v, v)$ . Thus, we can then write  $m_v^t = k(v, v) \cdot h_v^t = f_{\mathrm{mul}}(k(v, v), h_v^t)$  where  $f_{\mathrm{mul}}(x, y) = x \cdot y$ . Hence,  $m_v^t$  is a function application (S4) to a tuple (S3) of a constant node specific value (A1) together and a color (A3). Furthermore,  $m_a^t$  is an aggregation (S2) of tuples (A4) of a constant value (A1) combined with a color (A3). Thus, the color update function is strongly simulatable.
10. Shortest Path Networks [Abboud et al., 2022]: Let  $G = (V, E, F)$  be a graph,  $v \in V$  a vertex and  $i \geq 1$  an integer. We denote by  $\mathcal{N}_i(v)$  the  $i$ -hop shortest path neighborhood i.e., the set of all vertices that can be reached from  $v$  in a shortest path of length  $i$ . Then, the color update function of shortest path message passing graph neural networks (SP-MPNNs) are defined as
$$
c _ {v} ^ {t + 1} = \operatorname {C O M} \left(c _ {v} ^ {t}, \left(c _ {v} ^ {t}, \operatorname {A G G} _ {1} \left(\left\{\left\{c _ {u} ^ {t} \mid u \in \mathcal {N} _ {1} (v) \right\} \right\}\right)\right), \dots , \left(\operatorname {A G G} _ {k} \left(\left\{\left\{c _ {u} ^ {t} \mid u \in \mathcal {N} _ {k} (v) \right\} \right\}\right)\right)\right)
$$
where  $k \geq 1$  is an integer, COM is a combination function and AGG... are functions that map a multisets of colors to a single color. Let  $W = V$ . Obviously, COM and all AGG functions are function applications (S4). It is clear that  $c_v^t$  corresponds to a color atom (A3). Next we investigate the term  $(c_v^t, \mathrm{AGG}_j(\{c_u^t \mid u \in \mathcal{N}_j(v)\}))$  where  $j \in [k]$ . In this term,  $\{\{c_u^t \mid u \in \mathcal{N}_j(v)\}\}$  is the aggregation AMP (S2) of color atoms (A3). Thus,  $(c_v^t, \mathrm{AGG}_j(\{c_u^t \mid u \in \mathcal{N}_j(v)\}))$  is a tuple AMP (S3). It follows that the color update functions of SP-MPNNs correspond to AMP which implies that SP-MPNN can be strongly simulated.
11. Generalized Distance WL [Zhang et al., 2023]: Note that this generalizes shortest path networks. Let  $G = (V, E, F)$  be a graph. Let  $d_G(\cdot, \cdot)$  be an arbitrary distance metric i.e., a function  $d_G: V \times V \to \mathbb{R}$ . The color update function of generalized distance Weisfeiler-Leman (GD-WL) is defined as  $c_v^{t+1} = \text{HASH}\left(\{(d_G(u, v), c_u^t) \mid u \in V\}\right)$ . Let  $W = V$ . It
follows that  $\{(d_G(u,v),c_u^t)\mid u\in V\}$  is an aggregation AMP (S2) that aggregates a tuple atom (A4)  $(d_{G}(u,v),c_{u}^{t})$  built from a constant atom (A1)  $d_{G}(u,v)$  and a color atom (A3)  $c_{u}^{t}$ . As HASH corresponds to a function application (S4) we conclude that GD-WL is AMP and can be strongly simulated.
D Proofs for Limits of Strong Simulation (Section 4)
D.1 Cannot Simulate Nested Aggregation (Theorem 4.1 Part 1)
We prove the correctness of Theorem 4.1 for the nested aggregations.
Proof. We define two relational structures  $X_{1}, X_{2}$  that can be distinguished in the first round of message passing with nested aggregations, but cannot be distinguished in the first round of WL when representing the relational structures as graphs. Consider the set of objects  $U = \{x, a, b, c, d, h, h'\}$  with neighborhood functions:
-  $\mathcal{N}_1(a) = \mathcal{N}_1(b) = \mathcal{N}_1(c) = \mathcal{N}_1(d) = \{x\}$ ,
-  $\mathcal{N}_2(x) = \{h, h'\}$ ,
-  $\mathcal{N}_3(h) = \{a,b\}$ ,
-  $\mathcal{N}_3(h') = \{c, d\}$ .
In the above definition, the neighborhood function returns the empty set for all other objects. Both relational structures will have the same objects and neighborhood functions but different initial features:
-  $F_{1}(a) = F_{1}(b) = \square$ ,
$$
F _ {1} (c) = F _ {1} (d) = \bigcirc ,
$$
$$
F _ {1} (x) = F _ {1} (h) = F _ {1} \left(h ^ {\prime}\right) = \triangle ,
$$
-  $F_{2}(a) = F_{2}(d) = \square$ ,
$$
F _ {2} (b) = F _ {2} (c) = \bigcirc , a n d
$$
$$
F _ {2} (x) = F _ {2} (h) = \bar {F} _ {2} \left(h ^ {\prime}\right) = \triangle .
$$
fine the two relational structures as  $X_{1} = (U, \mathcal{N}_{1}, \mathcal{N}_{2}, \mathcal{N}_{3}, F_{1})$  and  $X_{2} = (U, \mathcal{N}_{1}, \mathcal{N}_{2}, \mathcal{N}_{3}, F_{2})$ . fine a color update function with nested-aggregations over these relations structures:
$$
c _ {v} ^ {t + 1} = \operatorname {H A S H} \left(c _ {v} ^ {t}, \left\{\left\{c _ {w} ^ {t} \mid w \in \mathcal {N} _ {1} (v) \right\} \right\}, \left\{\left\{\left\{c _ {y} ^ {t} \mid y \in \mathcal {N} _ {3} (x) \right\} \right\} \mid x \in \mathcal {N} _ {2} (v) \right\}\right),
$$
where  $c_v^t$  is the color of object  $v$  in iteration  $t$ . We use  $\pi_1, \pi_2$  to denote the color  $c_x^1$  for  $X_1$  and  $X_2$ , respectively. By definition we know that
$$
\pi_ {1} = \operatorname {H A S H} (\triangle , \emptyset , \{\{\{\bigcirc , \bigcirc \} \}, \{\{\square , \square \} \} \}),
$$
$$
\pi_ {2} = \operatorname {H A S H} (\triangle , \emptyset , \{\{\{\square , \bigcirc \} \}, \{\bigcirc , \square \} \} \}).
$$
Obviously  $\pi_1 \neq \pi_2$ . Suppose there exists a structure-to-graph encoding  $R$  such that WL can distinguish the color of the vertex  $x$  corresponding to object  $x$  for the two graphs  $R(X_1), R(X_2)$ . We use  $\tau_1, \tau_2$  to denote the color of vertex  $x$  after one iteration of WL on  $R(X_1), R(X_2)$ , respectively. Since the color of  $x$  depends on  $a, b, c, d$ , we can assume that there are edges from these vertices to  $x$  in both graphs. Since  $R$  is a structure-to-graph encoding it makes use of the mappings  $R_{\mathrm{graph}}$  and  $R_{\mathrm{feat}}$ . By definition of  $R_{\mathrm{graph}}$  it has no access to the features thus the graph created for  $X_1, X_2$  by  $R_{\mathrm{graph}}$  are identical. Hence, the graphs  $R(X_1)$  and  $R(X_2)$  only differ by the features assigned to  $a, b, c, d$ . By definition of WL, the colors  $\tau_1, \tau_2$  only depend on the features of the neighbors of  $x$  and are independent from any other vertices (or adjacencies between other vertices). Let  $Y = y_1, \ldots, y_m$  be all neighbors of  $x$  that are not  $a, b, c, d$ . Note that the features of the vertices of  $Y$  is the same for
both graphs as all vertices from  $Y$  are either not from  $U$  or they are assigned the same color by  $F_{1}$  and  $F_{2}$ . We add the relational structure  $X_{i}$  (for  $i \in \{1, 2\}$ ) as a subscript to the color notation to indicate where the color is originally coming from, e.g.,  $c_{x, X_{1}}^{0}$  is the initial color of vertex  $x$  in graph  $R(X_{1})$ . By definition of WL it holds that:
$$
\tau_ {1} = \mathrm {H A S H} \left(c _ {x, X _ {1}} ^ {0}, \left\{\left\{c _ {a, X _ {1}} ^ {0}, c _ {b, X _ {1}} ^ {0}, c _ {c, X _ {1}} ^ {0}, c _ {d, X _ {1}} ^ {0} \right\} \right\} \cup \left\{\left\{c _ {y, X _ {1}} ^ {0} \mid y \in Y \right\} \right\}\right),
$$
$$
\tau_ {2} = \mathrm {H A S H} \left(c _ {x, X _ {2}} ^ {0}, \left\{\left\{c _ {a, X _ {2}} ^ {0}, c _ {b, X _ {2}} ^ {0}, c _ {c, X _ {2}} ^ {0}, c _ {d, X _ {2}} ^ {0} \right\} \right\} \cup \left\{\left\{c _ {y, X _ {2}} ^ {0} \mid y \in Y \right\} \right\}\right).
$$
As  $R_{\mathrm{graph}}$  assigns the same features to  $x$  and all vertices of  $Y$  for the two graphs and  $R_{\mathrm{feat}}$  concatenates the vertex features with the features from the structures, it follows that  $c_{x,X_1}^0 = c_{x,X_2}^0$  and  $\{\{c_{y,X_1}^0 \mid y \in Y\}\} = \{\{c_{y,X_2}^0 \mid y \in Y\}\}$ . As we intend to argue that there exists no  $R$  such that  $\tau_1 \neq \tau_2$  we intend to argue that
$$
\left\{\left\{c _ {a, X _ {1}} ^ {0}, c _ {b, X _ {1}} ^ {0}, c _ {c, X _ {1}} ^ {0}, c _ {d, X _ {1}} ^ {0} \right\} \right\} \stackrel {!} {=} \left\{\left\{c _ {a, X _ {2}} ^ {0}, c _ {b, X _ {2}} ^ {0}, c _ {c, X _ {2}} ^ {0}, c _ {d, X _ {2}} ^ {0} \right\} \right\}.
$$
By definition the color of a vertex  $v \in \{a, b, c, d\}$  in graph  $R(X_i)$  (with  $i \in \{1, 2\}$ ) is the color assigned to  $v$  by  $R_{\mathrm{graph}}(X_i)$ :
$$
c _ {v, X _ {i}} ^ {0} = \operatorname {c o n c a t} \left(F _ {\text {g r a p h}, i} (v), F _ {i} (v)\right).
$$
We argue that all  $v \in \{a, b, c, d\}$  have the same feature  $F_{\mathrm{graph},i}(v)$  for all  $i \in \{1,2\}$ . First, any two  $v, w \in \{a, b, c, d\}$  that are part of the same set in  $\mathcal{N}_3(\{a,b\},\{c,d\})$  are necessarily assigned the same feature as they are indistinguishable for  $R_{\mathrm{graph}}$  based on the input  $(U,\mathcal{N}_1,\mathcal{N}_2,\mathcal{N}_3)$ . Second, for two  $v, w \in \{a,b,c,d\}$  that are not part of the same set in  $\mathcal{N}_3$  (e.g.  $v = a, w = c$ ),  $R_{\mathrm{graph}}$  can detect that they are part of different sets but cannot encode this into the vertex features. Any such encoding would treat the sets  $\{a,b\}$  and  $\{c,d\}$  differently which is not possible since the function operates on (multi)sets and is thus permutation equivariant. Together with the fact that  $\{\{F_1(a), F_1(b), F_1(c), F_1(d)\} = \{\{F_2(a), F_2(b), F_2(c), F_2(d)\}\}$  it follows that  $\tau_1 = \tau_2$ . This contradicts the initial assumption and proves that no structure-to-graph encoding  $R$  exists that allows for strong simulation on  $X_1$  and  $X_2$ . This proves the theorem.
D.2 Non-pairwise message passing cannot be simulated (Theorem 4.1 Part 2)
We prove the correctness of Theorem 4.1 for non-pairwise message passing.
Proof. The proof is similar to the case of nested aggregation (Appendix D.1). We define two relational structures  $X_{1}, X_{2}$  that can be distinguished in the first round of message passing with non-pairwise aggregations, but cannot be distinguished in the first round of WL when representing the relational structures as graphs. Consider the set of objects  $U = \{x, a, b, c, d\}$  with neighborhood functions:
-  $\mathcal{N}_1(a) = \mathcal{N}_1(b) = \mathcal{N}_1(c) = \mathcal{N}_1(d) = \{x\}$ ,
-  $\mathcal{N}_2(x) = \{(a,b),(c,d)\}$ .
$$
F _ {1} (x) = \triangle ,
$$
$$
F _ {2} (x) = \triangle .
$$