This constraint will allow surfaces to end on sources of flux for $c$, which will give rise to  junctions. Note however that unlike in the case of $(2+1)$d for which the constraint on $𝐠$ in the presence of non-trivial $c$ flux was $(1,-1)𝐠=0$, the above constraint on $𝐡$ instead requires $𝐡=(0,0)^T$ for $N$ odd, and $𝐡 = (0,0)^T$ or $(N/2, N/2)^T$ for $N$ even. This will give rise to more potential junctions than in lower dimensions.

\subsubsection{Operators in Symmetry TFT}

We now give a description of the gauge-invariant operators of the theory, beginning with surface operators.
The full gauge transformations for the theory are
\bea
\label{eq:5dGT}
&\vphantom{.}&\mathbf{b}_{ijk}\to K^{-\gamma_i}\left(\mathbf{b}_{ijk} + (\delta_c \mathbf{h})_{i j k} \right)~,\hspace{0.4 in} c_{ij} \rightarrow c_{ij} + (\delta \gamma)_{ij}~,
\no\\
&\vphantom{.}& x^{(3)}_{ijk\ell} \rightarrow x^{(3)}_{ijk\ell} + (\delta \eta^{(2)})_{i j k \ell}~,
\eea
with $𝐡$ constrained to satisfy (\ref{eq:hgtconst}).

\paragraph{Surface operators} We may first consider the invertible surface operators, given by
\begin{eqnarray}\label{5dLn}
\widetilde{S}_{\mathbf{n}}(\sigma)= e^{i\frac{2\pi}{N} \oint_\sigma \mathbf{n}^T \mathbf{b}}~, \hspace{0.5 in} \mathbf{n}\in \Z_N\times \Z_N~.
\end{eqnarray}
This operator is identical to the one defined in (\ref{eq:firstdeftildeS}). We recall that, due to the non-commutativity of $b$ and $b$, the surface $S_𝐧$ differs from the surface $S_𝐧$ defined in (\ref{eq:4dsigma}) by a phase, i.e. $S_𝐧(σ)= S_𝐧(σ) e^πi/N n_1 n_2 ([σ])$, where $([σ])$ is the Pontryagin square of the Poincar{\'e} dual of $σ$ and $n_1,2$ are the two components of $𝐧$. We prefer to use $S_𝐧(σ)$ because it transforms simply as $S_𝐧→S_K𝐧$ under $_4^EM$, and hence it is $_4^EM$ invariant if and only if $𝐧^T K = 𝐧^T$. A straightforward analysis paralleling that in Section \ref{sec:5dtopops} then reproduces the spectrum of gauge-invariant surfaces $S_[e,m]$.

\paragraph{Line and 3-manifold operators}

In addition to the surface operators studied above, there is also a topological line operator
\bea
K(\gamma) := e^{{\pi i \over 2} \oint_\gamma c}
\eea
generating the $_4$ symmetry quantum dual to $_4^EM$. There is also a three-manifold operator
\bea
\chi(M_3):=e^{{\pi i \over 2} \oint_{M_3} x}~,
\eea
but as in $(2+1)$d this is generically non-topological since $x$ is not closed in general. However, with appropriate restrictions on $b$ and $b$ the field $x$ can become closed. For odd $N$, we require $b = b=0$ at the locus $M_3$.\footnote{This is chosen such that $K$ acts as the identity on $\mathbf{b}=(b , \widehat b)$, and hence such that $c$ drops out of the kinetic term of (\ref{eq:5dSymTFTaction}) and can act as a proper Lagrange multiplier field for $x$.} We may then construct three-manifold operators $V_(0)(M_3)$ via
\bea
\widehat V_{(0)} (M_3) := \frac{|H^1(M_3, \Z_N)|}{|H^0(M_3,\Z_N)|}\chi(M_3)\, \delta_{\Z_N}(\,b\,)\big|_{M_3}\, \delta_{\Z_N}(\,\widehat b\,)\big|_{M_3}~,
\eea
which are the images of the twist defects upon gauging $_4^EM$. The normalization is chosen to match the fusion rules derived in Section \ref{sec:5dgaugingmethod1}. The delta functions may alternatively be rewritten as
\bea
\label{eq:deltafuncts5d}
\delta_{\Z_N}(\,b\,)\big|_{M_3}\, \delta_{\Z_N}(\,\widehat b\,)\big|_{M_3} &=& {1\over |H^1(M_3, \ZZ_N)|^2}\sum_{[\sigma]\in H^1(M_3, \ZZ_N)} e^{{2 \pi i \over N} \int [\sigma] \,\cup\, b} \times \sum_{[\sigma']\in H^1(M_3, \ZZ_N)} e^{{2 \pi i \over N} \int [\sigma'] \,\cup\, \widehat b}
\no\\
&=& {1\over |H^1(M_3, \ZZ_N)|^2} \sum_{\sigma, \sigma' \in H_2(M_3, \ZZ_N)} S_{(1,0)}(\sigma) S_{(0,1)}(\sigma')~.
\eea
For even $N$, we instead require that $(b,b)$ be trivial as an element in $H^2(M_3, (_N×_N)/_2)$ on the defect locus. We may then construct the three-manifold operator $V_(0)(M_3)$ via
\begin{eqnarray}
\widehat V_{(0)} (M_3) := \frac{|H^1(M_3, (\Z_N\times \Z_N)/\Z_2)|^{\frac{1}{2}}}{|H^0(M_3,(\Z_N\times \Z_N)/\Z_2)|^{\frac{1}{2}}}\chi(M_3)\, \delta_{(\Z_N\times \Z_N)/\Z_2}(\,(b,\widehat{b})\,)\big|_{M_3}~,
\end{eqnarray}
where the delta function can be rewritten as
\begin{equation}
\delta_{(\Z_N\times \Z_N)/\Z_2}(\,(b,\widehat{b})\,)\big|_{M_3} = {1\over |H^1(M_3, (\Z_N\times \Z_N)/\Z_2)|} \sum_{(\sigma, \sigma') \in H_2(M_3, (\Z_N\times \Z_N)/\Z_2)} S_{(1,0)}(\sigma+\sigma') S_{(0,1)}(\sigma'-\sigma)~.
\end{equation}
The remaining twist defects $V_(1) (σ, M_3)$ can then be obtained by stacking with $S_(1,0)$ as before. We can also consider the 1-endomorphisms and 2-endomorphisms on the three manifolds and surfaces, which give rise to non-genuine surfaces  and lines. The discussion is similar to that in Section \ref{sec:5dtopops}, and hence we will not repeat it here.

\subsubsection{Junctions and local fusion rules}

We now ask about gauge-invariant junctions between the operators above. The analysis here is done following that in Section \ref{sec:3djunc}. We begin by considering $S_(e,m)$ on a 2-chain $σ$ with boundary. Such a configuration is not gauge-invariant, but instead transforms as
\bea\label{eq:Semtransform}
\widetilde S_{(e,m)}(\sigma) \rightarrow \widetilde S_{(e,m)}(\sigma) e^{{2 \pi i \over N} (e,m) \mathbf{h} |_{\partial \sigma} }~.
\eea
Since the gauge-invariant operators $S_[e,m]$ are built out of these surfaces, in order for them to be well-defined in the presence of a boundary, one of the following must be satisfied:
\begin{itemize}
\item The surface ends on a line together with other surfaces $\widehat S_{[e,m]}$ such that the total charge cancels.
\item The surface ends on a locus with non-zero $c$ flux.
\end{itemize}
The first of these allows for gauge-invariant junctions between three surface defects,
\bea
\widetilde S_{(e+e',m+m')}\subset \widetilde S_{(e,m)} \otimes \widetilde S_{(e',m')} ~.
\eea
This then gives rise to a number of junctions between gauge-invariant surface operators. When all are accounted for, we obtain precisely the same fusion rules as in (\ref{eq:surfacefusionaftergauging}) and (\ref{eq:surfacefusionaftergauging2}).

On the other hand, we may also consider the surfaces ending on a locus with non-zero $c$ flux. In this case equation (\ref{eq:hgtconst}) enforces $𝐡= (0,0)^T$ or $(N/2, N/2)^T$, with the latter only possible when $N$ is even. Assuming first that $N$ is odd, we have $𝐡= (0,0)^T$ and hence \textit{any} surface is allowed to end on $V_(0)$. However, we cannot really discuss trivalent junctions of $S_[e,m]$ and $V_(0)$ directly, since the former is supported on a surface while the latter is supported on a three-manifold. Instead, we can summarize the above observation by saying that the identity surface in $V_(0)$, which we previously denoted by $ℑ_2(V_(0))$, admits a trivalent junction with $S_[e,m]$ of the form
\bea
\mathfrak{I}_2(\widehat V_{{(0)}})\subset \widehat S_{[e,m]} \otimes  \mathfrak{I}_2(\widehat V_{{(0)}}) ~, \hspace{1cm}  N\in 2\Z+1~.
\eea
This is consistent with the last local fusion rule in \eqref{eq:surfacefusionaftergauging}.

For $N$ even, we instead allow both $𝐡= (0,0)^T$ and $(N/2, N/2)^T$ at loci of non-zero $c$ flux. Under the latter, we have from \eqref{eq:Semtransform} that $S_(e,m)(σ)$ transforms as
\bea
\label{eq:SemgthN2}
\widetilde S_{(e,m)}(\sigma) \rightarrow \widetilde S_{(e,m)}(\sigma) e^{{\pi i} (e+m)}~,
\eea
which means that only operators $S_(e,m)$ with $e+m$ even can end on $V_(0)$, giving trivalent junctions of the form $ℑ_2(V_(0))⊂S_[e,m] ⊗ℑ_2(V_(0)) $. Contrarily, when $e+m$ is odd $S_[e,m]$ cannot end alone, but can form a trivalent junction
\bea
\mathfrak{I}_2(\widehat V_{{(1)}})\subset \widehat S_{[e,m]} \otimes \mathfrak{I}_2(\widehat V_{{(0)}})~, \hspace{1cm} N\in 2\Z~, \hspace{0.5cm} e+m\in 2\Z+1
\eea
since the gauge non-invariance of $ℑ_2(V_(1))$ at the boundary (coming from the gauge non-invariance of $S_(1,0)$) precisely cancels that in (\ref{eq:SemgthN2}). These reproduce the local fusion rule of the surfaces in \eqref{eq:surfacefusionaftergauging2}, and we see that a trivalent junction is allowed (by gauge invariance) whenever the three surface operators appear in the same fusion rule in \eqref{eq:surfacefusionaftergauging} and \eqref{eq:surfacefusionaftergauging2}. Similar techniques could be used to study trivalent junctions between lines, but we leave this to future work.

Let us close by mentioning that one might aim to use the Hopf linking of the operators above, which are readily computed, to define some higher analog of the S-matrix, along the lines of [73, 74]. We do not comment on this further here.

\section{Application: Intrinsic vs. non-intrinsic non-invertible duality defects}
\label{sec:SymTFTspinnonspin}

In this final section we briefly discuss one application of SymTFTs, namely to the determination of whether a given duality defect is intrinsically non-invertible or not. We will only discuss the case of $(1+1)$d bosonic theories, with the results for spin theories or theories in $(3+1)$d left for future work.

\subsection{Topological manipulations}

Given any $(1+1)$d QFT $$ with a non-anomalous $_N^(0)$ zero-form symmetry, one can define a non-trivial topological manipulation $σ_r$ for any $r$ dividing $N$, defined by gauging the $_r$ normal subgroup of $_N$. In terms of partition functions, we have
\begin{eqnarray}
Z_{\sigma_r\CX} [X_2, (A,A')]= \frac{1}{|H^0(X_2, \Z_r)|} \sum_{a \in H^1(X_2, \Z_r)} Z_{\CX}\left[X_2, \frac{N}{r} a + \tilde{A}'\right]\, e^{\frac{2\pi i}{r} \int_{X_2} a A}
\end{eqnarray}
where $A$ is a $_r$ background field, $A'$ is a $_N/r$ background field, and $Ã'$ is its $_N$ lift. The combination $N/ra + Ã'$ is a $_N$ gauge field.  After gauging $_r$, the non-anomalous $_N$ symmetry becomes a product symmetry $_r×_N/r$ with a nontrivial mixed anomaly between them [8]. The anomaly is given by $e^2πi/r∫_X_3 A β(A') $
where $β(A')$ is defined by the symmetry extension $1→_r→_N →_N/r→1$ specified by $δa = β(A)$.

Starting from $σ_r $, there are two topological manipulations that one can perform. The first, which we denote by $τ$ is stacking with a $_r×_N/r$ SPT,
\begin{eqnarray}
Z_{\tau \sigma_r \CX}[X_2, (A,A')] = Z_{\sigma_r \CX}[X_2, (A,A')] e^{\frac{2\pi i}{\gcd(r,N/r)} \int_{X_2} AA'}~.
\end{eqnarray}
The second is gauging of a $_r'$ subgroup of $_r×_N/r$. The resulting theory has the global symmetry $_r'×_r×_N/r/_r'$ with an appropriate mixed anomaly. One can then perform suitable $σ$ or $τ$ transformations on the resulting theory.

Suppose that the theory $$ is invariant under gauging $_N$ (up to an Euler counterterm), i.e.
\begin{eqnarray}
\CX = \CX/\Z_N \equiv \sigma_{N} \CX~.
\end{eqnarray}
If this is the case, then as we have seen above $$ admits a Tambara-Yamagami extension of its $_N$ symmetry. We now ask if, starting from $$, we can perform a sequence of topological manipulations $ϕ$ such that the $TY(_N)$ category of $$ is replaced by a group-like category $ϕ(TY(_N))$ in a theory $ϕ()$.
The non-invertible symmetry is referred to as non-intrinsic or intrinsic depending on if such a $ϕ$ exists or does not exist,
\begin{eqnarray}
\begin{split}
\phi \text{ exists }:&\hspace{0.2 in} TY(\Z_N)~\text{is non-intrinsically non-invertible}~,\\
\phi \text{ doesn't exist }:&\hspace{0.2 in} TY(\Z_N)~\text{is intrinsically non-invertible}~.
\end{split}
\end{eqnarray}
Because the possible set of topological manipulations is complicated when $N$ is large, it is difficult to enumerate all possible chains of $σ_r$ and $τ$ operations and demonstrate that such a topological manipulation $ϕ$ does or does not exist.

On the other hand, the SymTFT  allows us to answer this question rather straightforwardly. This is due to two basic facts, both of which have been used throughout this paper:
\begin{enumerate}
\item The SymTFT is an invariant under topological manipulations,
\item The SymTFT for group-like symmetries is a Dijkgraaf-Witten theory.
\end{enumerate}
What this means is that the duality defect in $TY(G)$ is non-intrinsically non-invertible \textit{if and only if the SymTFT is a bosonic Dijkgraaf-Witten theory}.
Using the explicit form of the SymTFT obtained in Section \ref{sec:3dDTYZN}, we may now propose a sufficient criteria for when the duality defect of $TY(_N)$ is non-intrinsically non-invertible.

\subsection{A sufficient condition for non-intrinsically non-invertible symmetry}

Our goal is to see whether the SymTFT of $TY(_N)$ obtained in Section \ref{sec:3dDTYZN} is a DW theory. Recall that a $(2+1)$d DW theory is a finite group gauge theory with gauge group $G$ (which can be non-abelian), and which is specified by an element in the group cohomology $H^3(BG, U(1))$. A line in a DW theory is specified by the data [75, 76, 77]
\begin{eqnarray}
([g], \rho_{[g]})~,
\end{eqnarray}
where $[g]$ is an element of a conjugacy class of $G$, and $ρ_g$ is an irreducible projective representation of $G$ satisfying
\begin{eqnarray}
\rho(h) \rho(k) =\beta_{g}(h,k) \rho(hk)~, \hspace{1cm} \beta_g(h,k)= \frac{\omega_3(g,h,k) \omega_3(h,k,k^{-1} h^{-1} g h k)}{\omega_3(h,h^{-1}gh, k)}~,
\end{eqnarray}
with $ω_3(g,h,k)∈H^3(BG, U(1))$. The irreducible projective representation depends only on the conjugacy class $[g]$, and not on the choice of specific element $g$ inside a given conjugacy class. The quantum dimension of the line is given by the dimension of the irreducible projective representation,
\begin{eqnarray}
d_{([g], \rho_{[g]})} = \dim(\rho_{[g]})~.
\end{eqnarray}
As a consequence, the quantum dimension of any line in a DW theory is an integer. For example, the DW theory with gauge group $_2×_2×_2$ and group cohomology class $ω_3(g,h,k)=e^i πg_1 h_2 k_3$ has 8 lines of quantum dimension 1 and 7 lines of quantum dimension 2 [77]. The field theory and its line operators are discussed in [78].

In contrast,  the SymTFT for $TY(_N)$ contains non-invertible lines with quantum dimension $√(N)$, which is not an integer unless $N=n^2$ is a perfect square. We therefore conclude that when $N$ is not a perfect square, a QFT with $TY(_N)$ symmetry category \textit{cannot} be mapped to another QFT with only invertible symmetry via topological manipulations, which is consistent with the result in [64]. In other words, the duality defect for $TY(_N)$ with $N$ not a perfect square is always intrinsically non-invertible.

\section*{Acknowledgements}

We would like to thank Linhao Li, Ryohei Kobayashi, Ho Tat Lam, Emily Nardoni, Sahand Seifnashri, Shu-Heng Shao, Zhengdi Sun, Yuji Tachikawa, Matthew Yu, and  Gabi Zafrir for helpful discussions. J.K. would like to thank Kavli IPMU for their generous hospitality and support.
KO is supported in part by JSPS KAKENHI Grant-in-Aid, No.22K13969 and the Simons Collaboration on Global Categorical Symmetries.
Y.Z. is partially supported by WPI Initiative, MEXT, Japan at IPMU, the University of Tokyo.

\newpage

\appendix

\section{Correlation functions of $k$-dimensional operators in $(2k+1)$d}
\label{app:linecorr}

In this appendix, we provide derivations for equations (\ref{eq:linking}), \eqref{eq:corrLL}, and \eqref{eq:4dcomm}; namely we derive the linking of $k$-dimensional operators in $(2k+1)$-dimensional $_N$ gauge theory, as well as their commutation relations in $2k$-dimensions. We begin with the action for $_N$ gauge theory in $(2k+1)$ dimensions,
\begin{eqnarray}
S= \frac{2\pi}{N}\int_{X_{2k+1}} b^{(k)} \cup \delta  a^{(k)}~.
\end{eqnarray}
This theory has $N^2$ $k$-dimensional operators given by
\begin{eqnarray}
L_{(e,m)}(M_k) = \exp\left( \frac{2\pi i}{N} \oint_{M_k} e a^{(k)} \right) \exp\left( \frac{2\pi i}{N} \oint_{M_k} m b^{(k)}\right), \hspace{1cm} (e,m)\in \Z_N\times \Z_N
\end{eqnarray}
with $L_(1,0)$ and $L_(0,1)$ together generating a $_N^(k)×_N^(k)$ $k$-form symmetry. When $k=1$, we obtain a standard $_N$ gauge theory in $(2+1)$d, as discussed in Section \ref{sec:symTFT3dZN}. When $k=2$, we obtain a $_N^(1)$ gauge theory in $(4+1)$d, as discussed in Section \ref{sec:symTFT5d}.\footnote{In Section \ref{sec:symTFT5d}, since the operators are surfaces, we use the notation $S_{(e,m)}$ instead of $L_{(e,m)}$. }

We consider the mutual braiding between two operators labeled by $(e,m)$ and $(e',m')$. To do so,
we evaluate the correlation functions of these two operators on manifolds $M_k$ and $M_k'$ which form a Hopf link. In practice, this means that we have insertions in the action of the form
\bea
\label{eq:actionwithloopsapp}
S &=&{2 \pi \over N} \int_{X_{2k+1}} b^{(k)}  \delta a^{(k)} + {2 \pi \over N}  \int_{M_k} (e a^{(k)} + m b^{(k)} ) + {2 \pi \over N}  \int_{M_k'} (e' a^{(k)} + m' b^{(k)})
\\
&=&{2 \pi \over N} \int_{X_{2k+1}} b^{(k)}  \delta a^{(k)} + {2 \pi \over N}  \int_{X_{2k+1}} ( e \omega_{M_k}+ e' \omega_{M_k'})  a^{(k)} + {2 \pi \over N}  \int_{X_{2k+1}}  ( m \omega_{M_k}+ m' \omega_{M_k'})  b^{(k)}~\no,
\eea
where $ω_M_k$ is the Poincar{\'e} dual of the $k$-cycle $M_k$ with respect to $X_2k+1$, and hence is a cocycle of degree $k+1$. Integrating out the field $b^(k)$ enforces
\bea\label{eq:deltaak}
\delta a^{(k)} =  -(m \omega_{M_k}+ m' \omega_{M_k'})~.
\eea
Defining $V_k+1$ such that $∂V_k+1 = m M_k + m' M_k'$, we have $a^(k) =- PD(V_k+1)$. Plugging this back into the action then gives contribution
\bea
-{2 \pi \over N}  \int_{X_{2k+1}}  ( e \omega_{M_k}+ e' \omega_{M_k'}) \cup  \mathrm{PD}(V_{k+1})  = - {2 \pi \over N}  \int_{X_{2k+1}}  \mathrm{PD}( (e M_k+ e' M_k') \cap  V_{k+1}) ~.
\eea
In general, the intersection pairing $M_k ∩V_d-k$ between $M_k ∈H_k(X_d, )$ and $V_d-k ∈H_d-k(X_d, )$ satisfies
\bea
\label{eq:intersectionpairing}
M_k\cap V_{d-k} = (-1)^{k(d-k)} V_{d-k} \cap M_k~,
\eea
and thus in the current case we may write
\bea\label{eq:braidingZNk}
-{2 \pi \over N}  \int_{X_{2k+1}}  \left[  e \,\mathrm{PD}(  M_k\cap  V_{k+1}) + e'\, \mathrm{PD}( V_{k+1} \cap M_k' )\right]~.
\eea
It is convenient to formally rewrite $V_k+1=m ∂^-1M_k + m' ∂^-1M_k'$ by moving the boundary operator $∂$ to the right hand side in the definition below \eqref{eq:deltaak}. Then $PD(  M_k∩V_k+1)= PD(  M_k∩∂^-1 M_k') ≡(M_k, M_k')$. Moreover, by using integration by parts, we have $PD( V_k+1 ∩M_k' ) = PD( ∂^-1M_k ∩M_k' ) = (-1)^k+1PD(  M_k∩∂^-1 M_k') ≡(-1)^k+1(M_k, M_k')$. Substituting these into \eqref{eq:braidingZNk} gives
\bea
\label{eq:Hopflinkgen}
-{2 \pi \over N}  (e m' + (-1)^{k+1}m e')\, \mathrm{link}(M_k, M_k')~.
\eea
We thus conclude that the braiding between two $k$-dimensional operators is
\begin{eqnarray}\label{eq: ZNKbraiding}
\langle L_{(e,m)}(M_k) L_{(e',m')}(M_k')...\rangle = \exp\left( - \frac{2\pi i}{N} (em' + (-1)^{k+1} me') \link(M_k, M_k')\right) \langle ...\rangle
\end{eqnarray}

We next derive the equal time correlation function between generic dyonic lines $(e,m)$ and $(e',m')$, given for $k=1$ and $k=2$ in \eqref{eq:corrLL} and \eqref{eq:5dcomm}. We start with the commutation relation
\begin{eqnarray}\label{eq:A1}
L_{(1,0)}(M_k) L_{(0,1)}(M_k') = \exp\left(-{2 \pi i \over N} \langle M_k, M_k'\rangle \right) L_{(0,1)}(M_k')  L_{(1,0)}(M_k)
\end{eqnarray}
which can be obtained, for example,  by canonical quantization.\footnote{To carry out the canonical quantization, we switch back to differential form notation. Let us assume $k=1$ for simplicity; higher $k$ can be similarly derived, but with more indices. Canonical quantization in the usual way yields $[b_x(p), a_y(p')]=iN/2\pi \delta(p-p')$, and then using the Baker?Campbell?Hausdorff formula, we obtain $e^{2\pi i/N \oint_{x} a_x} e^{2\pi i/N \oint_{y} b_y}= e^{(2\pi i/N)^2 i (N/2\pi)}e^{2\pi i/N \oint_{x} b_y} e^{2\pi i/N \oint_{x} a_x}=e^{-2\pi i/N }e^{2\pi i/N \oint_{y} b_y} e^{2\pi i/N \oint_{x} a_x}$. } The pairing $⟨M_k, M_k'⟩$ is the intersection pairing between two $k$-manifolds in $2k$-dimensions.
Moving the phase to the left side and relabeling $M_k↔M_k'$, we have
\begin{eqnarray}\label{eq:A2}
\begin{split}
L_{(0,1)}(M_k) L_{(1,0)}(M_k') &= \exp\left({2 \pi i \over N} \langle M_k', M_k\rangle \right) L_{(1,0)}(M_k')  L_{(0,1)}(M_k)\\
&=\exp\left({2 \pi i \over N}(-1)^k \langle M_k, M_k'\rangle \right) L_{(1,0)}(M_k')  L_{(0,1)}(M_k)\\
\end{split}
\end{eqnarray}
where in the second line we used $⟨M_k,M_k'|=⟩ (-1)^k ⟨M_k',M_k|$⟩.[Note that the symmetry properties of the linking number and the intersection pairing are opposite. We have $\braket{M_k,M_k'}= (-1)^k \braket{M_k',M_k}$, but $(M_k, M_k')= (-1)^k+1 (M_k',M_k)$. Hence when the intersection pairing is even (odd), the linking number is odd (even). }
Using \eqref{eq:A1} and \eqref{eq:A2} and the definition of the dyonic line \eqref{eq:beforegaugingLs}, we may then determine the equal time commutation relation between dyonic lines,
\begin{equation}\label{eq:intersectionZNk}
\begin{split}
&L_{(e,m)}(M_k) L_{(e',m')}(M_k') \,=\, \left(L_{(1,0)}(M_k)\right)^{\otimes e} \left(L_{(0,1)}(M_k)\right)^{\otimes m} \left(L_{(1,0)}(M_k')\right)^{\otimes e'} \left(L_{(0,1)}(M_k')\right)^{\otimes m'}\\
&\,\,\,\,=e^{-\frac{2\pi i}{N}(e m' +(-1)^{k+1} m e')\braket{M_k, M_k'}} \left(L_{(1,0)}(M_k')\right)^{\otimes e'} \left(L_{(0,1)}(M_k')\right)^{\otimes m'}\left(L_{(1,0)}(M_k)\right)^{\otimes e} \left(L_{(0,1)}(M_k)\right)^{\otimes m}\\
&\,\,\,\,= e^{-\frac{2\pi i}{N}(e m' +(-1)^{k+1} m e')\braket{M_k, M_k'}} L_{(e',m')}(M_k') L_{(e,m)}(M_k)
\end{split}
\end{equation}
which reproduces \eqref{eq:corrLL} and \eqref{eq:5dcomm}. Note that the phase from the equal time commutation relation in \eqref{eq:intersectionZNk} coincides with the phase from the linking in \eqref{eq: ZNKbraiding}, with the intersection pairing number being replaced by the linking number.

\section{Measuring EM charges of defect junctions}
\label{app:junctioncharge}

\begin{figure}[tbp]
\begin{center}

\begin{tikzpicture}[baseline=-10]
\shade[ball color = white!60!red] (0,0) circle (0.6cm);
\draw[red] (0,0) circle (0.6cm);
\draw[red] (-0.6,0) arc (180:360:0.6 and 0.2);
\draw[red,dashed] (0.6,0) arc (0:180:0.6 and 0.2);

\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};
\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red, below] at (-0.5,-0.45) {$D_{\mathrm{EM}}$};
\end{tikzpicture}
\begin{tikzpicture}[baseline=-10]
\draw[red,thick] (-0.6,-0.0) arc (180:120:0.6 and 0.65);
\draw[red,thick] (-0.3,-0.565) arc (240:180:0.6 and 0.65);
\draw[red,thick] (0.575,0.33) arc (30:66:0.6 and 0.65);
\draw[red,thick] (0.58,-0.26) arc (-23:-66:0.6 and 0.65);

\shade[ball color = white!60!red] (0,0.6) ellipse (0.3cm and 0.08cm);
\draw[thick, red] (0,0.6) ellipse (0.3cm and 0.08cm);

\shade[ball color = white!60!red] (0,-0.6) ellipse (0.3cm and 0.08cm);
\draw[thick,red] (0,-0.6) ellipse (0.3cm and 0.08cm);

\shade[ball color = white!60!red] (0.6,0.05) ellipse (0.08cm and 0.3cm );
\draw[thick,red] (0.6,0.05) ellipse (0.08cm and 0.3cm );

\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};
\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red] at (-0.9,0) {$\cA$};
\end{tikzpicture}
\begin{tikzpicture}[baseline=-10]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};
\draw[red, thick] (0,0) circle (0.6 cm);
\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red, below] at (-0.5,-0.45) {$\mathcal{A}$};
\filldraw[violet!60] (0.58,0.12) circle (2pt);
\filldraw[orange] (0,0.6) circle (2pt);
\filldraw[orange] (0,-0.6) circle (2pt);
\end{tikzpicture}

