SlowGuess/NeurIPS_2023_OCR huggingface dataset:
-  $\mathcal{F} = \{\{\mathrm{CODE}(C) \mid C \in \sigma^G\}\}$ : the multiset of all codes of the SPQR components of  $G$ .
-  $\mathcal{M} = \{\{\widehat{h}_C\mid C\in \sigma^G\}\}$  : the multiset of the representations of the SPQR components of  $G$
Specifically, we prove the following:
Claim 1. There exists a bijection  $\rho$  between  $\mathcal{F}$  and  $\mathcal{M}$  such that, for any SPQR component  $C$ :
$$
\rho (\widehat {\boldsymbol {h}} _ {C}) = \mathrm {C O D E} (C) a n d \rho^ {- 1} (\mathrm {C O D E} (C)) = \widehat {\boldsymbol {h}} _ {C}.
$$
Once Claim 1 established, the desired result is immediate, since, using the bijection  $\rho$ , and the completeness of the codes generated by the KHC algorithm, we obtain:
$$
\widehat {\mathbf {h}} _ {C} \neq \widehat {\mathbf {h}} _ {C ^ {\prime}}
$$
$$
\rho^ {- 1} \left(\operatorname {C O D E} (C)\right) \neq \rho^ {- 1} \left(\operatorname {C O D E} \left(C ^ {\prime}\right)\right)
$$
$$
\operatorname {C O D E} (C) \neq \operatorname {C O D E} \left(C ^ {\prime}\right)
$$
$C$  and  $C^\prime$  are non-isomorphic.
To prove the Claim 1, first note that the canonical code given by Weinberg's algorithm for any component  $C$  has the form:
$$
\begin{array}{l} \operatorname {C O D E} (C) = \operatorname {T R I C O D E} (C) = (\kappa [ 1 ], \operatorname {C O D E} ((\{\omega [ 1 ] \}, \{\}))), \dots , (\kappa [ k ], \operatorname {C O D E} ((\{\omega [ k ] \}, \{\})) \\ = (\kappa [ 1 ], \zeta (\omega [ 1 ])), \dots , (\kappa [ k ], \zeta (\omega [ k ])). \tag {2} \\ \end{array}
$$
There is a trivial bijection between the codes of the form (2) and sets of the following form:
$$
S _ {C} = \left\{\left(\zeta (\omega [ i ]), \kappa [ i ], i\right) \mid 1 \leq i \leq | \omega | \right\}, \tag {3}
$$
and, as a result, for each component  $C$ , we can refer to the set  $S_{C}$  that represents this component  $C$  instead of  $\mathrm{CODE}(C)$ . Sets of this form are of bounded size (since the number of walks are bounded in  $C$ ) and each of their elements is from a countable set. By Lemma A.1 there exists an injective map  $g$  between such sets and the interval [0, 1]. Since the size of every such set is bounded, and every tuple is from a countable set, we can apply Lemma 5 of Xu et al. [63], and decompose the function  $g$  as:
$$
g (S _ {C}) = \phi \left(\sum_ {x \in S _ {C}} f (x)\right),
$$
for an appropriate choice of  $\phi : \mathbb{R}^{d'} \to [0,1]$  and  $f(x) \in \mathbb{R}^{d'}$ . Based on the structure of the elements of  $S_{C}$ , we can further rewrite this as follows:
$$
g \left(S _ {C}\right) = \phi \left(\sum_ {i = 1} ^ {| \omega |} f \left(\left(\zeta \left(\omega [ i ]\right), \kappa [ i ], i)\right)\right)\right). \tag {4}
$$
Observe that this function closely resembles TRIENC (1). More concretely, for any  $\omega$  and  $i$ , we have that  $\zeta(\omega[i]) = h_{\omega[i]}$ , and, moreover,  $\pmb{p}_{\kappa[i]}$  and  $\pmb{p}_i$  are the positional encodings of  $\kappa[i]$ , and  $i$ , respectively. Hence, it is easy to see that there exists a function  $\mu$ , which satisfies, for every  $i$ :
$$
\left(\left(\zeta (\omega [ i ])\right), \kappa [ i ], i\right) = \mu \left(\boldsymbol {h} _ {\omega [ i ]} \| \boldsymbol {p} _ {\kappa [ i ]} \| \boldsymbol {p} _ {i}\right).
$$
$$
\begin{array}{l} g \left(S _ {C}\right) = \phi \left(\sum_ {i = 1} ^ {| \omega |} f \left(\left(\zeta (\omega [ i ]), \kappa [ i ], i)\right)\right) \right. \\ = \phi \left(\sum_ {i = 1} ^ {| \omega |} f \left(\mu \left(\boldsymbol {h} _ {\omega [ i ]} \| \boldsymbol {p} _ {\kappa [ i ]} \| \boldsymbol {p} _ {i}\right)\right)\right) \\ = \phi \left(\sum_ {i = 1} ^ {| \omega |} (f \circ \mu) \left(\boldsymbol {h} _ {\omega [ i ]} \| \boldsymbol {p} _ {\kappa [ i ]} \| \boldsymbol {p} _ {i}\right)\right). \\ \end{array}
$$
Observe that this function can be parameterized by TRIENC: we apply the universal approximation theorem [14, 31, 32], and encode  $(f\circ \mu)$  with an MLP (i.e., the inner MLP) and similarly encode  $\phi$  with another MLP (i.e., the outer MLP).
This establishes a bijection  $\rho$  between  $\mathcal{F}$  and  $\mathcal{M}$ : for any SPQR component  $C$ , we can injectively map both the code  $\mathrm{CODE}(C)$  (or, equivalently the corresponding set  $S_{C}$ ) and the representation  $\widehat{\pmb{h}}_C$  to the same unique value using the function  $g$  as  $\widehat{\pmb{h}}_C = g(S_C)$ , and we have shown that there exists a parameterization of TRIENC for this target function  $g$ .
Parameterizing BiENC. In this case, we are given a biconnected component  $B$  and the representations  $\widehat{h}_C$  of each component  $C$  from the SPQR tree  $\gamma = \mathrm{SPQR}(B)$ . We consider the representations  $\widehat{h}_C$  which are a result of the parameterization of TRIENC, described earlier.
BIENC uses the SPQR tree and the integers  $\theta(C, C')$  corresponding to how we connect  $C$  and  $C' \in \chi(C)$ . BIENC then computes a representation for each subtree  $\gamma_C$  induced by a node  $C$  in a bottom up fashion as:
$$
\widetilde {\boldsymbol {h}} _ {\gamma_ {C}} = \operatorname {M L P} \left(\widehat {\boldsymbol {h}} _ {C} + \sum_ {C ^ {\prime} \in \chi (C)} \operatorname {M L P} \left(\widetilde {\boldsymbol {h}} _ {\gamma_ {C ^ {\prime}}} \| \boldsymbol {p} _ {\theta (C, C ^ {\prime})}\right)\right). \tag {5}
$$
This encoder operates in a bottom up fashion to ensure that a subtree representation of the children of  $C$  exists before it encodes the subtree  $\gamma_{C}$ . The representation of the canonical root node in  $\gamma$  is used as the representation of the biconnected component  $B$  by setting:  $\tilde{\pmb{h}}_B = \tilde{\pmb{h}}_{\gamma_{\mathrm{ROOT}}(\gamma)}$ .
To show the result, we first note that the canonical code given by the KHC algorithm also operates in a bottom up fashion on the subtrees of  $\gamma$ . We have two cases:
Case 1. For a leaf node  $C$  in  $\gamma$ , the code for  $\gamma_C$  is given by  $\mathrm{CODE}(\gamma_C) = \mathrm{TRICODE}(C)$ . This case can be seen as a special case of Case 2 (and we will treat it as such).
Case 2. For a non-leaf node  $C$ , we concatenate the codes of the subtrees induced by the children of  $C$  in their lexicographical order, by first prepending the integer given by  $\theta$  to each child code. Then, we also prepend the code of the SPQR component  $C$  to this concatenation to get  $\mathrm{CODE}(\gamma_C)$ . More precisely, if the lexicographical ordering of  $\chi(u)$ , based on  $\mathrm{CODE}(\gamma_{C'})$  for a given  $C' \in \chi(C)$  is  $x[1], \ldots, x[|\chi(C)|]$ , then the code for  $\gamma_C$  is given by:
$$
\operatorname {C O D E} \left(\gamma_ {C}\right) = \left(\operatorname {T R I C O D E} (C), \left(\theta (C, x [ 1 ]), \operatorname {C O D E} \left(\gamma_ {x [ 1 ]}\right)\right), \dots , \left(\theta (C, x [ | x | ]), \operatorname {C O D E} \left(\gamma_ {x [ | x | ]}\right)\right)\right) \tag {6}
$$
We show a bijection between the multiset of codes  $\mathcal{F}$  (given by the KHC algorithm), and the multiset of representations  $\mathcal{M}$  (given by B1ENC), where the respective multisets are defined, based on  $G$  and the SPQR tree  $\gamma$ , as follows:
-  $\mathcal{F} = \{\{\mathrm{CODE}(\gamma_C) \mid C \in \gamma\}\}$ : the multiset of all codes of all the induced SPQR subtrees.
-  $\mathcal{M} = \{\{\widetilde{h}_{\gamma_C}\mid C\in \gamma \} \}$  : the multiset of the representations of all the induced SPQR subtrees.
Analogously to the proof of TRIENC, we prove the following claim:
Claim 2. There exists a bijection  $\rho$  between  $\mathcal{F}$  and  $\mathcal{M}$  such that, for any node  $C$  in  $\gamma$ :
$$
\rho (\widetilde {\boldsymbol {h}} _ {\gamma_ {C}}) = \mathrm {C O D E} (\gamma_ {C}) \mathrm {a n d} \rho^ {- 1} (\mathrm {C O D E} (\gamma_ {C})) = \widetilde {\boldsymbol {h}} _ {\gamma_ {C}}
$$
Given Claim 2, the result follows, since, using the bijection  $\rho$ , and the completeness of the codes generated by the KHC algorithm, we obtain:
$$
\tilde {\boldsymbol {h}} _ {B} \neq \tilde {\boldsymbol {h}} _ {B ^ {\prime}}
$$
$$
\Leftrightarrow
$$
$$
\widetilde {\boldsymbol {h}} _ {\gamma_ {\mathrm {R O O T}} (B)} \neq \widetilde {\boldsymbol {h}} _ {\gamma_ {\mathrm {R O O T}} \left(B ^ {\prime}\right)}
$$
$$
\rho^ {- 1} \left(\operatorname {C O D E} \left(\operatorname {R O O T} (B)\right)\right) \neq \rho^ {- 1} \left(\operatorname {C O D E} \left(\operatorname {R O O T} \left(B ^ {\prime}\right)\right)\right)
$$
$$
\operatorname {C O D E} \left(\operatorname {R O O T} (B)\right) \neq \operatorname {C O D E} \left(\operatorname {R O O T} \left(B ^ {\prime}\right)\right)
$$
$B$  and  $B^{\prime}$  are non-isomorphic.
To prove Claim 2, let us first consider how  $\mathrm{CODE}(\gamma_C)$  is generated. For any node  $C$  in  $\gamma$ , there is a bijection between the codes of the form given in Equation (6) and sets of the following form:
$$
S _ {C} = \{\{\{\mathrm {T R I C O D E} (C) \} \} \} \cup \{\{(\theta (C, C ^ {\prime}), \mathrm {C O D E} (\gamma_ {C ^ {\prime}})) \mid C ^ {\prime} \in \chi (C) \} \} \tag {7}
$$
Observe that the sets of this form are of bounded size (since the number of children is bounded) and each of their elements is from a countable set (given the size of the graph, we can also bound the number of different codes that can be generated). By Lemma A.1 there exists an injective map  $g$  from such sets to the interval [0, 1]. Since the size of every such set is bounded, and every tuple is from a countable set, we can apply Lemma 5 of Xu et al. [63], and decompose the function  $g$  as:
$$
g (S _ {C}) = \phi \left(\sum_ {x \in S} f (x)\right),
$$
$$
g \left(S _ {C}\right) = \phi \left(f \left(\operatorname {T R I C O D E} (C)\right) + \sum_ {C ^ {\prime} \in \chi (C)} f \left(\left(\theta \left(C, C ^ {\prime}\right), \operatorname {C O D E} \left(\gamma_ {C ^ {\prime}}\right)\right)\right)\right). \tag {8}
$$
Observe the connection between this function and BiENC (5): for every  $C' \in \chi(C)$ , we have  $\widetilde{h}_{\gamma_{C'}}$  instead of  $\mathrm{CODE}(\gamma_C)$ , and, moreover,  $\pmb{p}_{\theta(C, C')}$  is a positional encoding of  $\theta(C, C')$ . Then, there exists a function  $\mu$  such that:
$$
\left(\theta \left(C, C ^ {\prime}\right), \operatorname {C O D E} \left(\gamma_ {C ^ {\prime}}\right)\right) = \mu \left(\boldsymbol {p} _ {\theta \left(C, C ^ {\prime}\right)} \| \widetilde {\boldsymbol {h}} _ {\gamma_ {C ^ {\prime}}}\right),
$$
provided that the following condition is met:
$$
\widetilde {\boldsymbol {h}} _ {\gamma_ {C ^ {\prime}}} = \operatorname {C O D E} \left(\gamma_ {C ^ {\prime}}\right) \text {f o r a n y} C ^ {\prime} \in \chi (C). \tag {9}
$$
Importantly, the choice for  $\mu$  can be the same for all nodes  $C$ . Hence, assuming the condition specified in Equation (9) is met, the function  $g$  can be further decomposed using some function  $f'(x) \in \mathbb{R}^{d'}$  which satisfies:
$$
\begin{array}{l} g \left(S _ {C}\right) = \phi \left(f \left(\left\{\operatorname {T R I C O D E} (C) \right\}\right) + \sum_ {C ^ {\prime} \in \chi (C)} f \left(\left(\theta \left(C, C ^ {\prime}\right), \operatorname {C O D E} \left(\gamma_ {C ^ {\prime}}\right)\right)\right)\right) \\ = \phi \left(\widehat {\boldsymbol {h}} _ {C} + \sum_ {C ^ {\prime} \in \chi (C)} f ^ {\prime} \left(\mu \left(\boldsymbol {p} _ {\theta (C, C ^ {\prime})} \| \widetilde {\boldsymbol {h}} _ {\gamma_ {C ^ {\prime}}}\right)\right)\right) \\ = \phi \left(\widehat {\boldsymbol {h}} _ {C} + \sum_ {C ^ {\prime} \in \chi (C)} \left(f ^ {\prime} \circ \mu\right) \left(\boldsymbol {p} _ {\theta (C, C ^ {\prime})} \| \widetilde {\boldsymbol {h}} _ {\gamma_ {C ^ {\prime}}}\right)\right). \\ \end{array}
$$
Observe that this function can be parameterized by  $\mathrm{BIENC}^6$  (5): we apply the universal approximation theorem [14, 31, 32], and encode  $(f' \circ \mu)$  with an MLP (i.e., the inner MLP) and similarly encode  $\phi$  with another MLP (i.e., the outer MLP).
To conclude the proof of Claim 2 (and thereby the proof of Lemma 6.2), we need to show the existence of bijection  $\rho$  between  $\mathcal{F}$  and  $\mathcal{M}$  such that, for any node  $C$  in  $\gamma$ :
$$
\rho (\widetilde {\boldsymbol {h}} _ {\gamma_ {C}}) = \operatorname {C O D E} (\gamma_ {C}) a n d \rho^ {- 1} (\operatorname {C O D E} (\gamma_ {C})) = \widetilde {\boldsymbol {h}} _ {\gamma_ {C}}.
$$
This can be shown by a straight-forward induction on the structure of the tree  $\gamma$ . For the base case, it suffices to observe that  $C$  is a leaf node, which implies  $\widetilde{\pmb{h}}_{\gamma_C} = \phi (\widehat{\pmb{h}}_C)$  and  $\mathrm{CODE}(\gamma_C) = \{\mathrm{TRICODE}(C)\}$ . The existence of a bijection is then warranted by Claim 1. For the inductive case, assume that there is a bijection between the induced representations of the children of  $C$  and their codes to ensure that the condition given in Equation (9) is met (which holds since the algorithm operates in a bottom up manner). Using the injectivity of  $g$ , and the fact that all subtree representations (of children) already admit a bijection, we can easily extend this to a bijection on all nodes  $C$  of  $\gamma$ .
We have provided a parameterization of TRIENC and BIENC and proven that they can compute representations which bijectively map to the codes of the KHC algorithm for the respective components, effectively aligning KHC algorithm with our encoders for these components. Given the completeness of the respective procedures in KHC, we conclude that the encoders are also complete in terms of distinguishing the respective components.
Note that  $f(\mathrm{TRICODE}(C))$  can be omitted, because TRIENC has an outer MLP, which can incorporate  $f$ .
Having showed that a single layer parameterization of BIENC and TRIENC is sufficient for distinguishing the biconnected and triconnected components, we proceed with the main lemma.
Lemma 6.3. For a planar graph  $G = (V, E, \zeta)$  of order  $n$  and its associated Block-Cut tree  $\delta = \text{BLOCKCUT}(G)$ , there exists a  $L = \lceil \log_2(n) \rceil + 1$  layer parameterization of BASEPLANE that computes a complete graph invariant for each subtree  $\delta_u$  induced by each cut node  $u$ .
Proof. CUTENC recursively computes the representation for induced subtrees  $\delta_u$  from cut nodes  $u$ , where  $\delta = \mathrm{BLOCKCUT}(G)$ . Recall that in Block-Cut trees, the children of a cut node always represent a biconnected component, and the children of a biconnected component always represent a cut node. Therefore, it is natural to give the update formula for a cut node  $u$  in terms of the biconnected component  $B$  represented by  $u$ 's children  $\chi(u)$  and  $B$ 's children  $\chi(B)$ .
$$
\bar {\boldsymbol {h}} _ {\delta_ {u}} ^ {(\ell)} = \operatorname {M L P} \left(\boldsymbol {h} _ {u} ^ {(\ell - 1)} + \sum_ {B \in \chi (u)} \operatorname {M L P} \left(\widetilde {\boldsymbol {h}} _ {B} ^ {(\ell)} + \sum_ {v \in \chi (B)} \bar {\boldsymbol {h}} _ {\delta_ {v}} ^ {(\ell)}\right)\right). \tag {10}
$$
To show the result, we first note that the canonical code given by the KHC algorithm also operates in a bottom up fashion on the subtrees of  $\delta$ . We have three cases:
Case 1. For a leaf  $B$  in  $\delta$ , the code for  $\delta_B$  is given by  $\mathrm{CODE}(\delta_B) = \mathrm{BICODE}(B)$ . This is because the leafs of  $\delta$  are all biconnected components.
Case 2. For a non-leaf biconnected component  $B$  in  $\delta$ , we perform overrides for the codes associated with each child cut node, and then use BIENC. More precisely, we override the associated CODE(\{\{u\}, \{\}\}) := CODE(\delta_u) for all  $u \in \chi(B)$ , and then we compute CODE( $\delta_B$ ) = BICODE(B).
Case 3. For a non-leaf cut node  $u$  in  $\delta$ , we encode in a similar way to BIENC: we get the set of codes induced by the children of  $u$  in their lexicographical order. More precisely, if the lexicographical ordering of  $\chi(u)$ , based on  $\mathrm{CODE}(\delta_B)$  for a given  $B \in \chi(u)$  is  $x[1], \ldots, x[|\chi(u)|]$ , then the code for  $\delta_u$  is given by:
$$
\operatorname {C O D E} \left(\delta_ {u}\right) = \left(\operatorname {C O D E} \left(\delta_ {x [ 1 ]}\right), \dots , \operatorname {C O D E} \left(\delta_ {x [ | x | ]}\right)\right) \tag {11}
$$
Instead of modelling the overrides (as in Case 2), BASEPLANE learns the cut node representations. We first prove this result by giving a parameterization of BASEPLANE which uses linearly many layers in  $n$  and then show how this construction can be improved to use logarithmic number of layers. Specifically, we will first show that BASEPLANE can be parameterized to satisfy the following properties:
1. For every cut node  $u$ , we reserve a dimension in  $h_u^L$  that stores the number of cut nodes in  $\delta_u$ . This is done in the UPDATE part of the corresponding layer.
2. There is a bijection  $\lambda$  between the representations of the induced subtrees and subtree codes, such that  $\lambda (\bar{\pmb{h}}_{\delta_u}^{(L)}) = \mathrm{CODE}(\delta_u)$  and  $\lambda^{-1}(\mathrm{CODE}(\delta_u^{(L)})) = \bar{\pmb{h}}_{\delta_u}^{(L)}$ , for cut nodes  $u$  that have strictly less than  $L$  cut nodes in  $\delta_u$ .
3. There is a bijection  $\rho$  between the cut node representations and subtree codes, such that  $\rho(h_u^{(L)}) = \mathrm{CODE}(\delta_u)$  and  $\rho^{-1}(\mathrm{CODE}(\delta_u^{(L)})) = h_u^{(L)}$ , for cut nodes  $u$  that have strictly less than  $L$  cut nodes in  $\delta_u$ .
Observe that the property (2) directly gives us a complete graph invariant for each subtree  $\delta_u$  induced by each cut node  $u$ , since the codes for every induced subtree are complete, and through the bijection, we obtain complete representations. The remaining properties are useful for later in order to obtain a more efficient construction.
The UPDATE function in every layer is crucial for our constructions, and we recall its definition:
$$
\begin{array}{l} \boldsymbol {h} _ {u} ^ {(\ell)} = f ^ {(\ell)} \left(g _ {1} ^ {(\ell)} \left(\boldsymbol {h} _ {u} ^ {(\ell - 1)} + \sum_ {v \in N _ {u}} \boldsymbol {h} _ {v} ^ {(\ell - 1)}\right) \| g _ {2} ^ {(\ell)} \left(\sum_ {v \in V} \boldsymbol {h} _ {v} ^ {(\ell - 1)}\right) \right. \\ g _ {3} ^ {(\ell)} \left(\boldsymbol {h} _ {u} ^ {(\ell - 1)} + \sum_ {C \in \sigma_ {u} ^ {G}} \widehat {\boldsymbol {h}} _ {C} ^ {(\ell)}\right) \| g _ {4} ^ {(\ell)} \left(\boldsymbol {h} _ {u} ^ {(\ell - 1)} + \sum_ {B \in \pi_ {u} ^ {G}} \widetilde {\boldsymbol {h}} _ {B} ^ {(\ell)}\right) \| \bar {\boldsymbol {h}} _ {\delta_ {u}} ^ {(\ell)}\biggr), \\ \end{array}
$$
We prove that there exists a parameterization of BASEPLANE which satisfies the properties (1)-(3) by induction on the number of layers  $L$ .
Base case.  $L = 1$ . In this case, there are no cut nodes satisfying the constraints, and the model trivially satisfies the properties (2)-(3). To satisfy (1), we can set the inner MLP in CUTENC as the identity function, and the outer MLP as a function which adds 1 to the first dimension of the input embedding. This ensures that the representations  $\overline{h}_{\delta_u}^{(1)}$  of cut nodes  $u$  have their first components equal to the number of cut nodes in  $\delta_u$ . We can encode the property (1) in  $h_u^{(\ell)}$  using the representation  $\overline{h}_{\delta_u}^{(1)}$ , since the latter is a readout component in UPDATE.
Inductive step.  $L > 1$ . By induction hypothesis, there is an  $(L - 1)$ -layer parameterization of BASEPLANE which satisfies the properties (1)-(3). We can define the  $L$ -th layer so that our  $L$  layer parameterization of BASEPLANE satisfies all the properties:
Property (1): For every cut node  $u$ , the function UPDATE has a readout from  $h_u^{(L-1)}$  and  $\overline{h}_{\delta_u}^{(L)}$  which allows us to copy the first dimension of  $h_u^{(L-1)}$  into the first dimension of  $h_u^{(L)}$  using a linear transformation, which immediately gives us the property.
Property (2): For this property, let us first consider the easier direction. Given the code of  $\delta_{u}$ , we want to find the CUTENC representation for the induced subtree of  $u$ . From the subtree code, we can reconstruct the induced subtree  $\delta_{u}$ , and then run a  $L$ -layer BASEPLANE on reconstructed Block-Cut Tree to find the CUTENC representation. As for the other direction, we want to find the subtree code of given the representation of the induced subgraph. The CUTENC encodes a multiset  $\{\{\widetilde{h}_B, \{\{h_v | v \in \chi(B)\}\} \mid B \in \chi(u)\}\}$ . By induction hypothesis, we know that all grandchildren  $v \in \chi^2(u)$  already have properties (1)-(3) satisfied for them with the first  $(L-1)$  layers. Hence, using the parameterization of TRIENC and BIENC given in Lemma 6.2, as part of the  $L$ -th BASEPLANE layer, we can get a bijection between BICODE and biconnected component representation. This way we can obtain BICODE  $(B)$  for all the children biconnected components  $B \in \chi(u)$ , with all the necessary overriding. Having all necessarily overrides is crucial, because to get the KHC code for the cut node  $u$ , we need to concatenate the biconnected codes from 6 that already have the required overrides. Hence, we make the parameterization of CUTENC encode multisets of representations for biconnected components  $B \in \chi(u)$ , and by similar arguments as in the proof of Lemma 6.2, this can be done using the MLPs in CUTENC.
Property (3): Using the bijection from (2) as a bridge, we can easily show the property (3). In the update formula, we appended  $\overline{h}_{\delta_u}^{(L)}$  using the MLP. If the MLP is bijective with the dimension taken by  $\overline{h}_{\delta_u}^{(L)}$ , we get a bijection between the node representation and the subtree representation. By transitivity, we get a bijection between node representations and subtree codes.
This concludes our construction using  $L = O(n)$  BASEPLANE layers.
Efficient construction. We now show that the presented construction can be made more efficient, using only  $\lceil \log_2(n) \rceil + 1$  layers. This is achieved by treating the cut nodes  $u$  differently based on the number of cut nodes they include in their induced subtrees  $\delta_u$ . In this construction, the property (1) remains the same, but the properties (2)-(3) are modified:
1. For every cut node  $u$ , we reserve a component in  $\pmb{h}_u^{(L)}$  that stored to the number of cut nodes in  $\delta_u$ . This is done in the UPDATE part of the corresponding layer.
2. There is a bijection  $\lambda$  between the representations of the induced subtrees and subtree codes, such that  $\lambda (\overline{h}_{\delta_u}^{(L)}) = \mathrm{CODE}(\delta_u)$  and  $\lambda^{-1}(\mathrm{CODE}(\delta_u^{(L)})) = \overline{h}_{\delta_u}^{(L)}$ , for cut nodes  $u$  that have strictly less than  $2^{(L - 1)}$  cut nodes in  $\delta_{u}$ .
3. There is a bijection  $\rho$  between the cut node representations and subtree codes, such that  $\rho(\pmb{h}_u^{(L)}) = \mathrm{CODE}(\delta_u)$  and  $\rho^{-1}(\mathrm{CODE}(\delta_u^{(L)})) = \pmb{h}_u^{(L)}$ , for cut nodes  $u$  that have strictly less than  $2^{(L-1)}$  cut nodes in  $\delta_u$ .
These new modified properties allow us to reduce the depth of the induction to a logarithmic number of steps, by having a more carefully designed parameterization of CUTENC. The logarithmic depth comes immediately from properties (2) and (3), while the core observations for building the CUTENC parameterizations are motivated by standard literature on efficient tree data structures, and in particular by the Heavy Light Decomposition (HLD) [55]. In HLD, we build "chains" through the tree that always go to the child that has the most nodes in its subtree. This gives us the property that, the path between each two nodes visits at most a logarithmic number of different chains, and we will use this concept in our parametrization. More precisely, we can construct a single CUTENC layer, that will make the above properties hold for whole chains, and not only individual nodes as in the previous construction.