\caption{The $\ZZ_2^{\mathrm{EM}}$ charge of the trivalent junction denoted by a triangle can be measured by enclosing the junction with the surface $D_{\mathrm{EM}}$. This surface is a condensate of the algebra anyon $\cA$, and may be decomposed as in the middle image. The remaining discs of $D_{\mathrm{EM}}$ can be shrunk to give orange and purple junctions, which will be studied in the text. }
\label{fig:psisigsigcharge}
\end{center}
\end{figure}

The goal of this appendix is to compute the $_2^EM$ charge of the junctions involving $L_(N/2,N/2)$ and $Σ_(e)$. Recall that there are various such junctions depending on the angle between the line and the surface anchored on $Σ_(e)$, c.f. Figure \ref{fig:squarevstrianglejunc}, and we will focus here on the charge of the triangle junction. The $_2^EM$ charge of this junction can be measured by enclosing the junction with the surface $D_EM$, as shown in the left of Figure \ref{fig:psisigsigcharge}. This surface is a condensate of the algebra anyon $$, and we may simplify the configuration to the one in the middle of Figure \ref{fig:psisigsigcharge}. This leaves us with discs of $D_EM$ surrounding each of the outgoing lines, which may in general involve complicated intersections of $$ with the external lines. Instead of studying the details of these discs, we may instead shrink them to point-like junctions as shown in the right of Figure \ref{fig:psisigsigcharge}. Our goal will now be to understand the junctions appearing here, which will allow us to evaluate the configuration and obtain the charge. Throughout we will neglect real number normalization factors, since these will in any case cancel out to give the final $_2$-valued charge.

To begin, we consider the 4-valent junction between $L_(e,m)$ and the algebra object $$. In this appendix, we will always draw invertible $L_(e,m)$ lines in blue, $$ lines in red, and the junction between the two as a purple dot. The junction between $L_(e,m)$ and $$ is the one encountered when e.g. $L_(e,m)$ pierces the $_2^EM$ surface as in Figure \ref{fig:psiaajunc}. We note that, in Figure \ref{fig:psiaajunc}, the configuration should not depend on precisely where along the surface $L_(e,m)$ intersects. As such, we obtain the consistency condition on the junction shown in Figure \ref{fig:psiAAconsistency}. Note that we have introduced an associative (co)multiplication junction $μ$, defined in Figure \ref{eq:mujuncdef}, which every algebra object $$ is automatically equipped with.

\begin{figure}[tbp]
\begin{center}
\shade[top color=red!40, bottom color=red!10,rotate=90]  (0,-0.7) -- (2,-0.7) -- (2.6,-0.2) -- (0.6,-0.2)-- (0,-0.7);
\draw[thick,rotate=90] (0,-0.7) -- (2,-0.7);
\draw[thick,rotate=90] (0,-0.7) -- (0.6,-0.2);
\draw[thick,rotate=90]  (0.6,-0.2)--(2.6,-0.2);
\draw[thick,rotate=90]  (2.6,-0.2)-- (2,-0.7);
\draw[thick,blue,postaction={on each segment={mid arrow=blue}}] (-0.9,1.4)--(0.4,1.4);
\draw[thick,blue,dotted] (0.4,1.4)--(0.68,1.4);
\draw[thick,blue,postaction={on each segment={mid arrow=blue}}] (0.72,1.4)--(1.7,1.4);
\node[blue,right] at (-2.2,1.4) {$L_{(e,m)}$};
\node[blue,right] at (1.7,1.4) {$L_{(m,e)}$};
\node[red,below] at (0.4, -0) {$D_{\text{EM}}$};

\filldraw[violet!60] (0.4,1.4) circle (2pt);

\end{tikzpicture}}
\qquad$=$\qquad
\draw[thick,rotate=90] (0,-0.7) -- (2,-0.7);
\draw[thick,rotate=90] (0,-0.7) -- (0.6,-0.2);
\draw[thick,rotate=90]  (0.6,-0.2)--(2.6,-0.2);
\draw[thick,rotate=90]  (2.6,-0.2)-- (2,-0.7);
\draw[thick,blue,postaction={on each segment={mid arrow=blue}}] (-0.9,1.4)--(0.4,1.4);
\draw[thick,blue] (0.4,1.4)--(0.68,1.4);
\draw[thick,blue,postaction={on each segment={mid arrow=blue}}] (0.72,1.4)--(1.7,1.4);
\node[blue,right] at (-2.2,1.4) {$L_{(e,m)}$};
\node[blue,right] at (1.7,1.4) {$L_{(m,e)}$};
\node[red,below] at (0.4, -0) {$D_{\text{EM}}$};

\draw[thick,red](0.4,1.4)--(0.4,1.8);
\draw[thick,red](0.4,1.8)--(0.2,2);
\draw[thick,red](0.2,2)--(0.5,2.2);
\draw[thick,red](0.4,1.8)--(0.7,2);
\draw[thick,red](0.2,0.9)--(0.4,0.7);
\draw[thick,red] (0.4,0.7)--(0.55,0.2);
\draw[thick,red] (0.4,0.7)--(0.6,0.9);
\draw[thick,red] (0.6,0.9)--(0.4,1.4);
\draw[thick,red] (0.6,0.9)--(0.7,0.8);

\filldraw[violet!60] (0.4,1.4) circle (2pt);

\end{tikzpicture}}
\caption{The intersection of $L_{(m,e)}$ and $D_{\mathrm{EM}}$, with the latter resolved into a mesh of $\mathcal{A}$.}
\label{fig:psiaajunc}
\end{center}
\end{figure}

\begin{figure}[htbp]
\begin{center}

\draw [red, thick] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[red] (0,0) circle (1.5pt);
\node[red,left] at (0,0) {$\mu$};

\node[blue, left] at (-1,-1) {$L_{(e,m)}$};
\node[red,below] at (0,-1) {$\mathcal{A}$};
\node[red,above] at (0,1) {$\mathcal{A}$};
\node[red,below] at (1,-1) {$\mathcal{A}$};
\node[blue, left] at (2.6,0.1) {$L_{(m,e)}$};

\draw[white, line width=5pt] (-1,-1) to [out=20,in = 200] (1.3,0);
\draw [red, thick] (0,-1) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.9 with {\arrow{>}}},
postaction={decorate}] (-1,-1) to [out=20,in = 200] (1.3,0);
\filldraw[violet!60] (0,-0.575) circle (2pt);

\end{tikzpicture}}
\hspace{0.4 in}$=$\hspace{0.4 in}

\draw [red, thick] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[red] (0,0) circle (1.5pt);
\node[red,left] at (0,0) {$\mu$};

\node[blue, left] at (-1,0) {$L_{(e,m)}$};
\node[blue, left] at (2.6,1) {$L_{(m,e)}$};
\node[red,below] at (0,-1) {$\mathcal{A}$};
\node[red,above] at (0,1) {$\mathcal{A}$};
\node[red,below] at (1,-1) {$\mathcal{A}$};

\draw [red, thick] (0,-1) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (-1,0) to [out=20,in = 200] (1.3,1);
\filldraw[violet!60] (0,0.42) circle (2pt);

\end{tikzpicture}}

\caption{Consistency condition involving the purple junction between $L_{(e,m)}$ and $\cA$, and the trivalent junction $\mu$ between three $\cA$ lines. }
\label{fig:psiAAconsistency}
\end{center}
\end{figure}

\begin{figure}[htbp]
\begin{center}
\draw [red, thick] (0,-1) -- (0,1);
\draw [red, thick] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[red] (0,0) circle (1.5pt);
\node[red,left] at (0,0) {$\mu$};

\node[red,below] at (0,-1) {$\mathcal{A}$};
\node[red,above] at (0,1) {$\mathcal{A}$};
\node[red,below] at (1,-1) {$\mathcal{A}$};
\end{tikzpicture}}\hspace{0.2 in}$=\,\,\,\,\,\sum_{p,q=0}^{N-1}$\hspace{0.1 in}
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}]  (1,-1) to[out=90,in=0 ]  (0,0);

\node[below,blue] at (-0.3,-1) {$L_{(p,-p)}$};
\node[above,blue] at (0,1)  {$L_{(p+q,-p-q)}$};
\node[below,blue] at (1.2,-1){$L_{(q,-q)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\end{tikzpicture}}
\caption{Definition of the trivalent junction $\mu$ between three $\cA$ lines. }
\label{eq:mujuncdef}
\end{center}
\end{figure}

On general grounds, the junction between $L_(e,m)$ and $$ must be of the form shown in Figure \ref{fig:genformofpsiAA}, with $α_e,m(p)$ a series of undetermined constants. In fact, imposing the consistency condition in Figure \ref{fig:psiAAconsistency} is sufficient to fix these constants. This may be shown by expanding both sides of Figure \ref{fig:psiAAconsistency} and making use of Figures \ref{eq:mujuncdef} and \ref{fig:genformofpsiAA}. Once expanded, the right-hand side is given as in Figure \ref{fig:new1}, whereas the left-hand side is given in the first line of Figure \ref{fig:new2}. One may rearrange the configuration in Figure \ref{fig:new2} via a series of F-moves to get the second line in Figure \ref{fig:new2}, and upon using the half-braid and more F-moves one may put it in the form shown in the last line of Figure \ref{fig:new2}. This configuration may now be compared to the one in Figure \ref{fig:new1}. Equating the two gives
\bea
\alpha_{e,m}(p+q) = e^{{2 \pi i \over N}m q}\alpha_{e,m}(p)~,
\eea
and choosing $α_e,m(0)=1$ (which is simply a choice of convention) we derive that
\bea
\alpha_{e,m}(p) =e^{{2 \pi i \over N}m p}~.
\eea
This completely specifies the junction in Figure \ref{fig:psiaajunc}.

\begin{figure}[tbp]
\begin{center}
\draw [red, thick] (0,-1) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (-1.2,-0.8) to [out=20,in = 200] (1.2,0.8);
\filldraw[violet!60] (0,0) circle (2pt);
\node[below]at (0,-1) {$\color{red}\cA$};
\node[above]at (0,1) {$\color{red}\cA$};
\node[left] at (-1.2,-0.8) {$\color{blue}L_{(e,m)}$};
\node[right] at (1.2,0.8) {$\color{blue}L_{(m,e)}$};
\end{tikzpicture}}
\hspace{0.2 in}$=\,\,\,\,\sum_{p=0}^{N-1}\,\,\, \alpha_{e,m}(p)\,\,\,$
\draw [blue, thick, decoration={markings, mark=at position 0.2 with {\arrow{<}},mark=at position 0.8 with {\arrow{>}}},
postaction={decorate},distance = 0.9cm] (0,1)  to [out=270,in = 200] (1.2,0.8);
\draw [blue, thick, decoration={markings, mark=at position 0.4 with {\arrow{>}},mark=at position 0.9 with {\arrow{<}}},
postaction={decorate}, distance = 0.9cm]  (-1.2,-0.8)  to [out=20,in = 90] (0,-1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (-0.18,-0.45)--(0.2,0.47);
\filldraw[blue] (-0.18,-0.45) circle (1.5pt);
\filldraw[blue] (0.2,0.47) circle (1.5pt);
\node[below] at (-1.4,-0.6){$\color{blue}L_{(e,m)}$};
\node[below] at (0,-0.9){$\color{blue}L_{(p,-p)}$};
\node[above] at (2,0.7){$\color{blue}L_{(m,e)}$};
\node[above] at (0,1){$\color{blue}L_{(p+e-m,-p-e+m)}$};
\node[right] at (0.05,-0.1){$\color{blue}L_{(e+p,m-p)}$};
\end{tikzpicture}}
\caption{The general form of the junction between $L_{(e,m)}$ and $\cA$, with $\alpha_{e,m}(p)$ a series of to-be-determined constants.}
\label{fig:genformofpsiAA}
\end{center}
\end{figure}

\begin{figure}[tbp]
\begin{center}

\draw [red, thick] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[red] (0,0) circle (1.5pt);
\node[red,left] at (0,0) {$\mu$};

\node[blue, left] at (-1,0) {$L_{(e,m)}$};
\node[blue, left] at (2.6,1) {$L_{(m,e)}$};
\node[red,below] at (0,-1) {$\mathcal{A}$};
\node[red,above] at (0,1) {$\mathcal{A}$};
\node[red,below] at (1,-1) {$\mathcal{A}$};

\draw [red, thick] (0,-1) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (-1,0) to [out=20,in = 200] (1.3,1);
\filldraw[violet!60] (0,0.42) circle (2pt);

\end{tikzpicture}}
\hspace{0.1 in}$= \,\,\sum_{p,q=0}^{N-1}\,\,\,\alpha_{e,m}(p+q)$\hspace{0.1 in}

\draw [blue, thick,,decoration={markings, mark=at position 0.5 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[blue] (0,0) circle (1.5pt);

\node[blue, left] at (-1,0) {$L_{(e,m)}$};
\node[blue, left] at (2.6,1) {$L_{(m,e)}$};
\node[blue,below] at (-0.2,-1) {$L_{(p,-p)}$};
\node[blue,above] at (0,1.5) {$L_{(p+q+e-m,m-e-p-q)}$};
\node[blue,below] at (1.2,-1) {$L_{(q,-q)}$};

\draw [blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.9 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,1.5);
\draw[blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (-1,0) to [out=20,in = 200] (0,0.42);
\draw[blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (0,0.7) to [out=20,in = 200] (1.3,1);
\filldraw[blue] (0,0.42) circle (1.5pt);
\filldraw[blue] (0,0.7) circle (1.5pt);

\end{tikzpicture}}

\caption{The right-hand side of Figure \ref{fig:psiAAconsistency}, expanded out using Figure \ref{fig:genformofpsiAA}. }
\label{fig:new1}
\end{center}
\end{figure}

\begin{figure}[htbp]
\begin{center}

\draw [red, thick] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[red] (0,0) circle (1.5pt);
\node[red,left] at (0,0) {$\mu$};

\node[blue, left] at (-1,-1) {$L_{(e,m)}$};
\node[red,below] at (0,-1) {$\mathcal{A}$};
\node[red,above] at (0,1) {$\mathcal{A}$};
\node[red,below] at (1,-1) {$\mathcal{A}$};
\node[blue, left] at (2.6,0.1) {$L_{(m,e)}$};

\draw[white, line width=5pt] (-1,-1) to [out=20,in = 200] (1.3,0);
\draw [red, thick] (0,-1) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.9 with {\arrow{>}}},
postaction={decorate}] (-1,-1) to [out=20,in = 200] (1.3,0);
\filldraw[violet!60] (0,-0.575) circle (2pt);

\end{tikzpicture}}
\hspace{0.1 in}$= \,\,\sum_{p,q=0}^{N-1}\,\,\,\alpha_{e,m}(p)$\hspace{0.0 in}
\draw [blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{<}}},postaction={decorate}] (0,0) to[out=0,in=90 ]  (1,-1.2);
\filldraw[blue] (0,0) circle (1.5pt);

\node[blue, left] at (-1,-1.2) {$L_{(e,m)}$};
\node[blue,below] at (-0.2,-1.2) {$L_{(p,-p)}$};
\node[blue,above] at (0,1) {$L_{(p+q+e-m,m-e-p-q)}$};
\node[blue,below] at (1.2,-1.2) {$L_{(q,-q)}$};
\node[blue, left] at (2.6,0.1) {$L_{(m,e)}$};

\draw[white, line width=5pt] (-1,-1) to [out=20,in = 200] (1.3,0);
\draw [blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{>}},mark=at position 0.08 with {\arrow{>}}},postaction={decorate}] (0,-1.2) -- (0,1);
\draw[blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{>}}},postaction={decorate}] (0,-0.575) to [out=20,in = 200] (1.3,0);
\draw[blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (-1,-1.2) to [out=20,in = 200] (0,-0.9);
\filldraw[blue] (0,-0.9) circle (1.5pt);
\filldraw[blue] (0,-0.575) circle (1.5pt);

\end{tikzpicture}}
\\
\hspace{0.1 in}$= \,\,\sum_{p,q=0}^{N-1}\,\,\,\alpha_{e,m}(p)$\hspace{0.0 in}
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (0,-1)--(0,0);
\draw [blue, thick] (0,0)--(-0.6,0.6);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (-1.2,0)--(-0.6,0.6);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (-0.6,0.6)--(-0.8,1.3);
\draw [blue, thick] (0,0)--(0.6,0);
\filldraw[blue] (0,0) circle (1.5pt);
\filldraw[blue] (0.6,0) circle (1.5pt);
\filldraw[blue] (-0.6,0.6) circle (1.5pt);

\draw [blue,thick,decoration={markings, mark=at position 0.6 with {\arrow{<}}},postaction={decorate}] (0.6,0) arc [radius=.3, start angle=240-90, end angle=130-90];
\draw [blue,thick] (1.2-0.05,-0.1+0.05)--(1.2+0.2,-0.15-0.2) ;
\draw [blue,thick,decoration={markings, mark=at position 0.6 with {\arrow{>}}},postaction={decorate}] (0.6,0) arc [radius=.3, start angle=-60-90, end angle=42-90];
\draw [blue,thick] (1.05,-0.08)--(1.05+0.4,-0.08+0.4) ;

\node[blue, left] at (-1.2,0) {$L_{(e,m)}$};
\node[blue,below] at (-0.2,-0.9) {$L_{(p,-p)}$};
\node[blue,above] at (-0.8,1.3) {$L_{(p+q+e-m,m-e-p-q)}$};
\node[blue,right] at (1.2+0.2,-0.15-0.2) {$L_{(q,-q)}$};
\node[blue, right] at (1.05+0.4,-0.08+0.4) {$L_{(m,e)}$};

\end{tikzpicture}}
\\
\hspace{0.1 in}$= \,\,\sum_{p,q=0}^{N-1}\,\,\,\alpha_{e,m}(p)\,e^{{2 \pi i \over N} m q}$\hspace{0.0 in}

\draw [blue, thick,,decoration={markings, mark=at position 0.5 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=0,in=90 ]  (1,-1);
\filldraw[blue] (0,0) circle (1.5pt);

\node[blue, left] at (-1,0) {$L_{(e,m)}$};
\node[blue, left] at (2.6,1) {$L_{(m,e)}$};
\node[blue,below] at (-0.2,-1) {$L_{(p,-p)}$};
\node[blue,above] at (0,1.5) {$L_{(p+q+e-m,m-e-p-q)}$};
\node[blue,below] at (1.2,-1) {$L_{(q,-q)}$};

\draw [blue, thick,decoration={markings, mark=at position 0.2 with {\arrow{>}},mark=at position 0.9 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,1.5);
\draw[blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (-1,0) to [out=20,in = 200] (0,0.42);
\draw[blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},postaction={decorate}] (0,0.7) to [out=20,in = 200] (1.3,1);
\filldraw[blue] (0,0.42) circle (1.5pt);
\filldraw[blue] (0,0.7) circle (1.5pt);

\end{tikzpicture}}

\caption{The left-hand side of Figure \ref{fig:psiAAconsistency}, expanded out using Figure \ref{fig:genformofpsiAA}. A series of F-moves and a half-braid give the configuration in the last line. Equating this with Figure \ref{fig:new2} fixes the constants $\alpha_{e,m}(p)$. }
\label{fig:new2}
\end{center}
\end{figure}

Having understood the junction between $L_(e,m)$ and $$, we next study the junctions between $L_(e,m)$ and $Σ_(e')$. As mentioned in the main text, this junction depends on the angle between $L_(e,m)$ and the EM duality defect $D_EM$ which is anchored on $Σ_(e')$. This is illustrated in Figure \ref{fig:squarevstrianglejunc}. There we have highlighted two particular cases: first, the case in which $θ= 0^+$, which we denote by a square; and second, the case in which $θ= π$, which we denote by a triangle. These junctions are subject to consistency conditions illustrated in Figure \ref{fig:squaretriangconsconds}, which physically correspond to the statement that the junction should not depend on where along $Σ_(e')$ the line $L_(e,m)$ is anchored. We will now solve these consistency conditions, beginning with the triangle junction.

\begin{figure}[tbp]
\begin{center}
\draw [dgreen, thick] (0,-1) -- (0,1);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=0,in=90 ]  (1,-1);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};

\node[dgreen,below] at (0,-1) {${\Sigma_{(e')}}$};
\node[dgreen,above] at (0,1) {${\Sigma_{(e'+e+m)}}$};
\node[blue,below] at (1,-1) {${L_{(e,m)}}$};
\end{tikzpicture}}\hspace{0.2 in}$=\,\,\,\,\,\sum_{p=0}^{N-1}\,\,\beta_{e,m,e'}(p)\,\,$
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}]  (1,-1) to[out=90,in=0 ]  (0,0);

\node[blue,below] at (-0.3,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (1.2,-1){$L_{(e,m)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\end{tikzpicture}}
\caption{The definition of the triangle junction, given in terms of a series of undetermined coefficients $\beta_{e,m,e'}(p)$. These coefficients may be fixed by imposing the consistency condition in Figure \ref{fig:squaretriangconsconds}.}
\label{fig:new3}
\end{center}
\end{figure}

\begin{figure}[!tbp]
\begin{center}

\draw[dgreen,thick](0,-1) -- (0,1);
\draw [blue, thick,decoration={markings, mark=at position 0.7 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=0,in=90 ]  (1,-1);
\draw [red, thick] (0,-0.5) to[out=180,in=270 ]  (-0.5,0);
\draw [red, thick] (-0.5,0) to[out=90,in=180 ]  (0,0.5);

\node[red, left] at (-0.5,0) {\footnotesize{$\mathcal{A}$}};
\node[dgreen, below] at (0,-1) {\footnotesize{$\Sigma_{(e')}$}};
\node[blue, below] at (1.5,-1) {\footnotesize{$L_{(e,m)}$}};
\node[red, right] at (0,0.5) {\footnotesize{$\mu_L$}};
\node[red, right] at (0,-0.5) {\footnotesize{$\mu_L^\vee$}};

\filldraw[red] (0,0.5) circle (1.5pt);
\filldraw[red] (0,-0.5) circle (1.5pt);

\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};

\end{tikzpicture}}\hspace{0.2 in}$=\,\,\,\,\,\sum_{p,q=0}^{N-1}\,\,\beta_{e,m,e'}(p+q)\,\,$
\draw [blue, thick,decoration={markings, mark=at position 0.3 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}]  (1,-1) to[out=90,in=0 ]  (0,0);

\filldraw[blue] (0,0.5) circle (1.5pt);
\filldraw[blue] (0,-0.5) circle (1.5pt);

\node[blue,below] at (-0.3,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (1.2,-1){$L_{(e,m)}$};
\node[blue,left] at (-0.6,0){$L_{(q.-q)}$};
\filldraw[blue] (0,0) circle (1.5pt);

\draw [blue, thick] (-0.5,0) to[out=90,in=180 ]  (0,0.5);
\draw [blue, thick, decoration={markings, mark=at position 1 with {\arrow{<}}},
postaction={decorate}] (0,-0.5) to[out=180,in=-90 ] (-0.5,0) ;

\end{tikzpicture}}
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}]  (1,-1) to[out=90,in=0 ]  (0,0);

\node[blue,below] at (-0.3,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (1.2,-1){$L_{(e,m)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\end{tikzpicture}}
\caption{The left-hand side of the consistency condition in Figure \ref{fig:squaretriangconsconds}. Comparing this to Figure \ref{fig:new3} fixes the undetermined coefficients $\beta_{e,m,e'}(p)$. }
\label{fig:new4}
\end{center}
\end{figure}
The general form of the triangle junction is given in Figure \ref{fig:new3}, which depends on a series of undetermined coefficients $β_e,m,e'(p)$. We may solve for these coefficients by imposing the constraint in Figure \ref{fig:squaretriangconsconds}. The right-hand side of the equation for the triangle junction is precisely the configuration in Figure \ref{fig:new3}, whereas the left-hand side is as shown in the first line of Figure \ref{fig:new4} (we use the fact that the junctions $μ_L$ and $μ^∨_L$ do not involve any phases in their expansions). A series of F-moves and shrinking of a loop gives the second line in Figure \ref{fig:new4}. From this we obtain the constraint
\bea
\beta_{e,m,e'}(p+q) = \beta_{e,m,e'}(p)~,
\eea
and choosing the convention $β_e,m,e'(0)=1$, we see that all phases can be taken to be trivial,
\begin{eqnarray}
\beta_{e,m,e'}(p)=1~.
\end{eqnarray}
This completely fixes the triangle junction.

\begin{figure}[tbp]
\begin{center}
{\begin{tikzpicture}[baseline=0,square/.style={regular polygon,regular polygon sides=4}]

\draw[dgreen,thick](0,-1) -- (0,1);
\draw [white, line width=5pt] (0,0) to[out=180,in=90 ]  (-1,-1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);

\node[dgreen, below] at (0,-1) {\footnotesize{$\Sigma_{(e')}$}};
\node[blue, below] at (-1.5,-1) {\footnotesize{$L_{(e,m)}$}};

\node at (0,0) [square,draw,fill=violet!60,scale=0.5] {};

\end{tikzpicture}}\hspace{0.2 in}$=\,\,\,\,\,\sum_{p=0}^{N-1}\,\,\gamma_{e,m,e'}(p)\,\,$
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);

\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);

\node[blue,below] at (0.2,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (-1.2,-1){$L_{(e,m)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\end{tikzpicture}}
\caption{The definition of the square junction, given in terms of a series of undetermined coefficients $\gamma_{e,m,e'}(p)$.
\label{fig:new5}
\end{center}
\end{figure}

\begin{figure}[tbp]
\begin{center}
{\begin{tikzpicture}[baseline=0,square/.style={regular polygon,regular polygon sides=4}]

\draw[dgreen,thick](0,-1) -- (0,1);
\draw [red, thick] (0,-0.5) to[out=180,in=270 ]  (-0.5,0);
\draw [red, thick] (-0.5,0) to[out=90,in=180 ]  (0,0.5);
\draw [white, line width=5pt] (0,0) to[out=180,in=90 ]  (-1,-1);

\node[red, left] at (-0.5,0) {\footnotesize{$\mathcal{A}$}};
\node[dgreen, below] at (0,-1) {\footnotesize{$\Sigma_{(e')}$}};
\node[blue, below] at (-1.5,-1) {\footnotesize{$L_{(e,m)}$}};
\node[red, right] at (0,0.5) {\footnotesize{$\mu_L$}};
\node[red, right] at (0,-0.5) {\footnotesize{$\mu_L^\vee$}};

\filldraw[red] (0,0.5) circle (1.5pt);
\filldraw[red] (0,-0.5) circle (1.5pt);

\draw [blue, thick, decoration={markings, mark=at position 0.6 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);
\node at (0,0) [square,draw,fill=violet!60,scale=0.5] {};
\end{tikzpicture}}\hspace{0.2 in}$=\,\,\,\,\,\sum_{p,q=0}^{N-1}\,\,\gamma_{e,m,e'}(p+q)\,\,$
\draw [blue, thick,decoration={markings, mark=at position 0.3 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);

\node[blue,below] at (0.2,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (-1.2,-1){$L_{(e,m)}$};
\node[blue,left] at (-0.6,0.2){$L_{(q,-q)}$};

\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}},
postaction={decorate}] (-0.5,0) to[out=90,in=180 ]  (0,0.5);
\draw [blue, thick] (0,-0.5) to[out=180,in=-90 ] (-0.5,0) ;

\draw [white, line width=0.25cm] (0,0) to[out=180,in=90 ]  (-1,-1);
\draw [blue, thick, decoration={markings, mark=at position 0.6 with {\arrow{<}}},
postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);

\filldraw[blue] (0,0) circle (1.5pt);
\filldraw[blue] (0,0.5) circle (1.5pt);
\filldraw[blue] (0,-0.5) circle (1.5pt);

\end{tikzpicture}}\\
\hspace{-0.5 in}
\draw [blue, thick,decoration={markings, mark=at position 0.3 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.8 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);
\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}}, postaction={decorate}] (-0.5,0) to[out=180,in=90 ]  (-1.5,-1);

\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{>}}}, postaction={decorate}] (0,0.5) to[out=180,in=120 ]  (-1.1,-0.1);

\draw [blue, thick, distance = 0.4cm]  (-1,-0.25) to[out=300,in=260 ]  (-0.5,0);

\draw[blue,thick] (0,0)--(-0.5,0);

\filldraw[blue] (0,0.5) circle (1.5pt);
\filldraw[blue] (0,-0.5) circle (1.5pt);

\node[blue,below] at (0.2,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (-1.7,-1){$L_{(e,m)}$};
\node[blue,left] at (-1.1,0.5){$L_{(q,-q)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\filldraw[blue] (-0.5,0) circle (1.5pt);

\end{tikzpicture}}
\hspace{-0.1 in}$=\,\,\sum_{p,q=0}^{N-1}\,\,\gamma_{e,m,e'}(p+q)\,e^{-{2\pi i \over N} e q}$\hspace{-0.4in}
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,-1) -- (0,0);
\draw [blue, thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}},
postaction={decorate}] (0,0) -- (0,1);

\draw [blue, thick, decoration={markings, mark=at position 0.5 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=180,in=90 ]  (-1,-1);

\node[blue,below] at (0.2,-1) {$L_{(e'+p,-p)}$};
\node[blue,above] at (0,1)  {$L_{(e+e'+p,m-p)}$};
\node[blue,below] at (-1.2,-1){$L_{(e,m)}$};
\filldraw[blue] (0,0) circle (1.5pt);
\end{tikzpicture}}
\caption{The left-hand side of the consistency condition in Figure \ref{fig:squaretriangconsconds}. Comparing this to Figure \ref{fig:new3} fixes the undetermined coefficients $\beta_{e,m,e'}(p)$. }
\label{fig:new6}
\end{center}
\end{figure}

Having fixed the triangle junction, we may now fix the square junction in an analogous way. The most general form of the expansion is given in Figure \ref{fig:new5}, with the factors $γ_e,m,e'(p)$ to be determined. On the other hand, the left-hand side of the consistency condition in Figure \ref{fig:squaretriangconsconds} is as shown in Figure \ref{fig:new6}. A series of F-moves and braids gives the final line of Figure \ref{fig:new6}, from which we read off a constraint on  $γ_e,m,e'(p)$. Choosing conventions such that $γ_e,m,e'(0)=1$, the solution is
\bea
\gamma_{e,m,e'}(p) = e^{ {2 \pi i \over N} e p}~.
\eea
This completely fixes the square junction.  We note that, by the braiding properties of the lines $L_(e,m)$ and $L_(e'+n,-n)$, the square junction obtained here is equivalent to a half-braided triangle junction, as shown in Figure \ref{fig:tritosquare}. This was used in Section \ref{sec:3dFsymbols} of the main text, but will not be needed here.

We have now successfully understood the purple circle and triangle junctions appearing in Figure \ref{fig:psisigsigcharge}. We have also understood the purple square junction, which does not appear in Figure \ref{fig:psisigsigcharge} explicitly but which will be important for its computation. All that remains is to evaluate the orange circle junctions, i.e. the four-fold intersection of $$ and $Σ_(e)$.

\begin{figure}[tbp]
\begin{center}
\begin{tikzpicture}[baseline=-10]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw[red, thick] (0,0) circle (0.6 cm);
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red, below] at (-0.5,-0.45) {$\mathcal{A}$};
\filldraw[orange] (0,0.6) circle (2pt);
\filldraw[orange] (0,-0.6) circle (2pt);
\end{tikzpicture}
\hspace{0.1 in}$=\,\,\,\,\sum_{p,q=0}^{N-1} \,\,\,G_e(p,q)\,\,\,$
\begin{tikzpicture}[baseline=-10,square/.style={regular polygon,regular polygon sides=4}]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{>}}}, postaction={decorate}] (0,1) to[out=180,in=180] (0,-0.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{<}}}, postaction={decorate}] (0,-1) to[out=0,in=0] (0,0.5);

\node at (0,1) [square,draw,fill=violet!60,scale=0.5] {};
\node at (0,-0.5) [square,draw,fill=violet!60,scale=0.5] {};
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,-1){};
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0.5){};

\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[blue, below] at (-1.5,0) {$L_{(p,-p)}$};
\node[blue, below] at (1.5,0.5) {$L_{(q,-q)}$};

\end{tikzpicture}

\caption{Definition of the orange junctions between $\cA$ and $\Sigma_{(e)}$ in terms of the square and triangle junctions. For simplicity we only define the orange junctions in pairs, as shown. The coefficients $G_e(p,q)$ may be determined by imposing the consistency condition in Figure \ref{fig:new8}.}
\label{fig:new7}
\end{center}
\end{figure}

\begin{figure}[tbp]
\begin{center}
\begin{tikzpicture}[baseline=-10]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw[red, thick] (0,0) circle (0.6 cm);
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red, below] at (-0.5,-0.45) {$\mathcal{A}$};
\filldraw[orange] (0,0.6) circle (2pt);
\filldraw[orange] (0,-0.6) circle (2pt);
\end{tikzpicture}
\hspace{0.5 in}$=$\hspace{0.5 in}
\begin{tikzpicture}[baseline=-10,square/.style={regular polygon,regular polygon sides=4}]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\end{tikzpicture}

\caption{A consistency condition on the orange junctions. This follows from the fact that the $\Z_2^{\text{EM}}$ charge of the trivial junction between $\Sigma_{(e)}$, $\Sigma_{(e)}$, and $L_{(0,0)}$ is trivial. }
\label{fig:new8}
\end{center}
\end{figure}

In fact, instead of computing the four-fold junction itself, for our purposes it suffices to compute a \textit{pair} of orange junction, as shown in the left-hand side of Figure \ref{fig:new7}. This in general admits an expansion in terms of square and triangle junctions as in the right-hand side of Figure \ref{fig:new7}. Here $G_e(p,q)$ are a series of undertermined constants, which are subject to the consistency condition shown in Figure \ref{fig:new8}. Physically, what this condition says is that any point on $Σ_(e)$ is $_2^EM$ invariant.

By using the definitions of the square and triangle junctions obtained above, it is straightforward to derive an expression for $G_e(p,q)$ from the consistency condition in Figure \ref{fig:new8}. We will only give the result,
\bea
G_e(p,q) = e^{-{2\pi i \over N} (pq-p^2)}\, \delta_{p+q+e \text{ mod } 2}~,
\eea
where the delta function is included to enforce that the line in the interior of the bubble is the EM dual of the incoming line (since it passes $D_EM$ in between).
This is the final piece of data needed to compute the charge of the junction in Figure \ref{fig:psisigsigcharge}.

We finally return to the original calculation of interest, namely the computation of the charge of the junction between $L_(N/2,N/2)$ and $Σ_(e)$. The computation is illustrated in Figure \ref{fig:finalcomputation}. In words, we begin by using the definition of a pair of orange circle junctions given in Figure \ref{fig:new7}, together with the definition of the purple circle junction given in Figure \ref{fig:genformofpsiAA}. This gives a factor of
\bea
G_e(p,q) \,\alpha_{{N\over 2},{N\over 2}}(-q) = e^{-{2 \pi i \over N}(pq-p^2)} e^{-\pi i q} \delta_{p+q+e \text{ mod } 2}~.
\eea
We may then use the definition of the square and triangle junctions given in Figures \ref{fig:new3} and \ref{fig:new5}, which gives a factor of
\bea
\gamma_{p,-p,e}(r+q)\times \gamma_{-p,p,e}\left(r+p+{N\over 2}\right) = e^{{2\pi i \over N}p(r+q)}e^{-{2 \pi i \over N} p (r + p + N/2)}~.
\eea

\begin{figure}[!tbp]
\begin{center}
\begin{tikzpicture}[baseline=-10]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};
\draw[red, thick] (0,0) circle (0.6 cm);
\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[red, below] at (-0.5,-0.45) {$\mathcal{A}$};
\filldraw[violet!60] (0.58,0.12) circle (2pt);
\filldraw[orange] (0,0.6) circle (2pt);
\filldraw[orange] (0,-0.6) circle (2pt);
\end{tikzpicture}
\hspace{0.0 in}$=\,\,\,\sum_{\substack{p,q=0\\ p+q+e=0\mod 2}}^{N-1} \,\,\,e^{-{2 \pi i \over N}(pq-p^2)} e^{-\pi i q} \,\,\,$
\begin{tikzpicture}[baseline=-10,square/.style={regular polygon,regular polygon sides=4}]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{>}}}, postaction={decorate}] (0,1) to[out=180,in=180] (0,-0.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{<}}}, postaction={decorate}] (0,-1) to[out=0,in=0] (0,0);

\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0.5) to[out=45,in=200 ]  (1.5,0);

\node at (0,1) [square,draw,fill=violet!60,scale=0.5] {};
\node at (0,-0.5) [square,draw,fill=violet!60,scale=0.5] {};
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,-1){};
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0.5){};

\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};

\draw[blue,thick] (0.5,-0.1)--(0.5+0.32,-0.1+0.32);

\filldraw[blue] (0.5,-0.1) circle (1.5pt);
\filldraw[blue] (0.5+0.32,-0.1+0.32) circle (1.5pt);

\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};
\node[blue, below] at (-1.4,0) {$L_{(p,-p)}$};
\node[blue, below] at (1.5,-0.4) {$L_{(q,-q)}$};
\node[blue, below] at (2,0.7) {$L_{(N/2,N/2)}$};
\end{tikzpicture}
\\
$=\,\,\sum_{\substack{p,q,r=0\\ q+p+e+2r=0\,\,\mathrm{mod}\,\,N}}^{N-1} e^{-{2 \pi i \over N}(pq-p^2)} e^{-\pi i (q+p)} e^{{2\pi i \over N}p(q-p)}$
\begin{tikzpicture}[baseline=-10,square/.style={regular polygon,regular polygon sides=4}]
\draw [blue, thick] (0,-1.5) -- (0,1.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{>}}}, postaction={decorate}] (0,1) to[out=180,in=180] (0,-0.5);

\draw[blue,thick,distance=1cm, decoration={markings, mark=at position 0.55 with {\arrow{<}}}, postaction={decorate}] (0,-1) to[out=0,in=0] (0,0);

\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0.5) to[out=45,in=200 ]  (1.5,0);

\draw[blue,thick] (0.5,-0.1)--(0.5+0.32,-0.1+0.32);

\filldraw[blue] (0,-1) circle (1.5pt);
\filldraw[blue] (0,-0.5) circle (1.5pt);
\filldraw[blue] (0,0.5) circle (1.5pt);
\filldraw[blue] (0,1) circle (1.5pt);
\filldraw[blue] (0,0) circle (1.5pt);
\filldraw[blue] (0.5,-0.1) circle (1.5pt);
\filldraw[blue] (0.5+0.32,-0.1+0.32) circle (1.5pt);

\node[blue, below] at (0,-1.5) {$L_{(e+r,-r)}$};
\node[blue, below] at (-1.4,0) {$L_{(p,-p)}$};
\node[blue, below] at (1.5,-0.4) {$L_{(q,-q)}$};
\node[blue, below] at (2,0.7) {$L_{(N/2,N/2)}$};
\end{tikzpicture}\\
$\,\,\,=\,\,\,(-1)^e\,\,\sum_{r=0}^{N-1}$ \begin{tikzpicture}[baseline=-10]
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{>}},mark=at position 0.2 with {\arrow{>}}}, postaction={decorate}] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\filldraw[blue] (0,0) circle (1.5pt);

\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[blue, below] at (0,-1.5) {$L_{(e+r,-r)}$};

\end{tikzpicture}
$\,\,\,=\,\,\,(-1)^e$\,\,\, \begin{tikzpicture}[baseline=-10]
\draw [dgreen, thick] (0,-1.5) -- (0,1.5);
\draw [blue, thick, decoration={markings, mark=at position 0.8 with {\arrow{<}}}, postaction={decorate}] (0,0) to[out=45,in=200 ]  (1.5,0);
\node[isosceles triangle,scale=0.4,
isosceles triangle apex angle=60,
minimum size =0.01cm] at (0,0){};

\node[blue, above] at (1.7,0) {$L_{(N/2,N/2)}$};
\node[dgreen, below] at (0,-1.5) {$\Sigma_{(e)}$};

\end{tikzpicture}

\caption{The final computation of the junction charge. Details are given in the text. }
\label{fig:finalcomputation}
\end{center}
\end{figure}

Noting further that the line $L_(e+r+q+p,-r-q-p)$ in the interior of the bubble must be the EM dual of the incoming line $L_(e+r,-r)$ (since it passes $D_EM$ in between) forces us to restrict to triplets $r,p,q$ satisfying
\bea
e+r+q+p = -r\,\,\,\mathrm{mod}\,\,N~,
\eea
or in other words $p+q = -e-2r$ mod $N$. Thus in total we produce a phase of
\bea
e^{-{2 \pi i \over N}(pq-p^2)} e^{-\pi i q}\times e^{{2\pi i \over N}p(r+q)}e^{-{2 \pi i \over N} p (r + p + N/2)} = e^{-\pi i (p+q)} = (-1)^e~,
\eea
which is the final result for the charge of the junction.  In summary, for even $e$ the junction in Figure \ref{fig:psisigsigcharge} is $_2^EM$ even.  On the other hand, for odd $e$ the junction is $_2^EM$ odd, and hence there are an odd number of $K$ lines  terminating on the junction.

\section{Gauge invariance of twisted $\Z_N$ gauge theory}
\label{app:2dactioninvariance}

In this appendix we provide a bit more detail on the proof of gauge invariance of the action \eqref{3dZNC}. We first note that  $δ_C 𝐚$ is gauge invariant under \eqref{3dGT}. This means that the gauge variation of \eqref{3dgaugeinvariant} is
\begin{eqnarray}\label{A1}
\begin{split}
(\delta_C \mathbf{g}^T)_{ij}  K^{C_{ij}+1}  (\delta_C \mathbf{a})_{jkl} &= \left(\mathbf{g}^T_{j} K^{C_{ij}}- \mathbf{g}^T_{i}\right) K^{C_{ij}+1}  (\delta_C \mathbf{a})_{jkl} \\
&= \left(\mathbf{g}^T_{j} - \mathbf{g}^T_{i} K^{C_{ij}} \right) K (\delta_C \mathbf{a})_{jkl}~.
\end{split}
\end{eqnarray}
We further use
\begin{eqnarray}
(\delta_C \delta_C \mathbf{a})_{ijkl} = K^{C_{ij}}(\delta_C \mathbf{a})_{jkl} - (\delta_C \mathbf{a})_{ikl} + (\delta_C \mathbf{a})_{ijl} - (\delta_C \mathbf{a})_{ijk}=0
\end{eqnarray}
to replace $K^C_ij (δ_C 𝐚)_jkl$ by $ (δ_C 𝐚)_ikl - (δ_C 𝐚)_ijl + (δ_C 𝐚)_ijk$ in \eqref{A1}. The second line in \eqref{A1} becomes
\begin{equation}
\begin{split}
\mathbf{g}^T_{j} K (\delta_C \mathbf{a})_{jkl} - \mathbf{g}^T_{i} K (\delta_C \mathbf{a})_{ikl} + \mathbf{g}^T_{i} K  (\delta_C \mathbf{a})_{ijl} - \mathbf{g}^T_{i} K  (\delta_C \mathbf{a})_{ijk} \equiv \left(\delta (\mathbf{g}^T K \delta_C \mathbf{a})\right)_{ijkl}
\end{split}
\end{equation}
which is a total derivative. This shows that \eqref{3dZNC} is gauge invariant.

The invariance of \eqref{3dZNC} under background gauge transformation \eqref{3dbgdTransformation} is also straightforward. Under \eqref{3dbgdTransformation}, the term \eqref{3dgaugeinvariant} becomes
\begin{eqnarray}
(\mathbf{a}_{ij})^T K^{\gamma_i} K^{C_{ij}+ \gamma_j - \gamma_i +1} \left(K^{C_{jk}+ \gamma_k-\gamma_j} K^{-\gamma_k}\mathbf{a}_{kl}- K^{-\gamma_j}\mathbf{a}_{jl} + K^{-\gamma_j} \mathbf{a}_{jk}\right)
\end{eqnarray}
and all of the $γ_i$ manifestly cancel.

\section{Fusion rules of the $(2+1)$d SymTFT of $TY(\Z_N)$ from modular $S$ matrices}
\label{app:fusionDCTY}

In this appendix, we collect the data of the Drinfeld center $(TY(_N))$ of $TY(_N)$ obtained in the mathematics literature  [63, 64]. In particular, we record the explicit form of the modular $S$ matrices, which can be used to rederive the fusion rules of Section \ref{sec:ZTYZN} via the Verlinde formula.

\subsection{Objects and modular $S$ matrices}

In the notation of [63], the objects in the category $(TY(_N))$ include
\begin{enumerate}
\item $2N$ invertible lines: $X_{g,i}, g\in \Z_N, i\in \Z_2$.
\item $N(N-1)/2$ non-invertible lines of quantum dimension $2$: $Y_{[g,h]}, g,h\in \Z_N, g<h$.
\item $2N$ non-invertible lines of quantum dimension $\sqrt{N}$: $Z_{g,i}, g\in \Z_N, i\in \Z_2$.
\end{enumerate}
They are in one-to-one correspondence with $L_(e)^q, L_[e,m], Σ_(e)^q$ in the main text.
In this notation, the modular $S$ matrices are given by\footnote{For simplicity, we work only with the case in which the Frobenius-Schur indicator is trivial. }
\begin{eqnarray}
\label{eq:mathSmatrices}
\begin{split}
&S_{X_{g,i}, X_{h,j}}=\frac{1}{2N}e^{- \frac{4\pi i}{N} gh}~,\\
&S_{X_{g,i}, Z_{h,j}}= S_{Z_{h,j}, X_{g,i}} = \frac{(-1)^i}{2 \sqrt{N}} e^{- \frac{2\pi i}{N} gh}~,\\
&S_{X_{g,i}, Y_{[h,k]}}= S_{ Y_{[h,k]}, X_{g,i}}= \frac{1}{N} e^{-\frac{2\pi i}{N} g (h+k)}~,\\
&S_{Z_{g,i}, Y_{[h,k]}}= S_{ Y_{[h,k]}, Z_{g,i}} = 0~,\\
&S_{Z_{g,i},Z_{h,j}}= \frac{(-1)^{i+j}}{2N} \omega_g \omega_h \sum_{k=0}^{N-1} e^{\frac{2\pi i}{N}(k-g-h)k}~,\\
&S_{Y_{[g,h]},Y_{[g',h']}}=\frac{1}{N} \left( e^{-\frac{2\pi i}{N}(gh'+hg')}+ e^{-\frac{2\pi i}{N}(gg' + hh')}\right)~,
\end{split}
\end{eqnarray}
\begin{eqnarray}
\omega_g= \left( \frac{1}{\sqrt{N}} \sum_{h=0}^{N-1} e^{-\frac{2\pi i}{N}gh}\gamma(h)\right)^{1/2}, \hspace{1cm} \gamma(h)
(-1)^h e^{-\frac{\pi i}{N} h^2}, & N\in 2\Z+1\\
e^{-\frac{\pi i}{N} h^2}, & N\in 2\Z
\end{cases}
\end{eqnarray}
For completeness, we also record the spins of the lines here,
\bea
\theta_{X_{g,i}} = e^{-{2 \pi i \over N} g^2}~, \hspace{0.5 in} \theta_{Y_{[g,h]}}=e^{-{2 \pi i \over N} gh}~, \hspace{0.5 in} \theta_{Z_{g,i}} = (-1)^i\, \omega^*_g~.
\eea

The Verlinde formula [79] enables us to derive the fusion rules between $W_1, W_2, W_3∈{X_g,i, Y_[g,h], Z_g,i}$ from the modular $S$ matrices,
\begin{eqnarray}
\label{eq:Verlindeformula}
N_{W_1, W_2}^{W_3} = \sum_{W} \frac{S_{W_1, W} S_{W_2, W} S^*_{W_3, W}}{S_{X_{0,0}, W}}~.
\end{eqnarray}
As a consistency check, we will now apply these formulae to small values of $N$ in order to reproduce the fusion rules found in the main text.

\subsection{Fusion rules for small $N$}

\paragraph{$N=2$:}
The fusion rule between invertible lines is $X_g,i ⊗X_h,j = X_g+h, i+j$, and we therefore reproduce the results in the text upon identifying $X_g,i ↔L_(g)^(-1)^i$. The fusion rules involving non-invertible lines are more interesting. The S-matrix elements and Verlinde formula give rise to,
\begin{eqnarray}
\begin{split}
&X_{1,i} \otimes Z_{0,j} = Z_{0, i+j+1}~, \hspace{1cm} X_{1,i} \otimes Z_{1,j} = Z_{1, i+j}~,\\
&Z_{g,i}\otimes Z_{g,j} = X_{0,i+j} \oplus X_{1,i+j+g+1}~.
\end{split}
\end{eqnarray}
Comparing with the fusion rule \eqref{eq:LSfusion}, we find the identification $Z_1,j↔Σ_(0)^(-1)^j, Z_0,j↔Σ_(1)^(-1)^j$.
As there is only one line with quantum dimension 2, we also have the identification $Y_[0,1]↔L_[0,1]$. Indeed, the following fusion rules
\begin{eqnarray}
X_{g,i} \otimes Y_{[0,1]}= Y_{[0,1]}~, \hspace{1cm} Z_{0,i}\otimes Z_{1,j} = Y_{[0,1]}~,
\end{eqnarray}
match with those observed in Section \ref{sec:TYZ2}.

\paragraph{$N=3$:}
The fusion rules between invertible lines are again $X_g,i ⊗X_h,j = X_g+h, i+j$, and we therefore match the results in the text upon identify $X_g,i ↔L_(g)^(-1)^i$. The fusion rules involving non-invertible lines are more interesting. The ones involving quantum dimension $√(3)$ lines are
\begin{eqnarray}\label{eq:Z1Z2}
\begin{split}
&X_{0,i}\otimes Z_{0,j}= Z_{0,i+j}~, \hspace{1cm} X_{1,i}\otimes Z_{0,j}= Z_{2,i+j+1}~, \hspace{1cm} X_{2,i}\otimes Z_{0,j}= Z_{1,i+j+1}~.
\end{split}
\end{eqnarray}
Comparing with the fusion rule \eqref{eq:LSfusionodd}, we find the identification $Z_0,j↔Σ_0^(-1)^j$,  $Z_1,j↔Σ_(1)^-(-1)^j$, and $ Z_2,j↔Σ_(2)^-(-1)^j$.
Other fusion rules between $X$ and $Z$ can be derived by starting with \eqref{eq:Z1Z2} and fusing additional invertible lines on both sides. The fusion rule between $X$ and $Y$ is
\begin{eqnarray}
X_{g,i}\otimes Y_{[g',h']}= Y_{[g+g', g+h']}
\end{eqnarray}
which leads to the idenfication $Y_[g,h]↔L_[g,h]$. Other fusion rules can be similarly worked out, and we find that they match with those from Section \ref{sec:ZTYZN} upon using the above identifications.

\paragraph{$N=4$:}
The fusion rules between invertible lines are again $X_g,i ⊗X_h,j = X_g+h, i+j$, and we therefore identify $X_g,i ↔L_(g)^(-1)^i$ once again.
The fusion between $X$ and $Z$ lines are
\begin{eqnarray}
\begin{split}
X_{1,i}\otimes Z_{0,j}= Z_{2,i+j}~, \hspace{1cm} X_{1,i}\otimes Z_{1,j}= Z_{3,i+j+1}~, \hspace{1cm} X_{2,i}\otimes Z_{g,j}= Z_{g,i+j+g}~.
\end{split}
\end{eqnarray}
Note that upon fusing $X_h,j$, the $Z_g,i$'s for even $g$ form a closed orbit, while those for odd $g$ form another closed orbit. We therefore identify $Z_0,j↔Σ_(0)^(-1)^j$, $Z_1,j↔Σ_(1)^(-1)^j$, $Z_2,j↔Σ_(2)^(-1)^j$, and  $Z_3,j↔Σ_(3)^-(-1)^j$. The fusion rule between $X$ and $Y$ is
\begin{eqnarray}
X_{g,i}\otimes Y_{[g',h']}= Y_{[g+g', g+h']}
\end{eqnarray}
which leads to the idenfication $Y_[g,h]↔L_[g,h]$. Other fusion rules can be similarly worked out, and we find that they match with those from Section \ref{sec:ZTYZN} upon using the above identifications.

\section{Condensation defects for the EM exchange symmetry in $(4+1)$d}
\label{app:DEM}

In this appendix, we discuss the four-dimensional defect $D_EM$ generating the $_4^EM$ (or $_2^EM$ for $N=2$) symmetry in $(4+1)$d
$_N^(1)$ gauge theory. Since the defect is different depending on the value of $N$, we must discuss three separate cases.

\subsection{Odd $N$}

For $N$ odd the operator $D_EM$ is given by \eqref{eq:Z4EMcond}, which we reproduce here for convenience,
\begin{equation}\label{eq:DEModdN}
D_{\text{EM}}(M_4) =
\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'})\right) S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')~.
\end{equation}
From \eqref{eq:Z4EMoper}, the expected fusion rule would be $S_(e,m)(τ) D_EM(M_4) = D_EM(M_4) S_(-m,e)(τ)exp(-2πi em/N⟨τ,τ|)⟩$. We will check this now, together with the invertibility of the defect.

\subsubsection{Fusion rule $S_{(e,m)} D_{\mathrm{EM}}= D_{\mathrm{EM}} S_{(-m,e)} e^{-2\pi i em/N \braket{\tau,\tau}}$}

We begin by verifying the fusion rule above. We have
\begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&= \frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'})\right) S_{(e,m)}(\tau) S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')\\
&=\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ (e+m)\braket{\tau, \sigma}+ (m-e)\braket{\tau,\sigma'})\right)\\&\hspace{4cm} \times S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')S_{(e,m)}(\tau)~.
\end{split}
\end{equation}
Now we use the fusion rule \eqref{eq:4dfusionrule} to rewrite $S_(e,m)(τ)$ as $e^2πi m^2/N ⟨τ,τ|⟩S_(e,-e)(τ) S_(m,m)(τ) S_(-m,e)(τ)$. The above expression then becomes
\begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&=\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ (e+m)\braket{\tau, \sigma}+ (m-e)\braket{\tau,\sigma'}\\& \hspace{1cm}+ m^2 \braket{\tau,\tau})\bigg)  S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')S_{(e,-e)}(\tau) S_{(m,m)}(\tau) S_{(-m,e)}(\tau)~.
\end{split}
\end{equation}
Note that $(e,-e)=e(1,-1), (m,m)=m(1,1)$, and hence one can switch the order of the surface operators and combine the terms using the quantum torus algebra \eqref{eq:4dtorusquantumalgebra}. The result is \begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&=\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ m\braket{\tau, \sigma}+ (e+2m)\braket{\tau,\sigma'}\\&\hspace{1cm}+ m^2 \braket{\tau,\tau})\bigg) S_{(1,-1)}(\sigma+e \tau) S_{(1,1)}(\sigma'+m\tau) S_{(-m,e)}(\tau)~.
\end{split}
\end{equation}
We finally make a change of variables $σ→σ-eτ$, $σ'→σ'-mτ$, upon which the above expression then becomes
\begin{eqnarray}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&=\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'} -em \braket{\tau,\tau} )\bigg) \\&\hspace{4cm}\times  S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma') S_{(-m,e)}(\tau) \\
&= D_{\text{EM}}(M_4)S_{(-m,e)}(\tau)  \exp\left(-\frac{2\pi i em}{N}\braket{\tau,\tau}\right)~.
\end{split}
\end{eqnarray}
Using the commutation relation \eqref{eq:5dcomm}, the surface operator in the last step can finally be re-expressed as
\begin{eqnarray}
\begin{split}
S_{(-m,e)}(\tau)  \exp\left(-\frac{2\pi i em}{N}\braket{\tau,\tau}\right)&= S_{(-m,0)}(\tau) S_{(0,e)}(\tau)  \exp\left(-\frac{2\pi i em}{N}\braket{\tau,\tau}\right)\\
&= S_{(0,e)}(\tau) S_{(-m,0)}(\tau)~.
\end{split}
\end{eqnarray}
Thus $D_EM$ maps $S_(e,0)$ to $S_(0,e)$ and $S_(0,m)$ to $S_(-m,0)$, exactly as expected in \eqref{eq:Z4EMoper}.

\subsubsection{Charge conjugation operator $C=D_{\text{EM}}^2$}

Before checking $D_EM^4=1$, we first compute $C=D_EM^2$, which should be the charge conjugation operator.\footnote{Note that $C$ is the 4d charge conjugation defect, which should not be confused with the 3d condensation defect $\CC$ defined in \eqref{eq:NNbcondensate}. } To this effect, we have
\begin{equation}
\begin{split}
D_{\text{EM}}(M_4)^2 &= \frac{|H^0(M_4, \Z_N)|^4}{|H^1(M_4, \Z_N)|^4} \sum_{\sigma, \sigma',\tau,\tau'\in H_2(M_4, \Z_N)} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ \braket{\tau', \tau'} + \braket{\tau, \tau'})\right)\\&\hspace{4cm}\times  S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')S_{(1,-1)}(\tau) S_{(1,1)}(\tau')~.
\end{split}
\end{equation}
To simplify the above expression, we switch the order of surface operators, combine the terms with the same charge using the quantum torus algebra, and make a change of variables. The final expression is
\begin{equation}
\begin{split}
C(M_4)=D_{\text{EM}}(M_4)^2 &= \frac{|H^0(M_4, \Z_N)|^4}{|H^1(M_4, \Z_N)|^4} \sum_{\sigma, \sigma',\tau,\tau'\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ \braket{\tau', \tau'}\\& \hspace{1cm} + \braket{\tau, \tau} - \braket{\sigma',\tau'}- \braket{\sigma,\tau'}+ \braket{\sigma',\tau}-\braket{\sigma,\tau} )\bigg) S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')~.
\end{split}
\end{equation}
Since $τ, τ'$ only appear in the exponent and not in the surface operators, we can perform the sum over them to simplify the expression. We first sum over $τ$. The relevant part is
\begin{eqnarray}\label{eq:tautau}
\sum_{\tau\in H_2(M_4, \Z_N)} \exp\left( \frac{2\pi i}{N} (\braket{\tau, \tau}+ \braket{\sigma'-\sigma, \tau})\right) ~.
\end{eqnarray}
To complete the square, it is useful to introduce $ρ$ satisfying $2ρ=σ'-σ$. Note that $ρ$ exists since the equality is defined modulo $Nλ$ where $λ$ is the generator of $H_2(M_4, _N)$ and $N$ is odd. Hence \eqref{eq:tautau} can be simplified to
\begin{eqnarray}
\sqrt{|H_2(M_4, \Z_N)|} \CZ_{Y}[M_4, \Z_N] \exp\left(- \frac{2\pi i}{N} \braket{\rho, \rho}\right)~,
\end{eqnarray}
\begin{eqnarray}\label{eq:Yfunc}
\CZ_{Y}[M_4, \Z_N]:= \frac{1}{\sqrt{|H_2(M_4, \Z_N)|}}\sum_{\tau\in H_2(M_4, \Z_N)} \exp\left( \frac{2\pi i}{N} \braket{\tau, \tau}\right)
\end{eqnarray}
defines an invertible TQFT, which trivializes on a spin manifold. Similarly, we can sum over $τ'$ by introducing $2ω=σ+σ'$, which gives
\begin{eqnarray}
\sqrt{|H_2(M_4, \Z_N)|} \CZ_{Y}[M_4, \Z_N] \exp\left(- \frac{2\pi i}{N} \braket{\omega, \omega}\right)~.
\end{eqnarray}
The charge conjugation defect thus becomes
\begin{eqnarray}
\begin{split}
C(M_4) &= \frac{|H^0(M_4, \Z_N)|^4 |H_2(M_4, \Z_N)|}{|H^1(M_4, \Z_N)|^4} \CZ_{Y}[M_4, \Z_N]^2 \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} \\& \hspace{1cm} +\braket{\sigma,\sigma'}-\braket{\rho,\rho}-\braket{\omega,\omega} )\bigg) S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')~.
\end{split}
\end{eqnarray}
To further simplify the expression, it is useful to replace $σ,σ'$ in terms of $ρ,ω$ via
\begin{eqnarray}
\sigma=\omega-\rho, \hspace{1cm} \sigma'= \omega+ \rho~.
\end{eqnarray}
Summing over $σ,σ'$ is equivalent to summing over $ρ,ω$. Hence the expression for the charge conjugation defect  simplifies to
\begin{equation}\label{eq:Codd}
\begin{split}
&C(M_4)\\&= \frac{|H^0(M_4, \Z_N)|^4 |H_2(M_4, \Z_N)|}{|H^1(M_4, \Z_N)|^4} \CZ_{Y}[M_4, \Z_N]^2 \sum_{\rho, \omega\in H_2(M_4, \Z_N)} \exp\bigg(\frac{2\pi i}{N} (-\braket{\rho,\rho}+\braket{\omega,\omega}+ 2 \braket{\rho,\omega})\bigg) \\& \hspace{8cm}\times S_{(1,-1)}(\omega-\rho) S_{(1,1)}(\omega+\rho)\\
&= \frac{|H^0(M_4, \Z_N)|^4 |H_2(M_4, \Z_N)|}{|H^1(M_4, \Z_N)|^4} \CZ_{Y}[M_4, \Z_N]^2 \sum_{\rho, \omega\in H_2(M_4, \Z_N)} \exp\bigg(-\frac{4\pi i}{N} \braket{\rho, \omega}\bigg) S_{(0,2)}(\rho) S_{(2,0)}(\omega)~.
\end{split}
\end{equation}

\subsubsection{Invertibility of $D_{\text{EM}}$}

We finally check the invertibility of $D_EM$ by computing $D_EM^4$, and conforming it is the identity, up to a local counterterm.  Since we have already computed $C=D_EM^2$, we only need to compute $C^2$ as follows.
\begin{equation}
\begin{split}
&C(M_4)^2\\&= \frac{|H^0(M_4, \Z_N)|^8 |H_2(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^8} \CZ_{Y}[M_4, \Z_N]^4 \sum_{\sigma,\sigma',\tau,\tau'\in H_2(M_4, \Z_N)} \exp\bigg(-\frac{4\pi i}{N} (\braket{\sigma, \sigma'}+ \braket{\tau,\tau')}\bigg)\\& \hspace{6cm} \times S_{(0,2)}(\sigma) S_{(2,0)}(\sigma')S_{(0,2)}(\tau) S_{(2,0)}(\tau')\\
&=\frac{|H^0(M_4, \Z_N)|^8 |H_2(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^8} \CZ_{Y}[M_4, \Z_N]^4 \sum_{\sigma,\sigma',\tau,\tau'\in H_2(M_4, \Z_N)}\exp\bigg(\frac{2\pi i}{N} (-2\braket{\sigma, \sigma'}-2 \braket{\tau,\tau')}\\& \hspace{1cm}-4\braket{\sigma',\tau}\bigg)  S_{(0,2)}(\sigma+\tau) S_{(2,0)}(\sigma'+\tau')\\
&= \frac{|H^0(M_4, \Z_N)|^8 |H_2(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^8} \CZ_{Y}[M_4, \Z_N]^4 \sum_{\sigma,\sigma',\tau,\tau'\in H_2(M_4, \Z_N)}\exp\bigg(\frac{2\pi i}{N} (-2\braket{\sigma, \sigma'}+2 \braket{\sigma,\tau')}\\& \hspace{1cm}-2\braket{\sigma',\tau}\bigg)  S_{(0,2)}(\sigma) S_{(2,0)}(\sigma')\\
&= \frac{|H^0(M_4, \Z_N)|^8 |H_2(M_4, \Z_N)|^4}{|H^1(M_4, \Z_N)|^8} \CZ_{Y}[M_4, \Z_N]^4 = \chi[M_4,\Z_N]^4 \CZ_{Y}[M_4, \Z_N]^4~.
\end{split}
\end{equation}
From the second to the last line, we have combined the surface operators with the same charge, made a change of variables $σ→σ-τ, σ'→σ'-τ'$,  integrated out $τ$ and $τ'$ which enforced $σ,σ'$ to be trivial 2-cycles in $H_2(M_4, _N)$, and finally used the definition of the 4d Euler counterterm in \eqref{eq:Euler4d}. Note that $χ[M_4,_N]$ is a local counterterm and $_Y[M_4, _N]$ is a phase, which proves that $C(M_4)^2= D_EM(M_4)^4$ is an invertible operator.

\subsubsection{Summary of algebra of co-dimension one}

We now summarize the algebra involving the $D_EM$ defect. We may define the orientation reversal of $D_EM$ as  $D_EM$ via
\begin{equation}
\begin{split}
\overline{D}_{\text{EM}}(M_4) = \chi[M_4,\Z_N]^{-2}
\frac{|H^0(M_4, \Z_N)|^2}{|H^1(M_4, \Z_N)|^2} \sum_{\sigma, \sigma'\in H_2(M_4, \Z_N)} \exp\left(-\frac{2\pi i}{N} (\braket{\sigma, \sigma} + \braket{\sigma, \sigma'})\right) S_{(1,1)}(\sigma') S_{(1,-1)}(\sigma)
\end{split}
\end{equation}
where motivated by \eqref{eq:CNbarCN4d} the Euler counterterm is included. This also renders $D_EM×D_EM=1$. The fusion rules are then
\begin{eqnarray}
\begin{split}
&C(M_4)= D_{\text{EM}}(M_4)^2~,\\
&D_{\text{EM}}(M_4)^4=\chi[M_4, \Z_N]^4 \CZ_{Y}[M_4, \Z_N]^4~,\\
&\overline{D}_{\text{EM}}(M_4)\times D_{\text{EM}}(M_4)=1~,\\
& \overline{D}_{\text{EM}}(M_4)= \chi[M_4,\Z_N]^{-4} \CZ_{Y}[M_4, \Z_N]^{-4} C(M_4) D_{\text{EM}}(M_4)^2~.
\end{split}
\end{eqnarray}

\subsection{$N=2$}

When $N=2$, there is only one type of condensate, and the EM symmetry is $_2^EM$. The topological defect for $_2^EM$ is
\begin{eqnarray}
\begin{split}
D_{\text{EM}}(M_4) = \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma\in H_2(M_4,\Z_2)} S_{(1,0)}(\sigma) S_{(0,1)}(\sigma+[w_2^{TM}])~,
\end{split}
\end{eqnarray}
where $[w_2^TM]$ is the Poincar{\'e} dual of the second Stiefel-Whitney class of the tangent bundle of the spacetime manifold $w_2^TM$.\footnote{We thank Ryohei Kobayashi for discussions and a note which lead us to this construction. } To confirm that this is the correct result, we check the commutation relations with the surface operators $S_(e,m)(τ)$, as well as that $D_EM(M_4)^2=1$  up to Euler counterterm.

\subsubsection{Fusion with $S_{(e,m)}$}

We begin by computing
\begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma\in H_2(M_4,\Z_2)} S_{(e,m)}(\tau) S_{(1,0)}(\sigma) S_{(0,1)}(\sigma+[w_2^{TM}])\\
&= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma\in H_2(M_4,\Z_2)} \exp\left(i \pi (m \braket{\tau,\sigma}+ e \braket{\tau, \sigma+[w_2^{TM}]})\right) S_{(1,0)}(\sigma) S_{(0,1)}(\sigma+[w_2^{TM}])S_{(e,m)}(\tau)~.\\
\end{split}
\end{equation}
Using $S_(e,m)(τ)= S_(1,0)((e-m)τ)S_(0,1)((m-e)τ) S_(m,e)(τ)e^iπm(m-e)⟨τ,τ|⟩$ and combining the surface operators with the same charge, the above expression simplifies to
\begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma\in H_2(M_4,\Z_2)} \exp\Big(i \pi (m \braket{\tau,\sigma}+ e \braket{\tau, \sigma+[w_2^{TM}]}+m(m-e)\braket{\tau,\tau}\\&\hspace{0.5cm}+(e-m)\braket{\tau,\sigma+[w_2^{TM}]})\Big) S_{(1,0)}(\sigma+(e-m)\tau) S_{(0,1)}(\sigma+[w_2^{TM}]+(e-m)\tau)S_{(m,e)}(\tau)~.\\
\end{split}
\end{equation}
We further make a change of variable $σ→σ-(e-m)τ$, and use $⟨τ,τ|=⟩⟨τ,w_2^TM| ⟩ mod   2$, upon which the expression simplifies to
\begin{equation}
\begin{split}
&S_{(e,m)}(\tau) D_{\text{EM}}(M_4)\\
&= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma\in H_2(M_4,\Z_2)} \exp\left(i \pi em \braket{\tau,\tau}\right) S_{(1,0)}(\sigma) S_{(0,1)}(\sigma+[w_2^{TM}])S_{(m,e)}(\tau)\\
&=D_{\text{EM}}(M_4) S_{(m,e)}(\tau) \exp\left(i \pi em \braket{\tau,\tau}\right)
\end{split}
\end{equation}
as expected.\footnote{Note that this surface operator exchanges $e\leftrightarrow m$. It can be shown that this operator is a composition of $D_{m\psi} D_{e\psi} D_{m\psi}$, where $D_{m\psi}$ and $D_{e\psi}$ are operators exchanging $m \leftrightarrow \psi$ and $e\leftrightarrow \psi$, respectively. One has
$D_{m\psi}= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma \in H_2(M_4,\Z_2)} \exp\left( \frac{i \pi}{2} \int \cP(\text{PD}(\sigma)) \right) S_{(1,0)}(\sigma)$, and $D_{e\psi}= \frac{|H^0(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|} \sum_{\sigma \in H_2(M_4,\Z_2)} \exp\left( \frac{i \pi}{2} \int \cP(\text{PD}(\sigma)) \right) S_{(0,1)}(\sigma)$, where $\text{PD}(\sigma)$ is the Poincar{\'e} dual of $\sigma$.

\subsubsection{Invertibility of $D_{\mathrm{EM}}(M_4)$}

We next compute
\begin{equation}
\begin{split}
D_{\text{EM}}(M_4)^2 &= \frac{|H^0(M_4,\Z_2)|^2}{|H^1(M_4,\Z_2)|^2} \sum_{\sigma,\tau} S_{(1,0)}(\sigma) S_{(0,1)}(\sigma+[w_2^{TM}]) S_{(1,0)}(\tau) S_{(0,1)}(\tau+[w_2^{TM}]) \\
&= \frac{|H^0(M_4,\Z_2)|^2}{|H^1(M_4,\Z_2)|^2} \sum_{\sigma,\tau} S_{(1,0)}(\sigma+\tau) S_{(0,1)}(\sigma+\tau) \exp\left( i\pi \braket{\sigma+[w_2^{TM}], \tau}\right)\\
&=\frac{|H^0(M_4,\Z_2)|^2}{|H^1(M_4,\Z_2)|^2} \sum_{\sigma,\tau} S_{(1,1)}(\sigma)  \exp\left( i\pi \braket{\sigma+[w_2^{TM}]-\tau, \tau}\right)~.\\
\end{split}
\end{equation}
Using $⟨τ,τ|=⟩ ⟨[w_2^TM],τ| ⟩ mod  2$, this expression can be simplified to
\begin{equation}\label{eq:N=2fusionDD}
\begin{split}
D_{\text{EM}}(M_4)^2 &=\frac{|H^0(M_4,\Z_2)|^2}{|H^1(M_4,\Z_2)|^2} \sum_{\sigma,\tau} S_{(1,1)}(\sigma)  \exp\left( i\pi \braket{\sigma, \tau}\right)
\\&= \frac{|H^0(M_4,\Z_2)|^2 |H_2(M_4,\Z_2)|}{|H^1(M_4,\Z_2)|^2} = \chi[M_4,\Z_2]~.
\end{split}
\end{equation}
We can also define the orientation reversal as
\begin{eqnarray}\label{eq:DEMN=2orientrev}
\overline{D}_{\text{EM}}= \chi[M_4, \Z_2]^{-1} D_{\text{EM}}
\end{eqnarray}
upon which \eqref{eq:N=2fusionDD} can be rewritten as
\begin{eqnarray}
D_{\text{EM}}(M_4) \times \overline{D}_{\text{EM}}(M_4) = 1
\end{eqnarray}
Hence $D_EM(M_4)$ is invertible, and generates a $_2$ symmetry.

\subsection{Even $N$ and $N\geq 4$:}
\label{app:DEMN>4}

The symmetry defect in this case is almost identical to that for odd $N$, but with some minor modifications. In particular, we now have
\begin{equation}\label{eq:DEMevenN}
\begin{split}
D_{\text{EM}}(M_4)& =
\frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|} \sum_{(\sigma, \sigma')\in H_2(M_4, (\Z_N\times \Z_N)/\Z_2)} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'})\right) \\& \hspace{4cm} \times S_{(1,-1)}(\sigma)S_{(0,1)}\left(\frac{N}{2}[w_2^{TM}]\right) S_{(1,1)}(\sigma')~.
\end{split}
\end{equation}
As in the case of $N=2$, for generic even $N$, we are allowed to turn on the background field $w_2^TM$.

\subsubsection{Gauge invariance}

As explained in Section \ref{sec:Z4EM4d}, summing over $H_2(M_4, (_N×_N)/_2)$ requires  that the defect should be invariant under the gauge transformation $σ→σ+N/2λ, σ'→σ'+N/2λ$, which follows from the identification $S_(N/2,N/2)(σ)= S_(N/2,-N/2)(σ)$. Indeed, it is straightforward to check that \eqref{eq:DEMevenN} is invariant under this gauge transformation, due to the proper coupling to the background field $[w_2^TM]$. This means that summing over the elements $(σ,σ')$ in $H_2(M_4, (_N×_N)/_2)$ amounts to summing over $σ$ and $σ'$ in $H_2(M_4,_N)$ separately, but only over half of the total domain.\footnote{As an analogy, summing over $(a,b)\in (\Z_N\times \Z_N)/\Z_2$ amounts to choosing one element in the pair $(a,b) \sim (a+\frac{N}{2}, b+\frac{N}{2})$ and summing over the $N^2/2$ choices of pairs. The sum is independent of the choice thanks to gauge invariance. }

The $_4^EM$ defect \eqref{eq:DEMevenN} differs from that for the odd $N$ case by coupling to the background field $[w_2^TM]$. If we do not couple to the background field in \eqref{eq:DEMevenN} and use \eqref{eq:DEModdN} instead, then under the gauge transformation $σ→σ+N/2λ, σ'→σ'+N/2λ$ we would find that $D_EM$ transforms as $D_EM→(-1)^N/2⟨λ,λ|⟩ D_EM = (-1)^N/2⟨λ,[w_2^TM]|⟩D_EM$, which is not invariant and renders the sum over $H_2(M_4, (_N×_N)/_2)$ ill-defined.  The coupling to $[w_2^TM]$ in \eqref{eq:DEMevenN} precisely compensates this non-invariance.

\subsubsection{Fusing with $S_{(e,m)}(\tau)$}

To justify that \eqref{eq:DEMevenN} is the correct condensation defect of $_4^EM$, we may check that the commutation relation with the surface operators is of the desired form \eqref{eq:Z4EMoper},
\begin{eqnarray}
S_{(e,m)}(\tau) D_{\text{EM}}(M_4) = D_{\text{EM}}(M_4) S_{(-m,e)}(\tau) \exp\left( -\frac{2\pi i e m }{N} \braket{\tau,\tau}\right)~.
\end{eqnarray}
The proof is identical to the case for odd $N$, and will not be reproduced here.

\subsubsection{Two useful summation formulas}

Before discussing the charge conjugation operator and verifying the invertibility of $D_EM$, it is useful to discuss a summation formula which will be used later on. We start with the discrete Fourier transformation,
\begin{eqnarray}\label{eq:DFT}
\frac{1}{\sqrt{N}} \sum_{x\in \Z_N} \exp\left( \frac{2\pi i}{2N} x^2 + \frac{2\pi i}{N} x p \right) = \exp\left( \frac{\pi i}{4}- \frac{\pi i p^2}{N}\right)
\end{eqnarray}
\begin{eqnarray}\label{eq:C27}
\begin{split}
&\frac{1}{N} \sum_{x,y\in \Z_N, x+y\in 2\Z} \exp\left(\frac{2\pi i}{2N} (x^2+y^2)\right) =
\begin{cases}
i, & N\in 4\Z\\
0, & N\in 4\Z+2
\end{cases}\\
&\frac{1}{N} \sum_{x,y\in \Z_N, x+y\in 2\Z+1} \exp\left(\frac{2\pi i}{2N} (x^2+y^2)\right) = \begin{cases}
0, & N\in 4\Z\\
i, & N\in 4\Z+2
\end{cases}
\end{split}
\end{eqnarray}

\paragraph{First Formula:}
We now prove the first of two summation formulas of interest. To motivate the first, we begin by considering the function
\begin{eqnarray}
f(a,b)= \frac{1}{N}\sum_{\substack{x\in \Z_N, y\in \Z_N\\ x+y\in 2\Z}} \exp\left( \frac{2\pi i}{N} \bigg( \frac{x^2+y^2}{2}- ax - by\bigg)\right)
\end{eqnarray}
where $N$ is an even number, and $a,b∈_N$.
Note that $f(a,b)$ is invariant under shifting $a,b$ by $N/2$ simultaneously, i.e.
\begin{eqnarray}\label{eq:ff}
f(a,b)= f\left(a+\frac{N}{2}, b+\frac{N}{2}\right)
\end{eqnarray}
which is guaranteed by $x+y∈2$ in the range of sum. To perform the sum, we complete the square and make a change of variable. Then $f(a,b)$ simplifies to
\begin{eqnarray}\label{eq:fff}
f(a,b)= \exp\left(- \frac{2\pi i}{2N} (a^2+b^2)\right) \frac{1}{N}\sum_{\substack{x\in \Z_N, y\in \Z_N\\ x+y+a+b\in 2\Z}} \exp\left( \frac{2\pi i}{2N} (x^2+y^2)\right)~.
\end{eqnarray}
The sum is invariant under the shift $(a,b)→(a+N/2, b+N/2)$, but the phase in  front is not. The phase transforms as
\begin{eqnarray}
\exp\left(- \frac{2\pi i}{2N} (a^2+b^2)\right) \to e^{- i \pi (a+b) - i \pi N/2}\exp\left(- \frac{2\pi i}{2N} (a^2+b^2)\right)~.
\end{eqnarray}
On the other hand, $f(a,b)$ satisfies \eqref{eq:ff}, and hence $f(a,b)=0$ whenever the phase $e^- i π(a+b) - i πN/2≠1$. In particular, this implies that $f(a,b)=0$ when $(N,a+b)∈(4, 2)$ and $(N,a+b)∈(4+2, 2+1)$. Further evaluating the summation \eqref{eq:fff} via \eqref{eq:C27}, we obtain
\begin{eqnarray}\label{eq:DFT2}
f(a,b)= \exp\left(-\frac{2\pi i}{2N} (a^2+b^2) + \frac{\pi i}{2}\right) \delta_{a+b+N/2\,\,\mathrm{mod}\,\,2}~.
\end{eqnarray}
Comparing this to \eqref{eq:DFT}, this is the generalized discrete Fourier transformation on a space with constraints.

We would like to generalize \eqref{eq:DFT2} so that the variables are the elements in $H_2(M_4,_N)$, and the product is replaced by the intersection pairing or the Poincar{\'e} dual of the Pontryagin square. Concretely, we are interested in evaluating the generalized discrete Fourier transformation
\begin{eqnarray}\label{eq:useful1}
\begin{split}
\frac{1}{|H_2(M_4,\Z_N)|}\sum_{\substack{\tau,\tau'\in H_2(M_4,\Z_N),\\ \tau+\tau'= 2\eta\in H_2(M_4,\Z_N)}} \exp\left(\frac{2\pi i}{2N} (\CP([\tau]) + \CP([\tau'])) -\frac{2\pi i}{N} (\braket{a,\sigma} + \braket{b,\tau})\right)~,
\end{split}
\end{eqnarray}
where $a,b∈H_2(M_4,_N)$, and $[τ]$ is the Poincar{\'e} dual of $τ$. The condition $τ+τ'= 2η∈H_2(M_4,_N)$ simply means that $τ+τ'$ is an even element in $H_2(M_4,_N)$, i.e. $τ+τ'$ is trivial when regarded as an element in $H_2(M_4,_2)$. The sum \eqref{eq:useful1} is invariant under the gauge transformation
\begin{eqnarray}
a\to a+ \frac{N}{2}\lambda, \hspace{1cm} b\to b+ \frac{N}{2}\lambda~,
\end{eqnarray}
and hence $(a,b)$ can be regarded as an element in $H_2(M_4,(_N×_N)/_2)$. Following the same discussion which lead to \eqref{eq:DFT2}, we can complete the square in \eqref{eq:useful1}, and find
\begin{equation}\label{eq:C36}
\begin{split}
\exp\left(-\frac{2\pi i}{2N}(\CP([a])+ \CP([b]))\right) \frac{1}{|H_2(M_4,\Z_N)|}\sum_{\substack{\tau,\tau'\in H_2(M_4,\Z_N),\\ \tau+\tau'+a+b= 2\eta\in H_2(M_4,\Z_N)}} \exp\left(\frac{2\pi i}{2N} (\CP([\tau]) + \CP([\tau'])) \right)~.
\end{split}
\end{equation}
The sum is gauge invariant, and defines an invertible TQFT $_Y(M_4)$ as follows,
\begin{equation}\label{eq:Euler4dNeven}
\begin{split}
\frac{1}{|H_2(M_4,\Z_N)|}\sum_{\substack{\tau,\tau'\in H_2(M_4,\Z_N),\\ \tau+\tau'= 2\eta\in H_2(M_4,\Z_N)}} \exp\left(\frac{2\pi i}{2N} (\CP([\tau]) + \CP([\tau'])) \right)=
\begin{cases}
\CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]~, & N\in 4\Z\\
0, & N\in 4\Z+2
\end{cases}
\\
\frac{1}{|H_2(M_4,\Z_N)|}\sum_{\substack{\tau,\tau'\in H_2(M_4,\Z_N),\\ \tau+\tau'+\xi= 2\eta\in H_2(M_4,\Z_N)}} \exp\left(\frac{2\pi i}{2N} (\CP([\tau]) + \CP([\tau'])) \right)=
\begin{cases}
0, & N\in 4\Z\\
\CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]~, & N\in 4\Z+2
\end{cases}
\\
\end{split}
\end{equation}
where $ξ$ is an generator of $H_2(M_4,_N)$, and the sum is independent of the choice of $ξ$. In particular, we can choose $ξ=[w_2^TM]2$.
The above formula is a generalization of \eqref{eq:C27} and is similar to $_Y$ for the odd $N$ case, c.f. \eqref{eq:Yfunc}. But the phase in \eqref{eq:C36}  is not gauge invariant. This enforces that \eqref{eq:useful1} vanishes for certain $(N,a,b)$. To find the vanishing condition, we perform the gauge transformation
\begin{equation}
\exp\left(-\frac{2\pi i}{2N}(\CP([a])+ \CP([b]))\right) \to e^{-\pi i \braket{a+b,\lambda} - \pi i \frac{N}{2} \braket{w_2^{TM}, \lambda}} \exp\left(-\frac{2\pi i}{2N}(\CP([a])+ \CP([b]))\right)~.
\end{equation}
Because $λ$ is arbitrary, we require $a+b+N/2w_2^TM$ to be a trivial element in $H_2(M_4,_2)$ for the sum \eqref{eq:useful1} to be nontrivial. In summary, the sum \eqref{eq:useful1} equals
\begin{equation}\label{eq:usefulresult1}
\begin{split}
\exp\left(-\frac{2\pi i}{2N}(\CP([a])+ \CP([b]))\right) \CZ_{Y}\left[M_4, \frac{\Z_N\times \Z_N}{\Z_2}\right] \delta_{a+b+\frac{N}{2}w_2^{TM}\,\,\mathrm{mod}\,\,2}~.
\end{split}
\end{equation}

\paragraph{Second Formula:}
We further consider the summation
\begin{eqnarray}
\frac{1}{N^2/4} \sum_{\substack{(x,y)\in (\Z_N\times \Z_N)/\Z_2,\\ x+y=0\mod 2}} \exp\left( \frac{2\pi i}{N} (-x a + y b)\right) \delta_{a+b\mod 2} = \delta_{a} \delta_{b}~.
\end{eqnarray}
Upgrading the summation variables to elements in homology, we find
\begin{equation}\label{eq:useful2}
\frac{|H_2(M_4,\Z_2)|^2}{|H_2(M_4,\Z_N)|^2} \sum_{\substack{(\tau,\tau')\in H_2(M_4,(\Z_N\times \Z_N)/\Z_2)\\ \tau+\tau'=0\mod 2}} \exp\left( \frac{2\pi i}{N} (-\braket{\tau', \sigma}+ \braket{\tau, \sigma'})\right) \delta_{\sigma+\sigma'\mod 2} = \delta_{\sigma}\delta_{\sigma'} ~.
\end{equation}

\subsubsection{Charge conjugation $C= D_{\text{EM}}^2$}

We now return to the evaluation of powers of $D_EM$. Taking the square of \eqref{eq:DEMevenN}, we obtain
\begin{equation}
\begin{split}
&C(M_4)= D_{\text{EM}}(M_4)^2 \\
&=  \frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^2}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|^2} \sum_{\substack{(\sigma, \sigma')\in \\ H_2(M_4, (\Z_N\times \Z_N)/\Z_2)}} \exp\left(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ \frac{N}{2}\braket{[w_2^{TM}], \sigma'})\right) \\& \hspace{1cm} \times S_{(1,-1)}(\sigma) S_{(1,1)}(\sigma')  \sum_{\substack{(\tau, \tau')\in \\ H_2(M_4, (\Z_N\times \Z_N)/\Z_2)}} \exp\bigg( \frac{2\pi i}{N} (\braket{\tau',\tau'}+ \braket{\tau,\tau}- \braket{\sigma+\sigma'+\frac{N}{2}[w_2^{TM}], \tau'} \\&\hspace{1cm}- \braket{\sigma-\sigma'+\frac{N}{2}[w_2^{TM}], \tau})\bigg)~.
\end{split}
\end{equation}
Summing over $(τ,τ')∈H_2(M_4, (_N×_N)/_2))$ can be reorganized as summing over $τ:=τ'+τ$ and $τ':=τ'-τ$ in $H_2(M_4, _N)$ respectively, but with the constraint $τ±τ'$ being an even element in $H_2(M_4,_N)$, or equivalently a trivial element in $H_2(M_4,_2)$. This gives
\begin{equation}
\begin{split}
&\sum_{\substack{(\tau, \tau')\in \\ H_2(M_4, (\Z_N\times \Z_N)/\Z_2)}} \exp\Bigg( \frac{2\pi i}{N}\bigg( \braket{\tau',\tau'}+ \braket{\tau,\tau}- \braket{\sigma+\sigma'+\frac{N}{2}[w_2^{TM}], \tau'} - \braket{\sigma-\sigma'+\frac{N}{2}[w_2^{TM}], \tau}\bigg)\Bigg)\\
&=\sum_{\substack{\widetilde{\tau}, \widetilde{\tau}'\in H_2(M_4, \Z_N)\\ \widetilde{\tau}+\widetilde{\tau}'=2\eta\in H_2(M_4,\Z_N)}}\exp\Bigg(\frac{2\pi i}{2N} (\CP([\widetilde{\tau}])+ \CP([\widetilde{\tau}']))  -\frac{2\pi i}{N}(\braket{\sigma+\frac{N}{2}[w_2^{TM}], \widetilde{\tau}}+\braket{\sigma', \widetilde{\tau}'})\Bigg)~.  \\
\end{split}
\end{equation}
In particular,  the gauge invariance under $(σ,σ')→(σ+N/2λ, σ'+ N/2λ)$ is manifest for the first line, and can be seen in the second line from the constraint in the summation domain $τ+τ'=2η∈H_2(M_4,_N)$.
The last expression is of precisely the form \eqref{eq:useful1}, where $(a,b)= (σ+N/2[w_2^TM], σ')$, and hence we can apply the result \eqref{eq:usefulresult1} here. The sum simplifies to
\begin{eqnarray}
|H_2(M_4,\Z_N)| \CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}] \exp\left( - \frac{2\pi i}{2N} (\CP([\sigma]+\frac{N}{2}w_2^{TM})+ \CP([\sigma']))\right) \delta_{\sigma+\sigma'\,\,\mathrm{mod}\,\,2}~.\no\\
\end{eqnarray}
Substituting the above calculations into the expression of $C(M_4)$, we get
\begin{equation}\label{eq:Ceven}
\begin{split}
&C(M_4)=  \frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^2 |H_2(M_4,\Z_N)|}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|^2} \CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]  \\& \hspace{2cm} \times \sum_{\substack{(\sigma, \sigma')\in  H_2(M_4, (\Z_N\times \Z_N)/\Z_2),\\ \sigma+\sigma' =0 \in H_2(M_4,\Z_2)}} \exp\bigg(\frac{2\pi i}{N} (\braket{\sigma', \sigma'} + \braket{\sigma, \sigma'}+ \frac{N}{2}\braket{[w_2^{TM}], \sigma'} \\&\hspace{2cm}-\frac{1}{2} \CP([\sigma]+ \frac{N}{2}w_2^{TM})-\frac{1}{2} \CP([\sigma']))\bigg)  S_{(1,-1)}(\sigma)S_{(1,1)}(\sigma') ~.
\end{split}
\end{equation}

\subsubsection{Invertibility of $D_{\text{EM}}$}
We finally show that $D_EM^4 = C^2$ is the identity up to an Euler counterterm and an invertible phase $_Y$. Taking the square of \eqref{eq:Ceven}, we find
\begin{equation}
\begin{split}
&D_{\text{EM}}(M_4)^4 = C(M_4)^2\\
&= \frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^4 |H_2(M_4,\Z_N)|^2}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|^4} \CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]^2 \\&\times \sum_{\substack{(\sigma, \sigma'),(\tau,\tau')\in \\ H_2(M_4, (\Z_N\times \Z_N)/\Z_2),\\ \sigma+\sigma', \tau+\tau'=0 \in\\ H_2(M_4,\Z_2)}} \exp\bigg(\frac{2\pi i}{N} (\frac{1}{2}\CP([\sigma'])- \frac{1}{2}\CP([\sigma])+ \braket{\sigma,\sigma'}- \frac{N}{2}\braket{\sigma-\sigma',[w_2^{TM}]}\\&- \frac{N^2}{4}\braket{[w_2^{TM}],[w_2^{TM}]}-\braket{\tau',\sigma}+ \braket{\tau,\sigma'})\bigg)    S_{(1,-1)}(\sigma)S_{(1,1)}(\sigma') ~.
\end{split}
\end{equation}
We further sum over $τ,τ'$ by applying the formula \eqref{eq:useful2}, which constrains $σ,σ'$ to be trivial provided $σ+σ'=02$. Hence the above expression simplifies to
\begin{equation}
\begin{split}
&D_{\text{EM}}(M_4)^4 = C(M_4)^2\\
&= \frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^4 |H_2(M_4,\Z_N)|^2}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|^4} \CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]^2 \frac{|H_2(M_4,\Z_N)|^2}{|H_2(M_4,\Z_2)|^2}\\
&=\frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^4 |H^2(M_4,(\Z_N\times \Z_N)/\Z_2)|^2}{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|^4}\CZ_{Y}[M_4, \frac{\Z_N\times \Z_N}{\Z_2}]^2 \\
&= \chi\left[M_4, \frac{\Z_N\times \Z_N}{\Z_2}\right]^2 \CZ_{Y}\left[M_4, \frac{\Z_N\times \Z_N}{\Z_2}\right]^2~.
\end{split}
\end{equation}

\subsubsection{Summary of algebra of co-dimension one}

We close by summarizing the algebra involving the $D_EM$ defect. Noting that the orientation reversal of $D_EM$ is
\begin{equation}\label{eq:orientationN>4}
\begin{split}
\overline{D}_{\text{EM}}(M_4)& = \chi[M_4,(\Z_N\times \Z_N)/\Z_2]^{-1}
\frac{|H^0(M_4, (\Z_N\times \Z_N)/\Z_2)|}{|H^1(M_4, (\Z_N\times \Z_N)/\Z_2))|}\times \\&\sum_{(\sigma, \sigma')\in H_2(M_4, (\Z_N\times \Z_N)/\Z_2)} \exp\left(-\frac{2\pi i}{N}  \braket{\sigma, \sigma'}\right) S_{(1,1)}(\sigma') S_{(0,-1)}(\sigma+\frac{N}{2}[w_2^{TM}])  S_{(1,0)}(\sigma)~,
\end{split}
\end{equation}
we have
\begin{eqnarray}
\begin{split}
&C(M_4)= D_{\text{EM}}(M_4)^2~,\\
& D_{\text{EM}}(M_4)^4= \chi[M_4, (\Z_N\times \Z_N)/\Z_2]^2 \CZ_{Y}[M_4, (\Z_N\times \Z_N)/\Z_2]^2~,\\
& \overline{D}_{\text{EM}}(M_4)\times D_{\text{EM}}(M_4)=1~,\\
& \overline{D}_{\text{EM}}(M_4)=\chi[M_4, (\Z_N\times \Z_N)/\Z_2]^{-2} \CZ_{Y}[M_4, (\Z_N\times \Z_N)/\Z_2]^{-2} C(M_4) D_{\text{EM}}(M_4)^2~.
\end{split}
\end{eqnarray}

\section{More on $\widehat S_{\{N/2,0\}}$}
\label{app.absorbK}

Given an operator $𝒪$ invariant under a symmetry $G$, upon gauging $G$ we may get a series of operators $𝒪$ transforming in representations of the quantum dual $G$.
In this final appendix, we discuss how to assign representations of subgroups of the quantum symmetry $G$ to operators $𝒪$ descending from $𝒪$ that are invariant under only a subgroup $H ⊂G$. We will focus only on the case of interest to us in this paper, namely $G= _4^EM$, $H = _2^EM$, and the operator $O = S_{N/2,0}$.

Recall from the discussion in Section \ref{sec:5dtopops} that, unlike the surface $S_(N/2,N/2)$ which is invariant under $_4^EM$, or the surface $S_[e,m]$ whose constituents are not invariant under any subgroup of $_4^EM$, the constituents of $S_{N/2,0}$ are invariant under a $_2^EM$ subgroup of $_4^EM$. That is, under $(e,m) →(-e,-m)$ we see that both $S_(N/2,0)$ and $S_(0,N/2)$ are left unchanged. This means that $S_[e,m]$ can be assigned a representation of the quantum $_2^EM⊂_4^EM$, and hence that the identity line in $S_[e,m]$ carries a two-fold index, i.e. $ℑ_1^p(S_[e,m])$ for $p = 0,1$.

Physically, the statement is that the bare identity line $ℑ_1^0(S_{N/2,0})$ cannot absorb a single copy of $K$, and hence when stacked with $K$ gives a distinct line $ℑ_1^1(S_{N/2,0})$. However, it \textit{can} absorb $K^2$, and hence there are no other distinct lines generated in this way. To see how these statements arise, let us focus on the global fusion. We first consider coincident loops of $ℑ_1^0(S_{N/2,0})$ and $K$, and ask whether this configuration can be distinguished from a loop of $ℑ_1^0(S_{N/2,0})$ in isolation (c.f. Figure \ref{fig:LemabsorbK} and the discussion surrounding it). A loop of $K$ gives a non-trivial contribution to correlation functions if and only if it links with $n$ units of EM flux, with $n$ non-zero modulo 4. If $n=1,3$, then $K$ gives a non-trivial result, but the loop of $ℑ_1^0(S_{N/2,0})$ evaluates to zero since the constituent lines $ℑ_1^0(S_(N/2,0))$ and $ℑ_1^0(S_(0,N/2))$ (which are not lines in the EM-gauged theory, but which do exist in the pregauged theory) are not invariant under the primitive generator of $_4^EM$. Hence in the presence of $n=1,3$ units of EM flux, one cannot distinguish the configurations with $ℑ_1^0(S_{N/2,0})$ stacked with $K$ from the configuration with $ℑ_1^0(S_{N/2,0})$ in isolation. However, if we consider the case of $n=2$ units of EM flux, then the loop of $K$ is again non-trivial, but now $ℑ_1^0(S_(0,N/2))$ does not evaluate to zero since the constituent lines $ℑ_1^0(S_(N/2,0))$ and $ℑ_1^0(S_(0,N/2))$ are invariant under $_2^EM ⊂_4^EM$. Thus by considering the configuration with $n=2$ units of EM flux, one \textit{can} distinguish between the configurations with $ℑ_1^0(S_{N/2,0})$ stacked with $K$ and with $ℑ_1^0(S_{N/2,0})$ in isolation. In other words, $ℑ_1^0(S_{N/2,0})$ cannot absorb $K$.

We may now ask whether $ℑ_1^0(S_{N/2,0})$ can absorb $K^2$. As before, we consider coincident loops of $ℑ_1^0(S_{N/2,0})$ and $K^2$, and ask whether this configuration can be distinguished from a loop of $ℑ_1^0(S_{N/2,0})$ in isolation. The main difference from before is that the loop of $K^2$ gives a non-trivial result only in the presence of an \textit{odd} number of units of EM flux. However, as we have argued before, in the presence of an odd number of units of EM flux, the loop of $ℑ_1^0(S_{N/2,0})$ evaluates to zero. Hence $ℑ_1^0(S_{N/2,0})$ can absorb $K^2$.

\newpage

\bibliographystyle{ytphys}
\baselineskip=.95\baselineskip
\providecommand{\href}[2]{#2}\begingroup\raggedright\begin{thebibliography}{10}

[1]
E.~Verlinde, ``Fusion rules and modular transformations in 2d conformal field
theory,'' {\em Nuclear Physics B} {\bfseries 300} (1988) 360--376.

[2]
V.~B. Petkova and J.~B. Zuber, ``{Generalized twisted partition functions},''
\href{http://dx.doi.org/10.1016/S0370-2693(01)00276-3}{{\em Phys. Lett. B}
{\bfseries 504} (2001) 157--164},
\href{http://arxiv.org/abs/hep-th/0011021}{{\ttfamily arXiv:hep-th/0011021}}.

[3]
J.~Fuchs, I.~Runkel, and C.~Schweigert, ``{TFT construction of RCFT correlators
1. Partition functions},''
\href{http://dx.doi.org/10.1016/S0550-3213(02)00744-7}{{\em Nucl. Phys. B}
{\bfseries 646} (2002) 353--497},
\href{http://arxiv.org/abs/hep-th/0204148}{{\ttfamily arXiv:hep-th/0204148}}.

[4]
L.~Bhardwaj and Y.~Tachikawa, ``{On finite symmetries and their gauging in two
dimensions},'' \href{http://dx.doi.org/10.1007/JHEP03(2018)189}{{\em JHEP}
{\bfseries 03} (2018) 189}, \href{http://arxiv.org/abs/1704.02330}{{\ttfamily
arXiv:1704.02330 [hep-th]}}.

[5]
C.-M. Chang, Y.-H. Lin, S.-H. Shao, Y.~Wang, and X.~Yin, ``{Topological Defect
Lines and Renormalization Group Flows in Two Dimensions},''
\href{http://dx.doi.org/10.1007/JHEP01(2019)026}{{\em JHEP} {\bfseries 01}
(2019) 026}, \href{http://arxiv.org/abs/1802.04445}{{\ttfamily
arXiv:1802.04445 [hep-th]}}.

[6]
Y.-H. Lin, M.~Okada, S.~Seifnashri, and Y.~Tachikawa, ``{Asymptotic density of
states in 2d CFTs with non-invertible symmetries},''
\href{http://arxiv.org/abs/2208.05495}{{\ttfamily arXiv:2208.05495

[7]
Z.~Komargodski, K.~Ohmori, K.~Roumpedakis, and S.~Seifnashri, ``{Symmetries and
strings of adjoint QCD$_{2}$},''
\href{http://dx.doi.org/10.1007/JHEP03(2021)103}{{\em JHEP} {\bfseries 03}
(2021) 103}, \href{http://arxiv.org/abs/2008.07567}{{\ttfamily
arXiv:2008.07567 [hep-th]}}.

[8]
Y.~Tachikawa, ``{On gauging finite subgroups},''
\href{http://dx.doi.org/10.21468/SciPostPhys.8.1.015}{{\em SciPost Phys.}
{\bfseries 8} no.~1, (2020) 015},
\href{http://arxiv.org/abs/1712.09542}{{\ttfamily arXiv:1712.09542

[9]
J.~Frohlich, J.~Fuchs, I.~Runkel, and C.~Schweigert, ``{Kramers-Wannier duality
from conformal defects},''
\href{http://dx.doi.org/10.1103/PhysRevLett.93.070601}{{\em Phys. Rev. Lett.}
{\bfseries 93} (2004) 070601},
\href{http://arxiv.org/abs/cond-mat/0404051}{{\ttfamily

[10]
J.~Frohlich, J.~Fuchs, I.~Runkel, and C.~Schweigert, ``{Duality and defects in
rational conformal field theory},''
\href{http://dx.doi.org/10.1016/j.nuclphysb.2006.11.017}{{\em Nucl. Phys. B}
{\bfseries 763} (2007) 354--430},
\href{http://arxiv.org/abs/hep-th/0607247}{{\ttfamily arXiv:hep-th/0607247}}.

[11]
J.~Frohlich, J.~Fuchs, I.~Runkel, and C.~Schweigert,
\href{http://dx.doi.org/10.1142/9789814304634_0056}{``{Defect lines,
dualities, and generalised orbifolds},''} in {\em {16th International
Congress on Mathematical Physics}}.
\newblock 9, 2009.
\newblock \href{http://arxiv.org/abs/0909.5013}{{\ttfamily arXiv:0909.5013

[12]
N.~Carqueville and I.~Runkel, ``{Orbifold completion of defect bicategories},''
\href{http://dx.doi.org/10.4171/qt/76}{{\em Quantum Topol.} {\bfseries 7}
no.~2, (2016) 203--279}, \href{http://arxiv.org/abs/1210.6363}{{\ttfamily
arXiv:1210.6363 [math.QA]}}.

[13]
I.~Brunner, N.~Carqueville, and D.~Plencner, ``{A quick guide to defect
orbifolds},'' \href{http://dx.doi.org/10.1090/pspum/088/01456}{{\em Proc.
Symp. Pure Math.} {\bfseries 88} (2014) 231--242},
\href{http://arxiv.org/abs/1310.0062}{{\ttfamily arXiv:1310.0062 [hep-th]}}.

[14]
T.-C. Huang, Y.-H. Lin, and S.~Seifnashri, ``{Construction of two-dimensional
topological field theories with non-invertible symmetries},''
\href{http://dx.doi.org/10.1007/JHEP12(2021)028}{{\em JHEP} {\bfseries 12}
(2021) 028}, \href{http://arxiv.org/abs/2110.02958}{{\ttfamily
arXiv:2110.02958 [hep-th]}}.

[15]
R.~Thorngren and Y.~Wang, ``{Fusion Category Symmetry I: Anomaly In-Flow and
Gapped Phases},'' \href{http://arxiv.org/abs/1912.02817}{{\ttfamily
arXiv:1912.02817 [hep-th]}}.

[16]
R.~Thorngren and Y.~Wang, ``{Fusion Category Symmetry II: Categoriosities at
$c$ = 1 and Beyond},'' \href{http://arxiv.org/abs/2106.12577}{{\ttfamily
arXiv:2106.12577 [hep-th]}}.

[17]
L.~Lootens, C.~Delcamp, G.~Ortiz, and F.~Verstraete, ``{Dualities in
one-dimensional quantum lattice models: symmetric Hamiltonians and matrix
product operator intertwiners},''
\href{http://arxiv.org/abs/2112.09091}{{\ttfamily arXiv:2112.09091

[18]
T.-C. Huang, Y.-H. Lin, K.~Ohmori, Y.~Tachikawa, and M.~Tezuka, ``{Numerical
Evidence for a Haagerup Conformal Field Theory},''
\href{http://dx.doi.org/10.1103/PhysRevLett.128.231603}{{\em Phys. Rev.
Lett.} {\bfseries 128} no.~23, (2022) 231603},
\href{http://arxiv.org/abs/2110.03008}{{\ttfamily arXiv:2110.03008

[19]
K.~Inamura, ``{Fermionization of fusion category symmetries in 1+1
dimensions},'' \href{http://arxiv.org/abs/2206.13159}{{\ttfamily
arXiv:2206.13159 [cond-mat.str-el]}}.

[20]
J.~Kaidi, K.~Ohmori, and Y.~Zheng, ``{Kramers-Wannier-like duality defects in
(3+1)d gauge theories},'' \href{http://arxiv.org/abs/2111.01141}{{\ttfamily
arXiv:2111.01141 [hep-th]}}.

[21]
Y.~Choi, C.~Cordova, P.-S. Hsin, H.~T. Lam, and S.-H. Shao, ``{Non-Invertible
Duality Defects in 3+1 Dimensions},''
\href{http://arxiv.org/abs/2111.01139}{{\ttfamily arXiv:2111.01139

[22]
M.~Koide, Y.~Nagoya, and S.~Yamaguchi, ``{Non-invertible topological defects in
4-dimensional $\mathbb{Z}_2$ pure lattice gauge theory},''
\href{http://arxiv.org/abs/2109.05992}{{\ttfamily arXiv:2109.05992

[23]
Y.~Choi, C.~Cordova, P.-S. Hsin, H.~T. Lam, and S.-H. Shao, ``{Non-invertible
Condensation, Duality, and Triality Defects in 3+1 Dimensions},''
\href{http://arxiv.org/abs/2204.09025}{{\ttfamily arXiv:2204.09025

[24]
Y.~Hayashi and Y.~Tanizaki, ``{Non-invertible self-duality defects of
Cardy-Rabinovici model and mixed gravitational anomaly},''
\href{http://arxiv.org/abs/2204.07440}{{\ttfamily arXiv:2204.07440

[25]
G.~Arias-Tamargo and D.~Rodriguez-Gomez, ``{Non-Invertible Symmetries from
Discrete Gauging and Completeness of the Spectrum},''
\href{http://arxiv.org/abs/2204.07523}{{\ttfamily arXiv:2204.07523

[26]
K.~Roumpedakis, S.~Seifnashri, and S.-H. Shao, ``{Higher Gauging and
Non-invertible Condensation Defects},''
\href{http://arxiv.org/abs/2204.02407}{{\ttfamily arXiv:2204.02407

[27]
L.~Bhardwaj, L.~Bottini, S.~Schafer-Nameki, and A.~Tiwari, ``{Non-Invertible
Higher-Categorical Symmetries},''
\href{http://arxiv.org/abs/2204.06564}{{\ttfamily arXiv:2204.06564

[28]
J.~Kaidi, G.~Zafrir, and Y.~Zheng, ``{Non-Invertible Symmetries of
$\mathcal{N}=4$ SYM and Twisted Compactification},''
\href{http://arxiv.org/abs/2205.01104}{{\ttfamily arXiv:2205.01104

[29]
Y.~Choi, H.~T. Lam, and S.-H. Shao, ``{Non-invertible Global Symmetries in the
Standard Model},'' \href{http://arxiv.org/abs/2205.05086}{{\ttfamily
arXiv:2205.05086 [hep-th]}}.

[30]
C.~Cordova and K.~Ohmori, ``{Non-Invertible Chiral Symmetry and Exponential
Hierarchies},'' \href{http://arxiv.org/abs/2205.06243}{{\ttfamily
arXiv:2205.06243 [hep-th]}}.

[31]
A.~Antinucci, G.~Galati, and G.~Rizi, ``{On Continuous 2-Category Symmetries
and Yang-Mills Theory},'' \href{http://arxiv.org/abs/2206.05646}{{\ttfamily
arXiv:2206.05646 [hep-th]}}.

[32]
V.~Bashmakov, M.~Del~Zotto, and A.~Hasan, ``{On the 6d Origin of Non-invertible
Symmetries in 4d},'' \href{http://arxiv.org/abs/2206.07073}{{\ttfamily
arXiv:2206.07073 [hep-th]}}.

[33]
J.~A. Damia, R.~Argurio, and L.~Tizzano, ``{Continuous Generalized Symmetries
in Three Dimensions},'' \href{http://arxiv.org/abs/2206.14093}{{\ttfamily
arXiv:2206.14093 [hep-th]}}.

[34]
J.~A. Damia, R.~Argurio, and E.~Garcia-Valdecasas, ``{Non-Invertible Defects in
5d, Boundaries and Holography},''
\href{http://arxiv.org/abs/2207.02831}{{\ttfamily arXiv:2207.02831

[35]
Y.~Choi, H.~T. Lam, and S.-H. Shao, ``{Non-invertible Time-reversal
Symmetry},'' \href{http://arxiv.org/abs/2208.04331}{{\ttfamily
arXiv:2208.04331 [hep-th]}}.

[36]
D.-C. Lu and Z.~Sun, ``{On Triality Defects in 2d CFT},''
\href{http://arxiv.org/abs/2208.06077}{{\ttfamily arXiv:2208.06077

[37]
L.~Bhardwaj, S.~Schafer-Nameki, and J.~Wu, ``{Universal Non-Invertible
Symmetries},'' \href{http://arxiv.org/abs/2208.05973}{{\ttfamily
arXiv:2208.05973 [hep-th]}}.

[38]
L.~Lin, D.~G. Robbins, and E.~Sharpe, ``{Decomposition, condensation defects,
and fusion},'' \href{http://arxiv.org/abs/2208.05982}{{\ttfamily
arXiv:2208.05982 [hep-th]}}.

[39]
T.~Bartsch, M.~Bullimore, A.~E.~V. Ferrari, and J.~Pearson, ``{Non-invertible
Symmetries and Higher Representation Theory I},''
\href{http://arxiv.org/abs/2208.05993}{{\ttfamily arXiv:2208.05993

[40]
F.~Apruzzi, I.~Bah, F.~Bonetti, and S.~Schafer-Nameki, ``{Non-Invertible
Symmetries from Holography and Branes},''
\href{http://arxiv.org/abs/2208.07373}{{\ttfamily arXiv:2208.07373

[41]
I.~n. Garc\'\i{}a~Etxebarria, ``{Branes and Non-Invertible Symmetries},''
\href{http://arxiv.org/abs/2208.07508}{{\ttfamily arXiv:2208.07508

[42]
F.~Benini, C.~Copetti, and L.~Di~Pietro, ``{Factorization and global symmetries
in holography},'' \href{http://arxiv.org/abs/2203.09537}{{\ttfamily
arXiv:2203.09537 [hep-th]}}.

[43]
J.~Wang and Y.-Z. You, ``{Gauge Enhanced Quantum Criticality Between Grand
Unifications: Categorical Higher Symmetry Retraction},''
\href{http://arxiv.org/abs/2111.10369}{{\ttfamily arXiv:2111.10369

[44]
X.~Chen, A.~Dua, P.-S. Hsin, C.-M. Jian, W.~Shirley, and C.~Xu, ``{Loops in
4+1d Topological Phases},'' \href{http://arxiv.org/abs/2112.02137}{{\ttfamily
arXiv:2112.02137 [cond-mat.str-el]}}.

[45]
M.~Del~Zotto and I.~n. Garc\'\i{}a~Etxebarria, ``{Global Structures from the
Infrared},'' \href{http://arxiv.org/abs/2204.06495}{{\ttfamily
arXiv:2204.06495 [hep-th]}}.

[46]
J.~J. Heckman, M.~H\"ubner, E.~Torres, and H.~Y. Zhang, ``{The Branes Behind
Generalized Symmetry Operators},''
\href{http://arxiv.org/abs/2209.03343}{{\ttfamily arXiv:2209.03343

[47]
M.~Nguyen, Y.~Tanizaki, and M.~\"Unsal, ``{Semi-Abelian gauge theories,
non-invertible symmetries, and string tensions beyond $N$-ality},''
\href{http://dx.doi.org/10.1007/JHEP03(2021)238}{{\em JHEP} {\bfseries 03}
(2021) 238}, \href{http://arxiv.org/abs/2101.02227}{{\ttfamily
arXiv:2101.02227 [hep-th]}}.

[48]
D.~S. Freed and C.~Teleman, ``{Relative quantum field theory},''
\href{http://dx.doi.org/10.1007/s00220-013-1880-1}{{\em Commun. Math. Phys.}
{\bfseries 326} (2014) 459--476},
\href{http://arxiv.org/abs/1212.1692}{{\ttfamily arXiv:1212.1692 [hep-th]}}.

[49]
D.~S. Freed and C.~Teleman, ``{Topological dualities in the Ising model},''
\href{http://arxiv.org/abs/1806.00008}{{\ttfamily arXiv:1806.00008

[50]
D.~Gaiotto and J.~Kulp, ``{Orbifold groupoids},''
\href{http://dx.doi.org/10.1007/JHEP02(2021)132}{{\em JHEP} {\bfseries 02}
(2021) 132}, \href{http://arxiv.org/abs/2008.05960}{{\ttfamily
arXiv:2008.05960 [hep-th]}}.

[51]
F.~Apruzzi, F.~Bonetti, I.~n.~G. Etxebarria, S.~S. Hosseini, and
S.~Schafer-Nameki, ``{Symmetry TFTs from String Theory},''
\href{http://arxiv.org/abs/2112.02092}{{\ttfamily arXiv:2112.02092

[52]
F.~Apruzzi, ``{Higher Form Symmetries TFT in 6d},''
\href{http://arxiv.org/abs/2203.10063}{{\ttfamily arXiv:2203.10063

[53]
I.~M. Burbano, J.~Kulp, and J.~Neuser, ``{Duality Defects in $E_8$},''
\href{http://arxiv.org/abs/2112.14323}{{\ttfamily arXiv:2112.14323

[54]
D.~S. Freed, G.~W. Moore, and C.~Teleman, ``{Topological symmetry in quantum
field theory},'' \href{http://arxiv.org/abs/2209.07471}{{\ttfamily
arXiv:2209.07471 [hep-th]}}.

[55]
W.~Ji and X.-G. Wen, ``{Categorical symmetry and noninvertible anomaly in
symmetry-breaking and topological phase transitions},''
\href{http://dx.doi.org/10.1103/PhysRevResearch.2.033417}{{\em Phys. Rev.
Res.} {\bfseries 2} no.~3, (2020) 033417},
\href{http://arxiv.org/abs/1912.13492}{{\ttfamily arXiv:1912.13492

[56]
L.~Kong, T.~Lan, X.-G. Wen, Z.-H. Zhang, and H.~Zheng, ``{Algebraic higher
symmetry and categorical symmetry -- a holographic and entanglement view of
symmetry},'' \href{http://dx.doi.org/10.1103/PhysRevResearch.2.043086}{{\em
Phys. Rev. Res.} {\bfseries 2} no.~4, (2020) 043086},
\href{http://arxiv.org/abs/2005.14178}{{\ttfamily arXiv:2005.14178

[57]
W.~Ji and X.-G. Wen, ``{A unified view on symmetry, anomalous symmetry and
non-invertible gravitational anomaly},''
\href{http://arxiv.org/abs/2106.02069}{{\ttfamily arXiv:2106.02069

[58]
A.~Chatterjee and X.-G. Wen, ``{Algebra of local symmetric operators and
braided fusion $n$-category -- symmetry is a shadow of topological order},''
\href{http://arxiv.org/abs/2203.03596}{{\ttfamily arXiv:2203.03596

[59]
A.~Chatterjee and X.-G. Wen, ``{Holographic theory for the emergence and the
symmetry protection of gaplessness and for continuous phase transitions},''
\href{http://arxiv.org/abs/2205.06244}{{\ttfamily arXiv:2205.06244

[60]
H.~Moradi, S.~F. Moosavian, and A.~Tiwari, ``{Topological holography: Towards a
unification of Landau and beyond-Landau physics},''
\href{http://arxiv.org/abs/2207.10712}{{\ttfamily arXiv:2207.10712

[61]
D.~S. Freed and M.~J. Hopkins, ``{Reflection positivity and invertible
topological phases},'' \href{http://dx.doi.org/10.2140/gt.2021.25.1165}{{\em
Geom. Topol.} {\bfseries 25} (2021) 1165--1330},
\href{http://arxiv.org/abs/1604.06527}{{\ttfamily arXiv:1604.06527

[62]
A.~Kirillov and B.~Balsam, ``Turaev-viro invariants as an extended tqft,''
\newblock \url{https://arxiv.org/abs/1004.1533}.

[63]
M.~Izumi, ``The structure of sectors associated with longo--rehren inclusions
ii: examples,'' {\em Reviews in Mathematical Physics} {\bfseries 13} no.~05,
(2001) 603--674.

[64]
S.~Gelaki, D.~Naidu, and D.~Nikshych, ``Centers of graded fusion categories.
algebra number theory, 3 (8): 959--990,'' {\em arXiv preprint
arXiv:0905.3117} (2009) .

[65]
M.~Barkeshli, P.~Bonderson, M.~Cheng, and Z.~Wang, ``{Symmetry
Fractionalization, Defects, and Gauging of Topological Phases},''
\href{http://dx.doi.org/10.1103/PhysRevB.100.115147}{{\em Phys. Rev. B}
{\bfseries 100} no.~11, (2019) 115147},
\href{http://arxiv.org/abs/1410.4540}{{\ttfamily arXiv:1410.4540

[66]
J.~C.~Y. {Teo}, T.~L. {Hughes}, and E.~{Fradkin}, ``{Theory of Twist Liquids:
Gauging an Anyonic Symmetry},'' {\em arXiv e-prints} (Mar., 2015)
arXiv:1503.06812, \href{http://arxiv.org/abs/1503.06812}{{\ttfamily
arXiv:1503.06812 [cond-mat.str-el]}}.

[67]
T.~Dimofte, D.~Gaiotto, and R.~van~der Veen, ``{RG Domain Walls and Hybrid
Triangulations},'' \href{http://dx.doi.org/10.4310/ATMP.2015.v19.n1.a2}{{\em
Adv. Theor. Math. Phys.} {\bfseries 19} (2015) 137--276},
\href{http://arxiv.org/abs/1304.6721}{{\ttfamily arXiv:1304.6721 [hep-th]}}.

[68]
D.~Gaiotto and H.-C. Kim, ``{Duality walls and defects in 5d $ \mathcal{N}=1 $
theories},'' \href{http://dx.doi.org/10.1007/JHEP01(2017)019}{{\em JHEP}
{\bfseries 01} (2017) 019}, \href{http://arxiv.org/abs/1506.03871}{{\ttfamily
arXiv:1506.03871 [hep-th]}}.

[69]
T.~Dimofte, D.~Gaiotto, and N.~M. Paquette, ``Dual boundary conditions in 3d
scft?s,'' {\em Journal of High Energy Physics} {\bfseries 2018} no.~5, (2018)

[70]
D.~Gaiotto, A.~Kapustin, N.~Seiberg, and B.~Willett, ``{Generalized Global
Symmetries},'' \href{http://dx.doi.org/10.1007/JHEP02(2015)172}{{\em JHEP}
{\bfseries 02} (2015) 172}, \href{http://arxiv.org/abs/1412.5148}{{\ttfamily
arXiv:1412.5148 [hep-th]}}.

[71]
J.~Fuchs, C.~Schweigert, and A.~Valentino, ``{Bicategories for boundary
conditions and for surface defects in 3-d TFT},''
\href{http://dx.doi.org/10.1007/s00220-013-1723-0}{{\em Commun. Math. Phys.}
{\bfseries 321} (2013) 543--575},
\href{http://arxiv.org/abs/1203.4568}{{\ttfamily arXiv:1203.4568 [hep-th]}}.

[72]
F.~Benini, C.~C\'ordova, and P.-S. Hsin, ``{On 2-Group Global Symmetries and
their Anomalies},'' \href{http://dx.doi.org/10.1007/JHEP03(2019)118}{{\em
JHEP} {\bfseries 03} (2019) 118},
\href{http://arxiv.org/abs/1803.09336}{{\ttfamily arXiv:1803.09336

[73]
T.~Johnson-Freyd and D.~Reutter, ``{Minimal nondegenerate extensions},''
\href{http://arxiv.org/abs/2105.15167}{{\ttfamily arXiv:2105.15167

[74]
D.~Reutter, ``Higher s-matrices and higher modular categories.'' Talk at Global
Categorical Symmetries Conference 2022, https://pirsa.org/22060017.

[75]
Y.~Hu, Y.~Wan, and Y.-S. Wu, ``{Twisted quantum double model of topological
phases in two dimensions},''
\href{http://dx.doi.org/10.1103/PhysRevB.87.125114}{{\em Phys. Rev. B}
{\bfseries 87} no.~12, (2013) 125114},
\href{http://arxiv.org/abs/1211.3695}{{\ttfamily arXiv:1211.3695

[76]
R.~Dijkgraaf and E.~Witten, ``{Topological Gauge Theories and Group
Cohomology},'' \href{http://dx.doi.org/10.1007/BF02096988}{{\em Commun. Math.
Phys.} {\bfseries 129} (1990) 393}.

[77]
M.~D.~F. de~Wild~Propitius, {\em {Topological interactions in broken gauge
\newblock PhD thesis, Amsterdam U., 1995.
\newblock \href{http://arxiv.org/abs/hep-th/9511195}{{\ttfamily

[78]
H.~He, Y.~Zheng, and C.~von Keyserlingk, ``{Field theories for gauged
symmetry-protected topological phases: Non-Abelian anyons with Abelian gauge
group $\mathbb Z_2^{\otimes 3}$},''
\href{http://dx.doi.org/10.1103/PhysRevB.95.035131}{{\em Phys. Rev. B}
{\bfseries 95} no.~3, (2017) 035131},
\href{http://arxiv.org/abs/1608.05393}{{\ttfamily arXiv:1608.05393

[79]
E.~P. Verlinde, ``{Fusion Rules and Modular Transformations in 2D Conformal
Field Theory},'' \href{http://dx.doi.org/10.1016/0550-3213(88)90603-7}{{\em
Nucl. Phys. B} {\bfseries 300} (1988) 360--376}.

\end{thebibliography}\endgroup

\end{document}]