diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzzcnqs" "b/data_all_eng_slimpj/shuffled/split2/finalzzcnqs" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzzcnqs" @@ -0,0 +1,5 @@ +{"text":"\\section{Introduction}\nLet $C_n$ be the hypercube in dimension $n$. The vertex set of $C_n$ is $\\{0,1\\}^n$, and two vertices are adjacent if they differ on one coordinate. It is known that the number of spanning trees of $C_n$ is \n\\begin{equation}\\label{eq:spanning-cube}\nT(C_n)=\\frac{1}{2^n}\\prod_{i=1}^n(2i)^{n \\choose i}.\n\\end{equation}\nThis formula can be obtained by using the matrix-tree theorem and then determining the eigenvalues of the Laplacian of the hypercube. This, in turns, can be done either using the representation theory of Abelian groups (applied to the group $(\\ZZ\/2\\ZZ)^n$)~\\cite[chapter 5]{Stanley:vol2}, or by guessing and checking a set of eigenvectors~\\cite{Martin-Reiner:spanning-cube}. We will give two combinatorial proofs of this result, thereby answering an open problem mentioned for instance in~\\cite[pp. 62]{Stanley:vol2} and~\\cite{Hurlbert:spanning-trees} (the case $n=3$ was actually solved in \\cite{Tuffley:spanning-3-cube} by a method different from ours).\n\n\n\n\nWe shall discuss refinements and generalizations of~\\eqref{eq:spanning-cube} which are best stated in terms of rooted (spanning) forests. A \\emph{rooted forest} of a graph $G$ is a subgraph containing every vertex such that each connected component is a tree with a vertex marked as the \\emph{root vertex} of that tree. Given a rooted forest, we consider its edges as oriented in such a way that every tree is directed toward its root vertex (equivalently, every non-root vertex has one outgoing edge in $F$); see Figure~\\ref{fig:cube-with-diagonals}.\nWe say that an oriented edge $e=(u,v)$ of the hypercube $C_n$ has \\emph{direction} $i\\in[n]$ and \\emph{spin} $\\eps\\in\\{0,1\\}$ if the vertex $v$ is obtained from $u$ by changing the $i$th coordinate from $1-\\eps$ to $\\eps$. We denote $\\dir(e)$ and $\\spin(e)$ the direction and spin of the oriented edge $e$. We then define a generating function in the variables $t$ and $\\xx=(x_{1,0},x_{1,1},\\ldots,x_{n,0},x_{n,1})$ for the rooted forests of the hypercube $C_n$ as follows:\n\\begin{equation}\\label{def:enumeratorCn}\nF_{C_n}(t;\\xx):=\\sum_{F\\textrm{ rooted forest of } C_n}t^{\\#\\textrm{trees in } F}\\prod_{e\\in F} x_{\\dir(e),\\spin(e)}.\n\\end{equation}\nWe shall give two combinatorial proofs of the following result:\n\\begin{equation}\\label{eq:spanning-cube-2}\nF_{C_n}(t;\\xx)=\\prod_{S\\subseteq [n]}\\left(t+\\sum_{i\\in S} x_{i,0}+x_{i,1}\\right).\n\\end{equation}\nNote that the generating function of rooted spanning trees of $C_n$ is simply obtained by extracting the terms which are linear in $t$ in $F_{C_n}(t;\\xx)$, so that~\\eqref{eq:spanning-cube-2} gives a refinement of~\\eqref{eq:spanning-cube}. This refinement was first proved by Martin and Reiner in~\\cite{Martin-Reiner:spanning-cube} (in a slightly different form; see Section~\\ref{sec:conclusion}) using a matrix-tree method. Using a similar method we shall give a generalization of~\\eqref{eq:spanning-cube-2} valid for Cartesian products of complete graphs. However, the main goal of the present article is rather to investigate the combinatorial properties of the rooted forests of the hypercube suggested by~\\eqref{eq:spanning-cube-2}\n\n\\fig{width=.7\\linewidth}{cube-with-diagonals}{A rooted forest of the cube $C_3$ (left) and of the cube augmented with its main diagonals $D_3$ (right). The root vertices are indicated by large dots.} \n\n\nIn Section~\\ref{sec:bunkbed}, we prove a surprising \\emph{independence} property for the spins of the parallel edges of a random rooted forest of $C_n$. More precisely, we show that for a uniformly random rooted forest conditioned to have exactly $k$ trees and to contain a given set of edges in direction $n$, the spins of these edges are \\emph{independent} and uniform. This property is illustrated in Figure~\\ref{fig:example-bunkbed-lemma}.\nThe independence of the spins remains true when conditioning the forest to have a given number $n_{i,\\eps}$ of edges with direction $i$ and spin $\\eps$ for all $i\\in[n-1]$ and $\\eps\\in\\{0,1\\}$, and holds in the more general context of so-called \\emph{bunkbed graphs}. \nUsing the independence property, it is not hard to prove~\\eqref{eq:spanning-cube-2}.\n\n\\fig{width=\\linewidth}{example-bunkbed-lemma}{The rooted spanning trees of the square containing both vertical edges. The spins of the vertical edges are seen to be independent.}\n\n\nIn Section~\\ref{sec:withdiago}, we consider the graph $D_n$ obtained by adding the \\emph{main diagonals} to the hypercube $C_n$, that is, the edges joining each vertex to the antipodal vertex; see Figure~\\ref{fig:cube-with-diagonals}. We prove a generalization of~\\eqref{eq:spanning-cube-2} for the generating function $F_{D_n}(t;\\xx,y)$ of rooted forests of $D_n$, where the variable $y$ counts the number of diagonal edges contained in the forests (so that $F_{C_n}(t;\\xx)=F_{D_n}(t;\\xx,0)$). Our strategy there is to determine combinatorially the roots of $F_{D_n}(t;\\xx)$ considered as a polynomial in $t$ by exhibiting some ``killing involutions'' for the rooted forests of $D_n$.\n\nIn Section~\\ref{sec:matrix-tree}, we establish a generalization of~\\eqref{eq:spanning-cube-2} valid for Cartesian products of complete graphs using the matrix-tree theorem. Finally, we gather some additional remarks and open questions in Section~\\ref{sec:conclusion}.\\\\\n\n\n\nWe end this introduction with a few definitions. \nWe call \\emph{digraph} a finite directed graph. \nWe denote a digraph $G=(V,A)$ to indicate that $V$ is the set of vertices and $A$ is the set of arcs, and for an arc $a\\in A$ we denote $a=(u,v)$ to indicate that the arc $a$ goes from the vertex $u$ to the vertex $v$. We shall identify undirected simple graphs with the digraphs obtained by replacing each edge by two arcs in opposite directions. \n\nA \\emph{rooted forest} of a digraph $G$ is a subgraph without cycle, containing every vertex and such that each vertex is incident to at most one outgoing arc. We call \\emph{root vertices} the vertices not incident to any outgoing arc. Hence, each connected component of a rooted forest is a tree directed toward its unique root vertex. Two rooted forests are represented in Figure~\\ref{fig:cube-with-diagonals}. We denote by $k(F)$ the number of connected components of the forest $F$. A digraph is \\emph{weighted} if every arc $a$ has a weight $w(a)$ (which can be an arbitrary variable). The \\emph{weight} of a forest $F$ is $w(F)=\\prod_{a\\in F}w(a)$ where the product is over the arcs contained in $F$. \nThe \\emph{forest enumerator} of a weighted digraph $G$ is \n\\begin{equation}\\label{eq:forest-enumerator}\nF_G(t)=\\sum_{F\\textrm{ rooted forest of } G}t^{k(F)}w(F).\n\\end{equation}\nObserve that upon defining the weight of the arcs of $C_n$ with direction $i$ and spin $\\eps$ to be $x_{i,\\eps}$, the generating function $\\mF_{C_n}(t;\\xx)$ defined by~\\eqref{def:enumeratorCn} coincides with the forest enumerator $F_{C_n}(t)$ defined by~\\eqref{eq:forest-enumerator}.\n\nLet $G=(U,A)$ and $G'=(U',A')$ be digraphs. The \\emph{Cartesian product} $G\\times G'$ is the digraph $H$ with vertex set $U\\times U'$ and arc set obtained as follows: for every arc $a=(u,v)\\in A$ and every vertex $w'\\in U'$ there is an arc of $H$ from $(u,w')$ to $(v,w')$, and for every arc $a'=(u',v')\\in A'$ and every vertex $w\\in U$ there is an arc of $H$ from $(w,u')$ to $(w,v')$. An example of Cartesian product is given in Figure~\\ref{fig:bunkbed-graph-strong} (top line). Observe that the hypercube $C_n$ is equal to the Cartesian product \n$\\ds C_n=\\underbrace{K_2\\times \\cdots \\times K_2}_{n \\textrm{ times}},$\nwhere $K_2$ is the complete graph on two vertices considered as a digraph, that is, $K_2$ is the digraph with two vertices and two arcs in opposite directions joining these vertices. \n\n\n\n\n\n\n\n\n \n\n\n\n\\section{Spin independence approach for the hypercube}\\label{sec:bunkbed}\nIn this section we study the rooted forests of graphs of the form of the Cartesian product $G\\times K_2$ (and more generally of certain subgraphs of the strong product $G\\boxtimes K_2$). We prove an independence property for the spins of the edges of a random rooted forest of such graph: the spin of the edges in the different copies of $K_2$ are \\emph{independent}. The independence property remains true if one conditions the forest to contain a given number of edges of each type, and readily gives ~\\eqref{def:enumeratorCn}.\n\n\n\\fig{width=\\linewidth}{bunkbed-graph-strong}{The Cartesian product $G\\times K_2$ (top line) and the strong product $G\\boxtimes K_2$ (bottom line).}\n\n\nWe start with a few definitions. Let $G=(U,A)$ be a loopless digraph, let $K_2$ be the complete graph with vertex set $\\{0,1\\}$ (considered as a digraph). Recall that $G\\times K_2$ denotes the Cartesian product of $G$ by $K_2$. We denote by $G\\boxtimes K_2$ the \\emph{strong product} of $G$ by $K_2$ which is the graph obtained from $G\\times K_2$ by adding an arc from $(u,0)$ to $(v,1)$ and an arc from $(u,1)$ to $(v,0)$ for each arc $a=(u,v)$ in $A$. The graphs $G\\times K_2$ and $G\\boxtimes K_2$ are represented in Figure~\\ref{fig:bunkbed-graph-strong}.\nFor $a=(u,v)\\in A$ and $\\eps\\in\\{0,1\\}$, we call \\emph{straight $a$-arcs} the arcs of $H=G\\boxtimes K_2$ joining $(u,\\eps)$ to $(v,\\eps)$, and call \\emph{diagonal $a$-arcs} the arcs of $H$ joining $(u,\\eps)$ to $(v,1-\\eps)$.\nFor $u\\in U$ and $\\epsilon\\in\\{0,1\\}$, we call \\emph{vertical arc of spin $\\eps$ at $u$} the arc of $H$ from $(u,1-\\eps)$ to $(u,\\eps)$. Note that if $G$ has some loops then there will be both ``vertical arcs'' and ``diagonal arcs'' with the same endpoints. \nWe say that two rooted forests of $H$ have the same $G$-\\emph{projection} if they contain the same number of straight $a$-arcs and the same number of diagonal $a$-arcs for all $a\\in A$, and moreover contain vertical arcs at the same vertices of $G$. Two rooted forests having the same projection are shown in Figure~\\ref{fig:bunkbed-projection-strong}. We now state the key result of this section.\n\n\n\\fig{width=.7\\linewidth}{bunkbed-projection-strong}{Two rooted forests of the graph $H=G\\boxtimes K_2$ having the same $G$-projection. In this picture, for the sake of readability, the diagonal arcs of $H$ not contained in the forests are not drawn. The forests are drawn in thick lines and the root vertices are represented by large dots.}\n\n\\begin{thm}\\label{thm:bunkbed}\nLet $G=(U,A)$ be a digraph. Let $F_0$ be a rooted forest of $H=G\\boxtimes K_2$, and let $S\\subseteq U$ be the set of vertices $u$ of $G$ such that $F_0$ contains a vertical arc at $u$. Let $F$ be a uniformly random rooted forest of $H$ conditioned to have the same $G$-projection as $F_0$. For all $u$ in $S$, let $\\si_u\\in\\{0,1\\}$ be the spin of the vertical arc at $u$ of the forest $F$. Then the random variables $\\si_u,~u\\in S$ are independent and uniformly random in~$\\{0,1\\}$. \n\\end{thm}\nBefore proving Theorem~\\ref{thm:bunkbed}, let us derive a few corollaries. Roughly speaking Theorem~\\ref{thm:bunkbed} implies that in order to enumerate the rooted forests of $H=G\\boxtimes K_2$ it is sufficient to enumerate the rooted forests without vertical arc of spin 1. The following corollary makes this statement precise.\n\\begin{cor}\\label{cor:bunkbed-GF}\nLet $G=(U,A)$ be a digraph. Let $H$ be the digraph $G\\boxtimes K_2$, with arcs weighted as follows: for $\\eps\\in\\{0,1\\}$ the vertical arcs of $H$ of spin $\\eps$ have weight $x_\\eps$, and for $a\\in A$ the straight and diagonal $a$-arcs have weight $w_a$ and $w_a'$ respectively. Then the forest enumerator $F_H(t)\\equiv F_{H}(t;x_0,x_1)$ satisfies $F_{H}(t;x_0,x_1)=F_{H}(t;x_0+x_1,0)$.\n\\end{cor}\n\n\\begin{proof}\nFor a integer $v$ and tuples of integers $\\mm=(m_a)_{a\\in A}$ and $\\nn=(n_a)_{a\\in A}$, we let $\\mF(v,\\mm,\\nn)$ be the set of rooted forests of $H$ having $v$ vertical arcs, and $m_{a}$ straight $a$-arcs and $n_a$ diagonal $a$-arcs for all $a\\in A$. By Theorem~\\ref{thm:bunkbed}, the number of vertical arcs of spin 0 in a uniformly random forest $F$ in $\\mF(v,\\mm,\\nn)$ has a binomial distribution with parameter $(v,1\/2)$. Hence, \n$$\\sum_{F\\in \\mF(v,\\mm,\\nn)}x_0^{\\#\\textrm{vertical arcs of spin }0}\\,x_1^{\\#\\textrm{vertical arcs of spin }1}=|\\mF_{v,\\mm,\\nn}|\\left(\\frac{x_0}{2}+\\frac{x_1}{2}\\right)^v.$$\nThus, \n$$F_{H}(t;x_0,x_1)\\equiv \\sum_{\\mm,\\nn,v}\\prod_{a\\in A}w_a^{m_a}{w_{a}'}^{n_a}\\sum_{F\\in \\mF(v,\\mm,\\nn)}x_0^{\\#\\textrm{vertical arcs of spin }0}\\,x_1^{\\#\\textrm{vertical arcs of spin }1}$$\nis unchanged when replacing $(x_0,x_1)$ by $(x_0+x_1,0)$.\n\\end{proof} \nIn the next two corollaries, we focus on the forests of the Cartesian products $G\\times K_2$, which are simply the forests of $G\\boxtimes K_2$ without diagonal arcs.\n\n\n\\begin{cor}\\label{cor:K2-induction}\nLet $G=(U,A)$ be a weighted digraph with the weight of an arc $a\\in A$ denoted by $w_a$. \nLet $H$ be the digraph $G\\times K_2$ with arcs weighted as follows: for $\\eps\\in\\{0,1\\}$ the vertical arcs of spin $\\eps$ of $H$ have weight $x_\\eps$, and for $a\\in A$ the (straight) $a$-arcs of $H$ have weight $w_a$. Then the forest enumerators of $G$ and $H$ are related by \n$$F_H(t)=F_G(t)F_G(t+x_0+x_1).$$\n\\end{cor}\n\n\\begin{proof}\nLet us denote $F_H(t)=F_H(t;x_0,x_1)$ in order to make explicit the dependence in the variables $x_0,x_1$. By applying Corollary~\\ref{cor:bunkbed-GF} (in the special case where the weights of diagonal arcs are 0), we get $F_H(t;x_0,x_1)=F_H(t;x_0+x_1,0)$, so it only remains to prove that \n$$F_H(t;x_0,0)=F_G(t)F_G(t+x_0).$$\nNow, by definition \n$F_H(t;x_0,0)=\\sum_{F\\in \\mF'}w(F)$,\nwhere $\\mF'$ is the set of rooted forests without vertical arc of spin 1. For $\\eps\\in\\{0,1\\}$, let $G_\\eps$ be the subgraph of $H$ isomorphic to $G$ induced by the vertices of the form $(u,\\eps),u\\in U$. Clearly, any rooted forest in $\\mF'$ is obtained by \n\\begin{compactitem}\n\\item[(i)] choosing a rooted forest $F_0$ of $G_0$, \n\\item[(ii)] choosing a rooted forest $F_1$ of $G_1$, and then choosing for each root vertex of $F_1$ whether to add a vertical arc (of spin 0) out of this vertex, \n\\end{compactitem}\nand any choice (i), (ii) gives a rooted forest in $\\mF'$ (since it is impossible to create cycles by adding the vertical arcs). Moreover $F_G(t)$ is the generating function of all the possible choices for (i), while $F_G(t+x_0)$ is the generating function of all the possible choices for (ii). This completes the proof. \n\\end{proof}\n\nAs mentioned earlier the hypercube $C_n$ is equal to $K_2\\times \\cdots \\times K_2$ and we now use Theorem~\\ref{thm:bunkbed} to prove~\\eqref{eq:spanning-cube-2}.\n\n\\begin{cor}\\label{cor:cube}\nThe $n$-dimensional hypercube $C_n$ with weight $x_{i,\\eps}$ for the arcs having direction $i$ and spin $\\eps$ has forest enumerator\n$$F_{C_n}(t;\\xx)=\\prod_{S\\subseteq[n]}\\left(t+\\sum_{i\\in S} x_{i,0}+x_{i,1}\\right).$$ \n\n\\end{cor}\n\n\\begin{proof}\nCorollary~\\ref{cor:cube} follows from Corollary~\\ref{cor:K2-induction} by induction on $n$. Below we give a slightly more direct proof. First observe that by Corollary \\ref{cor:bunkbed-GF}, the forest enumerator $F_{C_n}(t;\\xx)$ is unchanged by replacing for all $i\\in[n]$ the variables $x_{i,0}$ and $x_{i,1}$ respectively by $x_{i,0}+x_{i,1}$ and $0$. Hence it only remains to prove \n\\begin{equation}\\label{eq:no1}\nF_{C_n}(t;x_{1,0},0,\\ldots,x_{n,0},0)=\\prod_{S\\subseteq[n]}\\left(t+\\sum_{i\\in S} x_{i,0}\\right).\n\\end{equation}\nBy definition, $\\ds F_{C_n}(t;x_{1,0},0,\\ldots,x_{n,0},0)=\\sum_{F\\in\\mF'}w(F),$\nwhere $\\mF'$ is the set of rooted forests of $C_n$ without arc of spin 1. A forest in $\\mF'$ represented in Figure~\\ref{fig:cube-with-diagonals}.\nSuch a forest is obtained by choosing for each vertex $v=(v_1,\\ldots,v_n)\\in\\{0,1\\}^n$ either to make this vertex a root vertex (this contributes weight $t$) or to make it a vertex with outgoing arc (of spin 0) in direction $i$ for $i$ in the subset $S_v=\\{i\\in[n],~v_i=1\\}$ (this contributes weight $\\sum_{i\\in S_v} x_{i,0}$). Since any such choice leads to a distinct rooted forest in $\\mF'$, we get~\\eqref{eq:no1}.\n\\end{proof}\n\n\n\nThe rest of this section is devoted to the proof of Theorem~\\ref{thm:bunkbed}.\n\n\\begin{proof}[Proof of Theorem~\\ref{thm:bunkbed}] Let $\\mF_0$ be the set of rooted forests of $H=G\\boxtimes K_2$ having the same $G$-projection as $F_0$. The rooted forest $F$ is chosen uniformly in $\\mF_0$ and we want to prove that the spins of its vertical arcs are uniformly random and independent. We will prove this property by induction on the number $n$ of vertices of $G$. The property is obvious for $n=1$. We now suppose that it holds for any graph $G'$ with less than $n$ vertices, and we want to prove the property for $G$. \n\nLet $\\al$ be the number of non-vertical arcs of $F_0$. Let $\\be=|S|$ be the number of vertices $u$ of $G$ such that $F_0$ contains a vertical arc at $u$, and let $\\ga=|U\\setminus S|=n-\\be$ be the number of other vertices of $G$. Since the forest $F_0$ has $\\al+\\be$ arcs and $2n$ vertices, one gets $\\al+\\be<2n$, hence $\\al<\\be+2\\ga$. \nThus there exists either \n\\begin{compactitem}\n\\item[(a)] a vertex $u\\in S$ such that $F_0$ contains no $a$-arc with $a\\in A$ directed toward $u$, \n\\item[(b)] or a vertex $u\\in U\\setminus S$ such that $F_0$ contains at most one $a$-arc with $a\\in A$ directed toward $u$. \n\\end{compactitem}\nCases (a) and (b) are illustrated in Figure~\\ref{fig:proof-bunkbed-strong}. In both cases we will apply the induction hypothesis on graphs obtained from $G$ by deleting the vertex $u$.\n\\fig{width=.9\\linewidth}{proof-bunkbed-strong}{Cases (a) and (b) of the inductive proof of Theorem~\\ref{thm:bunkbed}. In this picture, for the sake of readability, the diagonal arcs of $H=G\\boxtimes K_2$ not contained in the forests are not drawn.}\n\nWe first consider the case (a). Let $G'$ be the digraph obtained from $G$ by deleting the vertex $u$ and the incident arcs, and let $H'=G'\\boxtimes K_2$. For a rooted forest $T\\in\\mF_0$ we denote by $\\phi(T)$ the rooted forest of $H'$ obtained from $T$ by deleting the vertices $(u,0)$ and $(u,1)$ and the incident arcs; see Figure~\\ref{fig:proof-bunkbed-strong}(a). \nLet $F_0'=\\phi(F_0)$ and let $\\mF_0'$ be the set of rooted forests of $H'$ having the same $G'$-projection as $F_0'$. \nIt is easy to see that any rooted forest $T'\\in\\mF_0'$ has exactly two preimages in $\\mF_0$ by the mapping $\\phi$: one preimage having a vertical arc of spin 0 at $u$ and the other having a vertical arc of spin 1 at $u$. Hence, if $F$ is uniformly random in $\\mF_0$ then $F'=\\phi(F)$ is uniformly random in $\\mF_0'$. Thus, by the induction hypothesis, the vertical arcs of $F'$ are uniformly random and independent. Moreover the spin $\\si_u$ of the vertical arc of $F$ at $u$ is uniformly random and independent of the forest $F'=\\phi(F)$. Thus, the spins of all the vertical arcs of $F$ are uniformly random and independent, as wanted.\n\n\nWe now consider the case (b). There is at most one arc $a\\in A$ directed toward $u$ such that $F_0$ contains a $a$-arc, and at most two arcs $a'\\in A$ directed away from $u$ such that $F_0$ contains an $a'$-arc. Considering all the possibilities is a bit tedious (but not hard), so we shall only treat the most interesting case in detail: we suppose that there is an arc $a_0\\in A$ directed toward $u$ and two distinct arcs $a_1,a_2\\in A$ directed away from $u$ such that $F_0$ contains an $a_i$-arc for all $i\\in\\{0,1,2\\}$. This situation is represented in Figure~\\ref{fig:proof-bunkbed-strong}(b); in that figure the $a_1$-arc of $F$ is a diagonal arc and the $a_0$-arc and $a_2$-arc of $F$ are straight arcs. We partition $\\mF_0$ into two subsets $\\mF_0=\\mF_1\\uplus\\mF_2$, where for $i\\in\\{1,2\\}$, $\\mF_i$ is the set of rooted forests $T\\in\\mF_0$ such that the $a_0$-arc and $a_i$-arc of $T$ are incident to the same vertex of $H$. It is sufficient to prove that for $i\\in\\{1,2\\}$, if $\\mF_i\\neq\\emptyset$ and $F_i$ is a uniformly random rooted forest in $\\mF_i$ then the spins of the vertical arcs of $F_i$ are uniformly random and independent. \n\nLet $i\\in\\{1,2\\}$ be such that $\\mF_i$ is not empty. Let $G_i'$ be the digraph obtained from $G$ by merging the arcs $a_0$ and $a_i$ into a single arc $b$ (going from the origin of $a_0$ to the end of $a_1$) and then deleting the vertex $u$ and all the incident arcs, and let $H_i'=G_i'\\boxtimes K_2$. For $T\\in \\mF_i$ we denote by $\\phi_i(T)$ the forest of $H_i'$ obtained from $T$ by merging the $a_0$-arc and the $a_i$-arc into a single arc (the arc created will be a straight $b$-arc if $a_0$ and $a_i$ are both straight or both diagonal, and a diagonal $b$-arc otherwise) and then deleting the vertices $(u,0)$ and $(u,1)$ and the incident arcs . Let $F_{i,0}$ be a rooted forest in $\\mF_i$, let $F_{i,0}'=\\phi_i(F_{i,0})$, and let $\\mF_i'$ be the set of rooted forest of $H_i'$ having the same $G_i'$-projection as $F_{i,0}'$. It is easy to see that $\\phi_i$ is a bijection between $\\mF_i$ and $\\mF_i'$. Thus, if $F_i$ is uniformly random in $\\mF_i$ then $F_i'=\\phi_i(F_i')$ is uniformly random in $\\mF_i'$. Hence, by the induction hypothesis, the spins of the vertical arcs of $F_i$ (which are the same as the spins of the vertical arcs of $F_i'$) are uniformly random and independent. This completes the proof.\n\\end{proof}\n\\smallskip\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\section{Root identification approach for the hypercube with diagonals}\\label{sec:withdiago}\nIn this section we consider the graph $D_n$ obtained from the hypercube $C_n$ by adding a \\emph{diagonal arc} from each vertex $v=(v_1,\\ldots,v_n)\\in\\{0,1\\}$ to its \\emph{antipodal vertex} $v'=(1-v_1,\\ldots,1-v_n)$. The graph $D_3$ is represented in Figure~\\ref{fig:cube-with-diagonals}. Let $F_{D_n}(t;\\xx,y)$ be the forest enumerator of $D_n$ defined by \n\\begin{equation}\\label{eq:FDn}\nF_{D_n}(t;\\xx,y)=\\sum_{F\\textrm{ rooted forest of } D_n}\\,\\prod_{a\\in F}w(a),\n\\end{equation}\nwhere the weight $w(a)$ of a diagonal arc is $y$ and the weight of a non-diagonal arc of direction $i$ and spin $\\eps$ is $x_{i,\\eps}$. The main result of this section is the following product formula for $F_{D_n}(t;\\xx,y)$. \n\\begin{thm}\\label{thm:with-diago}\nThe forest enumerator of the hypercube with diagonals defined by~\\eqref{eq:FDn} equals\n\\begin{equation}\\label{eq:with-diago}\nF_{D_n}(t;\\xx,y)=\\prod_{S\\subseteq [n]}\\left(t+2y\\cdot\\textbf{1}_{|S| \\textrm{ odd}}+\\sum_{i\\in S}x_{i,0}+x_{i,1}\\right).\n\\end{equation}\n\\end{thm}\nObserve that the forest enumerator of the hypercube is $F_{C_n}(t;\\xx)=F_{D_n}(t;\\xx,0)$, hence Theorem~\\ref{thm:with-diago} gives a generalization of~\\eqref{eq:spanning-cube-2}. The rest of this section is devoted to the proof of Theorem~\\ref{thm:with-diago}. \nThe proof below uses Theorem~\\ref{thm:bunkbed} as one of its ingredients\\footnote{Using Corollary \\ref{cor:bunkbed-GF} it is actually sufficient to prove \\eqref{eq:with-diago} in the special case where $x_{1,1}=x_{2,1}=\\ldots=x_{n,1}=0$, but we have not found a more direct proof of this special case.}.\nHowever the case $y=0$ corresponding to~\\eqref{eq:spanning-cube-2} does not require Theorem~\\ref{thm:bunkbed} hence we obtain an independent combinatorial proof of this formula.\n\nIt is clear from the definitions that $F_{D_n}(t;\\xx,y)$ is a monic polynomial in $t$ of degree~$2^n$. Thus, in order to prove Theorem~\\ref{thm:with-diago} it suffices to show that for all $S\\subseteq [n]$,\n\\begin{equation}\\label{eq:tobeproved}\nF_{D_n}(-2y\\cdot\\textbf{1}_{|S| \\textrm{ odd}}-\\sum_{i\\in S}x_{i,0}+x_{i,1};\\xx,y)=0.\n\\end{equation}\nWe now fix a subset $S\\subseteq [n]$ and establish~\\eqref{eq:tobeproved} by exhibiting some ``killing involutions''. We denote $S'=S$ if $S$ is even and $S'=S\\cup \\{0\\}$ if $S$ is odd. We also say that the diagonal arcs of $D_n$ have \\emph{direction 0}.\nA rooted forest of $D_n$ is $S$-\\emph{labeled} if every root vertex has a \\emph{label} in $S'$. For a $S$-labeled forest $F$, we denote \n$$w(F)=\\prod_{a \\emph{ arc of }F}w(a)\\times \\prod_{r\\textrm{ root vertex of } F}\\ow(r),$$\nwhere $\\ow(r)=-2y$ if the root vertex $r$ is labeled 0, and $\\ow(r)=-x_{i,0}-x_{i,1}$ if $r$ is labeled $i>0$. With this notation we immediately get\n$$\nF_{D_n}(-2y\\cdot\\textbf{1}_{|S| \\textrm{ odd}}-\\sum_{i\\in S}x_{i,0}+x_{i,1};\\xx,y)=\\sum_{F\\in \\mF_S}w(F),\n$$\nand it remains to prove that \n\\begin{equation}\\label{eq:tobeproved2}\n\\sum_{F\\in \\mF_S}w(F)=0.\n\\end{equation}\n\nLet $\\mC$ be the set of subgraphs of $D_n$ such that every vertex of $D_n$ is incident to exactly one outgoing arc. Any element $C\\in\\mC$ is made of a some disjoint directed cycles together with directed trees rooted on the vertices of the cycles.\nFor a labeled rooted forest $F\\in \\mF_S$, we denote by $\\ov{F}$ the subgraph in $\\mC$ obtained from $F$ by adding the arc of direction $i$ going out of each root vertex labeled $i$ for all $i\\in \\{0,\\ldots,n\\}$ (with the convention that diagonal arcs have direction 0). We get\n$\\ds \\sum_{F\\in \\mF_S}w(F)=\\sum_{C\\in\\mC}~\\sum_{F\\in \\mF_S,~\\ov{F}=C}w(F),$\nand now proceed to compute $\\ds \\sum_{F,\\,\\ov{F}=C}w(F)$ for a given subgraph $C\\in\\mC$.\n\nLet $C\\in \\mC$ and let $C^{(1)},\\ldots,C^{(k)}$ be the directed cycles of $C$, and let $C^{(0)}$ be the set arcs of $C$ which are not in cycles. For all $j\\in[k]$, we denote by $C_S^{(j)}$ the set of arcs in $C^{(j)}$ having their direction in $S'$, and we denote $\\ov{C}^{(j)}_{S}=C^{(j)}\\setminus C^{(j)}_{S}$. \nThe forests $F$ such that $\\ov{F}=C$ are obtained from $C$ by removing an arbitrary subset of arcs in $C^{(0)}_S$, and by removing a non-empty subset of arcs in $C^{(j)}_S$ for all $j=1,\\ldots,k$. Moreover, if an arc $a\\in C$ is not removed then its contribution to the weight $w(F)$ is $w(a)$, while if $a$ is removed then its contribution to $w(F)$ is $\\ow(a)=-2y$ if $a$ is a diagonal edge and $\\ow(a)=-x_{i,0}-x_{i,1}$ if it is a non-diagonal edge of direction $i$ and spin $\\eps$. Thus \n$$\\sum_{F\\in\\mF_S,~\\ov{F}=C}\\!\\!\\!w(F)=\\prod_{a\\in \\ov{C}_{S}^{(0)}}\\!\\!w(a)\\prod_{a\\in C_S^{(0)}}\\!\\!\\tw(a)\\times\\prod_{j=1}^k\\prod_{a\\in \\ov{C}_{S}^{(j)}}\\!\\!w(a)\\left(\\prod_{a\\in C^{(j)}_S}\\!\\!\\tw(a)-\\prod_{a\\in C_{S}^{(j)}}\\!\\!w(a)\\right),$$\nwhere $\\tw(a)=w(a)+\\ow(a)$.\nNow we claim that for all $j\\in[k]$ the number of arcs in $C^{(j)}_S$ is even. For this purpose, consider for each vertex $v\\in\\{0,1\\}^n$ the quantity $v_S=\\sum_{i\\in S}v_i$. The parity of $v_s$ is changing along arcs having direction in $S'$ and not changing along the other arcs. Hence for all $j\\in[k]$ the number of arcs with direction in $S'$ in the cycle $C^{(j)}$ is even. Therefore, \n\\begin{equation}\\label{eq:tobekilled}\n\\sum_{F\\in\\mF_S,~\\ov{F}=C}\\!\\!\\!\\!w(F)=\\prod_{a\\in \\ov{C}_{S}^{(0)}}\\!\\!\\!w(a)\\prod_{a\\in C_S^{(0)}}\\!\\!\\!\\tw(a)\\times\\prod_{j=1}^k\\prod_{a\\in \\ov{C}_{S}^{(j)}}\\!\\!w(a)\\left(\\prod_{a\\in C^{(j)}_S}\\!\\!\\!\\hw(a)-\\prod_{a\\in C_{S}^{(j)}}\\!\\!\\!w(a)\\right),\n\\end{equation}\nwhere $\\hw(a)=-\\tw(a)$, that is, $\\hw(a)=y$ if $a$ is a diagonal edge, and $\\hw(a)=x_{i,1-\\eps}$ if $a$ is a non-diagonal edge of direction $i\\in S$ and spin $\\eps$. \n\nLet us now briefly consider the case $y=0$, which leads to an independent proof of~\\eqref{eq:spanning-cube-2}. In the case $y=0$ the right-hand side of~\\eqref{eq:tobekilled} is clearly 0 unless $C$ has no diagonal arc. Moreover, if $C$ has no diagonal arc then for all $j\\in[k]$, $i\\in[n]$ the cycle $C^{(j)}$ contains as many arcs with direction $i$ and spin 0 as arcs with direction $i$ and spin 1. Hence in this case, \n$\\ds \\prod_{a\\in C^{(j)}_S}\\!\\!\\hw(a)=\\prod_{a\\in C_{S}^{(j)}}\\!\\!w(a),$\nso that $\\ds \\sum_{F\\in\\mF_S,~\\ov{F}=C}w(F)$ is always~0. Thus, we have proved~\\eqref{eq:tobeproved2} and therefore~\\eqref{eq:with-diago} in the case $y=0$, which is precisely~\\eqref{eq:spanning-cube-2}.\n\nWe now resume our analysis in the case $y\\neq 0$. It is not true that the right-hand side of~\\eqref{eq:tobekilled} is~0 in general. However in the case where $x_{i,0}=x_{i,1}$ for all $i\\in S$ one has $\\hw(a)=w(a)$ for all arc $a$ having direction in $S'$, hence $\\sum_{F\\in\\mF_S,~\\ov{F}=C}w(F)=0$.\nThis gives~\\eqref{eq:tobeproved2} and therefore~\\eqref{eq:with-diago} in the case where $x_{i,0}=x_{i,1}$ for all $i\\in [n]$. Equivalently,\n$$F_{D_n}(t;\\xx',y)=\\prod_{S\\subseteq [n]}\\left(t+2y\\cdot\\textbf{1}_{|S| \\textrm{ odd}}+\\sum_{i\\in S}x_{i,0}+x_{i,1}\\right),$$\nfor $\\ds \\xx'=\\left(\\frac{x_{1,0}+x_{1,1}}{2},\\frac{x_{1,0}+x_{1,1}}{2},\\ldots,\\frac{x_{n,0}+x_{n,1}}{2},\\frac{x_{n,0}+x_{n,1}}{2}\\right)$.\n We now combine this result with Corollary~\\ref{cor:bunkbed-GF}.\n\n\nFirst observe that $D_n$ is obtained from the digraph $D_{n-1}\\boxtimes K_2$ by removing its straight $a$-arcs for every diagonal arc $a$ of $D_{n-1}$ and removing its diagonal $a'$-arcs for every non-diagonal arc $a'$ of $D_{n-1}$. Therefore, Corollary~\\ref{cor:bunkbed-GF} implies that $F_{D_n}(t;\\xx,y)$ is unchanged by replacing $(x_{n,0},x_{n,1})$ by $(x_{n,0}+x_{n,1},0)$ or by $\\ds (\\frac{x_{n,0}+x_{n,1}}{2},\\frac{x_{n,0}+x_{n,1}}{2})$. By symmetry, a similar result is true for every direction $i\\in[n]$. Therefore $F_{D_n}(t;\\xx,y)=F_{D_n}(t;\\xx',y)$. This completes the proof of Theorem~\\ref{thm:with-diago}.\\hfill $\\square$\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\section{Matrix-tree approach for products of complete graphs}\\label{sec:matrix-tree}\nIn the previous sections we gave combinatorial proofs of formula~\\eqref{eq:spanning-cube-2} for the forest enumerator of the hypercube. In this section we instead use the good old matrix-tree approach to establish some generalizations for Cartesian products of complete graphs. \n\nLet $G=(U,A)$ and $G'=(U',A')$ be weighted digraphs and let $w_a$ be the weight of any arc $a$ in $A\\cup A'$. The \\emph{weighted Cartesian product} of $G$ and $G'$, is the digraph $H=G\\times G'$ where for any arc $a=(u,v)\\in A\\cup A'$, the arcs of $H$ corresponding to $a$ (if $a\\in A$, these are arcs going from $(u,w)$ to $(v,w)$ for $w\\in U'$, while if $a\\in A'$ these are arcs going from $(w,u)$ to $(w,v)$ for $w\\in U$) have weight $w_a$. \nObserve that the weighted Cartesian product $K_2\\times\\cdots \\times K_2$ of $n$ copies of $K_2$ with the $i$th copy having arc weights $x_{i,0}$ and $x_{i,1}$ is equal to the hypercube with weight $x_{i,\\eps}$ for arcs having direction $i$ and spin $\\eps$. The following proposition will be proved by combining the matrix-tree theorem with a classical result about the eigenvalues of the Laplacian of a Cartesian product of graphs (see e.g. \\cite{Fiedler:eigenvalues-Cartesian}).\n\\begin{prop}\\label{prop:Laplacian}\nLet $G$, $G'$ be weighted digraph with respectively $p$ and $q$ vertices.\nLet $F_G(t)$, $F_{G'}(t)$ be the forest enumerators of $G$ and $G'$ as defined by~\\eqref{eq:forest-enumerator}. Let $\\la_1,\\ldots,\\la_p$ and $\\la_1',\\ldots,\\la_{q}'$ be the roots (appearing with multiplicity) of $F_G(t)$ and $F_{G'}(t)$ considered as polynomials in $t$ (the roots are taken in the splitting field of these polynomials). Then the forest enumerator of the weighted Cartesian product $H=G\\times G'$ is\n$$F_H(t)=\\prod_{i\\in [p],j\\in[q]}(t+\\la_i+\\la_j')= \\prod_{j\\in [q]}F_{G}(t+\\la_j')=\\prod_{i\\in [p]}F_{G'}(t+\\la_i).$$\n\\end{prop}\n\nObserve that Corollary~\\ref{cor:K2-induction} is a special case of Proposition~\\ref{prop:Laplacian} corresponding to $G'=K_2$ (with weight $x_0$ and $x_1$ on the edges of $K_2$). \nBefore proving Proposition~\\ref{prop:Laplacian}, we explore its consequences for products of complete graphs. We first recall a classical result about the forest enumerator of complete graphs. Let $K_p$ be the complete graph with vertex set $[p]$ (considered as a digraph with $p(p-1)$ arcs). If for all $j \\in[p]$ the arcs of $K_p$ directed toward the vertex $j$ are weighted by $x_j$, then the forest enumerator of $K_p$ is \n$$F_{K_p}(t)=t\\,(t+x_1+\\cdots+x_{p})^{p-1}.$$\nThis classical result, often attributed to Cayley, has many beautiful proofs~\\cite[Chapter 26]{AZ}. Since the roots of $F_{K_p}(t)$ are known explicitly for all $p$, Proposition~\\ref{prop:Laplacian} immediately gives the following result (by induction on $n$).\n\\begin{corollary}\\label{cor:product-complete}\nLet $p_1,\\ldots,p_n$ be positive integers and $K_{p_1},\\ldots,K_{p_n}$ be complete graphs with $p_1,\\ldots,p_n$ vertices respectively. For all $i\\in[n]$, let the $i$th complete graph $K_{p_i}$ be weighted by assigning a weight $x_{i,\\eps}$ to every arc going toward the vertex $\\eps$ for all $\\eps\\in [p_i]$. Then the weighted Cartesian product $K_{p_1}\\times \\cdots \\times K_{p_n}$ has the following forest enumerator \n\\begin{equation}\\label{eq:product-complete}\nF_{K_{p_1}\\times \\cdots \\times K_{p_n}}(t)=\\prod_{(v_1,\\ldots,v_n)\\in[p_1]\\times \\cdots \\times[p_n]}(t+\\sum_{i,~v_i\\neq 1}x_{i,1}+\\ldots+x_{i,p_i}).\n\\end{equation}\n\\end{corollary}\nCorollary \\ref{cor:product-complete} is closely related to a formula established by Martin and Reiner in \\cite{Martin-Reiner:spanning-cube} using a method similar to ours. Indeed \\cite[Theorem 1]{Martin-Reiner:spanning-cube} is equivalent (up to easy algebraic manipulations) to the special case $x_{i,1}=x_{i,2}=\\ldots=x_{i,p_i}$ of \\eqref{eq:product-complete}.\nObserve also that formula~\\eqref{eq:spanning-cube-2} for the hypercube corresponds to the case $p_1=\\ldots=p_n=2$ of Corollary~\\ref{cor:product-complete} (upon identifying the subsets of $[n]$ with the elements of $[2]^n$). \n\n\nThe rest of this section is devoted to the proof of Proposition~\\ref{prop:Laplacian}. We first recall the matrix-tree theorem.\nLet $G$ be a simple weighted digraph with vertex set $[n]$. For two vertices $i,j\\in [n]$ we define $w_{i,j}$ to be the weight of the arc from vertex $i$ to vertex $j$ if there is such an arc, and to be 0 otherwise. The \\emph{Laplacian} of $G$, denoted $L(G)$, is the $n\\times n$ matrix whose entry at position $(i,j)\\in[n]^2$ is equal to $-w_{i,j}$ if $i\\neq j$ and to $\\sum_{k=1}^nw_{i,k}$ otherwise.\nWe now recall the (directed, weighted, forest version of) the matrix-tree theorem\\footnote{Our weights $w_{i,j}$ are arbitrary indeterminates as authorized by the combinatorial proofs of the matrix-tree theorem (see e.g.~\\cite{Zeilberger:combinatorial-matrix}).} which gives the forest-enumerator of $G$ as a determinant:\n\\begin{equation}\\label{eq:matrix-tree}\nF_G(t)\\equiv\\sum_{F\\textrm{ rooted forest of } G}t^{k(F)}w(F)=\\det\\left(L(G)+t\\cdot \\Id_n\\right),\n\\end{equation}\nwhere $\\Id_n$ denotes the identity matrix of dimension $n\\times n$. In other words, for any weighted digraph $G$ the roots of the forest enumerator $F_G(t)$ are the opposite of the eigenvalues of the Laplacian $L(G)$. In order to complete the proof Proposition \\ref{prop:Laplacian}, it now suffices to combine this fact with the following result of Fiedler \\cite{Fiedler:eigenvalues-Cartesian} (Fiedler actually only considered undirected unweighted graph, but the proof allows for arbitrary weights).\n\\begin{lemma}[\\cite{Fiedler:eigenvalues-Cartesian}]\\label{lem:eigenvalues-add-up}\nIf $G$, $G'$ and $H$ are as in Proposition \\ref{prop:Laplacian} and the eigenvalues (taken with multiplicities) of the Laplacians $L(G)$ and $L(G')$ are $\\la_1,\\ldots,\\la_p$ and $\\la_1',\\ldots,\\la_q'$ respectively, then the eigenvalues of $L(H)$ (taken with multiplicities) are $(\\la_i+\\la'_j)_{i\\in[p],j\\in[q]}$.\n\\end{lemma}\n\\begin{proof}[Sketch of proof of Lemma \\ref{lem:eigenvalues-add-up}] The Laplacians of $G$, $G'$ and $H$ are related by\n$$L(H)=L(G)\\otimes \\Id_{q}+\\Id_p\\otimes L(G'),$$\nwhere ``$\\otimes$'' represents the \\emph{Kronecker product} of matrices. \nMoreover, if $M,N$ are any matrices of dimension $p\\times p$ and $q\\times q$ respectively, with eigenvalues $\\la_1,\\ldots,\\la_p$ and $\\la_1',\\ldots,\\la_q'$, then the eigenvalues of the matrix $L=M\\otimes \\Id_q+\\Id_p\\otimes N$ are $(\\la_i+\\la'_j)_{i\\in[p],j\\in[q]}$. \nIndeed, there exists invertible matrices $P,Q$ (with entries in the splitting field of the polynomial $\\det(M+t\\cdot\\Id_p)\\det(N+t\\cdot\\Id_q)$) such that the matrices $M':= P^{-1}MP$ and $N':= Q^{-1}NQ$ are both upper triangular with diagonal elements $\\la_1,\\ldots,\\la_p$ and $\\la_1',\\ldots,\\la_q'$ respectively. And it is easily seen that $$(P\\otimes Q)^{-1}\\cdot\\left(M\\otimes \\Id_q+\\Id_p\\otimes N\\right)\\cdot(P\\otimes Q)=M'\\otimes \\Id_p+\\Id_q\\otimes N'$$\nis a upper triangular matrix with diagonal elements $(\\la_i+\\la'_j)_{i\\in[p],j\\in[q]}$. \nThis completes the proof of Lemma \\ref{lem:eigenvalues-add-up} and Proposition \\ref{prop:Laplacian}.\n\\end{proof}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\section{Additional remarks and conjectures}\\label{sec:conclusion}\nIn this section we first give a formula for the enumerator of the spanning trees of the hypercube rooted at a given vertex, and explain its relation with a formula by Martin and Reiner~\\cite{Martin-Reiner:spanning-cube}. Then we mention a consequence of Theorem~\\ref{thm:bunkbed} and conjecture a generalization of this theorem.\\\\ \n\n\\noindent \\textbf{Unrooted spanning trees of the hypercube and relation with~\\cite[Theorem 3]{Martin-Reiner:spanning-cube}}.\\\\\nFor a vertex $v=(v_1,v_2,\\ldots,v_n)\\in\\{0,1\\}^n$ of the hypercube we denote by $\\mT_v$ the set of spanning trees of $C_n$ rooted at the vertex $v$, and we denote\n$$T_{C_n,v}(\\xx)=\\sum_{T\\in\\mT_v}\\,\\prod_{a\\in T}x_{\\dir(a),\\spin(a)}.$$ \nObserve that if $u=(u_1,\\ldots,u_n)\\in\\{0,1\\}^n$ is another vertex of $C_n$, then \n$$T_{C_n,u}(\\xx)=\\left(\\prod_{i=1}^n\\frac{x_{i,u_i}}{x_{i,v_i}}\\right) T_{C_n,v}(\\xx),$$\nsince changing the root of a spanning tree from $v$ to $u$ changes the number of arcs of direction $i$ and spin $1$ (resp. 0) by $u_i-v_i$ (resp. $v_i-u_i$). Combining this relation with\n$$\\sum_{v\\in c_n}T_{C_n,v}(\\xx)= [t]F_{C_n}(t;\\xx)=\\prod_{S\\subseteq [n],S\\neq\\emptyset}\\,\\sum_{i\\in S}(x_{i,0}+x_{i,1}),$$\ngives \n\\begin{equation}\\label{eq:rooted-at-v}\nT_{C_n,v}(\\xx)=\\left(\\prod_{i=1}^nx_{i,v_i}\\right)\\times\\left(\\prod_{S\\subseteq [n],|S|\\geq 2}\\,\\sum_{i\\in S}(x_{i,0}+x_{i,1})\\right).\n\\end{equation}\nWe now establish the equivalence of \\eqref{eq:rooted-at-v} with~\\cite[Theorem 3]{Martin-Reiner:spanning-cube}. For $i\\in[n]$, $\\eps\\in\\{0,1\\}$ and $T$ an unrooted spanning tree of $C_n$, we denote by $\\deg_{i,\\eps}(T)$ the sum of the degrees in $T$ of all the vertices of $C_n$ having their $i$th coordinate equal to $\\eps$. We then consider \n$$S_{C_n}(\\qq,\\yy)=\\sum_{T}\\left(\\prod_{e\\in T}q_{\\dir(e)}\\right)\\times\\left(\\prod_{i=1}^ny_{i,0}^{\\deg_{i,0}(T)}y_{i,1}^{\\deg_{i,1}(T)}\\right),$$\nwhere the sum is over the unrooted spanning trees of $C_n$. Let $T$ be an unrooted spanning tree of $C_n$ and let $T'$ be the rooted tree obtained by choosing $\\rho=(0,0,\\ldots,0)$ as the root vertex. It is easy to see that for all $i\\in[n],\\eps\\in\\{0,1\\}$\n$$\\deg_{i,\\eps}(T)=2^n-2\\cdot \\textbf{1}_{\\eps=0}+n_{i,\\eps}(T')-n_{i,1-\\eps}(T'),$$ \nwhere $n_{i,\\eps}(T')$ is the number of arcs of $T'$ with direction $i$ and spin $\\eps$. Therefore \n$$S_{C_n}(\\qq,\\yy)=\\left(\\prod_{i=1}^ny_{i,0}^{2^n}\\,y_{i,1}^{2^n}\\right)\\times \\frac{T_{C_n,\\rho}(\\xx)}{\\prod_{i=1}^ny_{i,0}^2},$$\nwith $x_{i,\\eps}=q_i\\, y_{i,\\eps}\/y_{i,1-\\eps}$. Using~\\eqref{eq:rooted-at-v} then gives the following result obtained by Martin and Reiner in~\\cite[Theorem 3]{Martin-Reiner:spanning-cube} using a matrix-tree approach:\n$$S_{C_n}(\\qq,\\yy)=\\left(\\prod_{i=1}^nq_i\\,y_{i,0}^{2^n-1}\\,y_{i,1}^{2^n-1}\\right)\\times\\left(\\prod_{S\\subseteq [n],|S|\\geq 2}\\,\\sum_{i\\in S}q_i\\left(\\frac{y_{i,0}}{y_{i,1}}+\\frac{y_{i,1}}{y_{i,0}}\\right)\\right).\n$$\n\n\\noindent \\textbf{A consequence of Theorem~\\ref{thm:bunkbed} about bicolored Cayley trees.}\\\\\nThe consequences of Theorem~\\ref{thm:bunkbed} explored in this paper are mainly about Cartesian products of graphs. \nLet us mention, for fun, a consequence with a different flavor. Let $K_{p,p}$ be the complete bipartite graph with black vertices labeled $1,\\ldots,p$ and white vertices labeled $1',\\ldots,p'$. Let $m0$) due to self-absorption in the optically thick regime \\citep{1986rpa..book.....R}. At higher frequencies, the medium is optically thin, and the spectrum falls ($\\alpha < 0$), following the distribution of energetic electrons.\nThe spectrum tells us about the condition of the emitting region. The most common variable sources between 90 and 150 GHz, active galactic nuclei (AGN), have $\\alpha\\ltsim 0$. Thus transients with $\\alpha>0$ between these frequencies are especially notable.\n\nWe report here on three serendipitous, high-significance discoveries of transient sources in maps from the Atacama Cosmology Telescope (ACT). The events are relatively bright, represent large fractional increases in luminosity, and appear to be unpolarized.\n\tOne has rapid, minute-timescale brightening, and two have rising spectra. These transients appear to be associated with stars.\n\n\\section{Observations }\n\\label{sec:obs}\n\\subsection{ACT}\nThe ACT experiment \\citep{thornton\/etal:2016} is a 6-meter telescope on Cerro Toco in the northern Chilean Andes. The third-generation receiver \\citep[AdvACT,][]{henderson\/etal:2016,choi\/etal:2018,crowley\/etal:2018} houses three separate arrays of feedhorn-coupled, dichroic, dual-polarization, transition-edge-sensor (TES) bolometers from the United States\nNational Institute of Standards and Technology (NIST), with each array occupying an individual optics tube. The arrays are cooled to 0.1 K and detect radiation in broad bands centered on 98, 150, and 225 GHz \\citep{choi\/etal:2020}. We label these bands f090, f150, and f220 respectively. The bolometers are read out with time-domain multiplexing electronics \\citep[chapter 2]{matthew-thesis} and stored in ``time-ordered data'' files (TODs), each of roughly 10-minute duration. Detector arrays PA5 and PA6 contain dichroic detectors which record intensity and linear polarization in the f090 and f150 bands simultaneously in each of 429 feeds. Array PA4 is similar but for the f150 and f220 bands in each of 503 feeds. Each optics tube images an instantaneous field of view with $\\sim 1^\\circ$ diameter on the sky. The average beam full-width-at-half-maximum for each band is 2.05\/1.40\/0.98 arcminutes at f090\/f150\/f220 respectively.\n\nThe observing strategy scans the telescope in azimuth with a peak-to-peak amplitude near $60^\\circ$ and a one way scan time of roughly 40 sec \\citep{debernardis\/etal:2016,choi\/etal:2020}. An individual scan covers a\nstripe of the sky the length of the azimuth throw and the width of the detector arrays, but due to the rotation\nof the sky the covered area drifts by $15^\\circ$ per hour in RA, allowing the same scanning motion to cover\nlarge areas of sky. When scanning in the East, a point on the sky is first observed\nwhen the bottom-most detectors in the lower two arrays (PA4 and PA5)\nsweep across it. These are gradually followed by detectors higher in the focal plane as the source rises.\nAfter $\\sim 6$ minutes it rises above these arrays, and about 3 minutes later enters the bottom\nof the upper array, PA6, where the process repeats. When scanning in the West the setting source crosses the arrays in reverse, from top to bottom.\nAll in all, a point on the sky takes about 15 minutes to traverse the ACT focal plane.\n\nSince 2016 ACT has been surveying $\\sim$40\\% of the sky with a variable but roughly weekly cadence, resulting in a\nset of 200 megapixel sky maps \\citep[e.g.][]{naess\/etal:2020}. ACT calibrates the data in several\nways, including by cross-correlation to quarter-degree-scale CMB fluctuations in maps from the Planck satellite.\nACT observes both during the night and day.\u00a0At night, the telescope has a simpler optical response and the processing of nighttime data is more mature. All three transient sources were observed at night.\n\nBased on comparing our mapping solution to the positions of known sources, pointing accuracy for the analysis presented here is approximately 3 arcsec (0.05 arcmin) independently in Dec and RA\/cos(Dec). This translates into effective 1$\\sigma$, 2$\\sigma$, and 3$\\sigma$ radii of\n5.8, 8.3 and 10.9 arcsec respectively for a $\\chi$ distribution with two degrees of freedom.\n\n\\subsection{Discovery}\nThe events presented here were not found in a search optimized for transients, but were instead\nserendipitously discovered during investigation of candidate events in a search for the hypothetical\nPlanet 9 \\citep{p9_hypothesis}, which will be the subject of an upcoming paper \\citep[in preparation]{act-planet9}.\nThis search covers roughly\n18\\,000 square degrees of sky using almost all ACT data from 2008 to 2019. However, the shift-and-stack\nalgorithm used for the planet search is far from optimal for detecting transients, so the events\npresented here were only found due to their high brightness. We expect a forthcoming search optimized\nspecifically for transients to have a higher yield.\n\n\\subsection{Characterization}\nWe perform a maximum likelihood fit of the position and a per-detector-array, per-frequency\nflux for each of our three detections. This fit was performed directly in the time-ordered data,\nusing the same noise model used for our normal map-making \\citep[e.g.,][]{aiola\/etal:2020},\nand therefore takes into account\nboth the temporal and inter-detector correlation structure of the atmospheric and instrumental\nnoise. Due to ACT's broad scans, each TOD hits multiple bright point sources with known positions,\nin addition to the transient. We improve the absolute position accuracy by including these in the fit.\n\n\n\\begin{figure*}[htbp]\n\\begin{center}\n\\includegraphics[width=0.9\\textwidth]{fig1.png}\n\t\\caption{Diagnostic plot for Event 1. The rows show a series of $0.5^{\\circ}\\times0.5^{\\circ}$ filtered maps corresponding to PA4 f150, PA5 f150, PA6 f150, PA4 f220, PA5 f090 and PA6 f090 from the bottom to the top, while the columns correspond to individual 3-day chunks of data for the 2017-2019 observing seasons, with those that don't have exposure near this object omitted (so there are implicit, variable-length gaps between each column). The maps are in units of signal-to-noise ratio, spanning from -8 (blue) to +8 (red). Time increases from left to right. It is clear that this region is quiet until the last map where a strong point source suddenly appears in all arrays that hit it. The columns are not equi-spaced, and there is a gap of 12 days between the preceding thumbnail maps and the ones in which the source is detected. The source is evident in the PA4 time line but the data do not pass our data quality cuts. The time for the last map spans from 2019-11-7 00:00:00 to 2019-11-10 00:00:00. Unfortunately, there are no observations of this region in 2019 after those shown in this figure. There is a several month long gap before any 2020 coverage of this region, and the 2020 data is not yet ready for analysis.\n}\n\\label{fig:thumbnails}\n\\end{center}\n\\end{figure*}\n\n\\begin{figure}[htbp]\n\t\\begin{center}\n\t\\includegraphics[width=\\columnwidth]{light_curve_cand_011_nogain.pdf}\n\t\t\\caption{High-resolution light curve for Event~1 ACT-T J181515-492746{} made by subdividing the ACT detector arrays\n\t\tinto 4 sub-sections that hit the source at slightly different times. We observe a rapid rise from\n\t\tabout 180 to 600 mJy at f090 and from 600 to 1100 mJy at f150 over the course of 8 minutes followed by what might\n\t\tbe the beginning of a slower decay. We do not detect anything at this location before this, even\n\t\twhen averaging four years of data. The gap between -4 and 0 minutes on the x-axis corresponds to\n\t\tthe separation between two of our detector arrays. Unfortunately there are no observations of this\n\t\tregion in 2019 after this. No f220 data survived our data cuts during the event.}\n\t\\label{fig:e1-lightcurve}\n\t\\end{center}\n\\end{figure}\n\n\\section{The events}\n\\label{sec:events}\n\n\\begin{table*}[hpt]\n\t\\begin{center}\n\t\\caption{Overview of the events}\n\t\\label{tab:overview}\n\t\\begin{tabular}{clrrr}\n\t\t& & Event 1 & Event 2 & Event 3 \\\\\n\t\tName & & \\scriptsize\\narrow ACT-T J181515-492746{} & \\scriptsize\\narrow ACT-T J070038-111436{} & \\scriptsize\\narrow ACT-T J200758+160954{} \\\\\n\t\t\\hline\n\t\t\\multirow{4}{*}{\\rotatebox[origin=c]{0}{\\makecell{Coords\\\\\\dg}}}\n\t\t&RA & 273.8138 & 105.1584 & 301.9952 \\\\\n\t\t&Dec & -49.4628 & -11.2434 & 16.1652 \\\\\n\t\t&l & 15.4692 & 223.9866 & 56.2617 \\\\\n\t\t&b & -14.8090 & -3.0893 & -8.8159 \\\\\n\t\t\\hline\n\t\t\\multicolumn{2}{l}{Pos. acc. \"} & 3 & 3 & 3 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Time}}}\n\t\t& Peak & 2019-11-8 22:30 & 2019-12-15 02:22 & 2018-9-11 23:36 \\\\\n\t\t& Rise & 8 min & $<8$ days & $<1$ day \\\\\n\t\t& Fall & $\\gg 4$ min & $\\gg 10$ min & $\\approx$ 2 weeks \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Mean flux\\\\mJy}}}\n\t\t& f090 & 5.9 $\\pm$ 4.8 & -0.7 $\\pm$ 5.8 & 10.3 $\\pm$ 2.9 \\\\\n\t\t& f150 & -2.4 $\\pm$ 3.3 & 7.7 $\\pm$ 6.5 & 3.6 $\\pm$ 2.2 \\\\\n\t\t& f220 & -1.0 $\\pm$ 4.0 & -5.2 $\\pm$13.2 & 0.4 $\\pm$ 4.5 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Peak flux\\\\mJy}}}\n\t\t& f090 & 579 $\\pm$36 & 143 $\\pm$13 & 340 $\\pm$10 \\\\\n\t\t& f150 & 1099 $\\pm$60 & 304 $\\pm$18 & 307 $\\pm$14 \\\\\n\t\t& f220 & -- & -- & 315 $\\pm$54 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Min factor\\\\50\\%}}}\n\t\t& f090 & 88 & 39 & 33 \\\\\n\t\t& f150 & 719 & 35 & 82 \\\\\n\t\t& f220 & -- & -- & 98 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Min factor\\\\98\\%}}}\n\t\t& f090 & 36 & 11 & 21 \\\\\n\t\t& f150 & 181 & 14 & 38 \\\\\n\t\t& f220 & -- & -- & 27 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{Pol limit\\\\mJy}}}\n\t\t& f090 & \\lt 76.8 (15\\%) & \\lt 74.2 (41\\%) & \\lt 56.7 (18\\%) \\\\\n\t\t& f150 & \\lt 57.1 (10\\%) & \\lt 63.0 (31\\%) & \\lt 95.4 (24\\%) \\\\\n\t\t& f220 & -- & -- & \\lt 57.9 (74\\%) \\\\\n\t\t\\hline\n\t\t\\multicolumn{2}{l}{Spec.ind. ($\\alpha$)} & 1.5 $\\pm$ 0.2 & 1.8 $\\pm$ 0.2 & -0.2 $\\pm$ 0.4 \\\\\n\t\t\\hline\n\t\t\\multirow{4}{*}{Assoc}\n\t\t& Name & \\scriptsize\\narrow 2MASS J18151564-4927472 & \\scriptsize\\narrow HD 52385 & \\scriptsize\\narrow HD 191179 \\\\\n\t\t& Sep. \" & 3.5 & 10.7 & 6.4 \\\\\n\t\t& Chance & $3.7\\times 10^{-4}$ & $8.9\\times 10^{-5}$ & $2.8\\times 10^{-5}$ \\\\\n\t\n\t\t& Dist pc & 62.0 $\\pm$ 0.6 & 403 $\\pm$ 4 & 219 $\\pm$ 1 \\\\\n\t\t\\hline\n\t\t\\multirow{3}{*}{\\rotatebox[origin=c]{0}{\\makecell{$\\nu L_\\nu$\\\\\\tiny$10^{22}$W}}}\n\t\t& f090 & 2.61 $\\pm$ 0.16 & 27.20 $\\pm$ 2.48 & 19.14 $\\pm$ 0.59 \\\\\n\t\t& f150 & 7.59 $\\pm$ 0.42 & 88.73 $\\pm$ 5.13 & 26.38 $\\pm$ 1.18 \\\\\n\t\t& f220 & -- & -- & 39.73 $\\pm$ 6.81 \\\\\n\t\t\\hline\n\t\t\\multicolumn{2}{l}{Notes} &\n\t\t\\makecell*[{{p{27mm}}}]{\\scriptsize Rapid rise from near zero to peak in 8 minutes.\n\t\tBlue spectrum.} &\n\t\t\\makecell*[{{p{27mm}}}]{\\scriptsize Not observed during rise and fall. No detectable evolution over 15 min.\n\t\tBlue spectrum. Position offset is a bit big.} &\n\t\t\\makecell*[{{p{27mm}}}]{\\scriptsize Flat spectrum. Slow, non-monotonic fall from peak over 2 weeks.} \\\\\n\t\t\\hline\n\t\\end{tabular}\n\t\\end{center}\n\t\\tablecomments{\\small\n\t\tThe ``peak'' time represents when ACT observed the\n\t\thighest flux from the source, in UTC. Due to sparse coverage this might not coincide with the\n\t\tactual peak of the light curve. The rise\/fall times are the time it takes the source\n\t\tto rise\/fall from below detectability to the peak. Due to sparse coverage some of these are\n\t\tonly upper limits, and some are completely unconstrained because the source was never observed\n\t\tafter this. The coordinates are J2000 and have an approximate accuracy of 3 arcseconds ($1\\sigma$ error), with\n\t\tcomparable contributions from statistical and systematic uncertainty. The ``mean'' fluxes\n\t\treported are those from forced photometry at the source position on maps using all data from\n\t\tthe 2016--2019 observing seasons, which includes the event itself as a small subset.\n\t\tThe ``min factor'' gives the 50\\% and 98\\% lower bound on how many times brighter the source\n\t\tgot during the peak compared to its normal state.\n\t\tWe do not detect polarization for any of the events, from which we derive the\n\t\t98\\% upper limits in flux and polarization fraction given in the row ``pol limit''.\n\t\tThe spectral index was measured using f090 and f150 only. Distances come from Gaia DR 2.\n\t\t``Chance'' is the probability that an object as bright as the given candidate would be\n\t\tthat close to the event by chance.\n\t\t$\\nu L_\\nu$ gives the characteristic luminosity of the event in units of $10^{22}$W,\n\t\tassuming isotropy and that the event is at the distance given by the tentative association.\n\t\tLuminosity error bars do not include distance uncertainty.\n\t}\n\\end{table*}\n\n\\subsection {Event 1: ACT-T J181515-492746{}}\nEvent 1 was observed at RA$=273.8162^\\circ \\pm 0.0013^\\circ$ and Dec$=-49.4628^\\circ \\pm 0.00083^\\circ$\nduring one TOD in PA5 and one in PA6 between 22:22 and 22:34 UTC on 2019-11-8. The galactic coordinates\nare $l=344.53^\\circ$ and $b=-14.81^{\\circ}$ consistent with being in the galactic plane.\nThe two arrays measured\na large and unexpected difference in the event's flux in these TODs, which could either be explained as\na relative calibration error for the two arrays, or as a rapid increase in brightness during the 8\nminutes it takes the sky to drift from one array to the next. To investigate this we split each array\ninto four sub-sets in elevation and measured the flux at the event's position in each.\nThis resulted in a total of 8 flux measurements taken at roughly 1 minute\nintervals. This light curve is shown in Figure~\\ref{fig:e1-lightcurve}, and shows a rapid and steady\nrise in flux from 300 mJy to a peak of 1100 mJy over the course of 8 minutes, followed by what might be\nthe start of a slower decay. At this point it was brighter than all but 51 of the 19\\,600 point sources\nseen by ACT at $>5\\sigma$ at f150. We did not detect the event in polarization, from which we place\nthe 98\\% upper limit of polarized flux density of 77 mJy at f090 and 57 mJy at f150.\n\nTo rule out calibration errors we measured the light curve for two bright\npoint sources that were also visible in these TODs. These were flat to within 10\\% over this period.\nThe subsequent observation of the event by two arrays (and their subsets) also rules out terrestrial contamination.\nAn object fixed to the celestial sphere transits one array in roughly 3 minutes. Because of their position in the focal plane, PA5 and PA6 view a point on the celestial sphere 8 minutes apart. The event was present at the same celestial location for the two TODs, which rules out anything moving quickly, such as an airplane, which would cross one array in roughly a second. Similarly, a source orbiting the Earth would transit an array in roughly 15 seconds.\n\nSince we did not observe this region of sky again in 2019, we cannot say how long the event lasted.\n\n\nAfter the event was identified, we measured the flux at the event's location in maps based on the full\nACT data set from 2008--2019 (of which data from 2016--2019 hit this region) to determine the baseline\nflux level. No significant flux was detected and there was nothing out of the ordinary at this position\nuntil the event occurred. We used this to set lower limits on how many times brighter\nthan its average level the source got at its peak: at 98\\% (50\\%) confidence the source got at least 36 (88) times\nbrighter at f090 and 181 (719) times brighter at f150. During the flare the source had a spectral\nindex of $\\alpha=1.5\\pm0.2$ as measured between f090 and f150. This value includes a $1\\sigma$ calibration\nuncertainty of 5\\% particular to this analysis. We see no evidence of the spectral index changing\nduring the flare.\n\nThe properties of Event~1 are summarized in the first column of Table~\\ref{tab:overview}.\n\n\n\n\\subsubsection{Possible counterparts}\n\nEvent 1 is 3.5 arcsec away from the high proper-motion M star 2MASS J18151564-4927472 at a distance of 62 pc \\citep{gaia:2020}.\nThe star has J2000 coordinates RA=273.8152$^\\circ$\nDec=-49.4631$^\\circ$ and spectral type M3V.\nThe star has TESS observations with a $0.4$ day periodicity, which suggests that it is a rapid rotator.\n \\citet{messina\/etal:2017} notes it as a single-line spectroscopic binary.\n\nThe star 2MASS J18151564-4927472 is a member of the $\\beta$ Pictoris moving group or possibly the Argus association \\citep{moor\/etal:2013,2017A&A...607A...3M}. These associations contain young stars: recent age estimates are in the range 16--28 Myr for the $\\beta$ Pic moving group \\citep{2016MNRAS.455.3345B,2016A&A...596A..29M,2020A&A...642A.179M} and 40--50 Myr for the Argus association \\citep{2019ApJ...870...27Z}.\n\nThe association with 2MASS J18151564-4927472 is much closer than one would\nexpect by chance, given the local density of such stars. According to \\citet{gaia:2020}, there are only 1568 stars\nof its brightness (g-mag 11.72) or brighter within $2\\dg$ of this position.\nAt this areal density, $n = 9.63\\times 10^{-6}$ arcsec$^{-2}$, the probability\nof having a star as bright as this within $r = 3.5$ arcsec is only $P = 1 -\n\\exp(-n\\pi r^2) = 3.7\\times 10^{-4}$. It therefore seems unlikely that this is\na chance association.\n\nEvent 1 is also associated with the ROSAT X-ray source 2RXS J200759.4+160959 \\citep{2rxs},\nwhich has a separation of 8.2 arcsec from the event, consistent with the ROSAT position\naccuracy of 6 arcsec. The local density of ROSAT X-ray sources of this\nbrightness (18.83 counts\/s) is $1.4 \\times 10^{-8} \\text{arcesc}^{-2}$ within a\ndistance of $10^\\circ$, leading to a random association probability of just\n$2.9 \\times 10^{-6}$. The X-ray source is therefore likely to be assicated\nwith Event 1 and 2MASS J18151564-4927472.\n\nAt a distance of 62 pc, the characteristic luminosity (assumed isotropic) of this transient event would be $\\nu L_\\nu = 2.61 \\pm 0.16 \\times 10^{22}$ W in f090 and $\\nu L_\\nu = 7.59 \\pm 0.42 \\times 10^{22}$ W in f150.\nThis is roughly a million times brighter than a bright solar flare (e.g. $3.5\\times 10^{16}$ W at\n212 GHz for an X5.6 class flare \\citep{Kaufmann_2003}), but is comparable to giant flares observed\nin young stars (see section~\\ref{sec:discussion}).\n\n\\subsection {Event 2: ACT-T J070038-111436{}}\n\nEvent 2 was observed at\nRA$=105.1584^\\circ \\pm 0.00085^\\circ$ and Dec$=-11.2434^\\circ \\pm 0.00083^\\circ$ in one TOD each of PA4, PA5 and PA6 during the period 02:30--02:38 UTC on 2019-12-15. In that interval,\nwe observed a flux consistent with being constant ($p = 0.51$, though with large error bars)\nat 143 $\\pm$ 13.0 mJy at f090 and 304 $\\pm$ 18 mJy at f150. The array PA4 is also sensitive\nto the f220 frequency band, but the f220 data did not pass our quality cuts for this TOD.\nFor comparison the mean sky flux at this location across our full data set is consistent with zero,\n-0.7\/7.7\/-5.2 $\\pm$ 5.8\/6.5\/13.2 mJy at f090\/f150\/f220.\nThis represents a brightening of a factor of at least 35 (39) at f090 and\n11 (14) at f150 at a confidence of 98\\% (50\\%). We do not detect the event in polarization,\nresulting in a 98\\% upper limit of 74\/63 mJy at f090\/f150.\n\nThese observations are preceded by an 8 day gap in coverage of this part of the sky, and\nthis area of the sky was not observed again in the ACT data we have analyzed so far. We can therefore only\nlimit the rise and fall times for the light curve to be $<$ 8 days and $\\gg 10$ min respectively.\nThe galactic coordinates are $l=-138.01^\\circ$ and $b=-3.09^{\\circ}$, so the event is close to the galactic\nplane. Between f090 and f150, $\\alpha=1.8\\pm0.2$.\n\nEvent 2 is summarized in column~2 in Table~\\ref{tab:overview}.\n\n\\subsubsection{Possible counterparts}\n\nThe two closest sources in the SIMBAD data base \\citep{simbad\/2000} are\nthe star HD 52385 (spectral type K0\/III) \\citep{cannon\/pickering:1993,1999MSS...C05....0H}, which is 10.7 arcsec ($2.9\\sigma$) away from the position of Event 2, and ROSAT source 2RXS J070037.4-111435\\footnote{\n\t$5.2 \\times 10^{-6}$ probability of seeing an X-ray source as bright as its\n\t22.68 counts\/s as close as this by chance.} \\citep{2rxs} which is 7.9 arcsec away.\n\nThe star's J2000 coordinates are RA=105.1567$^\\circ$ Dec=$-11.2459^\\circ$ and its distance is 403 pc \\citep{gaia:2020}. It is in the star forming region Canis Major R1.\nIn a ROSAT study of the young stellar population of this star forming region, the star and X-ray source are also associated by \\citet{2009A&A...506..711G}, who from color-magnitude and isochrone fitting determined the object's mass and age as $>5$ $M_\\odot$ and $<1$ Myr, although they remained uncertain about the age.\n\n{\\sl Gaia} lists 161 stars at least as bright as HD 52385's 8.11 g-mag within $4\\dg$ of Event 2, for a local density\nof $n=0.247\\times 10^{-6}$ arcsec$^{-2}$. The probability for a star as bright as this being\nas close as 10.7 arcsec by chance is only $P=8.9\\times 10^{-5}$.\n\nAt a distance of 403 pc,\nthe characteristic luminosity (again assuming isotropy) of this event would be\n$\\nu L_\\nu = 27 \\pm 2 \\times 10^{22}$ W at f090 and\n$\\nu L_\\nu = 89 \\pm 5 \\times 10^{22}$ W at f150, making it more than ten times as luminous as Event 1.\n\n\\begin{figure*}[th]\n\\begin{center}\n\\includegraphics[width=0.9\\textwidth]{light_curve_cand_018.pdf}\n\\caption{The light curve for Event~3 ACT-T J200758+160954{}. The event starts with a sudden rise from\nbelow our detection\nlimit to about 300 mJy in all three of ACT's frequency bands. It then decays roughly linearly to\nnearly undetectable over the course of 3 days, after which there is a new jump up to about 150 mJy\nfollowed by a new decay. There are large gaps in our coverage of these coordinates after this, but\nby day 12-15 the source is undetectable in f150 and f220 and barely detectable in f090. We do not\ndetect it after this. In sky maps built from all our data (including the event itself) we detect an object\nat this location only in f090, at $3.5 \\sigma$.}\n\\label{fig:event_3_lc}\n\\end{center}\n\\end{figure*}\n\n\\subsection {Event 3: ACT-T J200758+160954{}}\n\nEvent 3 was observed at RA$=301.9952^\\circ \\pm 0.00087^\\circ$ and Dec$=16.1652^\\circ \\pm 0.00083^\\circ$\nwith an (observed) peak on 2018-09-11 23:36, which is also our first detection of a signal at this\nlocation. Unlike the other events, we have extensive, if somewhat irregular,\ncoverage of this area both before and after the peak, resulting in the light curve shown in\nFigure~\\ref{fig:event_3_lc}. The source appears from one day to the next with a flux of\n340\/306\/315 $\\pm$ 10\/14\/54 mJy at f090\/f150\/f220, and then falls\ngradually to near non-detection over the course of 3 days, followed by a new sudden rise and\nanother slow decay. By day 12-15 the source is undetectable in f150 and f220 and barely detectable in f090.\nWe do not detect the event in polarization, resulting in a 98\\% upper limit of\n57\/95\/58 mJy at f090\/f150\/f220.\n\nWhen averaged over all our data, we find a mean flux of 10.3\/3.6\/0.4 $\\pm$ 2.9\/2.2\/4.5 mJy, corresponding\nto a $3.6 \\sigma$ detection at f090. However, it's important to note this data includes the event itself.\nIt is possible that the weak detection at f090 in the average data is simply a diluted version of the transient itself,\nwith no flux being present outside this event.\nWe will perform a more careful measurement\nof the multi-season average flux that excludes the event itself in a future paper describing a systematic search\nfor ACT transients. If these mean fluxes are representative of the source's behavior outside the\nevent, then the source got at least 21\/39\/27 (33\/92\/98) times brighter in f090\/f150\/f220 at 98\\% (50\\%)\nconfidence.\n\nThe galactic coordinates are $l=56.3^\\circ$ and $b=-8.8^{\\circ}$, again near the galactic plane.\nThe spectral index at the peak is $-0.25\\pm0.17$ between f090 and f150, $-0.23\\pm0.44$ between\nf090 and f220, and $0.12\\pm0.48$ between f150 and f220. We see no evidence of the spectral index changing\nduring the event.\n\nThe properties of Event 3 are summarized in the third column of Table~\\ref{tab:overview}.\n\n\\subsubsection {Possible counterparts}\n\nThe star HD 191179 \\citep{cannon\/pickering:1993} is within 6.4 arcsec ($1.1\\sigma$) with the position of event 3. It is a spectroscopic binary \\citep{1998MNRAS.295..257O,2009Obs...129..317G} with J2000 coordinates RA = 301.9968$^\\circ$, Dec = 16.1662$^\\circ$ and a distance of 219 pc. It is coincident with WISE J200759.23+160958.1\n\\citep{wright\/etal:2010} and X-ray source 1RXS J200759.3+160955\\footnote{\n\tSeparation 9.4 arcsec; $2.6 \\times 10^{-7}$ probability of seeing an X-ray source as bright as its\n\t349 counts\/s as close as this by chance.} \\citep{2000ApJS..131..335R,2012AcA....62...67K,2015A&A...575A..42G}. The X-ray source is identified with the stellar system.\nSIMBAD lists this object as a G5 star, but \\citet{1998MNRAS.295..257O} and \\citet{2002A&A...384..491C} fit the binary system with models of K0IV + G2V (subgiant\/dwarf) and K0IV + G2IV (subgiant\/subgiant), respectively. In particular, \\citet{2002A&A...384..491C} categorize the G star as a fast rotating solar-type star, which indicates that it is a young object, in a class of stars just before or just after arrival on the main sequence. The system appears in the catalog of \\citet{2008MNRAS.389.1722E} of chromospherically active binary stars.\n\nAlthough Event 3 has some of the characteristics of a blazar, e.g. a flat spectrum and evolution on day-to-week time-scales, we could not identify a potential candidate.\n\n{\\sl Gaia} lists 140 stars at least as bright as HD 191179's 7.96 g-mag within $4\\dg$ of Event 3,\nfor a local density of $n=0.215\\times 10^{-6}$ arcsec$^{-2}$. The probability\nfor a star this bright happening to be within 6.4 arcsec by chance is $P=2.8\\times 10^{-5}$. If the\nassociation with HD 191179 is correct, then the peak flux corresponded to a\ncharacteristic luminosity $\\nu L_\\nu$ of $19.1\/26.4\/39.7 \\pm 0.6\/1.2\/6.8 \\times\n10^{22}$ W in f090\/f150\/f220, making it intermediate between Event 1 and 2.\n\n\n\\section{Discussion}\n\\label{sec:discussion}\n\n\\begin{figure}\n\t\\centering\n\t\\includegraphics[width=\\columnwidth]{mm_flares.pdf}\n\t\\caption{Comparison of the characteristic luminosity with other bright mm-wave star\n\tflares from the literature. \\dfn{act-1\/2\/3}: Event 1\/2\/3 from this paper.\n\t\\dfn{alma-1\/2}: Proxima Centauri \\citep{macgregor\/etal:2018} and\n\tAU Mic \\citep{macgregor2020properties} flares measured with ALMA.\n\t\\dfn{bima-1}: Flaring of GMR-A in the Orion Nebula \\citep{Bower_2003}.\n\t\\dfn{eff-1, pdbi-1}: V773 Tau by \\citet{2009ASPC..402..400U}\n\tand \\citet{Massi_2006} respectively. \\dfn{ovma-1}: $\\upsigma$ Gem\n\t\\citep{Brown_2006}. \\dfn{scuba2-1}: JW 566 \\citep{Mairs_2019}.}\n\t\\label{fig:flare_comparison}\n\\end{figure}\n\n\nThe spatial coincidence of these three sources with stars is notable. Assuming the stellar associations are correct, we can compare them to other mm-wave stellar transient events as in Figure~\\ref{fig:flare_comparison}. There is a wide variety of behavior, and our events are comparably luminous to some of the previous observations. Of those previous events, three are in T Tauri stars:\nV773 Tau \\citep{2009ASPC..402..400U}, JW 566 \\citep{Mairs_2019}, and GMR-A \\citep{Bower_2003}.\nThree are in binary systems: V773 Tau and JW 566 are binary T Tauri systems, and $\\sigma$ Gem is an evolved giant K star in an RS Canum Venaticorum variable binary. Sources like these can exhibit strong\nvariability in both flux and spectral index during and after a flare \\citep{Bower_2003}. The time-scale of these events varies greatly. Some vary on time-scales\nof days, while others rise and fall in as little as a minute. For example\nProxima Centauri, an M-type star, increased in brightness by 1000 with a duration of about half a minute at 233 GHz (including both rise and fall), and with a spectral index of $\\alpha=-1.77\\pm0.45$ \\citet{macgregor\/etal:2018}.\n\nLikely all of our stars are young. One star (2MASS J18151564-4927472) is on the main sequence, but is a candidate member of young stellar associations and a fast rotator. The other two are much too luminous to be on the main sequence.\nHD 52385 is a young stellar object in a star forming region. HD 191179 is a fast rotator and young object.\nTwo of our stars (2MASS J18151564-4927472 and HD 191179) are known binaries. All the stars are associated\nwith strong X-ray emission.\n\nA main mechanism for stellar flares is magnetic reconnection in coronal loops on the surface of the star. These can happen in loop collisions on single stars, but are enhanced in young stellar objects by interactions with the protoplanetary disc and in binary star systems by interactions between the coronas of the two stars \\citep{Massi_2006}.\n\nWe expect to detect more flaring stars as well as extragalactic transients in a future systematic search for transients in the ACT data. This will permit an assessment of the associated event rates. The large area mm-wave coverage of ACT and the upcoming Simons Observatory \\citep{SO:2019} and CMB-S4 \\citep{CMB-S4:2019} will nicely complement the Vera Rubin Observatory's detection of transients in the optical \\citep{lsst-science-drivers-2019}.\nThe lack of time coverage in our detections highlights the need for a regular and frequent cadence to characterize such events well.\n\nBy surveying large areas, mm-wave instruments will be able to measure the population statistics of these mm-wave stellar flares. With a blind search, we will be able to constrain the rates of such flares both inside star forming regions (where many previous works have looked) and outside them in the general stellar population.\n\n\\section*{Acknowledgments}\nThis work was supported by the U.S. National Science Foundation through awards AST-0408698, AST-0965625, and AST-1440226 for the ACT project, as well as awards PHY-0355328, PHY-0855887 and PHY-1214379. Funding was also provided by Princeton University, the University of Pennsylvania, and a Canada Foundation for Innovation (CFI) award to UBC. ACT operates in the Parque Astron\\'omico Atacama in northern Chile under the auspices of the Comisi\\'on Nacional de Investigaci\\'on (CONICYT).\nComputations were performed on the Niagara supercomputer at the SciNet HPC Consortium and on the Simons-Popeye cluster of the Flatiron Institute. SciNet is funded by the CFI under the auspices of Compute Canada, the Government of Ontario, the Ontario Research Fund---Research Excellence, and the University of Toronto.\nKMH is supported by NSF through AST 1815887.\nEC acknowledges support from the STFC Ernest Rutherford Fellowship ST\/M004856\/2 and STFC Consolidated Grant ST\/S00033X\/1, and from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (Grant agreement No. 849169).\nSKC acknowledges support from NSF award AST-2001866.\nZX is supported by the Gordon and Betty Moore Foundation.\nNS acknowledges support from NSF grant number AST-1907657.\n\nWe gratefully acknowledge the many publicly available software packages that were essential for parts of this analysis. They include\n\\texttt{healpy}~\\citep{Healpix1}, \\texttt{HEALPix}~\\citep{Healpix2}, and\n\\texttt{pixell}\\footnote{https:\/\/github.com\/simonsobs\/pixell}. This research made use of \\texttt{Astropy}\\footnote{http:\/\/www.astropy.org}, a community-developed core Python package for Astronomy \\citep{astropy:2013, astropy:2018}. We also acknowledge use of the \\texttt{matplotlib}~\\citep{Hunter:2007} package and the Python Image Library for producing plots in this paper.\nLastly, we thank Rachel Osten for especially helpful comments on an earlier draft of this paper. \n\n\\bibliographystyle{act_titles}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section*{Introduction}\n\nCollective motion is one of the most striking examples of aggregated coherent behaviour in animal groups, dynamically self-organising out of local interactions between individuals.\nIt is observed in different animal species, such as schools of fish~\\cite{parrish2002self, sumpter2008information}, flocks of birds~\\cite{lissaman1970formation, may1979flight, ballerini2008interaction, bialek2012statistical}, colonies of insects~\\cite{buhl2006disorder, fourcassie2010ant, buhl2010group, attanasi2014collective, buhl2016} and herds of ungulates~\\cite{ginelli2015intermittent}.\nThere is an emerging understanding that information plays a \\emph{dynamic} role in such a coordination~\\cite{sumpter2008information}, and that \\emph{distributed} information processing is a specific mechanism that endows the group with collective computational capabilities~\\cite{bonabeau1999swarm, couzin2009collective, albantakis2014evolution}.\n\nInformation transfer is of particular relevance for collective behaviour, where it has been observed that small perturbations cascade through an entire group in a wave-like manner~\\cite{potts1984chorus, procaccini2011propagating, herbert2015initiation, attanasi2015emergence}, with these cascades conjectured to embody information transfer~\\cite{sumpter2008information}.\nThis phenomenon is related to underlying causal interactions, and a common goal is to infer physical interaction rules directly from experimental data~\\cite{katz2011inferring, gautrais2012deciphering, herbert2011inferring} and measure correlations within a collective.\n\nNagy et al.~\\cite{nagy2010hierarchical} used a variety of correlation functions to measure directional dependencies between the velocities of pairs of pigeons flying in flocks of up to ten individuals, reconstructing the leadership network of the flock.\nAs has been shown later, this network does not correspond to the hierarchy between birds~\\cite{nagy2013context}.\nInformation transfer has been extensively studied in flocks of starlings, by observing the propagation of direction changes across the flocks~\\cite{cavagna2013diffusion, cavagna2013boundary, attanasi2014information}.\nMore recently, Rosenthal et al.~\\cite{rosenthal2015revealing} attempted to determine a communication structure of a school of fish during its collective evasion manoeuvres manifested through cascades of behavioural change.\nA functional mapping between sensory inputs and motor responses was inferred by tracking fish position and body posture, and calculating visual fields.\n\nRather than consider \\emph{semantic} or \\emph{pragmatic} information, many contemporary studies employ rigorous information theoretic measures that quantify information as uncertainty reduction, following Shannon~\\cite{cover91}, in order to deal with the stochastic, continuous and noisy nature of intrinsic information processing in natural systems~\\cite{feldman2008organization}.\nDistributed information processing is typically dissected into three primitive functions: the \\emph{transmission}, \\emph{storage} and \\emph{modification of information}~\\cite{langton1990computation}.\n\\emph{Information dynamics} is a recent framework characterising and measuring each of the primitives information-theoretically~\\cite{liz14a,lizier2013book}.\nIn viewing the state update dynamics of a random process as an information processing event, this framework performs an \\emph{information regression} in accounting for where the information to predict that state update can be found by an observer, first identifying predictive information from the past of the process as \\emph{information storage}, then predictive information from other sources as \\emph{information transfer} (including both pairwise transfer from single sources, and higher-order transfers due to multivariate effects).\nThe framework has been applied to modelling collective behaviour in several complex systems, such as Cellular Automata~\\cite{lizier2008local, lizier2010information, lizier2012local}, Ising spin models~\\cite{barnett2013information}, Genetic Regulatory Networks and other biological networks~\\cite{lizier2011information, prokopenko2011relating, faes14a}, and neural information processing~\\cite{gomez2014reduced, wibral2015bits}.\n\nThis study proposes a domain-independent, information-theoretic approach to detecting and quantifying individual-level dynamics of information transfer in animal groups using this framework. This approach is based on transfer entropy \\cite{schreiber2000measuring}, an information-theoretic measure that quantifies the directed and time-asymmetric predictive effect of one random process on another.\nWe aim to characterize the dynamics of how information transfer is conducted in space and time within a \\emph{biological} school of fish (\\textit{Hemigrammus rhodostomus} or rummy-nose tetras, Figure \\ref{fig:polarisation-fish}).\n\nWe stress that the predictive information transfer should be considered from the observer perspective, that is, it is the observer that gains (or loses) predictability about a fish motion, having observed another fish.\nIn other words, notwithstanding possible influences among the fish that could potentially be reflected in their information dynamics, our quantitative analysis focuses on the information flow within the school which is detectable by an external observer, captured by the transfer entropy.\nThis means that, whenever we quantify a predictive information flow from a source fish to a destination fish, we attribute the change of predictability (uncertainty) to a third party, be it another fish in the school, a predator approaching the school or an independent experimentalist.\nAccordingly, this predictive information flow may or may not account for the causal information flow affecting the source and the destination~\\cite{ay2008information, lizier2010differentiating} --- however it does typically indicate presence of causality, either within the considered pair or from some common cause.\n\nWe focus on collective direction changes, i.e. collective U-turns, during which the directional changes of individuals\nprogress in a rapid cascade, at the end of which a coherent motion is re-established within the school.\nSets of different U-turns are comparable across experiments under the same conditions, permitting a statistically significant analysis involving an entire set of U-turns.\n\nBy looking at the \\emph{pointwise} or \\emph{local} values of transfer entropy over time, rather than at its average values, we are not only able to detect information transfer, but also to observe its dynamics over time and across the school.\nWe demonstrate that information is indeed constantly flowing within the school, and identify the source-destination lag where predictive information flow is maximised (which has an interpretation as an observer-detectable reaction time to other fish).\nThe information flow is observed to peak during collective directional changes, where there is a typical ``cascade'' of predictive gains and losses to be made by observers of these pairwise information interactions.\nSpecifically, we identify two distinct predictive information flows: (i) an ``informative'' flow, characterised by positive local values of transfer entropy, based on fish that have already changed direction about fish that are turning, and (ii) a ``misinformative'' flow, characterised by negative local values of transfer entropy, based on fish that have not changed direction yet about the fish that are turning.\nFinally, we identify spatial patterns coupled with the temporal transfer entropy, which we call spatio-informational motifs.\nThese motifs reveal spatial dependencies between the source of information and its destination, which shape the directed pairwise interactions underlying the informative and misinformative flows.\nThe strong distinction revealed by our quantitative analysis between informative and misinformative flows is expected to have an impact on modelling and understanding the dynamics of collective animal motion.\n\n\n\\section*{Information-theoretic measures for collective motion}\n\nThe study of Wang et al.~\\cite{wang2012quantifying} introduced the use of transfer entropy to investigations of collective motion.\nThis work quantitatively verified the hypothesis that information cascades within an (artificial) swarm can be spatiotemporally revealed by \\emph{conditional transfer entropy}~\\cite{lizier2008local, lizier2010information} and thus correspond to communications, while the collective memory can be captured by \\emph{active information storage}~\\cite{lizier2012local}.\n\nRichardson et al.~\\cite{richardson2013dynamical} applied related variants of conditional mutual information, a measure of non-linear dependence between two random variables, to identify dynamical coupling between the trajectories of foraging meerkats.\nTransfer entropy has also been used to study the response of schools of zebrafish to a robotic replica of the animal~\\cite{butail2014information, ladu2015acute}, and to infer leadership in pairs of bats~\\cite{orange2015transfer} and simulated zebrafish~\\cite{butail2016model}.\nLord et al.~\\cite{lord2016inference} also posed the question of identifying individual animals which are directly interacting with other individuals, in a swarm of insects (\\emph{Chironomus riparius}).\nTheir approach used conditional mutual information (called ``causation entropy'' although it does not directly measure causality \\cite{lizier2010differentiating}), inferring ``information flows'' within the swarm over moving windows of time.\n\nUnlike the study of Wang et al.~\\cite{wang2012quantifying}, the above studies quantified average dependencies over time rather than local dependencies at specific time points; for example, leadership relationships in general rather than their (local) dynamics over time.\nLocal versions of transfer entropy and active information storage have been used to measure pairwise correlations in a ``swarm'' of soldier crabs, finding that decision-making is affected by the group size~\\cite{tomaru2016information}.\nStatistical significance was not reported, presumably due to a small sample size.\nSimilar techniques were used to construct interaction networks within teams of simulated RoboCup agents~\\cite{cliff2017quantifying}.\n\nIn this study we focus on local (or pointwise) transfer entropy~\\cite{schreiber2000measuring,lizier2008local,liz14b} for specific samples of time-series processes of fish motion, which allows us to reconstruct the dynamics of information flows over time.\nLocal transfer entropy~\\cite{lizier2008local}, captures information flow from the realisation of a \\textit{source} variable $Y$ to a \\textit{destination} variable $X$ at time $n$.\nAs described in Methods, local transfer entropy is defined as the information provided by the source $\\mathbf{y_{n-v}} = \\{y_{n-v}, y_{n-v-1}, \\ldots, y_{n-v-l+1}\\}$, where $v$ is a time delay and $l$ is the history length, about the destination $x_n$ in the context of the past of the destination $\\mathbf{x_{n-1}}=\\{x_{n-1}, x_{n-2}, \\ldots, x_{n-k}\\}$, with a history length $k$:\n\\begin{equation}\nt_{y\\to x}(n,v) = \\log_2\\frac{ p( x_{n} | \\mathbf{x_{n-1}} , \\mathbf{y_{n-v}} ) }{ p( x_{n} | \\mathbf{x_{n-1}} ) }.\n\\label{eq:teInBackground}\n\\end{equation}\nImportantly, local values of transfer entropy can be negative, while the average transfer entropy is non-negative.\nNegative values of the local transfer entropies indicate that the source is \\textit{misinformative} about the next state of the destination (i.e. it increases uncertainty).\nPrevious studies that used average measures over sliding time windows in order to investigate how information transfer varies over time~\\cite{richardson2013dynamical, lord2016inference} cannot detect misinformation because they measure average but not local values.\n\nAs an observational measure, transfer entropy does not measure causal effect of the source on the target; this can only be established using interventional measures \\cite{ay2008information, lizier2010differentiating, chich12a, smirnov2013spurious}. Rather, transfer entropy measures the predictive information gained from a source variable about the state transition in a target, which may be viewed as \\emph{information transfer} when measured on an underlying causal interaction \\cite{lizier2010differentiating}.\nIt should be noted that while some researchers may be initially more interested in causality, the concept of information transfer reveals much about the dynamics that causal effect does not \\cite{lizier2010differentiating}, in particular being associated with emergent local structure in dynamics in complex systems \\cite{lizier2008local,wang2012quantifying} and with changes in behaviour, state or regime \\cite{boedecker2012information,barnett2013information}, as well as revealing the misinformative interactions described above. As a particular example, local transfer entropy spatiotemporally highlights emergent glider entities in cellular automata \\cite{lizier2008local}, which are analogues of cascading turning waves in swarms (also highlighted by transfer entropy \\cite{wang2012quantifying}), while local measures of causality do not differentiate these from the background dynamics \\cite{lizier2010differentiating}.\n\nIt is well known that the internal dynamics within a school of fish depends on the number of fish. For example, for schools of minnows (\\textit{Phoxinus phoxinus}), two fish schools are qualitatively different from schools containing three or more --- however, the effects seem to level off by the time the school reaches a size of six individuals~\\cite{partridge1980effect}.\nCollective behaviour, as well as a stereotypical ``phase transition'', when an increase in density leads to the onset of directional collective motion, have also been detected in small groups of six glass prawns (\\textit{Paratya australiensis})~\\cite{mann2013multi}.\nFurthermore, at such intermediate group sizes, it has been observed that multiple fish interactions could often be faithfully factorised into pair interactions in one particular species of fish~\\cite{gautrais2012deciphering}.\n\nIn our study we investigated information transfer within a school of fish during specific collective direction changes, i.e., U-turns, in which the school collectively reverses its direction.\nGroups of five fish were placed in a ring-shaped tank (Figure \\ref{fig:polarisation-tank}), a design conceived to constrain fish swimming circularly, with the possibility of undergoing U-turns spontaneously, without any obstacles or external factors.\nA total of 455 U-turns have been observed during 10 trials of one hour duration each.\nWe computed local transfer entropy between each (directed) pair of fish from time series obtained from fish heading.\nSpecifically, the destination process $X$ was defined as the directional change of the destination fish, while the source process $Y$ was defined as the relative heading of the destination fish with respect to the source fish (see Methods).\nThis allowed us to capture the influence of the source-destination fish alignment on the directional changes of the destination.\nSuch influence is usually delayed in time and we estimated the optimal delay (maximizing $\\langle t_{y\\to x}(n,v) \\rangle_n$ \\cite{wib13a}, see Methods) at $v=6$, corresponding to $0.12$ seconds.\n\n\n\\section*{Results}\n\n\n\\subsection*{Information flows during U-turns}\n\n\\begin{figure}[t]\n\\centering\n\\begin{minipage}{0.19\\textwidth}\n\\centering\n\\subfloat[]{\\label{fig:polarisation-fish}\\includegraphics[width=\\textwidth]{fish.jpg}}\\\\\\vspace{-3mm}\n\\subfloat[]{\\label{fig:polarisation-tank}\\includegraphics[width=\\textwidth]{tank.jpg}}\n\\end{minipage}\n\\hspace{5mm}\n\\begin{minipage}{0.6\\textwidth}\n\\centering\n\\subfloat[]{\\label{fig:polarisation-te}\\includegraphics[width=\\textwidth]{polarisation-te.pdf}}\n\\end{minipage}\n\\caption{\nTransfer entropy within the school during a U-turn.\nFigure \\ref{fig:polarisation-fish} is a photo of a spontaneous U-turn initiated by a single fish in a group of five \\textit{Hemigrammus rhodostomus} fish.\nFigure \\ref{fig:polarisation-tank} shows the experimental ring-shaped tank.\nFigure \\ref{fig:polarisation-te} plots the school's polarisation during a U-turn and the detected transfer entropy over a time interval of approximately 6 seconds.\nThe purple line represents the school's polarisation, while dots represent local values of transfer entropy between all directed pairs of fish: red dots represent positive transfer entropy and blue dots represent negative transfer entropy.\nTime is discretised in steps of length 0.02 seconds and for each time step 20 points of these local measures are plotted, for the 20 directed pairs formed out of 5 fish.\nThe yellow lines in the inset are the thresholds for considering a value of transfer entropy statistically different from zero ($p<0.05$ before false discovery rate correction, see Methods).\nGrey dots between these lines represent values that are not statistically different from zero.\n}\n\\label{fig:polarisation}\n\\end{figure}\n\nIn order to represent the school's orientation around the tank, we define its polarisation so that it is positive when the school is swimming clockwise and negative when it is swimming anti-clockwise (see Methods).\nThe better the school's average heading is aligned with an ideal circular trajectory around the tank, the higher is the intensity of the polarisation.\nWhen the school is facing one of the tank's walls, for example in the middle of a U-turn, the polarisation is zero, and the polarisation flips sign during U-turns.\nPolarisation allows us to map local values of transfer entropy onto the progression of the collective U-turns.\n\nThe analyses of transfer entropy over time reveal that the measure clearly diverges from its baseline in the vicinity of U-turns, as shown in the representative U-turn in Figure \\ref{fig:polarisation-te} (Supplementary Figure S1 shows a longer time interval during which several U-turns can be observed).\nThe figure shows that during regular circular motion, when the school's polarisation is highly pronounced, transfer entropy is low.\nAs the polarisation approaches zero the intensity of transfer entropy grows, peaking near the middle of a U-turn, when polarisation switches its sign.\n\nWe clarify that the aim here is \\emph{not} to establish transfer entropy as an alternative to polarisation for detecting turn; rather, our aim is to use polarisation to describe the overall progression of the collective U-turns and then to use transfer entropy to investigate the underlying information flows in the dynamics of such turns.\nIndeed, transfer entropy is found to be statistically different from zero at many points outside of the U-turns (see Supplementary Figure S1), although the largest values and most concentrated regions of these are during the U-turns.\nThis indicates that information transfer occurs even when fish school together without changing direction; we know that the fish are not executing precisely uniform motion during these in-between periods, and so interpret these small amounts of information transfer as sufficiently underpinning the dynamics of the group maintaining its collective heading.\n\nWe also see in Figure \\ref{fig:polarisation-te} that both positive and negative values of transfer entropy are detected.\nIn order to understand the role of the positive and negative information flows during collective motion, in the next section we show the dynamics of transfer entropy for individual pairwise interactions.\n\n\n\\subsection*{Informative and misinformative flows}\n\n\\begin{figure}[t!]\n\\centering\n\\subfloat[]{\\label{fig:trajectories-only}\\includegraphics[width=0.32\\textwidth]{trajectories-only.pdf}}\\hspace{0.01\\textwidth}\n\\subfloat[]{\\label{fig:trajectories-in}\\includegraphics[width=0.32\\textwidth]{trajectories-te-in.pdf}}\\hspace{0.01\\textwidth}\n\\subfloat[]{\\label{fig:trajectories-out}\\includegraphics[width=0.32\\textwidth]{trajectories-te-out.pdf}}\\\\\n\\subfloat[]{\\label{fig:polarisations-only}\\includegraphics[width=0.32\\textwidth]{polarisations-only.pdf}}\\hspace{0.01\\textwidth}\n\\subfloat[]{\\label{fig:polarisations-in}\\includegraphics[width=0.32\\textwidth]{polarisations-te-in.pdf}}\\hspace{0.01\\textwidth}\n\\subfloat[]{\\label{fig:polarisations-out}\\includegraphics[width=0.32\\textwidth]{polarisations-te-out.pdf}}\n\\caption{\nPositive and negative information flows during a U-turn.\nFigure \\ref{fig:trajectories-only} shows the trajectories of the five fish during the U-turn shown in Figure \\ref{fig:polarisation}.\nThe two black lines are the inner and the outer walls of the tank, and each of the five trajectories coloured in different shades of purple correspond to a different fish: from darkest purple for the first fish turning (Fish 1), to the lightest purple for the last (Fish 5).\nThe total time interval is approximately 2 seconds, during which all fish turn from swimming anti-clockwise to clockwise.\nFigure \\ref{fig:polarisations-only} depicts the polarisations of the five fish, showing the temporal sequence of fish turns.\nFigure \\ref{fig:trajectories-in} shows the fish trajectories again, but this time indicates the value of the \\textit{incoming} local transfer entropy to each fish as a destination, averaged over the other four fish as sources. \nThe colour of each trajectory changes as the fish turn:~strong red indicates intense positive transfer entropy; strong blue indicates intense negative transfer entropy; intermediate grey indicates that transfer entropy is close to zero.\nFigure \\ref{fig:polarisations-in} is obtained analogously to Figure \\ref{fig:trajectories-in}, but the polarisations of the individual fish are shown rather than their trajectories.\nFigures \\ref{fig:trajectories-out} and \\ref{fig:polarisations-out} mirror Figures \\ref{fig:trajectories-in} and \\ref{fig:polarisations-in}, but where the direction of the transfer entropy has been inverted: the colour of each trajectory or polarisation now indicates the value of the \\textit{outgoing} local transfer entropy from each fish as a source, averaged over the other four fish as destinations. \n}\n\\label{fig:trajectories}\n\\end{figure}\n\n\\begin{figure}[t]\n\\centering\n\\subfloat[]{\\label{fig:single-pol-in}\\includegraphics[width=0.4\\textwidth]{single-polarisation-te-in.pdf}}\\hspace{0.03\\textwidth}\n\\subfloat[]{\\label{fig:single-pol-out}\\includegraphics[width=0.4\\textwidth]{single-polarisation-te-out.pdf}}\\\\\n\\subfloat[]{\\label{fig:sequence-in}\\includegraphics[width=0.37\\textwidth]{sequence-in.pdf}}\n\\hspace{0.03\\textwidth}\n\\subfloat[]{\\label{fig:sequence-out}\\includegraphics[width=0.37\\textwidth]{sequence-out.pdf}}\n\\caption{\nFigure \\ref{fig:single-pol-in} shows the polarisation of the \\emph{second} fish turning, together with the incoming transfer entropy to that fish as the destination, with the other four fish as the sources:~red dots represent positive values and blue dots represent negative values.\nFigure \\ref{fig:single-pol-out} mirrors Figure \\ref{fig:single-pol-in}, but with the outgoing transfer entropy from that fish as the source, and the other four fish as destinations.\nIn Figure \\ref{fig:sequence-in}, each purple line corresponds to a fish, with the shade again reflecting the order in which the fish turn (darkest for first fish to turn, and lightest for the last).\nNow however (in Figure \\ref{fig:sequence-in}), rather than corresponding to a single U-turn event, the incoming local transfer entropy (to each fish as a destination, averaged over the other four fish as sources) is averaged over all 455 observed U-turns and is shown as a function of time.\nThe horizontal axis is the relative time of the U-turns, with zero being the time when the average polarisation of the school changes sign.\nFigure \\ref{fig:sequence-out} mirrors Figure \\ref{fig:sequence-in}, but where the direction of the transfer entropy has been inverted (showing outgoing transfer from each fish in turning order).\n}\n\\label{fig:cascade}\n\\end{figure}\n\nOur analysis revealed a clear relationship between positive and negative values of transfer entropy and the sequence of individual fish turning, which is illustrated in Figure \\ref{fig:trajectories}.\nFigure \\ref{fig:trajectories-only} shows the trajectories of individual fish during the same U-turn depicted in Figure \\ref{fig:polarisation}.\nThese trajectories are retraced in Figure \\ref{fig:polarisations-only} in terms of polarisation of each fish.\nIt is quite clear that there is a well-defined sequence of individual U-turns during the collective U-turn.\nMoreover, Figure \\ref{fig:trajectories} shows how the transfer entropy maps onto the fish trajectories, both from the fish whose trajectory is traced as a source to the other four fish~---~i.e. \\textit{outgoing} transfer entropy~---~and, vice versa, from the other four fish to the traced one as a destination~---~i.e. \\textit{incoming} transfer entropy.\n\nThe incoming transfer entropy clearly peaks during the destination fish's individual turns and its local values averaged over all sources go from negative, for the first (destination) fish that turns, to positive for the last fish turning (Figures \\ref{fig:trajectories-in} and \\ref{fig:polarisations-in}).\nIn the opposite direction, the outgoing transfer entropy (averaged over all destinations) displays negative peaks only before the source fish has turned, and positive peaks only afterwards (Figures \\ref{fig:trajectories-out} and \\ref{fig:polarisations-out}).\nFigure \\ref{fig:trajectories} suggests that predictive information transfer intensifies only when a destination fish is turning, with this transfer being informative based on source fish that have already turned and misinformative based on source fish that have not turned yet.\n\nThis phenomenon can be observed very clearly in Figures \\ref{fig:single-pol-in} and \\ref{fig:single-pol-out}, which show the transfer entropy in both directions for a single fish (the second fish turning in Figures \\ref{fig:polarisation} and \\ref{fig:trajectories}).\nOne positive peak of incoming transfer entropy (indicating informative flow) and three negative ones (misinformative flows) are detected when this fish, as a destination, is undergoing the U-turn (Figure \\ref{fig:single-pol-in}).\nNo other peaks are detected for this fish as a destination.\nOn the other hand, one negative peak of outgoing transfer entropy is detected before the fish, this time as a source, has turned, and three positive peaks are detected after the fish has turned (Figure \\ref{fig:single-pol-out}).\nThese four peaks occur respectively when the first, the third, the fourth and the fifth fish undergo the U-turn, as is evident by comparing Figures \\ref{fig:single-pol-out} and \\ref{fig:polarisations-only}.\nA movie of the fish undergoing this specific U-turn is provided in Supplementary Video S1, while a detailed reconstruction of the U-turn, showing the dynamics of transfer entropy over time for each directed pair of fish, is provided in Supplementary Video S2.\n\nIn order to demonstrate that the phenomenon described here holds for U-turns in general, and not only for the representative one shown in Figure \\ref{fig:trajectories}, we performed an aggregated analysis of all 455 U-turns observed during the experiment.\nSince the order in which fish turn is not the same in every U-turn, in this analysis, we refer not to single fish as individuals, but rather to fish in the order in which they turn.\nThus, when we refer, for instance, to ``the first fish that turns'', we may be pointing to a different fish at each U-turn.\n\nThe aggregated results are presented in Figures \\ref{fig:sequence-in} and \\ref{fig:sequence-out}.\nFigure \\ref{fig:sequence-in} shows that incoming transfer entropy peaks for each fish in turning order and gradually grows, from a minimum negative peak corresponding to the first fish turning, to a maximum positive peak corresponding to the last fish turning.\nVice versa, Figure \\ref{fig:sequence-out} shows that outgoing transfer entropy peaks only positively for the first fish turning, which is an informative source about all other fish turning afterwards.\nFor the last fish that turns the peak is negative, since this fish is misinformative about all other fish that have already turned.\nThe second, third and fourth fish present both a negative and a positive peak.\nThe intensity of the negative peaks increases from the second fish to the fourth, while the intensity of the positive peak decreases.\n\nIn general, the source fish is informative about all destination fish turning after it and misinformative about any destination fish turning before it.\nThis is because the prior turn of a source helps the observer to predict the later turn of the destination, whereas examining a source which has not turned yet itself is actively unhelpful (misinformative) in predicting the occurrence of such a turn.\nThis also explains why, for a source, the negative peaks come before positives.\n\nThe sequential cascade-like dynamics of information flow suggests that the strongest sources of predictive information transfer are fish that have already turned.\nMoreover our analyses reveal that once a fish has performed a U-turn, its behaviour in general ceases to be predictable based on the behaviour of other fish that swim in opposite direction (in fact such fish would provide misinformative predictions).\nThis suggests an asymmetry of predictive information flows based on and about an individual fish during U-turns.\n\n\n\\subsection*{Spatial motifs of information transfer}\n\n\\begin{figure}[t!]\n\\centering\n\\subfloat[]{\\label{fig:roses-pos}\\includegraphics[width=0.45\\columnwidth]{rose-positive.jpg}}\\hspace{5mm}\n\\subfloat[]{\\label{fig:roses-neg}\\includegraphics[width=0.45\\columnwidth]{rose-negative.jpg}}\n\\caption{\nSpatio-informational motifs.\nEach diagram is a circle centred on a source fish with zero heading, providing a reference.\nIn each diagram space is divided into 60 angular sectors measuring 6\\degree.\nWithin each circle we group all pairwise samples from all 455 U-turns such that the source fish is placed in the centre and the destination fish is placed within the circle in one of the sectors.\nThe left circles in Figures \\ref{fig:roses-pos} and \\ref{fig:roses-neg} aggregate the relative positions of destination fish, while the right circles aggregate the relative headings of destination fish.\nThe value of each radial sector (for both position and heading) represents the average of the corresponding values of either positive (Figure \\ref{fig:roses-pos}) of negative (Figure \\ref{fig:roses-neg}) transfer entropy.\nFor example, the value in each sector of the left diagram of \\ref{fig:roses-pos} represents the average positive transfer entropy for a destination fish, given it has relative position in that sector with respect to the source fish: all positive values of transfer entropy corresponding to each sector are summed and divided by the total number of values corresponding to that sector.\nThe value in each sector of the right diagram of \\ref{fig:roses-pos} represents the average positive transfer entropy for a destination fish, given that its heading diverges from the one of the source by an angle in that sector.\nFigure \\ref{fig:roses-neg} mirrors Figure \\ref{fig:roses-pos} this negative transfer entropy.\nThe source fish data are taken from the time points corresponding to the time delay $v$ with respect to the source.\n}\n\\label{fig:roses}\n\\end{figure}\n\nIt is reasonable to assume that predictive information transfer in a school of fish results from spatial interactions among individuals.\nWe investigated the role of pairwise spatial interactions in carrying the positive and negative information flows that we detected in the previous section, looking for spatial patterns of information and misinformation transfer.\n\nIn particular we established the statistics of the relative position and heading of the destination fish relative to the source fish, at times when the transfer entropy from the source to the destination is more intense.\nFor this purpose we used radial diagrams (see Figure \\ref{fig:roses}) representing the relative data in terms transfer entropy, focusing separately on their positive (informative) and negative (misinformative) values.\nIn each diagram we aggregate data from all 455 U-turns and all pairs.\nThe diagrams show clear spatial patterns coupled with the transfer entropy, which we call spatio-informational motifs.\n\nWe see that positive information transfer is on average more intense from source fish to: a. other fish positioned behind them (Figure \\ref{fig:roses-pos}, left), and b. to fish with headings closer to perpendicular rather than parallel to them (Figure \\ref{fig:roses-pos}, right).\nWe know from Figures \\ref{fig:trajectories} and \\ref{fig:cascade} that positive transfer entropy is detected from source fish that have already turned to destination fish that are turning.\nThus, Figure \\ref{fig:roses-pos} suggests that a source is more informative about destination fish that are left behind it after a turn, most intensely when the destination fish are executing their own turning manoeuvre to follow the source.\nDirectional relationships from individuals in front towards others that follow were observed in previous works on birds~\\cite{nagy2010hierarchical}, bats~\\cite{orange2015transfer} and fish~\\cite{katz2011inferring, herbert2011inferring, rosenthal2015revealing}.\n\nFor negative information transfer (Figure \\ref{fig:roses-neg}) we see a different spatio-informational motif.\nNegative information transfer is on average more intense to fish generally positioned at the side and with opposite heading.\nThis aligns with Figures \\ref{fig:trajectories} and \\ref{fig:cascade} in that negative transfer entropy typically flows from fish that have not turned yet to those which are turning.\n\nIn summary, transfer entropy has a clear spatial signature, showing that the spatiotemporal dependencies in the studied school of fish are not random but reflect specific interactions.\n\n\n\\section*{Discussion}\n\nInformation transfer within animal groups during collective motion is hard to quantify because of implicit and distributed communication channels with delayed and long-ranged effects, selective attention~\\cite{riley1976multidimensional} and other species-specific cognitive processes.\nHere we presented a rigorous framework for detecting and measuring predictive information flows during collective motion, by attending to the dynamic statistical dependence of directional changes in destination fish on relative heading of sources.\nThis predictive information flow should be interpreted as a change (gain or loss) in predictability obtained by an observer.\n\nWe studied \\textit{Hemigrammus rhodostomus} fish placed in a ring-shaped tank which effectively only allowed the fish to move straight ahead or turn back to perform a U-turn.\nThe individual trajectories of the fish were recorded for hundreds of collective U-turns,\nenabling us to perform a statistically significant information-theoretical analysis for multiple pairs of source and destination fish.\n\nTransfer entropy was used in detecting pairwise time delayed dependencies within the school.\nBy observing the local dynamics of this measure, we demonstrated that predictive information flows intensify during collective direction changes --- i.e.~the U-turns ---\na hypothesis that until now was not verified in a real biological system.\nFurthermore, we identified two distinct predictive information flows within the school: an informative flow based on fish that have already preformed the U-turn about fish that are turning, and a misinformative flow based on fish that have not preformed the U-turn yet about the fish that are turning.\n\nWe also explored the role of spatial dynamics in generating the influential interactions that carry the information flows, another well-known problem.\nIn doing so, we mapped the detected values of transfer entropy against fish relative position and heading, identifying clear spatio-informational motifs.\nImportantly, the positive and negative predictive information flows were shown to be associated with specific spatial signatures of source and destination fish.\nFor example, positive information flow is detected when the source fish is in front of the destination, similarly to what was already observed in previous works on animals~\\cite{nagy2010hierarchical, katz2011inferring, herbert2011inferring, rosenthal2015revealing, orange2015transfer}.\n\nLocal transfer entropy as it was applied in this study reveals the dynamics of \\emph{pairwise} information transfer.\nIt is well-known that multivariate extensions to the transfer entropy, e.g. conditioning on other information sources, can be useful in terms of eliminating redundant pairwise relationships whilst also capturing higher-order relationships beyond pairwise (i.e. synergies) \\cite{lizier2008local,lizier2010information,lizier2010differentiating,vak09,will11a}, and as such the identification of \\emph{effective} neighbourhoods cannot be accurately inferred using pairwise relationships alone.\nImprovements are possible by adapting algorithms for deciding when to include higher-order multivariate transfer entropies (and which variables to condition on), developed to study effective networks in brain imaging data sets~\\cite{liz12c,faes11a,mar12c,stra12b}, to collective animal behaviour, as such methods can eliminate redundant connections and detect synergistic effects.\nWhether or not such algorithms will prove useful for swarm dynamics is an open research question, with conflicting findings that first suggest that multiple fish interactions could be faithfully factorised into simply pair interactions in one species~\\cite{gautrais2012deciphering} but conversely that this may not necessarily generalise~\\cite{katz2011inferring}.\n\nIn any case, such adaptations to capture multivariate effects will be non-trivial, as it must handle the short-term and dynamic structure of interactions across the collective.\nEarly attempts have been made using (a similar measure to) conditional TE -- on average over time windows -- in collectives under such algorithms \\cite{lord2016inference}, however it remains to be seen what such measures reveal about the collective dynamics on a local scale.\n\nIn summary, we have proposed a novel information-theoretic framework for studying the dynamics of information transfer in collective motion and applied it to a school of fish, without making any specific assumptions on fish behavioural traits and\/or rules of interaction.\nThis framework can be easily applied to studies of other biological collective phenomena, such as swarming and flocking, artificial multi-agent systems and active matter in general.\n\n\n\\section*{Methods}\n\n\n\\subsection*{Ethics statement}\nAll experiments have been approved by the Ethics Committee for Animal Experimentation of the Toulouse Research Federation in Biology N1 and comply with the European legislation for animal welfare.\n\n\n\\subsection*{Experimental procedures} \n\n70 \\textit{Hemigrammus rhodostomus} (rummy-nose tetras) were purchased from Amazonie Lab{\\`e}ge (\\url{http:\/\/www.amazonie.com}) in Toulouse, France.\nFish were kept in 150 L aquariums on a 12:12 hour, dark:light photoperiod, at 27.7\\degree C ($\\pm0.5$\\degree C) and were fed \\textit{ad libitum} with fish flakes. Body lengths of the fish used in these experiments were on average 31 mm ($\\pm$ 2.5 mm).\n\nThe experimental tank measured $120 \\times 120$ cm, was made of glass and set on top of a box to isolate fish from vibrations.\nThe setup, placed in a chamber made by four opaque white curtains, was surrounded by four LED light panels giving an isotropic lighting.\nA ring-shaped tank made from two tanks (an outer wall of radius 35 cm and an inner wall, a cone of radius 25 cm at the bottom, both shaping a corridor of 10 cm) was set inside the experimental tank filled with 7 cm of water of controlled quality (50\\% of water purified by reverse osmosis and 50\\% of water treated by activated carbon) heated at 28.1\\degree C ($\\pm 0.7$\\degree C).\nThe conic shape of the inner wall has been chosen to avoid the occlusion on videos of fish swimming too close to the inner wall that would occur with straight walls.\n\nFive fish were randomly sampled from their breeding tank for a trial.\nFish were ensured to be used only in one experiment per day at most.\nFish were let for 10 minutes to habituate before the start of the trial.\nA trial consisted in one hour of fish swimming freely (i.e. without any external perturbation).\n\n\n\\subsection*{Data extraction and pre-processing}\n\nFish trajectories were recorded by a Sony HandyCam HD camera filming from above the setup at 50Hz (50 frames per second) in HDTV resolution (1920$\\times$1080p).\nVideos were converted from MTS to AVI files with the command-line tool FFmpeg 2.4.3.\nPositions of fish on each frame were tracked with the tracking software idTracker 2.1~\\cite{perez2014idtracker}.\n\nWhen possible, missing positions of fish have been manually corrected, only during the collective U-turn events detected by the sign changes of polarisation of the fish groups.\nThe corrections have involved manual tracking of fish misidentified by idTracker as well as interpolation or merging of positions in the cases where only one fish was detected instead of several because they were swimming too close from each others for a long time.\nAll sequences less or equal than 50 consecutive missing positions were interpolated.\nLarger sequence of missing values have been checked by eye to check whether interpolating was reasonable or not --- if not, merging positions with closest neighbors was considered.\n\nTime series of positions have been converted from pixels to meters and the origin of the coordinate system $\\mathcal{O}(0, 0)$ has been set to the centre of the ring-shaped tank.\nThe resulting data set contains $\\num{9273720}$ data points ($\\num{1854744}$ for each fish) including all the ten trials.\nVelocity was numerically derived from position using the symmetric difference quotient two-point estimation~\\cite{larson1983symmetric}.\nHeading was then computed as the four-quadrant inverse tangent of velocity and used to compute transfer entropy.\n\n\n\\subsection*{Polarisation}\n\nThe polarisation is used to represent the orientation of a fish or of the whole school around the tank, which can be clockwise or anti-clockwise.\nLet $Z$ and $\\dot{Z}$ be the two-dimensional position and normalised velocity of a fish, defined as Cartesian vectors with the centre of the tank being the origin --- in case of the whole school, $Z$ and $\\dot{Z}$ are averaged over all fish.\nThe fish direction along an ideal circular clockwise rotation is described by a unit vector $z=\\frac{\\omega\\times Z}{{|\\omega\\times Z|}}$, where $\\omega$ is a vector orthogonal to plane of the rotation, chosen using the left-hand rule.\n\nThe polarisation is defined as $\\dot{Z}\\cdot z$, so that it is positive when the fish is swimming clockwise and negative when it is swimming anti-clockwise.\nAlso, the better $\\dot{Z}$ is aligned with $z$ or $-z$, the higher is the intensity of the polarisation.\nOn the contrary, as $\\dot{Z}$ deviates from $z$ or $-z$, the polarisation decreases and eventually reaches zero when $\\dot{Z}$ and $z$ are orthogonal.\nAs a consequence, during a U-turn the intensity of the polarisation decreases and becomes zero at least once, before it increases again with the opposite sign.\n\n\n\\subsection*{Local transfer entropy}\n\nTransfer entropy~\\cite{schreiber2000measuring} is defined in terms of Shannon entropy, a fundamental measure in Information Theory~\\cite{cover91} that quantifies the uncertainty of random variables.\nShannon entropy of a random variable $X$ is $H(X)=-\\sum_{x\\in X}p(x)\\log_2p(x)$, where $p(x)$ is the probability of a specific instance $x$ of $X$.\n$H(X)$ can be interpreted as the minimal expected number of bits required to encode a value of $X$ without losing information.\nThe joint Shannon entropy between two random variables $X$ and $Y$ is $H(X,Y)=-\\sum_{x\\in X}\\sum_{y\\in Y}p(x,y)\\log_2p(x,y)$, where $p(x,y)$ is the joint probability of instances $x$ of $X$ and $y$ of $Y$. \nThis quantity allows the definition of conditional Shannon entropy as $H(X|Y)=H(X,Y)-H(X)$, which represents the uncertainty of $X$ knowing $Y$.\n\nIn this study we are interested in local (or pointwise) transfer entropy~\\cite{fano61,liz14b} for specific instances of time-series processes of fish motion, which allows us to reconstruct the dynamics of information flows over time.\nShannon information content of an instance $x_n$ of process $X$ at time $n$ is defined as $h(x_n)=-\\log_2 p(x_n)$.\nThe quantity $h(x_n)$ is the information content attributed to the specific instance $x_n$, or the information required to encode or predict that specific value.\nConditional Shannon information content of an instance $x_n$ of process $X$ given an instance $y_n$ of process $Y$ is defined as $h(x_n|y_n)=h(x_n,y_n)-h(x_n)$.\n\nLocal transfer entropy is defined as the information provided by the source $\\mathbf{y_{n-v}} = \\{y_{n-v}, y_{n-v-1},\\allowbreak \\ldots, y_{n-v-l+1}\\}$, where $v$ is a time delay and $l$ is the history length, about the destination $x_n$ in the context of the past of the destination $\\mathbf{x_{n-1}}=\\{x_{n-1}, x_{n-2}, \\ldots, x_{n-k}\\}$, with a history length $k$:\n\\begin{equation}\n\\begin{aligned}\nt_{y\\to x}(n,v) &= h(x_n | \\mathbf{x_{n-1}}) -h(x_n | \\mathbf{x_{n-1}}, \\mathbf{y_{n-v}})\\\\\n&= \\log_2\\frac{ p( x_{n} | \\mathbf{x_{n-1}} , \\mathbf{y_{n-v}} ) }{ p( x_{n} | \\mathbf{x_{n-1}} ) }.\n\\end{aligned}\n\\label{eq:teInMethods}\n\\end{equation}\nTransfer entropy $T_{Y\\to X}(v)$ is the average of the local transfer entropies $t_{y\\to x}(n,v)$ over samples (or over $n$ under a stationary assumption).\nThe transfer entropy is asymmetric in $Y$ and $X$ and is also a dynamic measure (rather than a static measure of correlations) since it measures information in state transitions of the destination.\n\nIn order to compute transfer entropy here, the source variable $Y$ and destination variable $X$ are defined in terms of the fish heading.\nSpecifically, $X$ is the first-order divided difference (Newton's difference quotient) of the destination fish heading, while $Y$ is the difference between the two fish headings at the same time.\nLet $\\Theta_S$ and $\\Theta_D$ be respectively the heading time series of the source and the destination fish. We then construct variables $X$ and $Y$ as follows, for all time points $n$:\n\\begin{center}\n\\setlength\\tabcolsep{0pt}\n\\begin{tabular}{m{0.55\\columnwidth}m{0.45\\columnwidth}}\n\\centering\n\\includegraphics[height=3.5cm]{fish-xy.jpg} &\n\\begin{equation}\nx_n = \\Theta^D_n - \\Theta^D_{n-1} \\textrm{\\ \\ \\ \\ \\ \\ \\ }\n\\label{eq:fish-x}\n\\end{equation}\n\\vspace{0.2cm}\n\\begin{equation}\ny_n = \\Theta^D_n - \\Theta^S_n . \\textrm{\\ \\ \\ \\ \\ \\ \\ \\ \\ }\n\\label{eq:fish-y}\n\\end{equation}\n\\end{tabular}\n\\setlength\\tabcolsep{6pt}\n\\end{center}\nThus, $y_n$ represents the relative heading of the destination fish with respect to the source fish, while $x_n$ represents the directional change of the destination fish.\nThe variables were so defined in order to capture directional changes of the destination fish in relation to its alignment with the source fish, which is considered an important component of movement updates in swarm models \\cite{reynolds87}.\n\nGiven the definition of the variables \\eqref{eq:fish-x} and \\eqref{eq:fish-y}, we computed local transfer entropy $t_{y\\to x}(n,v)$ using Equation \\eqref{eq:teInMethods}, where $v$ was determined as described in section ``Parameters optimisation'' that follows.\nThe past state $\\mathbf{x_{n-1}}$ of the destination in transfer entropy was defined as a vector of an embedding space of dimensionality $k$ and delay $\\tau$, with $\\mathbf{x_{n-1}} = \\{x_{n-1-j\\tau}\\}$, for $j = \\{0,1,\\dots,k-1\\}$.\nFinding optimal values for $k$ and $\\tau$ is also described in section ``Parameters optimisation''.\nThe state of the source process $\\mathbf{y_{n-v}}$ was also defined as a vector of an embedding space whose the dimensionality $l$ and delay $\\tau'$ were similarly optimised.\nThe local transfer entropy $t_{y\\to x}(n,v)$ computed on these variables therefore tells us how much information ($l$ time steps of) the heading of the destination relative to the source adds to our knowledge of the directional change in the destination (some $v$ time steps later), in the context of $k$ past directional changes of the destination.\nWe note that while turning dynamics of the destination may contain more entropy (as rare events), there will only be higher transfer entropy at these events if the source fish is able to add to the prediction of such dynamics.\n\nComputing transfer entropy requires knowledge of the probabilities of $x_n$ and $y_n$ defined in \\eqref{eq:fish-x} and \\eqref{eq:fish-y}.\nThese are not known a priori, but the measures can be estimated from the data samples using existing techniques.\nIn this study, this was accomplished assuming that the probability distribution function for the observations is a multivariate Gaussian distribution (making the transfer entropy proportional to the Granger causality~\\cite{barnett2009granger}), using the JIDT software implementation~\\cite{lizier2014jidt}.\n\nAlso, we assume stationarity of behaviour and homogeneity across the fish, such that we can pool together all pairwise samples from all time steps, for all trials, maximising the number of samples available for the calculation of each measure.\nFor performance efficiency, we make calculations of the local measures using 10 separate sub-sampled sets (sub-sampled evenly across the trials), then recombine into a single resultant information-theoretic data set.\n\n\n\\subsection*{Parameter optimisation}\n\nThe embedding dimensionality and delay for the source and the past state of the destination need to be appropriately chosen in order to optimise the quality of transfer entropy.\nThe combination $(k,\\tau)$ for the past state of the destination, as well as the combination $(l,\\tau')$ for the source, have been optimised separately by minimising the global self-prediction error, as described in~\\cite{PhysRevE.65.056201,wib14c}.\nIn the case of Markov processes, the optimal dimensionality of the embedding is the order of the process.\nLower dimensions do not provide the same amount of predictive information, while higher dimensions add redundancy that weaken the prediction.\nFor non-Markov processes, the algorithm selects the highest dimensionality found to contribute to self-prediction of the destination whilst still being supported by the finite amount of data that we have.\nValues of the dimensionality between 1 and 10 have been explored in combination with values of the delay between 1 and 5. The optimal combinations were found to be the same for both the source and the past of the destination: $k=l=3$, $\\tau=\\tau'=1$.\n\nThe lag $v$ was also optimised.\nThis was done by maximising the average transfer entropy (after the optimisation of $k$, $\\tau$, $l$ and $\\tau'$) as per~\\cite{wib13a}, over lags between 0.02 and 1 second, at time steps of 0.02 seconds.\nThe average transfer entropy was observed to grow and reach a local maximum at $v=6$ ($0.12$ seconds), and then decrease for higher values (see Figure \\ref{fig:lag-opt}).\nThis result might have a biological interpretation: it is plausible for a fish to have a minimum reaction time, which delays the response to behaviour of other fish.\n\n\\begin{figure}[t]\n\\centering\n\\includegraphics[width=0.55\\columnwidth]{lag-opt.pdf}\n\\caption{\nTime lag optimisation. The red line represents the average transfer entropy (with $k=l=3$, $\\tau=\\tau'=1$) over all samples, as a function of the time delay between the source variable and the destination variable, for time delays between 0.02 to 1 seconds (1 to 50 time cycles).\n}\n\\label{fig:lag-opt}\n\\end{figure}\n\n\n\\subsection*{Statistical significance of estimates of local transfer entropy}\n\nTheoretically, transfer entropy between two independent variables is zero.\nHowever, a non-zero bias (and a variance of estimates around that bias) is likely to be observed when, as in this study, transfer entropy is numerically estimated from a finite number of samples.\nThis leads to the problem of determining whether a non-zero estimated value represents a real relationship between two variables, or is otherwise not statistically significant~\\cite{wib14c}.\n\nThere are known statistical significance tests for the average transfer entropy~\\cite{vic11a,liz11a,lizier2014jidt}, involving comparing the measured value to a null hypothesis that there was no (directed) relationship between the variables.\nFor an average transfer entropy estimated from $N$ samples, one surrogate measurement is constructed by resampling the corresponding $\\mathbf{y_{n-v}}$ for each of the $N$ samples of $\\{x_n , \\mathbf{x_{n-1}} \\}$ and then computing the average transfer entropy over these new surrogate samples.\nThis process retains $p(x_n | \\mathbf{x_{n-1}})$ and $p(\\mathbf{y_{n-v}})$, but not $p(x_n | \\mathbf{y_{n-v}}, \\mathbf{x_{n-1}})$.\nMany surrogate measurements are repeated so as to construct a surrogate distribution under this null hypothesis of no directed relationship, and the transfer entropy estimate can then be compared in a statistical test against this distribution.\nFor the average transfer entropy measured via the linear-Gaussian estimator, it is known that analytically the surrogates (in nats, and multiplied by $2 \\times N$) asymptotically follow a $\\chi^2$ distribution with $l$ degrees of freedom \\cite{gew82,barn12a}.\nWe use this distribution to confirm that the transfer entropy at the selected lag of 0.12 seconds (and indeed all lags tested) is statistically significant compared to the null distribution (at $p < 0.05$ plus a Bonferroni correction for the multiple comparisons across the 50 candidate lags).\n\nNext, we introduce an extension of these methods in order to assess the statistical significance of the \\emph{local} values.\nThis simply involves constructing surrogate transfer entropy measurements as before, however this time retaining the local values within those surrogate measurements and building a distribution of those surrogates.\nMeasured local values are then statistically tested against this null distribution of local surrogates to assess their statistical significance.\n\nWe generated ten times as many surrogate local values as the number of actual local estimates, with a total of approximately $371$ million local surrogates.\nThis large set of surrogate local values was used to estimate $p$-values of actual local values of the transfer entropy.\nIf $p$-value is sufficiently small, then the test fails and the value of the transfer entropy is considered significant (the value represents an actual relationship).\nThe Benjamini-Hochberg~\\cite{10.2307\/2346101} procedure was used to select the $p$-value cutoff whilst controlling for the false discovery rate under ($N$) multiple comparisons.\n\n\n\\section*{Acknowledgements}\nE.C. was supported by the University of Sydney's ``Postgraduate Scholarship in the field of Complex Systems'' from Faculty of Engineering \\& IT and by a CSIRO top-up scholarship.\nL.J. was supported by a grant from the China Scholarship Council (CSC NO.201506040167).\nV.L. was supported by a doctoral fellowship from the scientific council of the University Paul Sabatier.\nThis study was supported by grants from the Centre National de la Recherche Scientifique and University Paul Sabatier (project Dynabanc).\nJ.L. was supported through the Australian Research Council DECRA grant DE160100630.\nThe University of Sydney HPC service provided computational resources that have contributed to the research results reported within this paper.\n\n\\section*{Author contributions statement}\nG.T. designed research; V.L., P.T. and G.T. performed research; V.L., L.J., P.T., R.W. and G.T. analysed data.\nE.C., J.L., R.W. and M.P. developed information dynamics methods, performed information-theoretic analysis, and identified information flows and motifs.\nE.C. designed, developed and run software for the information-theoretic analysis.\nG.T., J.L., E.C. and M.P. conceived and analysed information cascade.\nE.C., J.L and M.P. wrote the paper.\nG.T. and V.L. edited the manuscript and contributed to the writing.\n\n\\bibliographystyle{plain}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nWith the predicted advent of quantum computers compromising the bulk of existent cryptographic constructions, lattice based cryptography has emerged as a promising foundation for long term security. In particular, the Learning with Errors (henceforth LWE) problem introduced in \\cite{regev_lattices_2009}, as well as its variants over rings (RLWE) \\cite{lyubashevsky_ideal_2010} and modules (MLWE) \\cite{langlois_worst-case_2015}, provides a natural intermediate step to base cryptographic hardness on lattice short vector problems in a post quantum setting. Indeed, second round submissions to the NIST post quantum standardisation process such as NewHope \\cite{alkim_post-quantum_2016-2} and KYBER \\cite{avanzi_kyber_2019} rely on the hardness of LWE variants. Cryptography based on the classical LWE problem is typically somewhat impractical, in part due to large key sizes. To solve this, the ring variant was introduced as a way to provide extra structure in LWE to trade a potential loss of security for an increase in efficiency. MLWE generalizes ring and classical LWE, providing a smoother transition between security and efficiency than the binary option presented by ring or classical LWE. The flexibility of MLWE is highly desirable in practice, as demonstrated by third-round NIST finalists KYBER and SABER, both based on MLWE \\cite{NIST-Round3}.\n\nConceptually, one may view all these problems as variations on a single problem. The (search) LWE problem tasks a solver with recovering a secret vector $\\textbf{s} \\in \\mathbb{Z}_q^n$ from a collection of pairs $(\\textbf{a}_i, b = \\langle \\textbf{a}_i,\\textbf{s} \\rangle + e_i)$, where $\\langle \\cdot,\\cdot \\rangle$ denotes the inner product, each $\\textbf{a}_i \\in \\mathbb{Z}_q^n$ is uniformly random and the $e_i$'s are small random errors. In practice, we view this collection of equations in matrix-vector form:\n\\begin{align*}\nA \\textbf{s} + \\textbf{e} = \\textbf{b},\n\\end{align*}\nwhere all operations and entries are over $\\mathbb{Z}_q$ and the challenge is to recover $\\textbf{s}$ from $A, \\textbf{b}$. A popular ring variant replaces $A, \\textbf{s}, \\textbf{e}$ with elements $a,s,e$ from the ring $R_q := \\frac{\\mathbb{Z}_q[x]}{x^n+1}$, requiring the solver to obtain $s$ from samples $a_i \\cdot s + e_i$. For power-of-two $n$ this can be expressed in matrix-vector form by considering the matrix rot$(a)$, the negacyclic matrix obtained from the coefficients of $a$. Explicitly, for $a = a_0 +a_1 x +... +a_{n-1} x^{n-1}$ and bold faced letters denoting coefficient vectors, a sample from the RLWE distribution takes the form:\n\\begin{align*}\n\\begin{pmatrix}\na_0 & -a_{n-1} & \\dots & -a_{1} \\\\\na_1 & a_{0} & \\dots & -a_2 \\\\\n\\vdots & \\vdots & \\ddots & \\vdots \\\\\na_{n-1} & a_{n-2} & \\dots & a_0\n\\end{pmatrix} \\textbf{s} + \\textbf{e} = \\textbf{b}\n\\end{align*}\nwhere once again operations and entries are over $\\mathbb{Z}_q$. This is exactly a structured version of the classical LWE problem, where the uniformly random matrix $\\textbf{A}$ has been replaced by the negacyclic matrix rot$(a)$. Of course, this should be an easier problem to solve, yet no substantial progress has been made in using the structure of rot$(a)$ to solve the problem efficiently. We can extend this matrix-vector view to MLWE as well. An MLWE instance takes place in a module $M$ of dimension $d$ over $R_q$, such that a solver has to recover $\\textbf{s} \\in M$ from a collection of pairs $(\\textbf{a}_i, \\langle \\textbf{a}_i, \\textbf{s} \\rangle + e_i)$ where $\\textbf{a}_i$ is a uniformly random element of $M$ and each $e_i$ is a small random element of $R_q$. A collection of such pairs can be viewed as $A \\textbf{s} + \\textbf{e} = \\textbf{b}$, where the ambient space $\\mathbb{Z}_q$ has been replaced by $R_q$ e.g. with $d$ samples:\n\\begin{align*}\n\\begin{pmatrix}\na_{1,1} & a_{1,2} & \\dots & a_{1,d} \\\\\na_{2,1} & a_{2,2} & \\dots & a_{2,d} \\\\\n\\vdots & \\vdots & \\ddots & \\vdots \\\\\na_{d,1} & a_{d,2} & \\dots & a_{d,d}\n\\end{pmatrix} \\textbf{s} + \\textbf{e} = \\textbf{b}\n\\end{align*}\nwhere all operations are over $R_q$ and each $a_{i,j}$ is uniformly random. Of course, we could extend this to have operations over $\\mathbb{Z}_q$ by applying the rot$(\\cdot)$ operation coordinatewise, to obtain a structured LWE instance in dimension $nd$.\n\nAn advantage of these structured matrices is that they allow for streamlined storage and operations. For example, storing a uniformly random matrix $A$ requires one to store all $n^2$ of its entries, but rot$(a)$ requires a factor $n$ less memory since one need only store its first column. Equivalently, one RLWE sample generates $n$ LWE samples while reducing the storage space and key sizes. Multiplication can also be speeded up by using the Chinese Remaindering Theorem (CRT) or other techniques.\n\nThis concept of improving efficiency by adding structure motivates this work; can we perform an analog of the transformation taking an LWE matrix $A$ to an RLWE matrix rot$(a)$ for the module $M$? We solve this by constructing a new variant of the LWE problem over a certain non-commutative space known as a \\emph{cyclic algebra}. In recent years, cyclic algebras have received significant attention in the field of coding theory (see e.g. \\cite{vehkalahti_densest_2009, oggier_cyclic_2007, luzzi_almost_2018}) due to the particular nature of the matrix lattices they induce, and we view them as a suitable option for defining an LWE problem over a non-commutative ring. Though some efforts have been made to construct non-commutative LWE problems, for example \\cite{baumslag_generalized_2011}, \\cite{cheng_lwe_2016}, the majority of non-commutative cryptography has relied on group theoretic constructions, whose underlying hard problems are often less robust than those of lattice cryptography. Somewhat informally, for a cyclic algebra $\\mathcal{A}$ and well chosen parameters there exists an automorphism $\\theta$ of $R_q$ and a $\\gamma \\in R_q$ such that an LWE style sample $a \\cdot s + e$ over $\\mathcal{A}$ can be written in matrix-vector form\n\\begin{align*}\n\\begin{pmatrix}\na_0 & \\gamma \\theta(a_{d-1}) & \\gamma \\theta^2(a_{d-2}) & \\ldots &\\gamma \\theta^{d-1}(a_{1}) \\\\\na_1 & \\theta(a_{0}) & \\gamma \\theta^2(a_{d-1}) & \\ldots &\\gamma \\theta^{d-1}(a_{2}) \\\\\na_2 & \\theta(a_{1}) & \\theta^2(a_{0}) & \\ldots &\\gamma \\theta^{d-1}(a_{3}) \\\\\n\\vdots & \\vdots & \\vdots &\\ddots & \\vdots \\\\\na_{d-1} & \\theta(a_{d-2}) & \\theta^2(a_{d-3}) & \\ldots & \\theta^{d-1}(a_{0}) \\\\\n\\end{pmatrix} \\textbf{s} + \\textbf{e} = \\textbf{b}\n\\end{align*}\nwhere all entries and operations are now over $R_q$. Though more complex than the transformation taking LWE to RLWE this fulfills our goal of providing a structured version of MLWE, since we have replaced the uniformly random matrix $A$ over $R_q$ with a structured matrix which we denote $\\phi(a)$ that requires a factor of $d$ less storage. Of course, by applying the rot$(\\cdot)$ operation coordinatewise, one can extend this to a high dimensional version of the LWE problem, now with two sets of structure lying on top of each other.\n\\subsection{Contributions and Methodology}\nThe main novel contribution of this work is a definition of Cyclic Algebra LWE (CLWE), together with justifications for its construction and a polynomial time reduction from short vector problems over matrix lattices induced by ideals in a cyclic algebra to CLWE, establishing its security on the assumption that such problems are hard.\nAs in \\cite{lyubashevsky_ideal_2010}, the algorithm bases the security of CLWE on short vector problems over ideal lattices in $\\mathcal{A}$; similarly to ideal lattices in $K$, these have some extra underlying structure that might make computational problems easier. However, we leave the relative complexity of these problems an open area of investigation.\n\nOverall we consider it plausible that LWE in cyclic algebras could be both more efficient than MLWE and more secure than RLWE in a quantum setting. CLWE represents a middle ground between RLWE and MLWE, with the salient feature of its non-commutative ring structure. Cyclic algebra is equipped with a proper ring multiplication which preserves the dimension of the lattice. This is in sharp contrast to MLWE which only supports scalar multiplication and to RLWE whose multiplication is commutative. Specifically, we consider the following advantages of our CLWE construction:\n\n\\begin{itemize}\n\\item Efficiency. CLWE can be seen a structured variant of MLWE. Assuming for simplicity that the public key in LWE based schemes is a sample $(A,\\textbf{b})$, a public key generated as $A =$ rot($\\phi(a)$) requires only as much storage as that of an equivalent dimension RLWE public key\\footnote{In practice, a seed is often used to generate the matrix $A$, which however requires a pseudorandom generator under the random oracle model. By contrast, CLWE does not require the random oracle model. Moreover, certain applications do not permit the use of a seed, \\textit{e.g.}, pseudorandom functions \\cite{Banerjee}.}. Multiplication in cyclic algebras can be implemented over a product of skew polynomial rings following a CRT-style decomposition (see Appendix \\ref{appendix:multiplication-complexity}), for which well known fast algorithms, such as those of \\cite{caruso_fast_2017-4} and \\cite{puchinger_fast_2018}, can applied to compute the operation $A \\cdot \\textbf{s}$ more efficiently in the case where $A = \\phi(a)$ than in the module case where $A$ is uniform.\n\\item Security. Following recent works on quantum attacks on related ideal lattice problems (e.g. \\cite{biasse_quantum_2015},\\cite{cramer_recovering_2016}, \\cite{cramer_short_2017}, \\cite{campbell_soliloquy:_2015} amongst others), we observe that the non-commutativity of multiplication in cyclic algebras may be viewed as a security advantage. This is because the Hidden Subgroup Problem (HSP), an integral part of the majority of algorithms using quantum computing to gain an advantage over classical computation, requires that the underlying group, in this case the unit group of $\\mathcal{O}_K$, is commutative, see e.g. \\cite{jozsa_quantum_2001}, which is untrue for a non-commutative algebra. We conjecture that the security level is higher than RLWE, but welcome further cryptanalysis. We actively avoid known attacks on previous attempts to create structured MLWE (see \\cref{BCWappendix}).\n\\item Decryption failure rates. The scalar multiplication of MLWE is dimension-lossy. In other words, the message space of MLWE is restricted in $R_q$, whose dimension is smaller than that of the module lattice. It leaves less room for error correction coding in MLWE-based schemes (e.g., a KYBER instance for a key size of $256$ within $R_q$ of dimension $256$). This limitation of MLWE appears to be fundamental, due to its module structure. In contrast, the dimension of the message space of CLWE is that of the (non-commutative) ring, which is higher by a factor of $d$. Thus, it accommodates better error correction coding (see \\cref{clwecrypto}), and low decryption failure rates are desired under chosen ciphertext attacks (CCA). Even trivial repetition coding can dramatically reduce decryption failure rates (e.g., NewHope).\n\\item Functionality. We view the ring structure of CLWE as a major advantage over MLWE, which opens up the prospect of extra functionality. For example, since operations are composable and non-commutative, one could hope to construct FHE in this non-commutative ring. We leave this frontier open for separate work.\n\\end{itemize}\n\n\n\n\\subsection{Related Work and Organization}\\label{related}\n\nThis work is related to a number of different areas: lattice-based cryptography, information theory and number theory.\n\nIn lattice-based cryptography, an alternative construction for structured module LWE, called multivariate-RLWE, was presented in \\cite{pedrouzo-ulloa_ring_2016,Revisit-MRLWE}, where they tensor product two (or more) number fields in order to provide a structured module matrix. However, an efficient implementation of \\cite{pedrouzo-ulloa_ring_2016} was attacked in \\cite{bootland_security_2018}, together with a warning about taking care when putting structure on a module. In short, \\cite{bootland_security_2018} attacks certain instances of multivariate-RLWE by providing a homomorphism to some underlying subfield $K$, dramatically reducing the dimension of the lattice problem to be attacked. Fortunately for this work, a somewhat technical condition on the choice of $\\gamma$ known as the \\emph{non-norm condition} precludes such a homomorphism existing to reduce the dimension of CLWE (see \\cref{BCWappendix}). It is worth pointing out that that their problem has been addressed in \\cite{Revisit-MRLWE}, and in fact this fix looks somewhat like our non-norm condition (\\emph{e.g.}, unlike the original version, full rank is maintained in \\cite{Revisit-MRLWE}).\n\nThis paper is inspired by the abundant literature of space-time coding based on cyclic division algebras (see the monographs \\cite{oggier_cyclic_2007,Berhuy_2013} and references therein). On a high level, our construction is reminiscent of multi-block space-time codes \\cite{Lu_2008,lahtonen_construction_2008}, rather than single-block codes \\cite{Oggier_2006,Elia_2007}, with the caveat of scaling up the number of blocks to make the codes practically undecodable. In the context of space-time coding, our construction generalizes \\cite{lahtonen_construction_2008} and offers greater flexibility in the code parameters (the number of blocks vs. the number of antennas). Multi-block space-time codes have been used in \\cite{luzzi_almost_2018} to achieve information-theoretic security over wiretap channels, as opposed to computational security in a classic cryptographic setting of this paper. Maximal orders were shown in \\cite{Hollanti_2008,vehkalahti_densest_2009} as advantageous to the so-called natural orders; both types of orders play a crucial role in this paper. There is a major difference between the roles of cyclic algebras in coding and cryptography, though: the primary concern for coding is the non-vanishing determinant (NVD), while the non-commutative ring structure becomes crucial for cryptography. For efficient multiplication of elements in a cyclic algebra, we heavily rely on the CRT technique of \\cite{oggier_quotients_2012-4}; a similar technique has been used in lattice index codes \\cite{Huang_DA_CRT_2019,Huang_CRT_2017}.\n\nWe present two approaches (subfields and compositum fields) to the construction of novel cyclic division algebras, which enlarge the pool of algebras and may find other applications. Specifically, our proof that the natural order of the family of cyclic division algebras constructed in \\cref{goodalgebras} (including those in \\cite{lahtonen_construction_2008}) is in fact maximal, is an original contribution.\n\n\n\n\nThe rest of this paper is organized as follows. In \\cref{sec:preliminaries} we provide necessary background material on lattices, number fields, and cyclic algebras. In \\cref{sec3} we provide a definition and discussion of CLWE, together with novel constructions of cyclic division algebras for the CLWE problem. In \\cref{security_proof} we provide a reduction from structured lattice problems to search CLWE, as well as a search-worst case decision reduction for CLWE. In \\cref{crypto} we show a sample CLWE cryptosystem and provide an estimate of its asymptotic operation complexity. Finally, the paper is concluded in \\cref{conclusions} with a discussion of open problems. For a smooth flow of the main text, certain proofs, sideline discussions and technical details are deferred to appendices.\n\n\n\\section{Preliminaries}\\label{sec:preliminaries}\n\\subsection{Lattices}\nA lattice is a discrete additive subgroup of a vector space $V$. If $V$ has dimension $n$ a lattice $\\mathcal{L}$ can be viewed as the set of all integer linear combinations of a set of linearly independent vectors $B = \\lbrace \\textbf{b}_1,...,\\textbf{b}_k \\rbrace$ for some $k \\leq n$, written $\\mathcal{L} = \\mathcal{L}(B) = \\lbrace \\sum_{i=1}^k z_i \\textbf{b}_i: z_i \\in \\mathbb{Z} \\rbrace$. If $k=n$ we call the lattice full-rank, and we will only consider lattices of full-rank. We can extend this notion of lattices to matrix spaces by stacking the columns of a matrix. We recall two standard lattice definitions.\n\\begin{definition}\nGiven a lattice $\\mathcal{L}$ in a space $V$ endowed with a metric $\\Vert \\cdot \\Vert$, the minimum distance of $\\mathcal{L}$ is defined as $\\lambda_1 (\\mathcal{L}) = \\min_{\\textbf{v} \\in \\Lambda\/\\lbrace 0 \\rbrace} \\Vert \\textbf{v} \\Vert$. Similarly, $\\lambda_n(\\mathcal{L})$ is the minimum length of a set of $n$ linearly independent vectors, where the length of a set of vectors $ \\lbrace \\textbf{x}_1,..., \\textbf{x}_n \\rbrace$ is defined as $\\max_i(\\Vert \\textbf{x}_i \\Vert)$.\n\\end{definition}\n\\begin{definition}\nGiven a lattice $\\mathcal{L} \\subset V$, where $V$ is endowed with an inner product $\\langle \\cdot, \\cdot \\rangle$, the dual lattice $\\mathcal{L}^*$ is defined $\\mathcal{L}^* = \\lbrace \\textbf{v} \\in V : \\langle \\mathcal{L} , \\textbf{v} \\rangle \\subset \\mathbb{Z} \\rbrace$.\n\\end{definition}\n\n\\subsection{Gaussian Distributions}\n\\begin{definition}\nFor a vector space $V$ with norm $\\Vert \\cdot \\Vert$ and an $r >0$, we define the Gaussian function $\\rho_r: V \\rightarrow (0,1]$ by $\\rho_r(\\textbf{x}) = \\exp(- \\pi \\Vert \\textbf{x} \\Vert\/r^2)$.\n\\end{definition}\n\nWe can use this function to define the spherical Gaussian distribution $D_r$ over $V$, which outputs $\\textbf{v}$ with probability proportional to $\\rho_r(\\textbf{v})$. Similarly, we can sample an elliptical Gaussian $D_\\textbf{r}$ in a basis $\\textbf{b}_1,...,\\textbf{b}_n$ of $V$, for $\\textbf{r} = (r_1,...,r_n)$ a vector of positive reals, by sampling $x_1,...,x_n$ independently from the one dimensional Gaussian distributions $D_{r_i}$ and outputting $\\sum_{i =1}^n x_i \\textbf{b}_i$.\n\nWhen sampling a Gaussian over a lattice $\\mathcal{L}$ we will use the discrete form of the Gaussian distribution. We define the distribution $D_{\\Lambda,r}$ over $\\Lambda$ by outputting $\\textbf{x}$ with probability $\\frac{\\rho_r(\\textbf{x})}{\\rho_r(\\mathcal{L})}$ for each $\\textbf{x} \\in \\mathcal{L}$. This version of the discrete Gaussian is centered at $0$, which in general need not be the case.\n\nAn important lattice quantity, known as the smoothing parameter, was introduced in \\cite{micciancio_worst-case_2007}. The motivation for the name is provided by \\cref{1} following the definition.\n\\begin{definition}\nFor a lattice $\\mathcal{L}$ and $\\varepsilon > 0$, the smoothing parameter $\\eta_\\varepsilon(\\mathcal{L})$ is defined as the smallest $r > 0$ satisfying $\\rho_{1\/r}(\\mathcal{L}^* \/ \\lbrace \\textbf{0} \\rbrace ) \\leq \\varepsilon$.\n\\end{definition}\nThe following is a special case of \\cite{micciancio_worst-case_2007}, Lemma 4.1.\n\n\\begin{lemma}\\label{1}\nFor a lattice $\\mathcal{L}$ over $\\mathbb{R}^n$, $\\varepsilon > 0, r \\geq \\eta_\\varepsilon(\\mathcal{L})$, and $\\textbf{x} \\in \\mathbb{R}^n$, the statistical distance between $(D_r + \\textbf{x}) \\mod \\mathcal{L}$ and the uniform distribution modulo $\\mathcal{L}$ is bounded above by $\\varepsilon\/2$. Equivalently, $\\rho_r(\\mathcal{L} + \\textbf{x}) \\in [\\frac{1- \\varepsilon}{1+ \\varepsilon},1] \\cdot \\rho_r(\\mathcal{L})$.\n\\end{lemma}\nWe introduce well known lemmas used to relate the smoothing parameter to standard lattice properties. The first comes from \\cite{banaszczyk_new_1993}, the second from \\cite{peikert_pseudorandomness_2017-2}.\n\\begin{lemma}\nFor a lattice $\\mathcal{L}$ of dimension $n$ and $c \\geq 1$ it holds that $c \\sqrt{n}\/ \\lambda_1(\\mathcal{L}^*) \\geq \\eta_\\varepsilon(\\mathcal{L})$ for $\\varepsilon = \\exp(-c^2n)$.\n\\end{lemma}\n\\begin{lemma}\\label{smoothing1}\nFor a lattice $\\mathcal{L}$ and $\\varepsilon \\in (0,1)$ it holds that $\\eta_\\varepsilon(\\mathcal{L}) \\geq \\frac{\\sqrt{\\log(1\/\\varepsilon)\/\\pi}}{\\lambda_1(\\mathcal{L}^*)}$.\n\\end{lemma}\n\n\\subsection{Algebraic Number Theory}\n\\begin{definition}\nA number field $K$ is a finite degree extension of the rationals $\\mathbb{Q}$. Typically, we define a number field by adjoining some algebraic element $\\alpha \\in \\mathbb{C}$ and set $K = \\mathbb{Q}(\\alpha)$. The degree of $K$ refers to its degree as a field extension.\n\\end{definition}\nTo define a cyclic algebra, we will need to take an additional extension of $K$. In particular, we will need the extension to be Galois over $K$, defined as follows.\n\\begin{definition}\nLet $L\/K$ be an extension of number fields of dimension $d$. The Galois group of $L$ over $K$ is the group Aut$(L\/K)$ of automorphisms of $L$ that fix $K$. We say that the extension is Galois if the subfield of $L$ fixed by Aut$(L\/K)$ is exactly $K$.\n\\end{definition}\nWe define a cyclic Galois extension $L\/K$ to be a Galois extension such that the Galois group of $L$ over $K$ is the cyclic group generated by some element $\\theta$ of degree $d := [L:K]$. Finally, we require the ring of integers of a number field.\n\\begin{definition}\nGiven a number field $K$, its ring of integers $\\mathcal{O}_K$ is the ring consisting of those elements of $K$ whose minimal polynomial over $\\mathbb{Q}$ lie in $\\mathbb{Z}[x]$.\n\\end{definition}\nIt is easy to check that if $L\/K$ is an extension of number fields then $\\mathcal{O}_L \\cap K = \\mathcal{O}_K$.\n\n\\subsubsection{The Canonical Embedding}\nLet $K = \\mathbb{Q}(\\alpha)$ be a number field of degree $n$. It is a well known fact that there are exactly $n$ distinct ring embeddings $\\sigma_i : K \\rightarrow \\mathbb{C}$. These embeddings correspond to the $n$ distinct injective ring homomorphisms mapping $\\alpha$ to the roots of its minimum polynomial $f$. We split these embeddings and say that there are $r_1$ real embeddings (whose image lie in $\\mathbb{R}$) and $r_2$ conjugate pairs of complex embeddings (the complex embeddings come in pairs since complex roots of $f$ occur in conjugate pairs), such that $r_1 + 2 r_2 = n$. The standard convention is to order the embeddings such that the $r_1$ real embeddings come first and the complex embeddings are arranged such that $\\sigma_{r_1+ j} = \\overline{\\sigma_{r_1 + r_2 + j}}$ for $1 \\leq j \\leq r_2$.\n\\begin{definition}\nLet $K = \\mathbb{Q}(\\alpha)$ be a number field of degree $n = r_1 + 2r_2$. The canonical embedding $\\sigma$ is the ring homomorphism $\\sigma : K \\rightarrow \\mathbb{R}^{r_1} \\times \\mathbb{C}^{2 r_2}$ defined by\n\\begin{align*}\n\\sigma(x) = (\\sigma_1(x),...,\\sigma_n(x)).\n\\end{align*}\nFormally, $\\sigma$ maps into the space\n\\begin{align*}\nH = \\lbrace (x_1,...,x_n) \\in \\mathbb{R}^{r_1} \\times \\mathbb{C}^{2 r_2} \\, | \\, x_{r_1 + r_2 + j} = \\overline{x_{r_1 + j}} \\, \\, \\forall 1 \\leq j \\leq r_2 \\rbrace \\subset \\mathbb{C}^n,\n\\end{align*}\nwhich is isomorphic to $\\mathbb{R}^n$ as an inner product space.\n\\end{definition}\nWe can equip $H$ with the orthonormal basis $\\lbrace \\textbf{h}_i \\rbrace$, where $\\textbf{h}_i = \\textbf{e}_i$ for $1 \\leq i \\leq r_1$ and $\\textbf{h}_j = \\frac{1}{\\sqrt{2}}(\\textbf{e}_j + \\textbf{e}_{j + r_2}), \\textbf{h}_{j+r_2} = \\frac{\\sqrt{-1}}{\\sqrt{2}}(\\textbf{e}_j - \\textbf{e}_{j + r_2})$ for $r_1 < j \\leq r_1+r_2$, and use the well defined $\\ell_p$ norm induced by viewing $H$ as a subset of $\\mathbb{C}^n$. Observe that multiplication in $K$ maps to coordinatewise multiplication in $H$. The $\\ell_2$ norm on $H$ allows us to efficiently sample a Gaussian distribution $D_\\textbf{r}$ over $K$ by sampling such a Gaussian coordinatewise over $H$, although technically this distribution is over the field tensor product $K_\\mathbb{R} = K \\otimes_\\mathbb{Q} \\mathbb{R} \\cong H$. Furthermore, it satisfies the property that for any $x \\in K_\\mathbb{R}$ we have the equality of distributions $x \\cdot D_\\textbf{r}$ and $D_{\\textbf{r}'}$, where $r_i' = r_i \\cdot \\vert \\sigma_i(x)\\vert$. When we have an extension of number fields $L\/K$ we will denote their respective canonical embeddings $\\sigma_L$ and $\\sigma_K$ as maps into $H_L$ and $H_K$ to avoid confusion.\n\n\\subsubsection{Relative Embeddings}\nIn the case of an extension $L$ of a number field $K$ it is sometimes more convenient to apply a different order on its embeddings induced by extending embeddings of $K$ to those of $L$. Given a tower $L\/K\/\\mathbb{Q}$ where $K$ has degree $n$ and $L$ has degree $d$ over $K$, there are precisely $n$ embeddings $\\sigma_1,...,\\sigma_n$ of $K$ into $\\mathbb{C}$. Assuming $L\/\\mathbb{Q}$ is Galois, each of these can be extended to an embedding $\\alpha_i: L \\rightarrow L$ such that $\\alpha_i \\vert_K = \\sigma_i$. However, these extensions are not unique, and it is easy to see that there are $[L:K] = d$ choices for each $\\alpha_i$. In particular, in the case where $L\/K$ is a cyclic extension with Galois group generated by $\\theta$ it holds that the composite automorphisms $\\alpha_i \\circ \\theta^j( \\cdot ), 1 \\leq j \\leq d$, run through the $d$ choices of $\\alpha_i$. Hence for a fixed choice of $\\alpha_1,...,\\alpha_n$ the $nd$ automorphisms of $L$ can each be uniquely represented by some $\\alpha_i \\circ \\theta^j(\\cdot)$, which we denote by $\\alpha_i^j(\\cdot), 1 \\leq i \\leq n, 1\\leq j \\leq d$. Given the usual ordering of embeddings of $K$ this induces two systematic orderings on the embeddings of $L$ by running through either the $i$ or $j$ coordinates first.\n\n\\subsection{Cyclic Algebras}\n\\begin{definition}\nLet $K$ be a number field with degree $n$, and let $L$ be a Galois extension of $K$ of degree $d$ such that the Galois group of $L$ over $K$ is cyclic of degree $d$, Gal$(L\/K) = \\langle \\theta \\rangle$. For non-zero $\\gamma \\in K$ we define the resulting cyclic algebra\n\\begin{align*}\n\\mathcal{A} = (L\/K, \\theta, \\gamma) := L \\oplus u L \\oplus ... \\oplus u^{d-1}L\n\\end{align*}\nwhere $\\oplus$ denotes the direct sum, $u \\in \\mathcal{A}$ is some auxiliary generating element of $\\mathcal{A}$ satisfying the additional relations $xu = u \\theta(x), \\forall x \\in L$ and $u^d = \\gamma$. We will call $d$ the degree of the algebra $\\mathcal{A}$. We call such an algebra a division algebra if every element $a \\in \\mathcal{A}$ has an inverse $a^{-1} \\in \\mathcal{A}$ such that $aa^{-1} = 1$.\n\\end{definition}\n\nThe relations among $K$, $L$ and $\\mathcal{A}$ are illustrated in Fig. \\ref{fig:relation}.\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[trim=37mm 88mm 40mm 71mm, clip, width=1\\linewidth]{cyclicconstruction.pdf}\n \\caption{Structure of a cyclic algebra.}\\label{fig:relation}\n\\end{figure}\n\nSince $\\theta$ fixes $K$, the center of the cyclic algebra is precisely $K$. Oftentimes the condition $\\gamma \\in K$ is replaced by the stronger condition $\\gamma \\in \\mathcal{O}_K$, and we will use this condition in our work to guarantee the existence of a certain subring known as the natural order. Note that the division property does not hold for arbitrary $\\gamma$, and such algebras are not always easy to construct, which we will discuss later in this section.\n\n\nWe present a matrix representation of elements of $\\mathcal{A}$ which proves useful for computing multiplication in cyclic algebras. We can naturally view an element $a \\in \\mathcal{A}$ as an $d$-dimensional vector Vec$(a)$ over $L$, in which case we can view left multiplication of elements as matrix-vector operations. This is done by defining the map $\\phi: \\mathcal{A} \\rightarrow M_{d \\times d}(L)$, where for $x = x_0 + ux_1 + ... + u^{d-1} x_{d-1} \\in \\mathcal{A}$ with each $x_i \\in L$,\n\\begin{align*}\n\\phi(x) = \\begin{pmatrix}\nx_0 & \\gamma \\theta(x_{d-1}) & \\gamma \\theta^2(x_{d-2}) & \\ldots &\\gamma \\theta^{d-1}(x_{1}) \\\\\nx_1 & \\theta(x_{0}) & \\gamma \\theta^2(x_{d-1}) & \\ldots &\\gamma \\theta^{d-1}(x_{2}) \\\\\nx_2 & \\theta(x_{1}) & \\theta^2(x_{0}) & \\ldots &\\gamma \\theta^{d-1}(x_{3}) \\\\\n\\vdots & \\vdots & \\vdots &\\ddots & \\vdots \\\\\nx_{d-1} & \\theta(x_{d-2}) & \\theta^2(x_{d-3}) & \\ldots & \\theta^{d-1}(x_{0}) \\\\\n\\end{pmatrix}.\n\\end{align*}\nWe call this mapping a left regular representation of $\\mathcal{A}$, because it holds for any $a,b \\in \\mathcal{A}$ that $\\phi(a) \\text{Vec}(b) = \\text{Vec}(ab)$, and that $\\phi(ab) = \\phi(a) \\cdot \\phi(b)$. In the case where $\\mathcal{A}$ is a division algebra it follows that each $\\phi(a)$ is an invertible matrix. Since $\\theta$ is well defined on $L_\\mathbb{R}$ we abuse notation and extend this map to $\\phi: \\bigoplus_{i=0}^{d-1}u^i L_\\mathbb{R} \\rightarrow M_{d \\times d} (L_\\mathbb{R})$. We derive lattices from subrings of a cyclic algebra by vectorising their images under $\\phi$.\n\\begin{definition}\\label{def1}\nLet $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ be a cyclic division algebra. A $\\mathbb{Z}$-order $\\Lambda$ in $\\mathcal{A}$ is a finitely generated $\\mathbb{Z}$-module such that $\\Lambda \\cdot \\mathbb{Q} = \\mathcal{A}$ and that $\\Lambda$ is a subring of $\\mathcal{A}$ with the same identity element as $\\mathcal{A}$. We call $\\Lambda$ maximal if there is no $\\mathbb{Z}$-order $\\Gamma$ such that $\\Lambda \\subsetneq \\Gamma \\subsetneq \\mathcal{A}$. Here, $\\Lambda \\cdot \\mathbb{Q} = \\lbrace \\sum_{i=1}^m a_i q_i : a_i \\in \\Lambda, q_i \\in \\mathbb{Q}, m \\in \\mathbb{Z}_{\\geq 1} \\rbrace$.\n\\end{definition}\nSince we are only concerned with $\\mathbb{Z}$-orders in this paper, we will just refer to them as orders.\n\\begin{example}\nThe ring of integers $\\mathcal{O}_K$ of a number field $K$ is the unique maximal order of a number field. In the case of cyclic algebras a maximal order is not necessarily unique.\n\\end{example}\nAn order of particular interest that we will use in our LWE construction is known as the \\textit{natural order}, defined as $\\Lambda := \\bigoplus_{i=0}^{d-1} u^i \\mathcal{O}_L$. Unlike in the case of $\\mathcal{O}_K$, this order is not necessarily maximal (however, we are going to work with natural orders that are also maximal). Note that in order for $\\Lambda$ to be closed under multiplication the element $\\gamma$ must lie in $\\mathcal{O}_K$.\n\n\\subsubsection{Non-Norm Condition}\\label{existence}\nIt is not a priori obvious whether well-defined cyclic algebras or orders actually exist. As observed earlier, the existence of $\\gamma$ enforcing the division algebra condition is a key component in constructing such objects. Fortunately, it is sufficient for $\\gamma$ to satisfy the so called `non-norm condition' \\cite{vehkalahti_densest_2009}.\n\n\n\\begin{prop}\\label{non-norm}\nThe cyclic algebra $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ of degree $d$ is a division algebra if and only if none\nof the elements $\\gamma^t$, $1\\leq t \\leq d-1$, appears in $N_{L\/K}(L)$, where $N_{L\/K}$ represents the relative norm of $L$ into $K$.\n\\end{prop}\n\nIn other words, this condition states that the lowest power of $\\gamma$ that is norm of some element of $L$, is $\\gamma^d$.\n\n\\subsubsection{Order Ideals}\nAnalogous to the use of $\\mathcal{O}_K$ ideals in RLWE, we will be interested in ideals of an order $\\Lambda$ of a cyclic division algebra $\\mathcal{A}$. Although $\\Lambda$ is a ring, it is non-commutative - thus there are three types of ideals. A left (respectively right) ideal $\\mathcal{I}$ of $\\Lambda$ is an additive subgroup of $\\Lambda$ such that for any $i \\in \\mathcal{I}, r \\in \\Lambda$, we have $r \\cdot i \\in \\mathcal{I}$ (respectively $i \\cdot r \\in \\mathcal{I}$). A two-sided ideal of $\\Lambda$ is an additive subgroup that is closed under left and right scaling by $\\Lambda$, i.e. a right ideal that is also a left ideal. The sum and product of two ideals $\\mathcal{I}, \\mathcal{J}$ are defined as usual; $\\mathcal{I} + \\mathcal{J} = \\lbrace i + j: i \\in \\mathcal{I}, j \\in \\mathcal{J} \\rbrace$ and $\\mathcal{I} \\cdot \\mathcal{J} = \\lbrace \\sum^m_{l=1} i_l \\cdot j_l : i_l \\in \\mathcal{I}, j_l \\in \\mathcal{J}, m \\in \\mathbb{N}\\rbrace$. In the case of two-sided ideals we have the standard notion of a fractional ideal; $\\mathcal{I}$ is a fractional ideal of $\\Lambda$ if $c \\mathcal{I} = \\mathcal{J}$ for a two-sided ideal $\\mathcal{J}$ and some $c \\in K$. In the rest of this paper, a (fractional or integral) ideal is always restricted to be two-sided, unless otherwise stated.\n\nWe remark that the structure of the collection of two-sided ideals of the natural order is not as simple as those of $\\mathcal{O}_K$, or indeed those of an arbitrary maximal order. In a maximal order, the group of two-sided ideals is a free abelian group generated by the prime (e.g. maximal) ideals \\cite[Theorem 22.10]{reiner_maximal_1975}, from which one can deduce obvious definitions of inverse and coprime ideals. For a general order $\\Lambda$, we define its prime ideals as its maximal two-sided ideals and the inverse of an ideal $\\mathcal{I} \\subset \\Lambda$ is\n\\begin{align*}\n\\mathcal{I}^{-1} = \\lbrace x \\in \\mathcal{A} : \\mathcal{I} \\cdot x \\cdot \\mathcal{I} \\subset \\mathcal{I} \\rbrace,\n\\end{align*}\nwhich lines up with the expected definition in the two-sided case (e.g. $\\mathcal{I} \\cdot \\mathcal{I}^{-1} = \\mathcal{I}^{-1} \\cdot \\mathcal{I} = \\Lambda$).\n\nFor the case of the natural order we do not have such a well-behaved ideal group, but a nice exposition is given in \\cite[Section 3]{oggier_quotients_2012-4}. In particular, for a two-sided ideal $\\mathcal{I} \\subset \\Lambda$, $\\mathcal{I} \\cap \\mathcal{O}_K$ is an ideal of $\\mathcal{O}_K$. For an ideal $\\mathcal{I} \\subset \\mathcal{O}_K$, $(\\mathcal{I}\\cdot \\Lambda) \\cap \\mathcal{O}_K = \\mathcal{I}$, from which it follows that this intersection map is a surjection onto the ideals of $\\mathcal{O}_K$. However, it is not in general an injection since several ideals of $\\mathcal{A}$ may have the same intersection with $\\mathcal{O}_K$. Since the ideals of $\\Lambda$ do not in general form a finitely generated abelian group, we define two ideals $\\mathcal{I}, \\mathcal{J}$ of $\\Lambda$ to be coprime if $\\mathcal{I} + \\mathcal{J} = \\Lambda$.\n\nNonetheless, since the orders to be constructed in \\cref{goodalgebras} are both natural and maximal, it will always hold for a two-sided ideal $\\mathcal{I}$ that $\\mathcal{I} \\cdot \\mathcal{I}^{-1} = \\mathcal{I}^{-1} \\cdot \\mathcal{I}= \\Lambda$ and $(\\mathcal{I}^{-1})^{-1} = \\Lambda$. These properties will be required in the proofs of \\cref{3,homomorphism}.\n\n\\subsubsection{Some Useful Ideals}\nFor an order $\\Lambda$ we define the codifferent ideal\n\\begin{align*}\n\\Lambda^\\vee = \\lbrace x \\in \\mathcal{A} : \\text{Tr}(x \\Lambda) \\subset \\mathbb{Z} \\rbrace\n\\end{align*}\nwhere Tr refers to the reduced trace, defined Tr$(a) := \\text{Tr}_{K\/\\mathbb{Q}}(\\text{Trace}(\\phi(a)))$. Similarly, for an ideal $\\mathcal{I}$ we define the dual ideal\n\\begin{align*}\n\\mathcal{I}^\\vee = \\lbrace x \\in \\mathcal{A} : \\text{Tr}(x\\mathcal{I}) \\subset \\mathbb{Z}\\rbrace.\n\\end{align*}\nSince the matrix trace satisfies Trace$(AB)$ = Trace$(BA)$, this definition is two-sided. Note that the codifferent ideal and a general dual ideal may be fractional ideals rather than full ideals, and they satisfy the equality $\\mathcal{I}^{\\vee} = \\Lambda^{\\vee} \\cdot \\mathcal{I}^{-1}$ for any ideal $\\mathcal{I}$.\n\nWe will also be interested in principal ideals, but must take more care with these than in commutative settings. For a central element $t \\in K$, we can define simply $\\langle t \\rangle = t \\cdot \\Lambda$, the set of elements of $\\Lambda$ divisible by $t$. However, for a general $t$ that does not lie in the center of $\\Lambda$ we need the slightly more complex definition\n\\begin{align*}\n\\langle t \\rangle = \\left \\{ \\sum^m_{i=1} r_i t s_i: r_i, s_i \\in \\Lambda, m \\in \\mathbb{N} \\right \\},\n\\end{align*}\nwhich can easily be seen to be a two-sided ideal, moreover the smallest one that contains $t$.\n\n\\subsubsection{Orders and Ideals as Integer Lattices}\nAny order $\\Lambda$ of a cyclic algebra $\\mathcal{A} = (L\/K,\\theta, \\gamma)$ has dimension $n d^2$ over $\\mathbb{Z}$ and thus generates a lattice of dimension $nd^2$ over $\\mathbb{Z}$. We will consider the following representation of these lattices, which extends naturally to ideals of orders as well. Consider an element $x = \\bigoplus_{i = 0}^{d-1} u^i x_i \\in \\Lambda$. We can consider $x$ as a vector over $H_L$ of dimension $d$ by $\\sigma_\\mathcal{A}(x) := \\lbrace \\sigma_L(x_0), \\sigma_L(x_1),...,\\sigma_L(x_{d-1}) \\rbrace$. Then, the collection $\\sigma_\\mathcal{A}(\\Lambda)$ forms an integer lattice of dimension $nd^2$. We will refer to this representation as the ``module representation\" and will sometimes double index the element $x$, denoting by $x_{i,j}$ the embedding $\\sigma_j(x_i)$, and extend this notation in the obvious manner to the space $\\bigoplus_{i=0}^{d-1} u^iL_\\mathbb{R}$. Though this representation is conceptually simple, we remark that it has some drawbacks in the case where $\\vert \\sigma_i(\\gamma) \\vert \\neq 1$ for some $i$ when considering sizes of lattice elements; we will choose $\\gamma$ carefully in our constructions to remove this issue.\n\n\\subsubsection{Gaussian Distributions Over Cyclic Algebras}\nAs in (R)LWE, we will need to sample Gaussian distributions over our ambient space in certain norms. In the case of RLWE, the continuous Gaussians are sampled in $K_\\mathbb{R} \\cong H$. Since a cyclic algebra $\\mathcal{A}$ can be viewed as an $n$-dimensional algebra over $L$, we use the visualization from the previous subsection and sample our error distributions over $\\bigoplus_{i=0}^{d-1} u^iL_\\mathbb{R}$, which has the same structure as a vector space as ${H_L}^d$. For simplicity we restrict ourselves to the case when $\\vert \\sigma_i(\\gamma) \\vert = 1$ for each $i$. Although this is a strong condition on $\\gamma$ it holds in the case where it is a root of unity, which we will enforce later. Otherwise, in order to maintain a norm that is sub-multiplicative the norm and shape of $\\gamma$ must be considered.\n\nExplicitly, we just consider the norm of an element of $\\mathcal{A}$ to be equal to the norm of the corresponding module element in $L^d$ of dimension $nd^2$ used in \\cite{langlois_worst-case_2015}, e.g. $\\Vert x \\Vert = \\Vert (\\sigma_L(x_0), \\sigma_L(x_1),...,\\sigma_L(x_{d-1})) \\Vert_2$ for $x = x_0 + u x_1 + ... + u^{d-1} x_{d-1} \\in \\mathcal{A}$. It is straightforward to check that this is indeed a norm in the case where $\\vert \\sigma_i(\\gamma) \\vert = 1$ for each $i$, since $\\gamma$ is fixed under $\\theta$ and multiplying by $\\gamma$ does not change the norm of an entry of $\\sigma_L$. It is clear that this norm extends to any $y \\in\\bigoplus_{i=0}^{d-1} u^i L_\\mathbb{R}$ in a natural manner. Now that we have defined a norm, it is easy to define a Gaussian distribution $D_{\\textbf{r}}$ on $\\mathcal{A}$, or its discrete analogue on $\\Lambda$ by sampling over the module ${L_\\mathbb{R}}^d$.\n\n\\subsubsection{The CRT}\nIn this subsection we state the CRT for order ideals, and deduce some important consequences. We note that the following lemmas are merely adaptations of those in \\cite[Section 2.3.8]{lyubashevsky_ideal_2010} extended to the case of cyclic algebras. The first is just the CRT.\n\\begin{lemma}\nLet $\\mathcal{I}_1,...,\\mathcal{I}_r$ be pairwise coprime ideals of an order $\\Lambda$ of a cyclic algebra $\\mathcal{A}$, and let $ \\mathcal{I} = \\prod_{i=1}^r \\mathcal{I}_i$. Then, the natural map $\\Lambda \\rightarrow \\bigoplus_{i=1}^r (\\Lambda\/\\mathcal{I}_i)$ induces an isomorphism $\\Lambda\/\\mathcal{I} \\rightarrow \\bigoplus_{i=1}^r (\\Lambda\/\\mathcal{I}_i)$.\n\\end{lemma}\nWe call a CRT basis for a set of coprime order ideals $\\mathcal{I}_1,...,\\mathcal{I}_r$ a basis $C = \\lbrace c_1,...,c_r \\rbrace$ of elements of $\\Lambda$ satisfying $c_i = 1 \\mod \\mathcal{I}_i, c_i = 0 \\mod \\mathcal{I}_j$ for $i \\neq j$.\n\\begin{lemma}\\label{2}\nGiven pairwise coprime ideals $\\mathcal{I}_1,...,\\mathcal{I}_r$ of an order $\\Lambda$, there is a deterministic polynomial time algorithm that outputs a CRT basis $c_1,...,c_r \\in \\Lambda$ for those ideals.\n\\end{lemma}\nThe proof is the same as in the ring case \\cite[Lemma 2.13]{lyubashevsky_ideal_2010}. Using \\cref{2} we can efficiently invert the natural CRT isomorphism. Given $a = (a_1,...,a_r) \\in \\bigoplus_{i=1}^r (\\Lambda\/\\mathcal{I}_i)$, it can be easily checked that its inverse is $b = \\sum_{i=1}^r a_i c_i \\mod \\mathcal{I}$.\n\nThe next two lemmas will be required later to construct an efficiently invertible bijection between quotient spaces $\\mathcal{I}\/\\langle q \\rangle \\cdot \\mathcal{I}$ and $\\Lambda\/\\langle q \\rangle$.\n\n\\begin{lemma}\\label{3}\nAssuming $q$ is unramified in $L$. Let $\\mathcal{I}$ be an ideal of the natural order $\\Lambda$ which is maximal and let $\\mathcal{J} = q \\cdot \\Lambda = \\langle q \\rangle \\cdot \\Lambda$, where $q$ is a prime integer and $\\langle q \\rangle = \\prod_{i=1}^r \\mathfrak{q}_i$ is a decomposition into prime ideals in $\\mathcal{O}_K$. Assume $\\gamma \\notin \\mathfrak{q}_i$ for each $i$. Then, there exists an element $t \\in \\mathcal{I}\\cap \\mathcal{O}_K$ such that the ideal $t \\cdot \\mathcal{I}^{-1} \\subset \\Lambda$ is coprime to $\\mathcal{J}$, and we can compute such a $t$ efficiently given $\\mathcal{I}$ and the prime factorization of $\\mathcal{J}$.\n\\end{lemma}\n\n\\begin{remark}\nThe condition on $\\gamma$ will be immaterial in our use case, since when $\\gamma$ is a unit the only $\\mathcal{O}_K$ ideal that contains $\\gamma$ is $\\mathcal{O}_K$ itself.\n\\end{remark}\n\n\\begin{proof}\nFor an ideal $\\mathcal{I}$ denote by $\\overline{\\mathcal{I}}$ its intersection with $K$, which is a non-trivial ideal of $\\mathcal{O}_K$ (see \\cite[Section 3]{oggier_quotients_2012-4}). We apply the corresponding \\cite[Lemma 2.14]{lyubashevsky_ideal_2010} to obtain $t \\in \\overline{\\mathcal{I}}$ such that $t \\cdot \\overline{\\mathcal{I}}^{-1}$ and $\\overline{\\mathcal{J}}$ are coprime as ideals of $\\mathcal{O}_K$ and $t \\in \\overline{\\mathcal{I}} \\setminus\\bigcup_{i=1}^r \\mathfrak{q}_i \\cdot \\overline{\\mathcal{I}}$. Assume, for a contradiction, that $t \\cdot \\mathcal{I}^{-1} + \\mathcal{J} \\neq \\Lambda$ e.g. the ideals are not coprime. Then, there is some maximal ideal $\\mathcal{M}$ of $\\Lambda$ containing $t \\cdot \\mathcal{I}^{-1}$ and $\\mathcal{J}$. Since $q$ is unramified in $L$ and $\\gamma \\notin \\mathfrak{q}_i$, by \\cite[Propositions 1 and 4]{oggier_quotients_2012-4}, this ideal must be one of the ideals $\\mathfrak{q}_i \\cdot \\Lambda$ since it contains $\\mathcal{J}$. Then $t \\cdot \\mathcal{I}^{-1} \\subset \\mathfrak{q}_i \\cdot \\Lambda$ and consequentially $t \\in \\mathfrak{q}_i \\cdot \\mathcal{I}$ because $\\mathcal{I}\\cdot \\mathcal{I}^{-1}=\\Lambda$ in a maximal order. Since $t$ and $\\mathfrak{q}_i$ are central it follows that $t \\in \\mathfrak{q}_i \\cdot \\overline{\\mathcal{I}}$, a contradiction.\n\\end{proof}\n\n\n\n\nThe next lemma will be the one we use in our reduction. As in RLWE, in practice we are interested in the case where $\\mathcal{J} = \\langle q \\rangle$ for a prime integer $q$ and $\\mathcal{P} = \\Lambda^\\vee$. We will use the familiar notation $\\mathcal{I}_q := \\mathcal{I}\/q \\cdot \\mathcal{I}$ for an ideal $\\mathcal{I}$ and $q \\in \\mathbb{Z}$ throughout the paper.\n\\begin{lemma}\\label{homomorphism}\nLet $\\Lambda$, $\\gamma$ and $q$ be given in \\cref{3}. Let $\\mathcal{I}, \\mathcal{J}$ be ideals of $\\Lambda$, with $t \\in \\mathcal{I}\\cap \\mathcal{O}_K$ chosen as above such that $ t \\cdot \\mathcal{I}^{-1}$ and $\\mathcal{J}$ are coprime as ideals, and let $\\mathcal{P}$ denote an arbitrary fractional ideal of $\\Lambda$. Then, the function $\\chi_t: \\mathcal{A} \\rightarrow \\mathcal{A}$ defined as $\\chi_t(x) = t \\cdot x$ induces a module isomorphism from $\\mathcal{P}\/\\mathcal{J} \\cdot \\mathcal{P} \\rightarrow \\mathcal{I}\\cdot \\mathcal{P}\/ \\mathcal{I} \\cdot \\mathcal{J} \\cdot \\mathcal{P}$. Furthermore, in the case $\\mathcal{J} = \\langle q \\rangle$ for a prime integer $q$ we can efficiently compute the inverse.\n\\end{lemma}\n\n\\begin{proof}\nThe proof is similar to that of \\cite{lyubashevsky_ideal_2010}. Since $t$ lies in the center of $\\Lambda$ it is clear that multiplication by $t$ induces a module homomorphism. Given the map $\\chi_t: \\mathcal{P} \\rightarrow \\mathcal{I}\\cdot \\mathcal{P}\/\\mathcal{I} \\cdot \\mathcal{J}\\cdot \\mathcal{P}$ and $j \\in \\mathcal{J} \\cdot \\mathcal{P}$, $\\chi_t(j) = t \\cdot j \\in \\mathcal{I} \\cdot \\mathcal{J} \\cdot \\mathcal{P}$, so it is clear that $\\mathcal{J} \\cdot \\mathcal{P}$ is in the kernel of this map. Conversely, if $\\chi_t(x) = 0$ then $t \\cdot x \\in \\mathcal{I} \\cdot \\mathcal{J} \\cdot \\mathcal{P}$, from which it follows that $\\mathcal{I}^{-1} \\cdot t \\cdot x \\subset \\mathcal{J} \\cdot \\mathcal{P}$. From the definition of coprime, $t \\cdot \\mathcal{I}^{-1} + \\mathcal{J} = \\Lambda$, from which it follows that there exists $a \\in t \\cdot \\mathcal{I}^{-1}, b \\in \\mathcal{J}$ such that $a + b = 1$. Hence $x = (a+b)\\cdot x = a \\cdot x + b \\cdot x$. Since $a \\cdot x, b \\cdot x \\in \\mathcal{J} \\cdot \\mathcal{P}$ it follows that $x \\in \\mathcal{J} \\cdot \\mathcal{P}$, from which injectivity follows immediately.\n\nTo demonstrate efficient invertibility, we must work slightly harder. Now let $ \\mathcal{J} = \\langle q \\rangle$. Compute $t$ as in \\cref{3} and observe that the bijection $\\chi_t : \\Lambda_q \\rightarrow \\mathcal{I}_q$ is an additive homomorphism. Thus, it suffices to compute the inverse of all elements of a $\\mathbb{Z}$ basis of $\\mathcal{I}_q$, since then any element can be inverted by computing its representation in this basis and inverting that. We construct such a basis as follows. First, choose $n^2 \\cdot d^4$ elements $x_i, i = 1,..., n^2 \\cdot d^4$ from $\\Lambda_q$ uniformly at random and compute $y_i = \\chi_t (x_i)$ for each $i$. It follows that each $y_i$ is a uniformly random element of $\\mathcal{I}_q$. Then, with high probability the $y_i$'s form a spanning set of $\\mathcal{I}_q$ (see the proceeding lemma), which we can reduce to a $\\mathbb{Z}$ basis $y_1',...,y_{n \\cdot d^2}'$. This basis satisfies the desired property that each element has a known inverse. If this algorithm fails (e.g. there is no suitable basis $y_1',...y_{n \\cdot d^2}'$), we repeat, choosing a fresh set of elements $x_1,...,x_{n^2 \\cdot d^4}$ until we succeed.\n\\end{proof}\n\n\\begin{lemma}\nGiven a set of $n^2 \\cdot d^4$ independent and uniformly random elements $\\Xi \\subset \\mathbb{Z}_q^{n \\cdot d^2}$, the probability that $\\Xi$ contains no set of $n \\cdot d^2$ linearly independent vectors (over $\\mathbb{Z}$) is exponentially small in $d$.\n\\end{lemma}\nThis lemma is a straightforward adaptation of Corollary 3.16 of \\cite{regev_lattices_2009}.\n\n\\subsection{Lattice Problems}\\label{latticeproblems}\nComputational problems on lattices represent the foundations of the security of (R)LWE, and will do so for our Cyclic LWE as well. The standard lattice problems are as follows.\n\\begin{definition}\nLet $\\Vert \\cdot \\Vert$ be some norm on $\\mathbb{R}^n$ and let $\\xi \\geq 1$. Then the approximate Shortest Vector Problem (SVP$_\\xi$) on input a lattice $\\mathcal{L}$ is to find some non-zero vector $\\textbf{x}$ such that $\\Vert \\textbf{x} \\Vert \\leq \\xi \\cdot \\lambda_1(\\mathcal{L})$.\n\\end{definition}\n\\begin{definition}\nLet $\\Vert \\cdot \\Vert$ be some norm on $\\mathbb{R}^n$ and let $\\xi \\geq 1$. Then the (approximate) Shortest Independent Vectors Problem (SIVP$_\\xi$) on input a lattice $\\mathcal{L}$ is to find $n$ linearly independent non-zero vectors $\\textbf{x}_1,...,\\textbf{x}_n$ such that $\\max_{i}(\\Vert \\textbf{x}_i \\Vert) \\leq \\xi \\cdot \\lambda_n(\\mathcal{L})$.\n\\end{definition}\n\\begin{definition}\nLet $\\Vert \\cdot \\Vert$ be some norm on $\\mathbb{R}^n$, let $\\mathcal{L}$ be a lattice, and let $d < \\lambda_1(\\mathcal{L})\/2$. Then the Bounded Distance Decoding problem (BDD$_{\\mathcal{L}, d}$) on input $\\textbf{y} = \\textbf{x} + \\textbf{e}$ for $\\textbf{x} \\in \\mathcal{L}$ and $\\Vert \\textbf{e} \\Vert \\leq d$ is to compute $\\textbf{x}$, or equivalently $\\textbf{e}$.\n\\end{definition}\n\nThe above problems are all well investigated, and believed to be sufficiently hard to base post-quantum cryptographic security on; there are no known algorithms for any of these problems (for suitable parameters) running in polynomial time in dimension $n$.\n\nUnfortunately, these problems are not directly suitable for CLWE, where we will be interested in their adaptations to lattices generated by order ideals, similarly to how ideal lattices are used the ring case. Specifically we have the same problems on lattices that they induce under the map $\\sigma_\\mathcal{A}(\\cdot)$. So, SVP becomes:\n\\begin{definition}\nLet $\\mathcal{A}$ be a cyclic algebra, let $\\mathcal{I}$ be some (possibly fractional) ideal of the natural order $\\Lambda$. Then, for an approximation factor $\\xi \\geq 1$, the $\\mathcal{A}$-SVP$_\\xi$ is to find a non-zero element $a \\in \\mathcal{I}$ such that $\\vert a \\vert := \\Vert \\sigma_\\mathcal{A}(a) \\Vert_2 \\leq \\xi \\cdot \\lambda_1(\\mathcal{I})$, where as usual $\\lambda_1(\\mathcal{I})$ denotes the minimal length of elements of $\\mathcal{I}$ in the given norm.\n\\end{definition}\n\\begin{remark}\nWhen we use these problems in our security reductions, we will assume that the ideals are in fact \\textit{integral} ideals (e.g. we exclude fractional ideals). Observe that this may be done without loss of generality, since solving the $\\mathcal{A}$-SVP problem on the fractional ideal $\\mathcal{I}$ may be done by solving it on the integral ideal $c \\mathcal{I}$ (where $c \\in K$ is the element such that $c\\mathcal{I}$ is integral) and rescaling the solution.\n\\end{remark}\nEssentially we have a specialized version of the SVP problem; we must find an element of $\\mathcal{I}$ with minimal norm (up to approximation factor) in the ideal $\\mathcal{I}$. The extension of SIVP to $\\mathcal{A}$-SIVP is analogous, but since we consider our objects as $\\mathbb{Z}$-lattices we require the independent `vectors' $a_1,...,a_r$ to be linearly independent over $\\mathbb{Z}$. For BDD, we need a suitable ambient space, and use the following definition.\n\\begin{definition}\nLet $\\mathcal{A}$ be a cyclic algebra, let $\\mathcal{I}$ be some (possibly fractional) ideal of a maximal $\\mathbb{Z}$-order $\\Lambda$, and let $\\delta < \\lambda_1(\\mathcal{I})\/2$. Then the $\\mathcal{A}$-BDD$_{\\mathcal{I}, \\delta}$ problem, on input $y = x + e$ for $x \\in \\mathcal{I}$ and $e \\in \\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}}$ satisfying $\\vert e \\vert \\leq \\delta$, is to compute $x$.\n\\end{definition}\n\n\\subsection{The Learning With Errors Problem}\nWe will briefly recall the initial Learning With Errors (LWE) problem here; in \\cref{sec3} we will extend it to cyclic algebras. The problem comes in two forms; search and decision, both of which are based on the LWE distribution. Let $n$ and $q$ be positive integers, and let $\\alpha > 0$ be some error parameter. Define $\\mathbb{T} := \\mathbb{R}\/ \\mathbb{Z}$, the unit torus.\n\\begin{definition}\nFor a secret $\\textbf{s} \\in \\mathbb{Z}_q^n$, a sample $(\\textbf{a}, b) \\leftarrow A_{\\textbf{s}, \\alpha}$ is taken by sampling a uniformly random vector $\\textbf{a} \\in \\mathbb{Z}_q^n$ and $e \\leftarrow D_\\alpha$ and outputting $(\\textbf{a},b) = (\\textbf{a}, \\langle \\textbf{a}, \\textbf{s} \\rangle \/q + e \\mod \\mathbb{Z})$.\n\\end{definition}\nGiven the above distribution, the LWE problem comes in two forms.\n\\begin{definition}\nThe search LWE problem is to recover $\\textbf{s}$ from a collection of samples $A_{\\textbf{s}, \\alpha}$. The decision LWE problem on input a collection of samples on $\\mathbb{Z}_q^n \\times \\mathbb{T}$ is to decide whether they are uniform samples or were taken from $A_{\\textbf{s}, \\alpha}$ for some secret $\\textbf{s}$, providing the samples were taken from one of these distributions.\n\\end{definition}\nTypically, the number of samples provided in each of these problems depends on the application. Since the decision problems has a probabilistic element, we will be interested in the advantage of the algorithms that solve it, which is defined as the difference between their acceptance probabilities on samples from an LWE distribution $A_{\\textbf{s}, \\alpha}$ and the uniform distribution. In practice, the decision problem is of more interest in cryptography.\n\nWe will not define the popular extensions of these problems to number fields or modules, known as Ring-LWE and Module-LWE, but the unfamiliar reader may find details in \\cite{lyubashevsky_ideal_2010} and \\cite{langlois_worst-case_2015} respectively, both of which we reference frequently in this work.\n\n\n\\section{The CLWE Problem}\\label{sec3}\nIn this section we present the general definition of CLWE together with justifications for choices made in the definition, as well as constructions of specific algebras to use. We will save the security properties for \\cref{sec4}.\n\\begin{definition}\nLet $L\/K$ be a Galois extension of number fields of dimension $[L : K] = d$, $[K: \\mathbb{Q}] = n$ with cyclic Galois group generated by $\\theta (\\cdot)$. Let $\\mathcal{A} := (L\/K, \\theta, \\gamma)$ be the resulting cyclic algebra with center $K$ and invariant $u$ with $u^d = \\gamma \\in \\mathcal{O}_K$. Let $\\Lambda$ be an order of $\\mathcal{A}$. For an error distribution $\\psi$ over $\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}}$, an integer modulus $q \\geq 2$, and a secret $s \\in \\Lambda^\\vee_q$, a sample from the CLWE distribution $\\Pi_{q, s, \\psi}$ is obtained by sampling $a \\leftarrow \\Lambda_q$ uniformly at random, $e \\leftarrow \\psi$, and outputting $(a,b) =(a, (a \\cdot s)\/q + e \\mod \\Lambda^\\vee) \\in (\\Lambda_q, \\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}})\/\\Lambda^\\vee$.\n\\end{definition}\n\\begin{remark}\nUnlike in commutative spaces, the order of multiplication of $a$ and $s$ is important; our choice is $(a \\cdot s)$, but similar security properties would hold if one took $(s \\cdot a)$ instead. Also observe that our modulo reduction in the second coordinate of the pair is well defined, since $(a \\cdot s) \\in \\Lambda^\\vee_q$.\n\\end{remark}\nAs usual, the associated CLWE problem will come in search and decision variants.\n\\begin{definition}\nLet $\\Pi_{q,s, \\psi}$ be a CLWE distribution for parameters $q \\geq 2$, $s \\in \\Lambda^\\vee_q$, and error distribution $\\psi$. Then, the search CLWE problem, which we denote by CLWE$_{q, s, \\psi}$, is to recover $s \\in \\Lambda^\\vee_q$ from a collection of independent samples from $\\Pi_{q,s, \\psi}$.\n\\end{definition}\nWe do not state the number of samples allowed for this (or the next) problem, as typically it depends on the application.\n\\begin{definition}\nLet $\\Upsilon$ be some distribution on a family of error distributions over $\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}}$ and $U_\\Lambda$ denote the uniform distribution on $(\\Lambda_q, (\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}})\/\\Lambda^\\vee)$. Then, the decision CLWE problem, written D-CLWE$_{q, \\Upsilon}$, is on input a collection of independent samples from either $\\Pi_{q, s, \\psi}$ for a random choice of $(s, \\psi) \\leftarrow U(\\Lambda^\\vee_q) \\times \\Upsilon$ or from $U_\\Lambda$, to decide which is the case with non-negligible advantage.\n\\end{definition}\n\n\\subsection{Discussions}\\label{discussions}\n\n\\subsubsection{Relation to Module-LWE}\nFirst, we explain why we choose the order of multiplication $a \\cdot s$. As discussed in the introduction, the transformation from a (primal) RLWE sample to $n$ related LWE samples provides our motivation. Here, one RLWE sample $a \\cdot s + e$, where $a,s,e \\in R_q \\cong \\frac{\\mathbb{Z}_q[x]}{x^n+1}$, generates $n$ LWE samples by considering the multiplication operation as $A\\textbf{s} + \\textbf{e}$, where $A :=$ rot$(a)$ is a negacyclic matrix. For appropriate choices of error distributions, this is precisely $n$ LWE samples with the exception that there is some structure in the matrix $A$. By ordering the multiplication $a \\cdot s$, we get a similar transform from CLWE to MLWE. Assuming for now that we have a discretized form of CLWE, and observing that for $q \\in \\mathbb{Z}$ we have $\\Lambda_q \\cong \\bigoplus_{i=0}^{d-1} u^i \\mathcal{O}_L\/q \\mathcal{O}_L$ (see \\cite{oggier_quotients_2012-4}), we transform a CLWE sample $a \\cdot s + e$ into matrix-vector form to get $\\phi(a) \\cdot \\textbf{s} + \\textbf{e}$, where $\\textbf{s}$ and $\\textbf{e}$ are vectors of dimension $d$ over $\\mathcal{O}_L\/q \\mathcal{O}_L$. Setting $A = \\phi(a)$, one can see that for appropriate choices of error distribution this is similar to $d$ samples from the MLWE distribution with some additional structure in the matrix $A$, as intended.\n\n\\subsubsection{The Natural Order vs. Maximal Order}\nWe consider $\\Lambda$ the natural order or a maximal order. The natural order is simple to construct and represent, whereas finding a maximal order is computationally slow. Additionally, the natural order is somewhat orthogonal, in the sense that it has the same span in each $u^i$ coordinate independently of the other coordinates. This is advantageous when considering the relation to MLWE, where the module is always taken to be the full module $\\mathcal{O}_K^d$.\n\nAs mentioned above, two-sided ideals in a maximal order form a free abelian group, which is not necessarily the case in the natural order. Further, as lattices, a maximal order gives denser sphere packing than the natural order, since the latter is a sublattice. Fortunately, we will construct in \\cref{goodalgebras} cyclic algebras whose natural order is also maximal, thus enjoying both the simplicity of the natural order and the convenience of a maximal order.\n\n\\begin{example}\nQuaternion algebra over $\\mathbb{Q}$ is defined by $\\mathbb{H} = \\left\\{ x + yj: x, y \\in \\mathbb{Q}(i)\\right\\}$, with the usual relations $i^2=j^2=-1$ and $ij = -ji$. It can be seen as a cyclic division algebra $(\\mathbb{Q}(i)\/\\mathbb{Q}, \\overline{(\\cdot)}, -1)$ where $\\overline{(\\cdot)}$ denotes the complex conjugate and $-1$ is a non-norm element. A quaternion has matrix representation\n$$\\left(\\begin{array}{cc} x & -\\overline{y} \\\\ y & \\overline{x} \\end{array}\\right).$$\n\nThe \\textit{Lipschitz integers} $\\mathcal{L} \\subset \\mathbb{H}$ form the (non-maximal) natural order $\\mathcal{L}=\\left\\{x+yj : x, y \\in \\mathbb{Z}[i]\\right\\}.$\nThe maximal Hurwitz order is given by\n$$\\mathcal{H} = \\left\\{a+bi+cj+d(-1+i+j+ij)\/2 : a, b, c, d \\in \\mathbb{Z}\\right\\}.$$ It is easy to check that, as $\\mathbb{Z}$-lattices of dimension $4$, the Lipschitz order is a sublattice of the Hurwitz order, of index $2$.\n\\end{example}\n\n\\subsubsection{A Pair of Number Fields}\nIn MLWE, we are free to choose the dimension of our module over the underlying number field $K$. However, in the cyclic algebra case we are restricted to cases where we can find $L,K$, and $\\gamma$ such that $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ is well defined. From a theoretical standpoint it is not immediately clear whether we want to consider asymptotic security in terms of $n$ or $d$, but following our motivation from MLWE we suggest that $n$ is likely the suitable choice since the module dimension $d$ is typically small in applications using MLWE, whereas the dimension of the underlying field $K$ is large. However, there seems to be no a priori reason why with the right techniques one could not consider both $n$ and $d$ asymptotically; the only case a cyclic algebra precludes is high dimensional MLWE over a low dimension number field $L$, because the parameter $d$ occurs in both the module and field dimension.\n\n\\subsection{Evading BCV Style Attacks}\\label{BCWappendix}\nIn our CLWE construction we have enforced that $\\gamma$ is selected so that $\\mathcal{A}$ is a division algebra. We do this to avoid attacks in the style of \\cite{bootland_security_2018} on the $m$-RLWE protocol. For $m = 2$, the $m$-RLWE protocol of \\cite{pedrouzo-ulloa_ring_2016} can be considered as a structured variant of MLWE, where the matrix $A$ in the operation $A\\textbf{s} + \\textbf{e}$ is a negacyclic matrix over some ring $R_q$. More explicitly, $2$-RLWE considers the tensor product of two fields $K = K_1 \\otimes K_2$ and runs the LWE assumption in the ring of integers $R_q$. The example use case given in \\cite{pedrouzo-ulloa_ring_2016} considers power-of-two cyclotomics $K_1, K_2$ defined by the polynomials $x^{k_1} + 1$ and $y^{k_2} + 1$ respectively, claiming that the resulting problem in $R_q = \\frac{\\mathbb{Z}_q[x,y]}{(x^{k_1}+1, y^{k_2} +1)}$ effectively corresponds to an RLWE problem of dimension $k_1 \\cdot k_2$ due to an obvious homomorphism between $K$ and the two-power cyclotomic field $L$ of degree $k_1 \\cdot k_2$. The problem also represents a structured MLWE instance over $\\frac{\\mathbb{Z}_q[x]}{(x^{k_1}+1)}$ of dimension $k_2$.\n\nHowever, the observation of \\cite{bootland_security_2018} is that there is a smaller field $K'$ containing $K_1$ such that there is a homomorphism from $K$ into $K'$ with a well defined image for $y$. This is because the roots of distinct two-power cyclotomic polynomials are algebraically related. For example, in the case $k_1 = 8, k_2 = 4$, it is clear that the map taking $y$ to $x^2$ and fixing $K_1$ is a well defined homomorphism from $K$ to $K_1$. Using this homomorphism, \\cite{bootland_security_2018} simplifies the problem of solving one $2$-RLWE instance by considering it as four RLWE instances in dimension $k_1$ rather than one instance in dimension $k_1 \\cdot k_2$, essentially removing the module dimension $k_2$ from the problem.\n\nWe argue that the non-norm condition of $\\gamma$ precludes the existence of a homomorphism removing the module structure by taking a well defined cyclic algebra $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ to a smaller subfield containing $K$. We restrict our search to maximal subfields of $\\mathcal{A}$, since any subfield is contained in at least one maximal subfield. It is a well known result on division algebras that any maximal subfield $E$ of $\\mathcal{A}$ contains $K$ and satisfies $[E:K] = d$, and that in the case of a cyclic division algebra $\\mathcal{A}$ there is a choice of $u' \\in \\mathcal{A}$ such that the cyclic algebra $\\mathcal{A}' := \\bigoplus_j u'^j E$ is isomorphic to $\\mathcal{A}$ (see Section 15.1, Proposition a of \\cite{pierce_cyclic_1982-1}). Assume, for a contradiction, that we had such a homomorphism $\\chi : \\mathcal{A} \\rightarrow L$, where without loss of generality we assume the maximal subfield is $L$ by the aforementioned proposition. Since $L$ is Galois, the restriction of $\\chi$ to $L$ is an automorphism of $L$. It is clear that $\\chi$ must agree on conjugates, since $\\chi(u) \\cdot \\chi(\\ell) = \\chi(u \\cdot \\ell) = \\chi(\\theta(\\ell) \\cdot u) = \\chi(u) \\cdot \\chi(\\theta(\\ell))$ for any $\\ell \\in L$. However, this contradicts $\\chi$ being injective on $L$ and it follows that no such homomorphism exists. Hence we conclude that the attack style of \\cite{bootland_security_2018} does not threaten our algebraic structure.\n\nOn the other hand, Appendix \\ref{badgamma} shows that if $\\gamma$ violates the non-norm condition, then those instances of the CLWE problem are potentially vulnerable. To sum up, the non-norm condition is crucial to the hardness of the CLWE problem.\n\n\\subsection{Concrete Algebras for CLWE}\\label{algebras}\n\nIn order to apply the CLWE assumption in a practical cryptosystem one must choose a concrete algebra as an ambient space. More generally, we are interested in finding families of algebras suitable for CLWE that allow for asymptotic analysis and varied security levels. Our search for algebras is motivated by the restrictions and conditions discussed in the previous section. In particular, we are interested in cyclic division algebras satisfying the following properties:\n\\begin{itemize}\n\\item The non-norm element $\\gamma$ must lie in $\\mathcal{O}_K$ to keep the natural order closed under multiplication, and should satisfy $\\vert \\gamma \\vert = 1$ in order to maintain both the coordinatewise independence and sub-multiplicative properties of the norm\\footnote{We abbreviate the condition $\\vert \\sigma_i(\\gamma) \\vert=1$ for all $i$ by $\\vert \\gamma \\vert = 1$, since in fact these are equivalent for algebraic $\\gamma$.}.\n\\item The dimension $n:= [K: \\mathbb{Q}]$ of the division algebra should be large and the degree $d:= [L:K]$ should be small. This is to maintain the analogy with structured MLWE (the degree corresponds to the module rank) and follows from the search-decision reduction, which takes time polynomial in $n$ but not in $d$.\n\\item The base field $K$ should be cyclotomic and $q$ should split completely in $K$. This is also a result of the methodology of the search-decision reduction, which uses the well understood factorization of $\\langle q \\rangle$ in $\\mathcal{O}_K$. In addition, since the bulk of lattice based cryptography is done over cyclotomic fields, we consider algebras which are small extensions of these as somewhat natural. We observe that an improved proof of decision security may allow this point to be dropped, whereas the other two points feel more integral.\n\\end{itemize}\nAlthough significant effort has been expended by coding theorists to construct cyclic division algebras satisfying a variety of conditions, such as in \\cite{vehkalahti_densest_2009} or \\cite{lahtonen_construction_2008}, we find ourselves with a fairly unique set of restrictions. In particular, for reasons relating to desired applications, the majority of algebras used in coding theory are either of small total dimension or have small $[K:\\mathbb{Q}]$ and scale asymptotically in $[L:K]$. Since we are interested in scaling up $K$ asymptotically, we will have to build novel algebras satisfying the above requirements ourselves. We will, however, make heavy use of the following theorem as an intermediate step. Here $\\zeta_m$ denotes a primitive $m^\\text{th}$ root of unity where $\\varphi(m)=n$ is the degree of the base field $K = \\mathbb{Q}(\\zeta_m)$.\n\n\\begin{theorem}[\\cite{lahtonen_construction_2008}]\\label{lahtonenalgebras}\nLet $m = p^a$ be a prime power and let $K = \\mathbb{Q}(\\zeta_m)$. Then, there exist infinitely many cyclic Galois extensions $L\/K$ of degree $m$ such that $\\zeta_m^i$ is not a norm of $L\/K$ for $0 \\sqrt{2} q \\cdot \\eta_\\varepsilon(\\mathcal{I})$.\n\\end{theorem}\nFrom this we deduce the following corollary, similarly to \\cite{langlois_worst-case_2015}, since the lattice structure of our algebra is merely a special case of their modules. We denote by $N$ the total dimension of $\\mathcal{A}, N := nd^2$.\n\\begin{corollary}\n\n\nLet $\\mathcal{A}, \\Lambda, \\alpha$ and $q$ be as above. Then, there is a polynomial-time quantum reduction from $\\mathcal{A}$-SIVP$_\\xi$ to search CLWE$_{q, \\Sigma_\\alpha}$ for any $\\sqrt{8 Nd} \\cdot \\xi = (\\omega(\\sqrt{d n})\/\\alpha)$.\n\\end{corollary}\n\nThe following theorem is our analogy of Lemma 4.10 of \\cite{langlois_worst-case_2015}.\n\\begin{theorem}\\label{bootstrapping}\nGiven an oracle that solves CLWE$_{q, \\Sigma_{\\alpha}}$ for input $\\alpha \\in (0,1)$, an integer $q \\geq 2$, an ideal $\\mathcal{I} \\subset \\Lambda$, a number $r \\geq \\sqrt{2}q \\cdot \\eta(\\mathcal{I})$ satisfying $r' := r \\cdot \\omega(\\sqrt{\\log{N}})\/(\\alpha q) > \\sqrt{2N}\/\\lambda_1(\\mathcal{I}^\\vee)$, and polynomially many samples from the discrete Gaussian $D_{\\mathcal{I},r}$ there exists an efficient quantum algorithm that outputs an independent sample from $D_{\\mathcal{I}, r'}$.\n\\end{theorem}\nWe can then prove \\cref{mainresult} in the standard iterative manner; for a very large value of $r$, e.g. $r \\geq 2^{2N}\\lambda_N(\\mathcal{I})$, start by sampling classically from $D_{\\mathcal{I}, r}$. Then apply the above algorithm to obtain a polynomial number of samples from $D_{\\mathcal{I}, r'}$. Repeating this step gives samples from progressively narrower distributions, until we arrive at the desired Gaussian parameter $s \\geq \\xi$. In order to classically sample the initial collection of Gaussian samples, we use the standard Lemma 3.2 of \\cite{regev_lattices_2009} to sample $D_{\\mathcal{I}, r}$ on the module representation $\\bigoplus_{i=0}^{d-1} u^i L_\\mathbb{R}$. As usual, we obtain \\cref{bootstrapping} in two steps, first the main reduction of \\cref{bddtrans}, then the following quantum step adapted from \\cite{regev_lattices_2009}. We use a form of $\\mathcal{A}-$BDD$_{L,\\delta}$ from \\cite{langlois_worst-case_2015} where we bound the offset in the norm $\\Vert e \\Vert_{2,\\infty} := \\max_j\\sqrt{(\\sum_{i = 0}^{d-1} \\vert \\sigma_j(e_i) \\vert^2)} \\leq \\delta$, where $\\sigma$ denotes the canonical embedding of $L$.\n\n\\begin{lemma}\nThere is an efficient quantum algorithm that given any $N = n \\cdot d^2$ dimensional lattice $\\mathcal{L} := \\sigma_\\mathcal{A}(\\mathcal{I})$ for some ideal $\\mathcal{I}$, a real $\\delta < \\lambda_1(\\mathcal{L}^*)\/(2 \\sqrt{2 nd})$, and an oracle that solves $\\mathcal{A}$-BDD$_{\\mathcal{L}^*,\\delta}$ with all but negligible probability, outputs an independent sample from $D_{\\mathcal{L}, \\sqrt{d} \\omega(\\sqrt{\\log(nd)})\/\\sqrt{2} \\delta}$.\n\\end{lemma}\n\n\nFor the reduction of BDD to Search CLWE, we begin with the cyclic algebra analogy of the BDD-to-LWE samples transformation from Section 4 of \\cite{lyubashevsky_ideal_2010}. As is standard for LWE security, we use the following `modulo $q$' definition of BDD:\n\\begin{definition}\nFor any $q \\geq 2$ the $q\\mathcal{A}-$BDD$_{\\mathcal{I},d}$ problem is as follows: given an instance of the $\\mathcal{A}-$BDD$_{\\mathcal{I}, \\delta}$ problem $y = x+e$ with solution $x \\in \\mathcal{I}$ and error $e \\in \\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}}$ satisfying $\\Vert e \\Vert_{2, \\infty} \\leq \\delta$, output $x \\mod q\\mathcal{I}$.\n\\end{definition}\nWe use (a special case of) Lemma 3.5 from \\cite{regev_lattices_2009}, which lifts immediately since it is lattice preserving.\n\\begin{lemma}\nFor any $q \\geq 2$ there is a deterministic polynomial time reduction from $\\mathcal{A}-$BDD$_{\\mathcal{I}, d}$ to $q\\mathcal{A}-$BDD$_{\\mathcal{I},d}$.\n\\end{lemma}\nWe now present an algorithm which transforms $q\\mathcal{A}$-BDD samples to CLWE samples given some additional Gaussian samples. The algorithm is the same in spirit as Lemma 4.7 of \\cite{lyubashevsky_ideal_2010}, but has some technical differences induced by the structure of cyclic algebras.\n\n\\begin{lemma}\\label{bddtrans}\nLet $\\mathcal{A}$ be as in Theorem \\ref{mainresult}. There is a probabilistic polynomial time algorithm that on input a prime integer $q \\geq 2$, a fractional ideal $\\mathcal{I}^\\vee \\subset \\Lambda$, a $q\\mathcal{A}-$BDD$_{L, \\alpha q \\cdot \\omega(\\sqrt{\\log(nd)})\/\\sqrt{2nd} \\cdot r}$ instance $y = x + e$ where $x \\in \\mathcal{I}^\\vee$, a parameter $r \\geq \\sqrt{2}q \\cdot \\eta(\\mathcal{I})$, and samples from the discrete Gaussian $D_{\\mathcal{I},r'}$ with $r' \\geq r$, outputs samples that are within negligible statistical distance of the CLWE distribution $ \\Pi_{q, s, \\Sigma}$ for a secret $s = \\chi_t(x \\mod q \\mathcal{I}^\\vee) \\in \\Lambda^{\\vee}_q$, where $\\chi_t$ is as in \\cref{homomorphism} and $\\Sigma$ is an error distribution such that in the case where $\\vert \\gamma \\vert = 1$ the resulting error $e''$ has marginal distribution in its $i,j^{\\text{th}}$ coordinate that is Gaussian with parameter $r_{i,j} \\leq \\alpha$.\n\\end{lemma}\n\\begin{proof}\nThe proof will be in two parts - first, we will describe the algorithm, then we will prove correctness. Recall that in the definition of CLWE, a sample is in the form $(a, b) = (a, (a \\cdot s)\/q + e \\mod \\Lambda^\\vee)$, where $e$ is taken from an error distribution $\\psi \\in \\Sigma_\\alpha$.\n\nBegin by computing an element $t \\in \\mathcal{I}$ such that $\\mathcal{I}^{-1} \\cdot \\langle t \\rangle$ and $\\langle q \\rangle$ are coprime using \\cref{3}. We can now create a sample from the CLWE distribution as follows:\ntake an element $z \\leftarrow D_{\\mathcal{I},r'}$ from the Gaussian samples, and compute a pair\n\\begin{align*}\n(a, b) = (\\xi^{-1}_t( z \\mod q\\mathcal{I}), (z \\cdot y)\/q + e' \\mod \\Lambda^\\vee) \\in (\\Lambda_q \\times (\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}})\/\\Lambda^\\vee)\n\\end{align*}\nwhere $e' \\leftarrow D_{\\alpha\/\\sqrt{2}}$.\n\nWe now claim that these samples are within negligible statistical distance of the CLWE distribution and that $s$ is uniformly random. First we show that $a \\in \\Lambda_q$ is statistically close to uniform. By assumption, $r \\geq q \\cdot \\eta(\\mathcal{I})$ and so by appealing to \\cref{1} it can be seen that any value $z \\mod q \\mathcal{I}$ is obtained with probability in the interval $[\\frac{1 - \\varepsilon}{1 + \\varepsilon}, 1] \\cdot \\beta$ for some positive $\\beta$, from which it follows immediately that the statistical distance between $z \\mod q\\mathcal{I}$ and the uniform distribution is bounded above by $2\\varepsilon$. Since $\\chi_t$ of \\cref{homomorphism} and its inverse are both bijections, we conclude that $a = \\chi_t^{-1}(z \\mod q\\mathcal{I})$ is within statistical distance $2\\varepsilon$ of the uniform distribution over $\\Lambda_q$.\n\nNow we must show that $b$ is in the form $(a \\cdot s)\/q + e''$, for some suitable error $e''$ and a uniformly random $s$, where we condition on some fixed value of $a$. By construction,\n\\begin{align*}\nb :&= (z \\cdot y)\/q + e' \\mod \\Lambda^\\vee \\\\\n &= (z \\cdot x)\/q + (z \\cdot e)\/q + e' \\mod \\Lambda^\\vee,\n\\end{align*}\nso since $z = t \\cdot a \\mod \\Lambda_q^\\vee$ and $t$ lies in the center of $\\mathcal{A}$ it follows that $(z \\cdot x)\/q = (a \\cdot t \\cdot x)\/q = (a \\cdot s)\/q \\mod \\Lambda^\\vee$ for $s := \\chi_t(x \\mod q \\mathcal{I}^\\vee)$. It follows that $s$ is uniformly random over $\\Lambda^\\vee_q$ as long as $x$ is uniform over $\\mathcal{I}^\\vee$, since $\\chi_t$ is a bijection.\n\nFinally it is left to show that, conditioned on a fixed value of $a$, the marginal distribution of the $i,j^\\text{th}$ coordinate of the error term $ e'' = (z \\cdot e)\/q + e'$ is negligibly close to that specified by $\\Sigma$. We can explicitly calculate the error as\n\\begin{align}\\label{errorresult}\ne'' = \\sum_{i = 0}^{d-1} u^i (\\sum_{j + k = i} \\theta^k(z_j) \\cdot e_k(1-(1- \\gamma) \\mathbbm{1}_{j +k \\geq d})) + e'\n\\end{align}\nwhere the sum $j + k$ is taken modulo $d$ and the functon $(1-(1- \\gamma) \\mathbbm{1}_{j +k \\geq d})$ is $1$ if $j+k < d$ and $\\gamma$ otherwise\\footnote{This term is just indicating whether or not we have had to use the relation $u^d = \\gamma$ in this summand or not.}. Since $\\vert \\gamma \\vert = 1$ and $z \\leftarrow D_{\\mathcal{I},r}$ is spherically distributed, it follows that multiplying by $\\gamma$ and applying the permutation of $j$ coordinates induced by $\\theta$ does not change the distribution of $z_{i,j}$. Hence, each marginal distribution may be analyzed independently as in the case of MLWE, and the result follows using the analysis of the error from Lemma 4.15 of \\cite{langlois_worst-case_2015}.\n\\end{proof}\nThough we do not specify the covariance of $\\Sigma$, one can see that each entry of $\\sigma_\\mathcal{A}(z)$ appears in $\\sigma_\\mathcal{A}(e'')$ exactly $d$ times, and so by symmetry each element of $\\sigma_\\mathcal{A}(e'')$ has non-zero correlation with at most $d^2$ other entries. Hence, a proportion of at most $\\frac{nd^4}{n^2d^4} = \\frac{1}{n}$ of entries of $\\Sigma$ are non-zero.\n\n\n\n\\subsection{Search To Decision Reduction}\\label{searchdecisionsection}\nIn this section we will show that the hardness of decision CLWE follows from that of the search problem. Once again, we will follow a combination of the expositions of \\cite{lyubashevsky_ideal_2010} and \\cite{langlois_worst-case_2015} for the ring and module cases, making necessary changes for the structure of cyclic algebras. We will make heavy use of the following CRT style decomposition, a rephrasing of \\cite[Lemma 4]{oggier_quotients_2012-4}.\n\\begin{lemma}\\label{CRTlike}\nLet $\\Lambda$ be the natural order of a cyclic algebra $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ and let $\\mathcal{I}$ be an ideal of $\\mathcal{O}_K$ which splits completely as $\\mathcal{I} = \\mathfrak{q}_1...\\mathfrak{q}_n$ as an ideal of $\\mathcal{O}_K$. Then, we have the isomorphism\n\\begin{align*}\n\\Lambda\/\\mathcal{I}\\Lambda \\cong \\mathcal{R}_1 \\times ... \\times \\mathcal{R}_n,\n\\end{align*}\nwhere $\\mathcal{R}_i = \\bigoplus_{j=0}^{d-1} u^j (\\mathcal{O}_L\/\\mathfrak{q}_i\\mathcal{O}_L)$ is the ring subject to the relations $( \\ell + \\mathfrak{q}_i \\mathcal{O}_L)u = u(\\theta(\\ell) + \\mathfrak{q}_i \\mathcal{O}_L)$ and $u^d = \\gamma + \\mathfrak{q}_i$.\n\\end{lemma}\nOf course, this is not a true CRT decomposition, because we are considering ideals of $\\mathcal{O}_K$ rather than those of $\\Lambda$. In the case where $\\gamma$ is a unit, $\\Lambda^\\vee = \\bigoplus_i u^i \\mathcal{O}_L^\\vee$ and the above lemma is also valid in the case where each instance of $\\mathcal{O}_L$ and $\\Lambda$ are replaced with their respective duals.\n\nAs in \\cite{lyubashevsky_ideal_2010}, our reduction will be limited to certain choices of algebras. The above lemma considers the splitting of the ideal $\\mathcal{I}$ as an ideal of the base field $K$. Setting $\\mathcal{I} = \\langle q \\rangle$, the ideal generated by the modulus $q$, we will consider cases where $q$ splits completely in the base field.\nNow consider the family of algebras $\\mathcal{A}$ in \\cref{algebras} and let $K = \\mathbb{Q}(\\zeta_{p^a})$ have dimension $n$. It follows that if $q \\equiv 1 \\mod p^a$ then $q$ splits completely into a product of prime ideals $\\mathfrak{q}_1,...,\\mathfrak{q}_n$ as an ideal of $\\mathcal{O}_K$. Hence, we obtain the decomposition\n\\begin{align*}\n\\Lambda\/q\\Lambda \\cong R_1 \\times ... \\times R_n\n\\end{align*}\nwhere $R_i$ is as is \\cref{CRTlike}.\n\nAlso as in \\cite{lyubashevsky_ideal_2010}, we see no way to avoid randomizing the error distribution in the resulting decision problem. Further, we require that an oracle for D-CLWE$_{q, \\Upsilon_\\alpha}$ on an algebra $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ is also an oracle for the decision problem on any algebra $\\mathcal{A'} = (L\/K, \\theta, \\gamma')$ over the same number fields $L,K$ and some other root of unity $\\gamma' \\in \\mathcal{O}_K$. Intuitively this implies that for fixed $L$ and $K$ as in \\cref{algebras} the hardness of the D-CLWE problem is invariant under the choice of root of unity $\\gamma$, and will be required for Lemma 15. This is because there exist efficient, easy-to-compute isomorphisms isomorphisms sending $\\mathcal{A}$ to $\\mathcal{A}'$, which we will define shortly.\n\n\nThe main theorem of this section is \\cref{searchdecision}; we emphasize that our algorithm is only intended to be efficient in the dimension $n$ of the base field $K$, since we expect to fix $d$ as a small constant in practice. We will prove \\cref{searchdecision} in the usual manner: first we show that it is sufficient to recover the value of $s \\in \\Lambda^\\vee\/q\\Lambda^\\vee$ in one of the rings $R_i$ (\\cref{crtlemma}). Then, we use a hybrid distribution to define a decision problem in $R_i$, for which we demonstrate a search to decision reduction (\\cref{searchdecisionguess}). We then use a hybrid argument to conclude the proof (\\cref{hybridlemma}).\n\n\\subsubsection{CLWE in $R_i$}\nIn this section we will abuse notation and denote by $s \\mod R_i$ the value of $s \\in \\Lambda^\\vee\/q \\Lambda^\\vee$ in the $R_i$ coordinate under the isomorphism of \\cref{CRTlike}.\n\\begin{definition}\nThe $R_i-$CLWE$_{q, \\Sigma_\\alpha}$ problem is to find the value $s \\mod R_i$ given access to the CLWE distribution $\\Pi_{q,s,\\Sigma}$ for some arbitrary $\\Sigma \\in \\Sigma_\\alpha$.\n\\end{definition}\nIn the following lemmata we make use of the automorphisms of $K$ coordinatewise on the rings $R_i$. Since $K$ is a Galois extension of $\\mathbb{Q}$ and $q$ splits completely, it follows that the automorphisms $\\sigma_i$ of $K$ act transitively on the ideals $\\mathfrak{q}_i$. We demonstrate how to extend these to functions of $\\mathcal{A}$. First, extend these automorphisms to automorphisms $\\alpha_i$ of $L$ in some arbitrary manner. Then, we can extend these to isomorphisms $\\alpha_i : \\mathcal{A} \\rightarrow \\mathcal{A}'$, with $\\mathcal{A'} = (L\/K, \\theta, \\gamma')$, which agree with $\\alpha_i$ on $L$ and send $u$ to $u'$ with $u'^d = \\alpha_i(\\gamma)$ and $x u' = u' \\theta(x)$ for $x \\in L$. By the construction of $K$ from \\cite{lahtonen_construction_2008}, $\\alpha_i(\\gamma)$ is a non-norm element since it is some primitive $n^\\text{th}$ root of unity, and so it is easy to check that this $\\mathcal{A}'$ is a well defined division algebra and that $\\alpha_i$ is indeed an isomorphism which sends $\\mathcal{A}$ to $\\mathcal{A}'$. Furthermore, it fixes the family of error distributions $\\Sigma_\\alpha$. This is because each component of $z \\cdot e + e'$ is defined coordinatewise over the $d$ copies of $L_\\mathbb{R}$ in the module representation of $\\mathcal{A}$, and since $\\alpha_i$ induces the same permutation of the entries of the canonical embedding of $L$ in each coordinate as an automorphism of $L$ it fixes the family of choices for each of $z, e, e'$; hence since $\\alpha_i$ is an isomorphism the family of distributions $z \\cdot e + e'$ is fixed. It follows that the extended $\\alpha_i$ function maps the $R_i-$CLWE$_{q, \\Sigma_\\alpha}$ problem in $\\mathcal{A}$ to the same problem in $\\mathcal{A}'$, and moreover that this map preserves $\\Lambda^\\vee$ and the CRT style decomposition (\\cref{CRTlike}) of $\\Lambda^\\vee_q$ by sending $R_i$ to some $R_j$, where $j$ depends on the choice of $\\sigma_i$. We are now ready for the first step of our reduction.\n\\begin{lemma}\\label{crtlemma}\nThere is a deterministic polynomial time reduction from CLWE$_{q, \\Sigma}$ to $R_i-$CLWE$_{q,\\Sigma}$.\n\\end{lemma}\n\\begin{proof}\nLet $\\mathcal{O}_i$ be an oracle for the $R_i-$CLWE$_{q,\\Sigma}$ problem. Since \\cref{CRTlike} defines an isomorphism, it is sufficient to use $\\mathcal{O}_i$ to solve the $R_j-$CLWE$_{q,\\Sigma}$ for each $j$. Let $\\alpha_{j\/i}$ be an extension of the automorphism of $K$ mapping $\\mathfrak{q}_j$ to $\\mathfrak{q}_i$, which exists by transitivity. Then, given a sample $(a, b) \\leftarrow \\Pi_{q, s, \\Sigma}$, we construct the sample $(\\alpha_{j\/i}(a), \\alpha_{j\/i}(b))$. Since $\\Lambda_q$ and $\\Lambda_q^\\vee$ are fixed by each $\\alpha_{j\/i}$, the resulting pair is a valid CLWE sample in $\\mathcal{A}' = (L\/K, \\theta, \\alpha_{j\/i}(\\gamma))$; feeding these samples into $\\mathcal{O}_i$ outputs a value $t_j \\mod R_i$.\n\nWe claim $\\alpha_{j\/i}^{-1}(t_j) = s \\mod R_j$. Since $\\alpha_{j\/i}$ is an automorphism, each sample $(a,b)$ is mapped to a new CLWE sample $(\\alpha_{j\/i}(a), \\alpha_{j\/i}(a \\cdot s\/q + e) \\mod \\Lambda^\\vee)$ in a new algebra $\\mathcal{A}'$. We may write the second coordinate as $\\alpha_{j\/i}(a) \\cdot \\alpha_{j\/i}(s)\/ q + \\alpha_{j\/i}(e) \\mod \\Lambda^\\vee$. Since our automorphisms fix our family of error distributions and map the uniform distribution to the uniform distribution, it follows that this is a valid CLWE instance with secret $\\alpha_{j\/i}(s)$ and error distribution $\\Sigma'$. Hence, $\\mathcal{O}_i$ outputs $t = \\alpha_{j\/i}(s) \\mod R_i$, from which we recover $\\alpha_{j\/i}^{-1}(t) = s \\mod R_j$, as required.\n\\end{proof}\n\\subsubsection{Hybrid CLWE and Search-Decision}\\label{sec:Hybrid}\nFor this section we must introduce the cyclic algebra analog of the Hybrid LWE distribution used in \\cite{lyubashevsky_ideal_2010}; we use the decomposition into the rings $R_i$ rather than the CRT.\n\\begin{definition}\nFor a secret $s \\in \\Lambda_q^\\vee$, distribution $\\Sigma$ over $\\bigoplus_{j} u^j L_\\mathbb{R}$, and $i \\in [n]$, we define a sample from the distribution $\\Pi_{q,s,\\Sigma}^i$ over $\\Lambda_q \\times (\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}})\/\\Lambda^\\vee$ by taking $(a,b) \\leftarrow \\Pi_{q,s,\\Sigma}$ and $h \\in \\Lambda^\\vee_q$ which is uniformly random and independent $\\mod R_j, j \\leq i$ and $0 \\mod R_j, j > i$, and outputting $(a,b + h\/q)$. If $i=0$,we define $\\Pi_{q,s,\\Sigma}^0 = \\Pi_{q,s,\\Sigma}$.\n\\end{definition}\nUsing this distribution we define a worst-case decision problem relative to one $R_i$ and reduce it to the search problem $R_i-$CLWE.\n\\begin{definition}\nFor $i \\in [n]$ and a family of distributions $\\Sigma_\\alpha$, the W-D-CLWE$^i_{q, \\Sigma_\\alpha}$ problem is defined as the problem of finding $j$ given access to $\\Pi_{q,s,\\Sigma}^j$ for $j \\in \\lbrace i-1,i \\rbrace$ and valid CLWE secret and error distribution $s, \\Sigma$.\n\\end{definition}\n\nFor a technical reason in the following proof, we restrict our secret $s$ so that $s \\mod \\mathcal{R}_i$ lies in a set $G_i$ with the property that $g \\neq h \\in G_i$ implies $g-h$ is an invertible element. Applying this restriction for each $i$ places $s \\in G$ for a set $G = G_1 \\times \\dots \\times G_n$ of size $\\vert G \\vert = \\prod_i \\vert G_i \\vert$. We will call such a set $G$ a \\textit{pairwise different set}. We need to guarantee that there exist sufficiently large choices of $G$. It is not difficult to see that the maximal set sizes $\\vert G_i \\vert = q^d$ and $\\vert G \\vert = q^{nd}$, because any set of matrices in $M_{d \\times d}(\\mathbb{F}_q)$ of size at least $q^d +1$ contains two matrices with the same first row, whose difference is therefore uninvertible. Constructions of such maximal sets $G$ are given in Appendix \\ref{appendix:secretspace}.\n\n\\begin{lemma}\\label{searchdecisionguess}\nAssuming $s \\in G$, there is a probabilistic polynomial-time reduction from $R_i-$CLWE$_{q,s,\\Sigma_\\alpha}$ to W-D-CLWE$_{q,\\Sigma}^i$ for any $i \\in [n]$.\n\\end{lemma}\n\n\n\\begin{proof}\nWe follow the standard search-decision methodology of guessing the value of the secret mod $R_i$ and then modifying the samples so that the decision oracle tells us whether or not our guess was correct. Note that there are only $|G_i|$ possible values of $s \\mod R_i$, which is bounded above by $q^{d^2}$, polynomial in $n$, and so we may efficiently enumerate over the possible values.\n\nWe define the transform which takes a value $g \\in \\Lambda^\\vee_q$ and maps $\\Pi_{q,s,\\Sigma}$ to $\\Pi_{q,s,\\Sigma}^{i-1}$ if $g = s \\mod R_i$ or $\\Pi_{q,s,\\Sigma}^i$ otherwise as follows. On input a CLWE sample $(a,b) \\leftarrow \\Pi_{q,s,\\Sigma}$, output the pair\n\\begin{align*}\n(a',b') = (a + v, b+ (h+vg)\/q) \\in \\Lambda_q \\times (\\bigoplus_{i = 0}^{d-1} u^i L_{\\mathbb{R}})\/\\Lambda^\\vee,\n\\end{align*}\nwhere $v \\in \\Lambda_q$ is uniformly random mod $R_i$ and $0 \\mod R_j$ for $j \\neq i$ and $h \\in \\Lambda^\\vee_q$ is uniformly random and independent mod $R_j, j < i$ and $0$ on the other $R_j$. It is clear that $a'$ is still uniformly distributed on $\\Lambda_q$, so we are left to show $b'$ is correctly distributed. For a fixed value of $a'$, we write\n\\begin{align*}\nb ' &= b +(h +vg)\/q \\\\\n&= (as + h +vg)\/q + e \\\\\n&= (a's + h +v(g-s))\/q + e,\n\\end{align*}\nwhere $e$ is still drawn from $\\Sigma$. If $g = s \\mod R_i$, then $v(g-s) = 0 \\mod R_i$, and so the distribution of the pair $(a',b')$ is precisely $\\Pi_{q,s,\\Sigma}^{i-1}$. Otherwise, $v(g-s)$ is uniformly random mod $R_i$ by assumption on $G$ and $0$ mod the other $R_j$, and so letting $h' = h +v(g-s)$ we see that the distribution of $(a',b')$ is precisely $\\Pi_{q,s,\\Sigma}^i$.\n\\end{proof}\n\n\\begin{remark}\nThis is the only stage of the proof which enforces that the asymptotic complexity scales only with $n$ and not with $d$, since we are forced to guess all of $s$ mod $R_i$ at once.\n\\end{remark}\n\nSince the above reduction is secret preserving the required decision oracle for W-D-CLWE$_{q,\\Sigma_\\alpha}^i$ has the additional restriction that $s \\in G$, but for the purposes of the rest of our proof it will be more convenient to have access to an oracle solving the at least as hard problem where $s$ is arbitrary. Additionally, in practical applications we will use the decision problem for arbitrary $s$, so we see no benefit of the tighter reduction where $s$ is restricted.\n\n\\subsubsection{Worst-Case to Average-Case Decision Reduction}\n\nNow that we have removed the restriction that $s \\in G$, we are able to follow the skeleton of the RLWE search-decision reduction of \\cite{lyubashevsky_ideal_2010} more liberally.\n\n\\begin{definition}\\label{errorfamily}\nThe error distribution $\\Upsilon_\\alpha$ on the family of possible error distributions is sampled from by choosing an error distribution $\\Sigma \\leftarrow \\Sigma_\\alpha$ and adding it to $D_\\textbf{r}$, where each $r_i:= \\alpha((n \\cdot d^2)^{1\/4} \\cdot \\sqrt{y_i})$ for $y_1,...,y_{n \\cdot d^2}$ sampled from $\\Gamma(2,1)$.\n\\end{definition}\n\n\n\n\\begin{definition}\nFor $i \\in [n]$ and a distribution $\\Upsilon_\\alpha$ over possible error distributions, an algorithm solves the D-CLWE$_{q, \\Upsilon_\\alpha}^i$ problem if with a non-negligible probability over the choice pairs $(s, \\Sigma) \\leftarrow U(\\Lambda_q^\\vee) \\times \\Upsilon_\\alpha$ it has a non-negligible difference in acceptance probability on inputs from $\\Pi_{q,s, \\Sigma}^i$ and $\\Pi_{q,s,\\Sigma}^{i-1}$.\n\\end{definition}\nThis is the average case decision problem relative to $R_i$; in our worst-case to average-case reduction we will need to randomize the choice of error distribution, which we do by sampling from $\\Upsilon_\\alpha$.\n\\begin{lemma}\nFor any $\\alpha > 0$ and $i \\in [n]$ there is a randomized polynomial-time reduction from W-D-CLWE$_{q, \\Sigma_\\alpha}^i$ to D-CLWE$_{q, \\Upsilon_\\alpha}^i$.\n\\end{lemma}\n\\begin{proof}\nSince the definition of $\\Upsilon_\\alpha$ is a distribution over the family of distributions obtained by sampling from $\\Sigma_\\alpha$ and adding an elliptical Gaussian, the proof is the same as Lemma 5.12 of \\cite{lyubashevsky_ideal_2010}, except we replace each instance of mod $\\mathfrak{q}_i R^\\vee$ with mod $R_i$ and each instance of $R_q$ with $\\Lambda_q$.\n\\end{proof}\n\\begin{remark}\nThis choice of $\\Upsilon_\\alpha$ means that our decision problem is closer to diagonal than the corresponding search problem! In fact, if one increased the elliptical error in the decision problem, one could `flood out' the non-diagonal entries of the covariance matrix, leading to elliptical error which is easier to handle in practice.\n\\end{remark}\nFinally, we use a hybrid argument. We must first show that $\\Pi_{q,s,\\Sigma}^n$ is uniformly random given $\\Sigma$ sampled from $\\Upsilon_\\alpha$, but again this follows the same method as the ring case, except we must replace their use of \\cref{1} by \\cite[Lemma 2.4]{peikert_efficient_2010}.\n\\begin{lemma}\\label{hybridlemma}\nLet $\\Upsilon_\\alpha$ be as above and let $s \\in \\Lambda_q^\\vee$. Then given an oracle $\\mathcal{O}$ which solves the D-CLWE$_{q, \\Upsilon_\\alpha}$ problem there exists an efficient algorithm that solves D-CLWE$_{q, \\Upsilon_\\alpha}^i$ for some $i \\in [n]$ using $\\mathcal{O}$.\n\\end{lemma}\n\\begin{proof}\nThe proof is identical to the ring case, Lemma 5.14 of \\cite{lyubashevsky_ideal_2010}, except that the indexing set $\\mathbb{Z}_m^*$ is replaced by $[n]$.\n\\end{proof}\n\nDenote by CLWE$_{q, \\Sigma_\\alpha,G}$ the search CLWE problem where $s \\in G$ for arbitrary\nfixed $G \\subset \\Lambda_q^\\vee$. To sum up, we have obtained the main result of this section:\n\n\\begin{theorem}\\label{searchdecision}\nLet $\\Lambda$ be the natural order of a cyclic algebra $\\mathcal{A} = (L\/K, \\theta, \\gamma)$, $q \\in$ \\text{poly}$(n)$ and assume that $\\alpha \\cdot q \\geq \\eta_\\varepsilon(\\Lambda^\\vee)$ for a negligible $\\varepsilon = \\varepsilon(n)$. Then, there is a probabilistic reduction from CLWE$_{q, \\Sigma_\\alpha,G}$ for any pairwise different $G \\subset \\Lambda_q^\\vee$ to D-CLWE$_{q ,\\Upsilon_\\alpha}$ which runs in time polynomial in $n$.\n\\end{theorem}\n\n\\subsection{Summary of Security Proof}\n\nThere are certain technicalities and subtleties in our security proof, which we briefly summarize as follows.\n\nThe hardness of Search CLWE in \\cref{sec4} requires a natural, maximal order $\\Lambda$. Nonetheless, \\cref{bddtrans} (due to \\cref{3,homomorphism}) is the only stage of the proof that assumes such a natural, maximal order. An improved proof technique may be able to drop this assumption (\\textit{e.g.}, to use the natural order).\nThe search to decision reduction in \\cref{searchdecisionsection} requires a natural order $\\Lambda$, due to the CRT decomposition of \\cref{CRTlike}. A better version of CRT may extend the reduction to a maximal order.\nFortunately, the orders we take from \\cref{goodalgebras} are both natural and maximal, thereby meeting these requirements.\nThe requirement of unramified $q$ in \\cref{mainresult} (due to \\cref{3}) is minimal: for the algebras of \\cref{primepoweralgebras}, the only unsuitable primes are the $p$ and $q'$ used in the construction (cf. \\cref{algebras}).\n\n\n\\cref{searchdecisionguess} in \\cref{sec:Hybrid} enforces that $s$ lies in a pairwise different set $G$. It is\nthe only stage of the proof which requires such a set.\nWe emphasize that our reduction takes the search CLWE problem where $s \\in G$ for \\textit{arbitrary fixed} $G$ to the decision CLWE problem for \\textit{arbitrary secret} $s$. In other words, we claim hardness for the full decision problem, based on hardness of a restricted search problem. Also, our reduction implies that the decision problem is as hard as the search problem for the hardest choice of $G$. See Appendix \\ref{appendix:secretspace} for more details.\n\n\\begin{remark}\nThe so-called normal form is used de facto in LWE-based cryptography. We note that the normal form reduction is agnostic to the secret space $G$. More precisely, secret $s \\in G$ gets completely cancelled in the transformation and replaced by a new secret $s'$ over the entire space (see of \\cref{lem:normal-form} in \\cref{sec:normal-form}). Therefore, the secret space in the normal form of CLWE is the entire space, after all.\n\\end{remark}\n\nIn practice it may be a concern with security of CLWE if these reductions were best possible (\\textit{e.g.} decision CLWE is polynomial-time equivalent to restricted search, rather than at least as hard). In any case, our secret space is still exponentially large in $n$.\n\n\n\n\\section{CLWE in Cryptography}\\label{crypto}\n\nIn this section we present a proof of concept cryptosystem using CLWE. To demonstrate our comparison against MLWE our scheme will closely resemble the typical `compact' LWE cryptography schemes over modules, in particular KYBER (see \\cite{avanzi_kyber_2019}), although it is likely that an adaptation of Regev style encryption from \\cite{regev_lattices_2009} would suit CLWE as well.\n\n\\subsection{Making CLWE Suitable For Cryptography: Normal Form}\\label{sec:normal-form}\nWe implicitly use some standard LWE facts: firstly, we discretize our error distribution $e$ to $\\Lambda_q^\\vee$; discretizing does not reduce security since an attacker may always discretize the samples themselves. Secondly, we can `tweak' the problem so that $e,s \\in \\Lambda_q$. Fortunately, in the case where $\\gamma$ is a unit, $\\Lambda^\\vee = \\bigoplus_i u^i \\mathcal{O}_L^\\vee$ and so this tweak is precisely multiplying on the right by the tweak factor taking $\\mathcal{O}_L^\\vee$ to $\\mathcal{O}_L$ (see e.g. \\cite{peikert_how_2016-1}). Finally, we require hardness of a `normal' form for the CLWE distribution, where $s$ is sampled from the same distribution as the noise $e$.\n\n\nWe require two facts for our proof: firstly, given that $q$ splits completely in $K$ the ring $\\Lambda_q$ is isomorphic to the direct product of $n$ full matrix algebras over $M_{d \\times d}(\\mathbb{F}_q)$, which can be seen by appealing to the CRT-style decomposition of \\cref{CRTlike} and Wedderburn's Theorem as in \\cite[Propositions 1 and 4]{oggier_quotients_2012-4}. Secondly, we require that a non-negligible fraction in $n$ of elements of $\\Lambda_q$ are\ninvertible, which follows for fixed, small, $d$ and $q \\in \\text{poly}(n)$ from this direct product decomposition. Otherwise, our proof follows the outline for that of plain LWE from \\cite{applebaum_fast_2009}. Given these two facts, we proceed with showing that the normal form of the CLWE distribution is as hard as the case of taking the secret uniformly at random.\n\n\\begin{lemma}\\label{invertible}\nFor a fixed $d$ and $q \\geq (n+1)$, a non-negligible proportion of elements of $\\Lambda_q$ are invertible.\n\\end{lemma}\n\n\\begin{proof}\nFollowing the decomposition of \\cref{CRTlike} and Wedderburn's Theorem, it is sufficient to show that a non-negligible proportion of elements of\n\\begin{align*}\n M_{d \\times d}(\\mathbb{F}_q) \\times \\dots \\times M_{d \\times d}(\\mathbb{F}_q)\n\\end{align*}\nare invertible, where there are $n$ copies of $M_{d \\times d}(\\mathbb{F}_q)$. The proportion of invertible elements of $ M_{d \\times d}(\\mathbb{F}_q)$ is precisely\n\\begin{align*}\n &\\dfrac{(q^d-1)(q^d - q)\\dots(q^d - q^{d-1})}{q^{d^2}} \\\\\n &= (\\dfrac{q^d-1}{q^d}) \\dots (\\dfrac{q^d-q^{d-1}}{q^d}) \\\\\n &= (1- \\frac{1}{q^d})\\dots(1-\\frac{1}{q}) \\\\\n &\\geq (1-\\frac{1}{q})^d,\n\\end{align*}\nfrom which it follows that the total fraction of invertible elements in $\\Lambda_q$ is at least $((1-\\frac{1}{q})^d)^n$. By assumption, $q \\geq n+1$, and so $(1 -\\frac{1}{q})^{nd} \\geq ((1- \\frac{1}{n+1})^n)^d \\geq ({e^{-1}})^d = e^{-d}$, as required.\n\\end{proof}\n\n\\begin{remark}\nThis lower bound of $e^{-d}$ means that the normal form reduction will be asymptotic in $n$ but only valid for fixed $d$. However, as $d$ increases the number of invertible matrices in $\\Lambda_q$ is bounded above by $(1- \\frac{1}{q})^{nd}$, and so the reduction would be efficient in $d$ in the case where one enforced a relation on $q$ and $d$, such as $q \\geq nd + 1$, or more succinctly $q \\geq N$.\n\\end{remark}\n\n\\begin{lemma}\\label{lem:normal-form}\nThere is a probabilistic polynomial time reduction from the CLWE problem with uniformly random secret $s$, possibly over a limited secret space $G$, and error distribution $\\chi$ to the CLWE problem with secret $s' \\leftarrow \\chi$.\n\\end{lemma}\n\n\\begin{proof}\nIt is sufficient to show that there is an efficient transformation taking samples with secret $s$ to samples with some new secret $s'$ taken from $\\chi$. Sample pairs $(a,b) \\leftarrow \\Pi_{q,s,\\chi}$ until a pair $(a_1, b_1:= a_1 \\cdot s + e_1)$ such that $a_1$ is invertible in $\\Lambda_q$ is obtained. Since a non-negligible fraction of elements of $\\Lambda_q$ are invertible by \\cref{invertible}, this step takes only polynomial time.\n\nNow, given a pair $(a_i,b_i) \\leftarrow \\Pi_{q,s,\\chi}$, we obtain a sample from the CLWE distribution $\\Pi_{q,e_1,\\chi}$ by outputting $(\\overline{a}_i, \\overline{b}_i) = (a_i a_1^{-1}, a_i a_1^{-1}b_1 - b_i)$. Since $a_1^{-1}$ is invertible, $\\overline{a}_i$ is uniform. Similarly,\n\\begin{align*}\na_i a_1^{-1}b_1 - b_i &= (a_i a_1^{-1}(a_1 \\cdot s + e_1)) - a_i \\cdot s + e_i \\\\\n&= a_i a_1^{-1}e_1 -e_i,\n\\end{align*}\nand so $(\\overline{a}_i, \\overline{b}_i)$ is a valid CLWE sample with secret $e_1$ and error distribution $\\chi$. Relabelling $e_1$ as $s'$ completes the proof.\n\\end{proof}\n\n\\subsection{Sample Cryptosystem}\\label{clwecrypto}\nOur scheme is parameterized by an algebra $\\mathcal{A} := (L\/K, \\theta, \\gamma)$, where $\\mathcal{A}$ is as in \\cref{algebras}, an error distribution $\\Sigma$, and a prime modulus $q \\equiv 1 \\mod m$ (recall $K = \\mathbb{Q}(\\zeta_{m})$) which is completely split in $L$. We will denote with bold faced letters the vector form of an element of $\\Lambda_q$, e.g. if $a = a_0 + u a_1 +... +u^{d-1} a_{d-1}$ then $\\textbf{a} = (a_0, a_1,...,a_{d-1})$. We note that $\\mathcal{O}_L\/q\\mathcal{O}_L$ has a polynomial representation of dimension $n \\cdot d$, and so we encode our message $\\in \\lbrace 0,1 \\rbrace^{n \\cdot d^2}$ as an entry of $\\Lambda_q$ as a vector $\\textbf{m}$ of $d$ $\\lbrace 0,1 \\rbrace$ polynomials. The scheme proceeds as follows:\n\\begin{itemize}\n\\item Alice generates a CLWE sample $(a,b := a \\cdot s + e)$, where $a \\in \\Lambda_q$ is uniformly random and $e \\leftarrow \\Sigma$, and outputs public key $\\textbf{a}, \\textbf{b}$.\n\\item To encrypt $\\textbf{m} \\in \\lbrace 0,1 \\rbrace^{n \\cdot d^2}$, Bob samples $t, e_1, e_2 \\leftarrow \\Sigma$ and outputs $\\textbf{u} := \\phi(a)^T \\textbf{t} + \\textbf{e}_1, \\textbf{v} := \\phi(b)^T \\textbf{t} + \\textbf{e}_2 + \\lceil \\frac{q}{2} \\rfloor \\cdot \\textbf{m}$.\n\\item To decrypt, Alice computes $\\textbf{c} = \\textbf{v} - \\phi(s)^T \\textbf{u}$ and recovers each coordinate of $\\textbf{m}$ by rounding the corresponding entry of $\\textbf{c}$ to $0$ or $\\lceil \\frac{q}{2} \\rfloor$ and outputting $0$ or $1$ respectively.\n\\end{itemize}\n\\begin{remark}\nThere are two benefits of instantiating this scheme in the cyclic algebra setting rather than over modules as in \\cite{avanzi_kyber_2019}, both following from the matrix embedding $\\phi$. Firstly, in the module setting Alice must publish a matrix $\\textbf{A}$ rather than the vector $\\textbf{a}$ in her key, since $\\phi(a)$ lets us generate a matrix; this saves a factor of $d$ in the size of the public key. Secondly, by extending $\\textbf{b}$ to $\\phi(b)$ we are able to increase the dimension of $\\textbf{v}$, and correspondingly increase the size of the message by a factor of $d$.\n\\end{remark}\n\n\\begin{example}\\label{example:prototype}\n\nRecall our explicit algebras from \\cref{algebras}. Without considering streamlined implementation for specific NIST submissions, we will pick toy comparison parameters for equivalent module based systems and ring based schemes, e.g. KYBER and NewHope. For the module case, consider a module of dimension $4$ over a ring $L$ of dimension $256$, with $2$-power cyclotomic base field $[K:\\mathbb{Q}] = 64$. Our public key $(\\textbf{a}, \\textbf{b})$ requires storing only $8$ elements of $R_q =O_L\/q \\cdot O_L$ rather than $20$ in the form $(A, \\textbf{b})$. Our message consists of $1024$ bits, corresponding to the total dimension of the algebra rather than the module versions $256$ which corresponds to the field dimension; if the private key size is $256$, our CLWE scheme allows a rate-$1\/4$ binary error correction code, while KYBER does not. Our ciphertext sizes are the same. As far as the modulus $q$ is concerned, we find $q=3329$ splits completely in a quartic cyclic extension $L$ of $K$. This matches with the modulus $q$ used in KYBER\\footnote{The initial version of KYBER uses $q=7681$, but it has been reduced to $3329$ later which does not split completely in $L=\\mathbb{Q}(\\zeta_{512})$. It is noteworthy that, with a similar technique, further reduction of $q$ in CLWE may also be possible.}. Overall this represents a noteworthy gain in key and message size without loss in efficiency. For the ring case, consider an instantiation of NewHope in dimension $1024$. Both public keys are in the form $(a,s)$ and so require equivalent levels of storage ($8$ elements of a field of dimension $256$ or $2$ in dimension $1024$), and the same phenomenon is true of ciphertext sizes and message length. However, a larger modulus $q=12289$ is ued in NewHope. Hence, we hope to gain in security without losing much efficiency.\n\\end{example}\n\nBefore considering security and correctness we need a somewhat technical lemma allowing the use of the matrix transpose operation. Essentially, it states that if the CLWE problem is hard in an algebra $\\mathcal{A}$, then for $a, s, e \\in \\Lambda_q$, the equation $\\phi(a)^T \\textbf{s} + \\textbf{e}$ is a valid CLWE instance in some other algebra $\\mathcal{A}'$ for which the CLWE problem is still hard.\n\\begin{lemma}\\label{technical}\nLet $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ be a cyclic division algebra with matrix embedding $\\phi(a)$ and natural order $\\Lambda$. Then there exists another cyclic algebra $\\mathcal{A}' = (L\/K, \\theta, \\gamma^{-1})$ with matrix embedding $\\phi'(a')$ and natural order $\\Lambda'$ such that for $a \\in \\mathcal{A}$ there exists $a' \\in \\Lambda'$ satisfying $\\phi(a)^T = \\phi'(a')$. Moreover, $\\mathcal{A}'$ still satisfies the division algebra condition, and $\\Lambda_q'$ are $\\Lambda_q$ canonically isomorphic as additive groups.\n\\end{lemma}\n\\begin{proof}\nThe fact that $\\mathcal{A}'$ is still a division algebra follows from the non-norm property on $\\gamma$ and the fact that $N_{L\/K}(L^\\times)$ is a multiplicative group. $\\Lambda_q'$ and $\\Lambda_q$ are additive isomorphic because both algebras share the same underlying fields and $\\gamma, \\gamma^{-1}$ are both units of $\\mathcal{O}_L$. Since the first row of $\\phi(a)$ is precisely $(x_0, \\gamma \\theta(x_{d-1}), \\gamma \\theta^2(x_{d-2}), \\ldots,\\gamma \\theta^{d-1}(x_{1}))$, by setting $a' = x_0 + u \\gamma \\theta(x_{d-1}) +\\dots + u^{d-1} \\gamma \\theta^{d-1}(x_1)$ and observing that $\\theta^d$ is the identity it is easy to check that $\\phi(a)^T = \\phi'(a')$.\n\\end{proof}\n\nThe proofs of correctness and security are similar in spirit to those of other compact LWE schemes such as e.g. NewHope \\cite{alkim_post-quantum_2016-2} or KYBER \\cite{avanzi_kyber_2019}. We proceed with a somewhat informal security argument.\n\\begin{lemma}\nThe defined scheme is IND-CPA secure under the assumption that the decision CLWE$_{q,\\Upsilon}$ problem is hard.\n\\end{lemma}\n\\begin{proof}\nThe goal of an IND-CPA adversary is to distinguish, with non-negligible advantage, between encryptions of two plaintexts $m_1, m_2$. The challenger chooses $i \\in \\lbrace 0,1 \\rbrace$ uniformly at random and encrypts $m_i$ as $\\textbf{u}, \\textbf{v}$. By the assumption that the decision CLWE problem is hard, the adversary cannot distinguish between the case where $b = as +e$ and the case where it is replaced by a uniform random $b'$, so we replace the challenge ciphertext $\\textbf{v}$ with $\\textbf{v}'$ by replacing $b$ with $b'$. Setting $\\textbf{v}'' := \\textbf{v}' - \\lceil \\frac{q}{2} \\rfloor \\cdot \\textbf{m}_i$, it follows by \\cref{technical} that $\\textbf{u}, \\textbf{v}''$ represent two samples from a valid CLWE distribution with secret $\\textbf{t}$, and so the adversary cannot distinguish them from uniform with non-negligible advantage. Hence, the challenger cannot distinguish $\\textbf{v}'$ and hence $\\textbf{v}$ from uniform with non-negligible advantage and so cannot guess $i$ with non-negligible advantage.\n\\end{proof}\nFinally, we demonstrate conditions on the error term for the scheme to be correct.\n\\begin{lemma}\nThe defined scheme is correct as long as the $\\ell_\\infty$ norm of $\\textbf{e}' =(\\phi(e)^T \\textbf{t} + \\textbf{e}_2 - \\phi(s)^T \\textbf{e}_1)$ is less than $\\lceil \\frac{q}{4} \\rfloor$, where the $\\ell_\\infty$ norm is over the vector of all polynomial coefficients of each $u^i$ entry of $\\textbf{e}'$ of dimension $n \\cdot d^2$.\n\\end{lemma}\n\\begin{proof}\nTo decrypt, Alice computes $\\textbf{v} - \\phi(s)^T \\textbf{u}$ and computes $\\textbf{m}$ by rounding. Since $\\phi(\\cdot)$ is a homomorphism, we have\n\\begin{align*}\n\\textbf{v} - \\phi(s)^T \\textbf{u} &= \\phi(b)^T \\textbf{t} + \\textbf{e}_2 + \\lceil \\frac{q}{2} \\rfloor \\cdot \\textbf{m} - \\phi(s)^T( \\phi(a)^T \\textbf{t} + \\textbf{e}_1) \\\\\n&= \\phi(e)^T \\textbf{t} + \\textbf{e}_2 - \\phi(s)^T \\textbf{e}_1 + \\lceil \\frac{q}{2} \\rfloor \\cdot \\textbf{m} \\\\\n&= \\textbf{e}' + \\lceil \\frac{q}{2} \\rfloor \\cdot \\textbf{m}.\n\\end{align*}\nfrom which the result follows immediately.\n\\end{proof}\nWe note that the error term $\\textbf{e}'$ will be unsurprising to those familiar with LWE based cryptography. Although we do not provide concrete correctness estimations, the error parameters for our decision reduction are equivalent to those of MLWE up to some small covariance terms.\nWe do not expect this covariance to greatly affect the distribution of the error and thus for equivalent parameter choices we expect a similarly small probability of decryption failure.\n\n\n\\subsection{Operational Complexity in Cyclic Algebras}\\label{complexity}\nIn the previous subsection we showed that the CLWE problem can be used to construct a standard LWE based cryptosystem. Assuming that parameters across all variants of the LWE assumption are roughly equivalent, the CLWE problem supports key and message sizes as advantageous as those of the RLWE problem, and better than those of the module case. Along with storage considerations, another important facet of the ambient space in LWE cryptography is the efficiency of operations. Here, we will construct algorithms and consider the asymptotic complexity of multiplication in a cyclic algebra in order to compare it to the ring and module variants. Since in practice we consider operations modulo some prime $q$, addition in rings, modules, and cyclic algebras can be considered as addition in vector spaces over $\\mathbb{Z}_q$, which has complexity dominated by that of multiplication.\n\nConsequentially, we only concern ourselves with a comparison of the cost of computing the multiplication operation $\\textbf{A} \\textbf{s}$ in the three cases. In order to keep our comparison consistent, we let $N$ denote the total dimension of the underlying LWE instance. In the ring case, $N$ denotes the ring dimension; in the module case, $N = nd$, where $n$ denotes the ring dimension and $d$ the module rank; in the cyclic algebra case $N = nd^2$, where the ring dimension is $nd$ and the algebra has `module' rank $d$. However, since it will be important later we remark here that the cyclotomic part of the ring will be of dimension $n$ rather than $nd$. The three cases can be considered as follows:\n\\begin{itemize}\n\\item In the ring case, the operation $\\textbf{A} \\textbf{s}$ over $\\mathbb{Z}_q$ is a representation of the ring operation $a \\cdot s$ in $R_q \\cong {\\mathbb{Z}_q[X]}\/{(X^N+1)}$. Using the CRT decomposition in dimension $N$ of \\cite{lyubashevsky_toolkit_2013}, this operation is decomposed into coordinatewise multiplication in a vector of dimension $N$ over $\\mathbb{Z}_q$, following which the decomposition is reversed to recover $a \\cdot s$. The complexity of this technique is dominated by that of the CRT decomposition, which takes time $O(N \\log N)$, although the coordinatewise multiplication also requires time $O(N)$.\n\\item In the module case, $\\textbf{A}$ is a $d \\times d$ matrix over $R_q$. In this case, one can compute $\\textbf{A} \\textbf{s}$ by applying the CRT in dimension $n$ coordinatewise on $\\textbf{A}$ and $\\textbf{s}$. This requires $d^2+d$ applications of the CRT, for a total asymptotic complexity of $O(d^2 n\\log n) = O(Nd \\log (N\/d))$. Again, this hides a coordinatewise multiplication step which takes time $O(Nd)$ in this setting.\n\\item In the cyclic algebra case, $\\textbf{A}$ is a matrix in the shape $\\phi(a)$, where $\\phi(a)$ is the left regular representation of $a \\in \\Lambda_q$. We estimate the complexity of the operation $\\phi(a) \\cdot \\textbf{s}$ in Appendix \\ref{appendix:multiplication-complexity}. Explicitly, our algorithm has complexity $O(N \\log (N\/d^2)) + O(Nd^{\\omega-2})$ in the case where $q$ splits completely in $L$, with $\\omega \\in [2, 2.373]$ denoting the exponent of matrix multiplication. The latter term corresponds to the cost of multiplication in our analog of the finite fields used in the CRT method for RLWE.\n\\end{itemize}\n\n\n\nWe see that cyclic algebras compare favourably with modules for multiplication in the same dimension $N$,\ndepending on the exact relationship between $\\log d^2$ and $d^{\\omega-2}$. Since $d$ is\nlikely to be fixed while $n$ scales up, we expect that the $O(N \\log N)$ term will\ndominate the complexity. Nonetheless, we include the second term in our results to\nquantify our claims. The second term $O(Nd^{\\omega-2})$ becomes $O(Nd)$ with naive matrix multiplication instead of the algorithms of \\cite{caruso_fast_2017-4}, yet its overall multiplication complexity is still lower than that of module multiplication in the same dimension.\n\n\n\n\n\n\\section{Conclusions and Future Work}\\label{conclusions}\n\nThe primary goal of this work is the introduction of the Learning with Errors problem over Cyclic Algebras, CLWE, adding to the family of available LWE assumptions for use in cryptography. To this end, the central pillars of an LWE problem are provided for the cyclic algebra case. First, in order to provide a foundation for the construction the notion of lattices derived from ideals of the natural order of a cyclic algebra are applied in cryptography for the first time. Then, in \\cref{sec3}, the CLWE problem is formally introduced, following which explicit algebras are provided with dimensions and structure appropriate for cryptographic use. Then, in \\cref{security_proof}, the usual LWE security reductions are established in the CLWE case: namely, the problem of solving short vector problems on order-ideal lattices is reduced to the search CLWE problem, and then a variant of the search CLWE problem where the secret is restricted to a fixed, well constructed subset of its usual space is reduced to the decision CLWE problem. Under plausible assumptions on this restricted search problem, combining these two reductions gives the necessary security grounding for CLWE based cryptography, which is that samples from the CLWE distribution appear pseudorandom to an onlooker with no knowledge of the secret $s$. Finally, in \\cref{crypto}, the necessary steps are taken to mold the CLWE problem into a practical format for cryptography. Normal form reduction is shown and a sample cryptosystem in this form is provided. Additionally, the complexity of operations in CLWE cryptography is compared to that of RLWE and MLWE based schemes.\n\nCyclic algebras exhibit substantial novel structures within lattice-based cryptography, and discovering use cases for these previously unseen features represents an exciting area of future research. We outline a few directions of future research in the following.\n\nFrom a theoretical standpoint, the most pressing question to be solved about CLWE is whether or not the search and decision problem are polynomial time equivalent, or instead if the hardness of the decision variant can be based directly on hard lattice problems via some other technique. In this work, the hardness of the decision problem for arbitrary secret is shown to derive from the assumed hardness of a variant of the search problem where the secret is restricted to lie in any so-called pairwise difference set $G$. Although this substantially lowers the size of the secret space, the resulting secret space is still far too large to exhaustively search. Furthermore, the decision problem is as hard as the search problem for the hardest choice of decision set $G$, precluding particularly easy cases. Nonetheless, this does not establish the formal hardness of the decision CLWE problem based on the lattice problems of \\cref{latticeproblems}. The reduction fails to permit arbitrary secret since the decomposition into matrix rings of \\cref{CRTlike} results in a problem that can not be `guessed' effectively, since the oracle does not necessarily accept inputs as valid when the guess is wrong.\n\nAnother method of establishing the hardness of decision RLWE that is not shown for CLWE in this work is a direct to decision reduction, which more generally represents a security proof for the decision problem that holds for wider classes of cyclic division algebras than those of \\cref{searchdecisionsection}. The direct to decision reduction of \\cite{peikert_pseudorandomness_2017-2} is the only security reduction for RLWE which establishes the hardness of the decision problem without enforcing that $K$ is a cyclotomic field within which $q$ splits completely, as in the search-decision reduction of \\cite{lyubashevsky_ideal_2010} and the presented analog for CLWE. Dropping this restriction, and hence widening the possible choices of cyclic algebras supporting the hardness of the decision problem, would provide larger design space for CLWE based cryptography.\n\n\n\n\n\n\nAs for another direction of future work, we view a drawback of our work to be that we are restricted to certain instances of cyclic algebras. Although in practice most cryptography would use a fixed choice of algebra, this is a function of our methods and may be possible to remove. Additionally, showing the aforementioned direct-to-decision reduction may generalize the choice of algebras.\n\nFinally, this work is focused on the theoretical construction of a non-commutative Ring-LWE assumption, and we leave practical analysis and implementation of cryptography based on CLWE as further research.\n\n\\section*{Acknowledgment}\n\nThe authors would like to thank Jyrki Lahtonen, Damien Stehle and Martin Albrecht for helpful discussions.\nThey are also grateful to Andrew Mendelsohn for finding the prime $q=3329$ in \\cref{example:prototype}.\n\n\\appendices\n\n\\section{Attacking non-Division Algebras}\\label{badgamma}\nIn \\cref{discussions}, the condition that $\\gamma$ is a non-norm element of $L\/K$ is required in order to stop parallelizing attacks in the style of that of \\cite{bootland_security_2018} applying to the CLWE problem. Thus, $\\gamma$ is chosen so that $\\gamma^i$ is not in the norm group of $L$ into $K$ for $i =1,2,\\dots, d-1$. Here, we demonstrate that picking $\\gamma$ that violates this condition leads to potentially vulnerable instances of the CLWE problem. We will need the following lemma, a rephrasing of \\cite[Theorem 30.4]{reiner_maximal_1975}.\n\\begin{lemma}\\label{reinerlemma}\nLet $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ be a cyclic algebra with $[L:K] = d$. Let $\\gamma, \\delta \\in K$ be non-zero. Then\n\\begin{itemize}\n\\item $\\mathcal{A} \\cong \\mathcal{A}_i := (L\/K, \\theta^i, \\gamma^i)$ for each $i$ such that $(i,d) = 1$.\n\\item If $\\gamma = 1$ then $\\mathcal{A} \\cong M_{d \\times d}(K)$.\n\\item If $\\delta = N_{L\/K}(\\beta)\\gamma$ for some non-zero $\\beta \\in L$ then $\\mathcal{A} \\cong \\mathcal{A}' := (L\/K, \\theta, \\delta)$.\n\\end{itemize}\n\\end{lemma}\n\\begin{remark}\nIf $\\gamma \\in \\mathcal{O}_K$ is a unit then all isomorphisms of this lemma hold when replacing $L$ and $K$ with $\\mathcal{O}_L$ and $\\mathcal{O}_K$ respectively. The first and third can be seen by examining the proofs in \\cite{reiner_maximal_1975}; the first is a re-indexing of $u$ coordinates of $\\mathcal{A}$, and the third simply sends $u$ to $\\beta u$. The second requires a little more work. We map $\\mathcal{A}$ to Hom$_K(L,L)$ by sending $u$ to $\\theta$ and $x \\in L$ to the $K$-homomorphism on $L$ defined by multiplying by $x$. Finally, we appeal to the standard isomorphism between Hom$_K(L,L)$ and $M_{d \\times d}(K)$, which preserves integral elements as long as there exists an integral basis of $L$ over $K$. We discuss the details of this last part later, because we also require it to preserve a notion of smallness.\n\\end{remark}\nArmed with this lemma, we demonstrate potential weaknesses of choosing $\\gamma$ poorly. Let $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ be a cyclic algebra where $\\gamma$ lies in the norm group $N_{L\/K}(L^\\times)$ (and still lies in $\\mathcal{O}_K)$; later we will generalize our argument to the case where instead some power of $\\gamma$ less than $d$ is a norm instead. Consider the primal CLWE instance $(a, a \\cdot s + e) \\in \\Lambda_q \\times \\Lambda_q$, where $a, s$ are uniform\\footnote{In practice $s$ is typically sampled from the error distribution, but this normal form variant is no easier than the case where $s$ is uniform. We assume uniform $s$ here for ease of illustration.} and $e \\leftarrow \\chi$ is drawn from an error distribution which is of Gaussian shape. Applying \\cref{reinerlemma} transforms our sample into one over $M_{d \\times d}({\\mathcal{O}_K}_q) \\times M_{d \\times d}({\\mathcal{O}_K}_q)$. That is, we construct a sample in the form\n\\begin{align*}\n(\\textbf{A}, \\textbf{A} \\cdot \\textbf{S} + \\textbf{E})\n\\end{align*}\nwhere $\\textbf{A},\\textbf{S},\\textbf{E} \\in M_{d \\times d}({\\mathcal{O}_K}_q)$. Since isomorphisms are bijections, $\\textbf{A}$ and $\\textbf{S}$ are uniformly random matrices. Assume for the time being that the isomorphisms are also smallness preserving, so that if $e$ is a small element of $\\Lambda_q$ then the corresponding matrix $\\textbf{E}$ will have entries that are small elements of $\\mathcal{O}_K$.\n\nLet $\\textbf{s}_i, \\textbf{e}_i$ denote the $i^\\text{th}$ columns of $\\textbf{S}$ and $\\textbf{E}$ respectively. Then, for each $i$ the pair $(\\textbf{A},\\textbf{A} \\textbf{s}_i + \\textbf{e}_i)$ constitutes $d$ samples from the MLWE distribution in dimension $n$ and rank $d$. That is, the single CLWE sample provides a collection of $d$ samples from $d$ instances of the MLWE distribution with different secrets $\\textbf{s}_1, \\dots, \\textbf{s}_d$, where each set of samples shares the same uniformly random matrix $\\textbf{A}$. Since the difficulty of LWE problems is assumed to be superlinear in dimension $N$, solving $d$ instances of the MLWE problem in dimension $n$ and module rank $d$ is easier than solving a single instance in dimension $nd$ and rank $d$, the targeted dimension of our CLWE problem, which is essentially the parallelizing argument of the attack of \\cite{bootland_security_2018} on $m$-RLWE. Furthermore, the matrix $\\textbf{A}$ being common to each set of samples potentially weakens the resulting MLWE instances. Thus, assuming that $\\textbf{e}_i$ is suitably distributed, it is clear that choosing a $\\gamma$ that is the norm of an element of $L$ compromises security.\n\nWe are left to consider the distribution of the error matrix $\\textbf{E}$. In order to understand this, we must discuss the proof of \\cref{reinerlemma} further. Let $\\gamma = N_{L\/K}(\\beta)$, so that the isomorphism mapping $\\mathcal{A}$ to $\\mathcal{A}' = (L\/K, \\theta, 1)$ fixes $L$ and sends $u$ to $u \\beta$. Following the proof of \\cref{primepoweralgebras} we see that the $\\gamma$ which are both roots of unity and norm elements are precisely norms of some other root of unity. Hence, $\\beta$ is a root of unity and this isomorphism maps a Gaussian distribution on $\\mathcal{A}$ to a Gaussian distribution on $\\mathcal{A}'$.\n\nThe isomorphism mapping $\\mathcal{A}'$ to $M_{d \\times d}(K)$ begins with a mapping from $\\mathcal{A}'$ to Hom$_K(L,L)$ that sends $x \\in L$ to the multiplication function $f_x(y) = xy$ for $y \\in L$ and sends $u$ to $\\theta$. Then, it applies the well known isomorphism sending Hom$_K(L,L)$ to $M_{d \\times d}(K)$, which can be defined constructively as follows:\n\\begin{itemize}\n\\item Fix a $K$-basis $\\lbrace \\ell_1,\\dots,\\ell_d \\rbrace$ of $L$ over $K$.\n\\item Define $f_j: K \\rightarrow L$ as $f_j(x) = \\ell_j x$, a mapping onto the $j$ coordinate of the basis.\n\\item Let $\\pi_j: L \\rightarrow K$ denote the projection map onto the $\\ell_j$ sending $\\pi_j(\\sum_{i=1}^d x_i \\ell_i) = \\ell_j$.\n\\item Define $\\Delta: \\text{Hom}_K(L,L) \\rightarrow M_{d \\times d} (K)$ coordinatewise as $\\Delta(\\psi)_{i,j} = (\\pi_i \\circ \\psi \\circ f_j)(1)$.\n\\end{itemize}\nSince it permits an arbitrary choice of $K$-basis, this isomorphism is non-unique. Furthermore, an attacker trying to apply this isomorphism would be able to use their choice of basis and still compute the isomorphism efficiently. We are interested in the image of a Gaussian sample $e \\in \\Lambda_q$ under this isomorphism, with $e = \\sum_{i=0}^{d-1} u^i e_i$, having each $e_i$ sampled independently from a discrete Gaussian over ${\\mathcal{O}_L}_q$, being sent to $\\psi_e = \\sum_{i=0}^{d-1} e_i' \\sigma^i$. Correspondingly, the $i,j$ coordinate of the matrix $\\textbf{E} = \\Delta(e)$ is\n\\begin{align*}\n\\pi_i (\\sum_{k=0}^{d-1} e_k \\theta^k(\\ell_j)).\n\\end{align*}\nFor the $j^\\text{th}$ column of $\\textbf{E}$ (the error vector in the set of $d$ MLWE samples with secret $\\textbf{s}_i$), the error is precisely the $\\ell_i$ coordinate of $\\sum_{k=0}^{d-1} e_k \\theta^k(\\ell_j)$.\n\nNow the distribution of the error in each collection of MLWE samples depends on the properties of the chosen basis. Since the $e_k$ are independent Gaussian samples from $L$, $j$ is fixed and $\\theta$ represents a permutation of the canonical embedding coordinates of $L$ elements. Hence, $\\sum_{k=0}^{d-1} e_k \\theta^k(\\ell_j)$ is an elliptical Gaussian with $n$ blocks of $d$ different parameters. Furthermore, if $\\lbrace \\ell_1, \\dots, \\ell_d \\rbrace$ is a cyclic basis then, since the distribution of $\\Vert \\sigma_L (\\ell_k) \\Vert_2$ is independent of $k$, the projection $\\pi_i (\\sum_{k=0}^{d-1} e_k \\theta^k(\\ell_j))$ follows an elliptical Gaussian. In addition, these coordinates are not independent and are potentially highly correlated.\n\nThe end result of this exposition is that, depending on the properties of the cyclic bases of $L\/K$ and given the choice of $\\gamma$ as a norm element, from a single CLWE instance we can construct $d$ parallel copies of $d$ MLWE instances in dimension $n$ and rank $d$ with correlated error. These correlated instances of the MLWE problem are plausibly substantially easier than the claimed security of the CLWE instance, which is that it is roughly as hard as an MLWE instance in the same dimension $nd$ and rank $d$. Of course, the error distributions in the underlying MLWE instances are non-standard and we have not presented a concrete attack on them. Instead, we believe this discussion is sufficient to persuade the unconvinced reader that solving the CLWE problem with norm element $\\gamma$ can be simplified by some parallelization into MLWE instances, and thus we should stick to our specification that $\\gamma$ is a norm.\n\nIn the above exposition we restricted ourselves to cases where $\\gamma$ is a norm, but the definition of the non-norm condition also precludes $\\gamma$ as valid if and only if $\\gamma^i$ is a norm for some $i < d$ that is coprime with $d$ (see \\cite{vehkalahti_densest_2009}). However, we have previously assumed that the hardness of the CLWE problem was independent of the choice of primitive $n^\\text{th}$ root. In the constructions of \\cref{primepoweralgebras} $\\gamma$ is an $n^\\text{th}$ root of unity and $d$ divides the prime power $n$, so if $i$ is coprime with $d$ then $i$ is also coprime with $n$ and so $\\gamma^i$ is a primitive root which defines a cyclic algebra in which the CLWE problem can be parallelized. Thus, we conclude that $\\gamma$ must satisfy the non-norm condition rather than just itself not be a norm. Independently, a recent work \\cite{Revisit-MRLWE} revisiting $m$-RLWE observes that the underlying property causing the attacks of \\cite{bootland_security_2018} on the original instantiations was the presence of zero-divisors in the ambient space. In our case, zero-divisors exist in a cyclic algebra if and only if the non-norm condition is not satisfied, so their argument should preclude not just the $\\gamma$ that are themselves norms but also all $\\gamma$ which fail the non-norm condition.\n\n\n\\section{Impossible Algebras}\\label{impossiblealgebras}\nWe show that certain algebras that would otherwise be what we are looking for do not exist under our restrictions. As discussed above we would like to begin with a base field that is cyclotomic, $K = \\mathbb{Q}(\\zeta_m)$ for integer $m$, and proceed to fix some low degree cyclic Galois extension $L\/K$ and non-norm element $\\gamma \\in \\mathcal{O}_K$ with $\\vert \\gamma \\vert = 1$ e.g. $\\gamma$ is a root of unity. Given these restrictions and the shape of lattice cryptography, the most natural fields to look for are low degree extensions of two-power cyclotomics e.g. $m = 2^k$. Unfortunately, we are able to prove the non-existence of a large class of such extensions.\n\\begin{theorem}\\label{dcoprime}\nLet $K = \\mathbb{Q}(\\zeta_m)$ for some positive integer $m$ and let $p \\geq 2$ be some integer which is coprime with $m$. Then, for any Galois extension $L\/K$ of degree $p$ each $\\zeta_m, \\zeta_m^2,\\dots,\\zeta_m^{m-1}$ lies in $N_{L\/K}(K^\\times)$.\n\\end{theorem}\n\\begin{proof}\nSince $L\/K$ is a Galois extension of degree $p$, the relative norm map $N_{L\/K}(\\cdot)$ induces the map $x \\rightarrow x^p$ on elements $x \\in K^\\times$. Let $1 \\leq i \\leq m-1$ be an integer; we will prove the theorem by finding $1 \\leq j \\leq m-1$ such that $N_{L\/K}(\\zeta_m^j) = \\zeta_m^i$. Since $\\zeta_m$ and its powers lie in $K$, the relative norm map takes $\\zeta_m^j$ to $\\zeta_m^{jp}$ and we are left to solve the congruence $jp \\equiv i \\mod m$. By assumption, g.c.d.$(m,p) = 1$ and so $p$ is invertible modulo $m$. Denoting this inverse $p^{-1}$ and letting $j = p^{-1} i \\mod m$ it is easy to see that $jp \\equiv i p^{-1} p \\equiv i \\mod m$. The theorem statement follows immediately.\n\\end{proof}\nThis theorem precludes the existence of a very large class of cyclic division algebras with cyclotomic base field. In particular, if the degree of $[L:K]$ is coprime with $m$ then we can not have our restrictions that $\\vert \\gamma \\vert = 1$, is integral, and that $K$ is cyclotomic. We draw attention to the specific classes whose non-existence we are interested in: in an ideal world we might instantiate CLWE with $K = \\mathbb{Q}(\\zeta_{2^k})$ and $[L:K] = d$ for arbitrary small integer $d$ corresponding to the module rank, which in practice is likely to be at most say $5$. However, as a result of \\cref{dcoprime} we know that $d$ can not be coprime with $2^k$ and must be even in order to permit a suitable $\\gamma$, from which it follows that we can not have $d=3,5$.\n\n\\section{Proof of \\cref{natural_is_maximal}}\\label{appendix:natural-maximal}\n\nBefore proving \\cref{natural_is_maximal} we need some additional concepts and a Lemma.\nGiven a $K$-central division algebra $\\mathcal{A}$ and some $\\mathcal{O}_K$ order $\\Lambda$ in it, then\nthe $\\mathcal{O}_K$-\\emph{discriminant} of $\\Lambda$, $d(\\Lambda\/\\mathcal{O}_K)$, is a certain ideal in $\\mathcal{O}_K$ \\cite[p.126]{reiner_maximal_1975}. While $\\mathcal{A}$ has many maximal orders they all share the same discriminant, which is called the discriminant of the algebra $d_\\mathcal{A}$. Now the key fact about discriminants we need is that an order $\\Lambda$ is maximal if and only it's discriminant equals that of $d_\\mathcal{A}$.\n\n\n\n\nWe will now use the notation of \\cref{algebras}. According to \\cite{lahtonen_construction_2008} the field $L$ and therefore also its subfield $M$ are subfields of $\\mathbb{Q}(\\zeta_m,\\zeta_{q'})$, where $m=p^a$, and $q'\\neq p$ is some large prime. Let $n=\\varphi(m)=p^{a-1}(p-1)$. Furthermore it is known that $q'$ splits completely in the field $K=\\mathbb{Q}(\\zeta_m)$. Let us now denote with\n$$\nq'\\mathcal{O}_K =\\mathfrak{q}'_1 \\cdots \\mathfrak{q}'_{n},\n$$\nthe prime ideal decomposition of $q'$ in $K$. We then have the following result.\n\n\n\\begin{lemma}\n\\label{naturaldiscriminant}\nLet $(M\/K,\\theta, \\zeta_m)$ be an index $d$ division algebra of Theorem \\ref{primepoweralgebras}\nand let $\\Lambda$ be the corresponding natural order.\nThen we have that\n\\begin{equation}\\label{natural}\nd(\\Lambda\/\\mathcal{O}_K)= (\\mathfrak{q}'_1, \\cdots \\mathfrak{q}'_{n})^{d(d-1)}.\n\\end{equation}\n\\end{lemma}\n\n\\begin{proof}\nAccording to \\cite[Lemma 5.4]{vehkalahti_densest_2009} we have that\n$$\nd(\\Lambda\/\\mathcal{O}_K)=d(M\/K)^d \\zeta_m^{d(d-1)}=d(M\/K)^d,\n$$\nwhere $d(M\/K)$ is the relative number field discriminant of the extension $M\/K$. In order to find the discriminant of the natural order, it is now enough to find $d(M\/K)$.\nBy the basic theory of cyclotomic fields we know that $\\mathbb{Q}(\\zeta_m,\\zeta_{q'})=\\mathbb{Q}(\\zeta_{mq'})$. We also know that the only ramified primes in the extension $\\mathbb{Q}(\\zeta_{mq'})\/\\mathbb{Q}$ are $p$ and $q'$ and their ramification indices are $e_1=n$ and $e_2=q'-1$, respectively. Furthermore ramification index of $p$ in the extension $\\mathbb{Q}(\\zeta_m)\/\\mathbb{Q}$ is $e_1$. As ramification indices are multiplicative in towers of extensions we can deduce that the only primes that are possibly ramified in the extension $\\mathbb{Q}(\\zeta_{mq'})\/\\mathbb{Q}(\\zeta_m)$ are those that lie above $q'$ in the ring ${\\mathcal O}_{K}$. As $q'$ is not ramified in $\\mathbb{Q}(\\zeta_m)$, we get again by the multiplicativity of the ramification indices that all the primes $\\mathfrak{q'_i}$ are totally ramified in the extension $\\mathbb{Q}(\\zeta_{mq'})\/\\mathbb{Q}(\\zeta_m)$. Therefore they are also totally ramified in the extension $M\/\\mathbb{Q}(\\zeta_m)$. Because $q'$ does not divide $d$ the prime ideals $\\mathfrak{q'_i}$ are tamely ramified. Dedekind's discriminant theorem now imply\nthat\n\\[\nd(M\/K)=(\\mathfrak{q}'_1 \\cdots \\mathfrak{q}'_{n})^{(d-1)}.\n\\]\n\\end{proof}\n\n\n\n\nNow we are ready to prove the natural order in \\cref{natural_is_maximal} is actually maximal.\n\n\n\n\\begin{proof}\nThe proof is based on the result in \\cite{reiner_maximal_1975} that states that an order is maximal if and only if it has the same discriminant as the discriminant of the algebra.\nAccording to Lemma \\ref{naturaldiscriminant} we have that\n\\begin{equation}\\label{nat}\nd(\\Lambda\/ \\mathcal{O}_K) =d(M\/K)^d=(\\mathfrak{q}'_1 \\cdots \\mathfrak{q}'_{n})^{d(d-1)}.\n\\end{equation}\nAccording to \\cite{reiner_maximal_1975} the discriminant of the maximal order will always divide the discriminant of the natural order. Hence we know that the only prime ideals that can possibly divide the discriminant of the maximal order are $\\mathfrak{q}'_i$. Let us now assume that $\\mathfrak{Q}_i$ is prime ideal above $\\mathfrak{q}'_i$ in $L$. By abusing notation we will denote with $L_{\\mathfrak{q}'_i}$ the $\\mathfrak{Q}_i$-adic completion of $L$ and in the same way the respective completion $M_{\\mathfrak{q}'_i}$.\n\nFollowing the proof of \\cite[Theorem 4]{lahtonen_construction_2008} we can see that the authors actually prove that $\\zeta_m$ is a non-norm element in the extension\n$L_{\\mathfrak{q}'_i}\/K_{\\mathfrak{q}'_i}$ for each prime ideal $\\mathfrak{q}'_i$. Using the same proof as in Theorem 2 we can now see that $\\zeta_m$ is a non-norm element in the extensions $M_{\\mathfrak{q}'_i}\/K_{\\mathfrak{q}'_i}$, for all $i$. According to \\cite[Theorem 30.8]{reiner_maximal_1975} $A\\otimes_{K}K_{\\mathfrak{q}'_i}\\cong (M_{\\mathfrak{q}'_i}\/K_{\\mathfrak{q}'_i},\\theta', \\zeta_m)$, where $\\theta'$ naturally extends $\\theta$. As $\\zeta_m$ is a non-norm element, $(M_{\\mathfrak{q}'_i}\/K_{\\mathfrak{q}'_i},\\theta', \\zeta_m)$ is an index $d$ division algebra. By definition of the local index we can see that the local indices $m_{\\mathfrak{q}'_i}$ are $d$ for all $\\mathfrak{q}'_i$. We now know that $\\mathfrak{q}'_i$ are the only possible primes dividing the discriminant and that their local indices are $d$. \nAccording to \\cite[Theorem 32.1]{reiner_maximal_1975} the discriminant of the algebra $\\mathcal{A}$ is\n$$\n d_{\\mathcal{A}}= \\prod_{i=1}^{n} \\mathfrak{q'}_i^{(m_{\\mathfrak{q}'_i}-1)\\frac{d^2}{m_{\\mathfrak{q}'_i}}}=\\prod_{i=1}^{n} \\mathfrak{q'}_i^{(d-1)d},\n$$\ncompleting the proof.\n\\end{proof}\n\n\n\\section{Constructions Using Compositum Fields}\\label{appendix:compositum}\nOur other method for constructing suitable extensions starts from extensions which are nearly what we are looking for and applies field compositums (cf. \\cite[Chapter 30]{reiner_maximal_1975}). We recommend this method to build on top of fields constructed using either \\cref{lahtonenalgebras} or \\cref{primepoweralgebras}. Say we have a Galois field extension $L'\/K'$ with non-norm element $\\gamma \\in \\mathcal{O}_{K'}$ whose Galois group is cyclic of degree $d$. Let $F$ be some other Galois number field with $F \\cap L'= \\mathbb{Q}$. Then Gal$(L'F\/K'F) \\cong \\text{Gal}(L'\/K')$ and $\\gamma$ is a non-norm element in $L'F\/K'F$. Relabelling this extension as $L\/K$ and letting $\\theta$ denote the cyclic generator of the Galois group gives a cyclic field extension with non-norm $\\gamma$ such that $[L:K] = d$ and $[K:\\mathbb{Q}] = [K':\\mathbb{Q}] \\cdot [F : \\mathbb{Q}]$. The relations among these fields are illustrated in \\cref{fig:compositum}(a).\n\nOne can generalize this method to the case where the base field can not be written conveniently as a compositum of two fields. Let $L'\/K'$ be a cyclic Galois extension of degree $d$ with non-norm element $\\gamma$ and let $K$ be another Galois number field which contains $K'$. Then $KL'\/K$ is a cyclic Galois extension of degree $k$ for some $k$ dividing $d$, and in particular if $K \\cap L' = K'$ then $k = d$ since the fields are linearly disjoint above $K'$. See \\cref{fig:compositum}(b) for the relations among these fields.\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=0.70\\linewidth]{Figure-compositum.jpg}\\\\\n \\caption{Constructions using field compositums: (a) base field $K$ is a compositum $K'F$, (b) $K$ cannot be written as a compositum.}\\label{fig:compositum}\n\\end{figure}\n\n\n\nWe give example algebras of dimensions $576$, $768$ and $1152$ in Table \\ref{Sample Cyclic Algebra Parameters} with less restrictive dimension using field compositum techniques. We propose two alternate methods of applying field compositums in \\cref{fig:compositum}(a): either use \\cref{primepoweralgebras} to make an algebra which already has large dimension by selecting large center $K$ and small extension $L$, then compose a small field $F$ onto $K$ and $L$ to tweak the total dimension. Alternatively, one can create algebras by selecting small fields $L$ and $K$ using \\cref{lahtonenalgebras} and composing both with a large field $F$.\n\nWe begin with an example of the first method that achieves dimension $768$. Let $L'$ be a degree two extension of the field $K' = \\mathbb{Q}(\\zeta_{64})$ chosen by \\cref{primepoweralgebras} with non-norm root of unity $\\gamma$, so that the corresponding algebra $\\mathcal{A}'$ has dimension $128$. Compose both $L'$ and $K'$ with the field $F = \\mathbb{Q}(\\zeta_9)$, denoting the compositums by $L$ and $K$ respectively. Then $\\gamma$ is still a non-norm element in the extension $L\/K$, a degree two extension that is cyclic and Galois, and the algebra $\\mathcal{A}= (L\/K, \\theta, \\gamma)$ is a cyclic algebra of dimension $6 \\times 128 = 768$, as required. We observe that here the center $K$ corresponds to the fields with fast operations used in \\cite{lyubashevsky_truly_2019}.\n\nOur final method of composing large degree fields onto small degree extensions is aimed at targeting odd module ranks. Begin by choosing the desired module rank $d$ as a (likely small) odd prime. Then set $K' = \\mathbb{Q}(\\zeta_d)$ and pick $L'$ as a cyclic Galois extension of $K'$ in which the $d^\\text{th}$ root of unity is a non-norm element using \\cref{lahtonenalgebras}. Let $F := \\mathbb{Q}(\\zeta_{2^k})$ and again let $L$ and $K$ denote its compositum with $L'$ and $K'$ respectively. Then $\\mathcal{A} = (L\/K, \\theta, \\gamma)$ is a cyclic algebra with $n := [K:\\mathbb{Q}] = (d-1)2^{k-1}$ and $d = [L:K]$ a small prime. The form of the total dimension $N = d^2(d-1)2^{k-1}$ constrains our choice of dimension, but for examples of cryptographically relevant sizes with $d=3$ one can consider setting $k =6$ or $k=7$ to achieve dimension $N = 576$ or $N =1152$ respectively. If one required additional flexibility of dimension one could also consider increasing $d$ or replacing the power-of-two cyclotomic field with any cyclotomic field whose intersection with $\\mathbb{Q}(\\zeta_d)$ is precisely $\\mathbb{Q}$. This method comes with the subtle drawback that the module rank $d$ is also present in the dimension of the base field $K$, which precludes the case where one wants a large module rank and a small center. On the other hand, since such cases are excluded in our security proof we view this drawback as minor.\n\n\n\n\n\\section{Extensions Where $q$ Splits Completely in $L$}\\label{qsplits}\nWe would like $q$ to be of roughly appropriate cryptographic size (say between $3000$ and $15000$ as a soft estimate, once again presuming parameters similar to those of NewHope or KYBER). Having $q$ split completely in $L$ is not as straightforward as in $K$ because $L$ is not a cyclotomic field, so we return to our examination of the proof of \\cref{lahtonenalgebras}. Recall that in this proof the extension field $L$ is a subfield of $K(\\zeta_{mq'})$ for some prime integer $q'$ satisfying $q' = 1 \\mod m$ and, for $m = p^a$, $p^{a+1}$ does not divide $q'-1$. That is, $a$ is the highest power of $p$ that divides $q'-1$. We have several methods to ensure that $q$ splits completely in $L$, of which we start with the most naive.\n\\subsubsection{Naive Method}\nFor our general method we rely on the following fact: If $\\mathfrak{q}_i$ is an ideal of $\\mathcal{O}_K$ which splits completely in an extension $M\/K$ then it splits completely in any intermediate field $M\/L\/K$. As it is conceptually simpler to apply this idea to the integer $q$ than to the $\\mathcal{O}_K$-ideals $\\mathfrak{q}_i$ we use a simpler statement, that if $\\langle q \\rangle$ splits completely in some $M$ containing $L$ then it splits completely in $L$. This gives us an easy way to find some $q$ that splits completely by examining a cyclotomic field that contains $L$: let $K = \\mathbb{Q}(\\zeta_m)$ and let $M = K(\\zeta_{q'})$. Then since $q' = 1 \\mod m$ it follows that $M = \\mathbb{Q}(\\zeta_{mq'})$. Thus $q$ splits completely in $M$ if and only if $q = 1 \\mod mq'$ and consequentially splits completely in our extension $L$ if $q = 1 \\mod mq'$. Since there are infinitely many primes equal to $1 \\mod mq'$ this recipe always provides a prime $q$ that splits completely in $L$. The upside of this method is that it is both very general and simple, since all candidate fields $L$ we construct are contained in a larger cyclotomic field. Theoretically, this method can be extended to any abelian extension of $\\mathbb{Q}$ using the partial converse of the Kronecker-Weber Theorem. However, using the Kronecker-Weber Theorem constructively is not as straightforward as picking $q'$ as in the proof of \\cref{lahtonenalgebras}, so this extension to general abelian $L$ is slightly contrived.\n\nThe downside to this method is that it seems that often this will result in unrealistically large $q$. Since $q' = 1 \\mod m$ and not $1 \\mod p^{a+1}$, $q'$ must be chosen carefully and there are not many `small' primes satisfying these conditions. For example, in our quadratic extension case with $m = 512$ the smallest prime that is $1 \\mod m$ but not $1 \\mod 2m$ is $q' = 7681$. The smallest $q$ which is $1 \\mod (512 \\cdot 7681)$ has to be bigger than $512 \\cdot 7681 = 3932672$, which is inappropriately large for lattice cryptography. Of course, one could be lucky here and have much smaller $q$ for different choices of $L$ and $K$, but in general we regard this as a theoretical result rather than a practical method. Even for smaller $2$-power cases such as $m = 128$ one must set $q' = 641$, which leads to a smallest valid prime of $q = 820481$.\n\nRemarkably, this is much less bad in the cubic case; $K = \\mathbb{Q}(\\zeta_{81})$ gives $q' = 163$ as a suitable prime and $q = 26407$ still splits completely. This is perhaps slightly too large, but certainly not so much so that it is completely impractical. Nonetheless, we move on to a better method for quadratic cases.\n\n\\subsubsection{Quadratic Case}\nIn the case where $L\/K$ ($K = \\mathbb{Q}(\\zeta_{512})$) is a quadratic extension we are able to choose substantially smaller $q$ by examining the unique quadratic subfields of $E' :=\\mathbb{Q}(\\zeta_{q'})$. We rewrite $M$ as the compositum of $E'$ and $K$, and observe that since our chosen $L$ contains $K$ our method of choosing $L$ as a subfield of $M$ allows us to write $L = EK$ for a subfield $E$ of $E'$. In the case where $L$ is a degree two extension of $K$ we know that $E$ is a quadratic field, and since $E'$ is a prime cyclotomic field we have an explicit description for its unique quadratic subfield $E$; namely that $E = \\mathbb{Q}(\\sqrt{q'})$ if $q' = 1 \\mod 4$ and $E = \\mathbb{Q}(\\sqrt{-q'})$ is $q' = 3 \\mod 4$. It is a standard fact that the discriminant $d_E$ of $E$ is $q'$ if $q' = 1 \\mod 4$ and $-q'$ otherwise. Finally, we know that a prime $q$ splits completely in $E$ if and only if the congruence $d_E = x^2 \\mod q$ has a solution e.g. if $d_E$ is a square mod $q$. Plugging in the prime numbers $q = 12289$ and $q' = 7681$ that are common in cryptography we see that $q' = 1 \\mod 4$ and that $7681 = 3788^2 \\mod 12289$, so that $q = 12289$ splits completely in $E,K$, and thus $L$, as required. Since this prime is explicitly the prime used in NewHope for all parameter sets we view this method as a substantial improvement on the previous technique.\n\n\\subsubsection{Quartic Fields}\nAgain, we use the method of describing $L$ as a compositum $MK\/K$. Now, $M$ will be a quartic subfield of the field $\\mathbb{Q}(\\zeta_{q'})$ and one can establish the linearly disjoint nature of $M$ and $K$ required to express $L$ as this compositum by e.g. examining their discriminants: since $K$ is a power-of-two cyclotomic field the only prime appearing in its discriminant is $2$, and since $M$ is a subfield of $\\mathbb{Q}(\\zeta_{q'})$ the only prime in its discriminant is $q'$. Since they have coprime discriminants they are linearly disjoint, and since ramified primes are factors of the discriminant we have a relatively easy way to discount $q$ being ramified ($q \\neq 2, q'$), so the remaining case to concern ourselves with is $q$ being inert.\n\nSince the discriminants are coprime we have a method for explicitly describing the integral basis of $L = MK$; the integral basis for $K$ is clear, and an integral basis for $M$ in fixed dimension can be computed relatively easily since it has degree $4$. Then, the product of their integral bases is an integral basis for $L$. Now one only needs to check whether $q$ splits completely in $M$, since splitting in $K$ is well understood. We are unable to provide a general method for finding such $q$, but an easy computation reveals that for $q = 10753$ and $K= \\mathbb{Q}(\\zeta_{256})$ there is a quartic field $M$ such that $q$ splits completely in $M$ and $K$ and hence $L$. Since we have a relatively small range in which we wish to place $q$ and $M$ has low degree we do not consider the cost of this search as a large drawback since it can be done efficiently on computational software such as SAGE or PARI.\n\n\\begin{remark}\nIn fact, this quartic method can be applied to other instances where we do not have an explicit description of the subfields of $K(\\zeta_{q'})$ which have degree $d$ over $K$: define the families of $q$ which split completely in $K$, then check whether those $q$ split completely in $L$ using computational software. Since $q = 1 \\mod m$ and $m$ is relatively large, there will not be many $q$ to check of appropriate size for lattice cryptography, and so we conclude that this method is sufficient for fixed choices of fields $L,K$ for which a satisfactory $q$ exists.\n\\end{remark}\n\n\n\n\\section{Restricting the Secret Space}\\label{appendix:secretspace}\n\nIn \\cref{searchdecisionguess} we need to use a fact that is implicit in the search-decision reduction of \\cite{lyubashevsky_ideal_2010}: for uniformly random $v \\in \\mathcal{R}_i$ and an incorrect guess $g$ of the secret $s$ modulo $\\mathcal{R}_i$, the distribution of $v(g-s)$ is uniformly random. In the ring and module cases, the secret space is decomposed into a direct product of finite fields, so it is clear that $v(g-s)$ is uniformly random in each finite field for $g \\neq s$.\n\nIn our case, an appeal to Wedderburn's theorem demonstrates that, since for our parameter choices each $\\mathcal{R}_i$ is a central simple algebra over ${\\mathcal{O}_K}^\\vee\/ \\mathfrak{q}_i{\\mathcal{O}_K}^\\vee \\cong \\mathbb{F}_q$, each $\\mathcal{R}_i$ is isomorphic to the full matrix ring $M_{d \\times d}(\\mathbb{F}_q)$, for which it is not true in general that $v(g-s)$ is uniformly random for $g \\neq s$; in fact, it is uniformly random if and only if $g-s$ is invertible. Thus we restrict our secret $s$ so that $s \\mod \\mathcal{R}_i$ lies in a set $G_i$ with the property that $g \\neq h \\in G_i$ implies $g-h$ is an invertible matrix. Applying this restriction for each $i$ places $s \\in G$ for a set $G = G_1 \\times \\dots \\times G_n$ of size $\\vert G \\vert = \\prod_i \\vert G_i \\vert$. Now, an incorrect guess $g \\in G_i$ of $s \\mod \\mathcal{R}_i$ results in a distribution of $v(g-s)$ which is uniformly random mod $\\mathcal{R}_i$. We will call such a set $G$ a pairwise difference set.\n\nWe also need to guarantee that there exist sufficiently large choices of $G$. A simple method for constructing a valid $G_i$ is by fixing some arbitrary embedding $\\beta$ of $\\mathbb{F}_{q^d}$ into $M_{n \\times n}(\\mathbb{F}_q)$ and letting $G_i$ equal the image of this embedding, such that $\\vert G_i \\vert = q^d$ and $\\vert G \\vert = q^{nd}$. Indeed, a $G_i$ constructed in this way is maximal because any set of matrices in $M_{d \\times d}(\\mathbb{F}_q)$ of size at least $q^d +1$ contains two matrices with the same first row, whose difference is therefore uninvertible.\n\nThere are a number of choices of embedding $\\beta$, and thus set $G_i$, equal to the number of irreducible polynomials of degree $d$ in $\\mathbb{F}_q[x]$, which can be calculated by the Necklace polynomial and in general will vastly exceed $q$. We make clear that our reduction will take the decision CLWE problem for \\textit{arbitrary secret} $s$ to the search CLWE problem where $s \\in G$ for \\textit{arbitrary fixed} $G$, which we denote by CLWE$_{q, \\Sigma_\\alpha, G}$. Thus, our reduction states that the decision problem is as hard as the search problem for the hardest choice of $G$, precluding obvious attacks on the unique case where $G = {{\\mathcal{O}_L}_q}^\\vee$ and the CLWE problem with $s \\in G$ corresponds to $d$ parallel copies in $L$ of the RLWE problem\\footnote{Although this case exists only when each $\\mathfrak{q}_i \\mathcal{O}_L$ is a prime ideal in $\\mathcal{O}_L$.}. For a general set $G$, $s \\in G$ will not provide parallelization since they need not have the property of $L$ that they are entirely contained in one $u$ coordinate of $\\mathcal{A}$. Additionally, even though elements of $G$ constructed this way co-commute, they do not lie in the center of $\\Lambda$ and the multiplication $a \\cdot s$ in the CLWE instance will not be a commutative operation.\n\nOf course, fixing a $G$ of size $q^{nd}$ restricts the size of the secret space by a factor of $\\frac{q^{nd}}{q^{nd^2}}$, a substantial loss in size even for fixed, small $d$. For concrete parameter settings, this may result in a much easier problem, but asymptotically it is still exponential in $n$ and thus establishes a suitable hardness property for decision CLWE. Of course, attacks based on exhaustive search are unlikely to represent the best attacks on the CLWE problem, so this may or may not substantially aid an attacker in practice.\n\nIn fact, there is no a priori reason why $G_i$ should be a field, or even closed under multiplication. For example, fixing a pair of invertible matrices $M_1, M_2$ and replacing $G_i$ with $M_1 \\cdot G_i \\cdot M_2 = \\lbrace M_1 X M_2 \\vert X \\in G_i\\rbrace$ results in a new set of size $q^d$ whose pairwise differences are all invertible but is not multiplicatively closed in general. Although the field embedding technique is perhaps the most elegant way of building $G_i$, and certainly the most constructive, it may transpire that taking $s$ from some set with less algebraic structure is advantageous in terms of the hardness of the resulting search problem. One can also construct the valid set $G_i + X$ by adding a fixed matrix $X$ to each element of $G_i$, but this technique is somewhat constrained by the fact that LWE samples are additive in the secret $s$ (e.g. one could just add $a \\cdot X$ into the second coordinate of the resulting samples).\n\n\nAlthough this restriction is not ideal, we have a remark about the implications on the security of the CLWE problem. Restricting the secret space in (R)LWE problems is not an uncommon idea: tertiary secrets, where each coordinate of $s \\in \\lbrace -1, 0,1 \\rbrace$, are used in the NIST candidate LAC \\cite{lu_lac_2018} amongst others, and security whilst restricting the secret to orders or subfields is discussed in \\cite{bolboceanu_order_2018}, and to other $K$-lattices in \\cite{peikert_algebraically_2019}. Overall, we suspect that the decision CLWE problem is polynomial time equivalent to the search CLWE problem without restriction on $s$, in particular when the number of samples is small as in our applications in \\cref{crypto}, and that the restriction is a function of our reduction technique rather than some causal property of the CLWE distribution. For the purposes of constructing a cryptosystem, we assume that this reduction implies that the decision CLWE problem is hard.\n\n\\section{Estimating the Multiplication Complexity}\\label{appendix:multiplication-complexity}\n\nThe overall flow to compute the multiplication is depicted in Fig. \\ref{fig:multiplication}, which is explained in detail in the sequel.\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[trim= 51mm 40mm 00mm 10mm, clip, width=1.1\\linewidth]{skewpolymult.pdf}\n \\caption{Depiction of the multiplication algorithm for cyclic algebras. [CLB17] is referred to as \\cite{caruso_fast_2017-4}.}\\label{fig:multiplication}\n\\end{figure}\n\n\n\\subsection{Algorithm for Multiplication in Cyclic Algebras}\nWe recall some details necessary to understand our multiplication algorithm. Recall that in the explicit constructions of \\cref{primepoweralgebras} the base field $K$ is cyclotomic and $q$ is a prime integer chosen so that $\\langle q \\rangle$ splits completely in $\\mathcal{O}_K$ as $\\langle q \\rangle = \\mathfrak{q}_1\\dots\\mathfrak{q}_n$, where $n$ is the dimension of $K$ as an extension of $\\mathbb{Q}$. Furthermore, the degree of $L$ over $K$ is a typically small $d$. Then, following the CRT-like decomposition of \\cref{CRTlike} we write\n\\begin{align*}\n\\Lambda_q \\cong \\mathcal{R}_1 \\times \\dots \\times \\mathcal{R}_n\n\\end{align*}\nfor $\\mathcal{R}_i = \\bigoplus_{j=0}^{d-1} u^j \\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$. We will show that each $\\mathcal{R}_i$ is a skew polynomial ring over $\\mathbb{Z}_q$, and in particular a skew polynomial ring for which we can apply the algorithms of \\cite{caruso_fast_2017-4} to compute multiplication independently in each $\\mathcal{R}_i$ in $O(d^\\omega)$ operations in $\\mathbb{Z}_q$, which output elements whose $u$ coordinates are in the form $\\sum_i \\ell_i k_i$ for $k_i \\in {\\mathcal{O}_K}_q$ and $\\{\\ell_i\\}$ some arbitrary normal basis for ${\\mathcal{O}_L}_q$ over ${\\mathcal{O}_K}_q$. We remark that the representation as a skew polynomial ring need not contradict the fact that we viewed the rings $\\mathcal{R}_i$ as matrix rings in \\cref{searchdecisionsection}, since computing matrix multiplication can be reduced to the problem of computing multiplication of skew polynomials (see \\cite{caruso_fast_2017-4}). Since $\\omega \\leq 2.373$ and we can compute the multiplication in each $\\mathcal{R}_i$ in parallel, this leads to a complexity of approximately $O(Nd^{0.373})$. However, we must also compute the complexity of the splitting isomorphism.\n\n\n\n\\subsection{The Rings $\\mathcal{R}_i$}\nIn order to apply the algorithm of \\cite{caruso_fast_2017-4}, we must confirm that each $\\mathcal{R}_i$ satisfies the following conditions:\n\\begin{itemize}\n\\item $\\mathcal{R}_i$ is the quotient of a skew polynomial ring with center $\\mathcal{O}_K\/\\mathfrak{q}_i$ by a polynomial in the form $X^d - \\gamma$.\n\\item $\\gamma$ is a norm from $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ into $\\mathcal{O}_K\/\\mathfrak{q}_i$.\\footnote{Due to the modulo reduction this does not contradict the assumption that $\\gamma$ is not a global norm.}\n\\item $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is a field extension of $\\mathcal{O}_K\/\\mathfrak{q}_i$ or an \\'{e}tale-$\\mathcal{O}_K\/\\mathfrak{q}_i$ algebra.\n\\end{itemize}\nThe first of the conditions follows immediately from the definitions of a skew polynomial ring and a cyclic algebra. The veracity of the latter conditions will depend on how the prime ideal $\\mathfrak{q}_i$ of $\\mathcal{O}_K$ splits in $\\mathcal{O}_L$ as $\\mathfrak{q}_i \\mathcal{O}_L$. Since $\\mathfrak{q}_i$ is prime in $K$ and $L\/K$ is Galois, we know\n\\begin{align*}\n\\mathfrak{q}_i \\mathcal{O}_L = \\prod_{j=1}^g (\\mathfrak{q}_{i,j})^e\n\\end{align*}\nfor some prime ideals $\\mathfrak{q}_{i,j}$ in $\\mathcal{O}_L$ and integers $e,g$ satisfying $efg = [L:K] = d$, where $f$ denotes the inertial degree. Assuming that $L$ is constructed as a subfield of a cyclotomic field as in \\cite{lahtonen_construction_2008}, it is a Galois number field and it follows that each $\\mathfrak{q}_i$ splits with the same $e,f,$ and $g$. Furthermore, since they are coprime as ideals of $\\mathcal{O}_K$, their factorizations' in $L$ are disjoint. Thus, we are left to consider three cases.\n\nWe first consider the case where each $\\mathfrak{q}_i \\mathcal{O}_L$ remains prime in $\\mathcal{O}_L$. It follows that $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is a finite field, and computing the norm of $\\mathfrak{q}_i \\mathcal{O}_L$ indicates $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L \\cong \\mathbb{F}_{q^d}$. In this case it is easy to see that $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is a finite field extension of $\\mathcal{O}_K\/\\mathfrak{q}_i \\cong \\mathbb{F}_q$ and consequentially, because the norm map is surjective over finite field extensions, that $\\gamma$ is a norm. Here it is clear that the algorithms of \\cite{caruso_fast_2017-4} can be applied.\n\nThe second case we consider is $g = d$, $e =f = 1$. Now each $\\mathfrak{q}_i \\mathcal{O}_L$ splits completely in $\\mathcal{O}_L$ into a product of prime ideals $\\mathfrak{q}_{i,1}\\dots\\mathfrak{q}_{i,d}$. By the CRT we have\n\\begin{align*}\n\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L \\cong \\bigotimes_{j=1}^d \\mathcal{O}_L\/\\mathfrak{q}_{i,j}\n\\end{align*}\nwhere each $\\mathcal{O}_L\/\\mathfrak{q}_{i,j} \\cong \\mathbb{F}_q$, and it follows that $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is an \\'{e}tale-$\\mathcal{O}_K\/\\mathfrak{q}_i$ algebra. We are left to show that $\\gamma$ is a norm, which we show via the stronger condition that the norm map in this extension is surjective. By the CRT, $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is isomorphic to a direct product of $d$ copies of $\\mathbb{F}_q$. Since the embeddings of $L$ cyclically permute the ideal factors of $\\mathfrak{q}_i$ it follows that the relative norm of an element $(x_1,\\dots,x_d) \\in \\bigotimes_{j=0}^d \\mathcal{O}_L\/\\mathfrak{q}_{i,j}$ is precisely $\\prod_{k=1}^d x_k \\mod q$. It is easy to see that this norm is surjective (because any $x \\in \\mathbb{F}_q$ is the norm of e.g. $(1,1,\\dots,x)$) and now once again we can apply the multiplication algorithms of \\cite{caruso_fast_2017-4}.\n\nIntermediate cases, where $\\mathfrak{q}_i$ splits into a product of prime ideals with the same norm such that $e=1, fg = d$, can be handled using a straightforward combination of these two methods.\n\nThe final case to consider is the ramified case, when $e \\neq 1$. Now the factorization of $\\mathfrak{q}_i \\mathcal{O}_L$ contains some power $\\mathfrak{p}_i^{e_i}$ of a prime $\\mathcal{O}_L$ ideal $\\mathfrak{p}_i$. In this case, we are not able to verify that the necessary conditions for the algorithms of \\cite{caruso_fast_2017-4} hold. However, we observe that the ideal $\\langle q \\rangle$ ramifies in $\\mathcal{O}_L$ if and only if $q$ divides the discriminant of $\\mathcal{O}_L$. Since only a finite number of primes divide this discriminant, we restrict ourselves to considering the cases where $q$ does not ramify. We emphasize that in the main cases of interest, where $K$ is the $m^\\text{th}$ cyclotomic field with $m$ having small divisors and $[L:K]$ is small, it is particularly unlikely that the large modulus $q$ typical in cryptography divides the discriminant of $L$. Indeed, when we pick $L$ as a subfield of $K(\\zeta_{q'})$ for some large prime integer $s$ using the techniques of \\cite{lahtonen_construction_2008} as in \\cref{primepoweralgebras}, it is easy to quantify which primes potentially ramify for a fixed choice of fields: either $s$ or the primes smaller than or equal to the divisors of $m$. As an easy example, the modulus $q =12289$ does not ramify in the example algebras given in the \\cref{sampleparameters} achieving dimension $1024$.\n\\subsection{Complexity of the CRT Style Isomorphism}\nWe have shown that we may apply the algorithms of \\cite{caruso_fast_2017-4} to compute the multiplication operation in each $\\mathcal{R}_i$ in complexity $O(d^\\omega)$. We are left to consider the complexity of the isomorphism defined by \\cref{CRTlike} generating the rings $\\mathcal{R}_i$. Essentially, this operation is a coordinatewise split of the $u$ coordinates of $\\Lambda_q = \\bigoplus_{j=0}^{d-1} u^j \\mathcal{O}_L$, where each entry is split into its mod $\\mathfrak{q}_i \\mathcal{O}_L$ parts. That is, the isomorphism maps\n\\begin{align*}\n\\sum_{j=0}^{d-1} u^j x_j \\rightarrow \\bigotimes_{i=1}^n \\sum_{j=0}^{d-1} u^j (x_j \\mod \\mathfrak{q}_i \\mathcal{O}_L).\n\\end{align*}\nSplitting one element $x_i \\in \\mathcal{O}_K$ can be done in time $O(n \\log n)$ using the CRT algorithm of \\cite{lyubashevsky_toolkit_2013} when $K$ is a cyclotomic field of dimension $n$. However, $L$ is a not a cyclotomic field, but instead a small degree $d$ cyclic extension of a cyclotomic. Furthermore, we are trying to split the elements of $L$ modulo ideals of $K$ extended to those of $L$. We do not know of an existing general, efficient way of doing this. The naive estimate for an optimal method would take time $O(nd \\log nd)$, where $nd$ is the dimension of $L$, but we suspect something this efficient is impossible. We have to perform $d$ such splits, which would result in a total complexity of $O(N \\log N\/d)$. Note that this compares relatively closely with the $O(Nd^{0.3})$ claimed for the multiplication step, and since these steps are sequential rather than parallel which of them dominates the asymptotic complexity would depend on the exact relationship between $n$ and $d$, but the result is an operational complexity essentially equivalent to that of the ring variant.\n\nOf course, the discussion of the previous paragraph relies on our implausibly low estimate of $O(nd \\log nd)$ complexity of the CRT split and so we do not claim such efficiency. Instead, we present techniques in the proceeding sections to work around the problem of splitting the $L$ part modulo the $K$ ideals in the factorization of $q$. Our methods are particularly efficient in the case where $q$ splits completely in $L$, but can be generalized to arbitrary splitting at only a small cost.\n\n\\subsection{Fast Cryptography When $q$ Splits Completely in $L$}\\label{qfast}\nWe consider an explicit method for implementing fast cryptography in the special case where the ideal $\\langle q \\rangle$ splits completely in $\\mathcal{O}_L$. By construction, $\\langle q \\rangle = \\prod_i \\mathfrak{q}_i$ in $\\mathcal{O}_K$, so in this case we split $\\langle q \\rangle = \\prod_{i,j} \\mathfrak{q}_{i,j}$ in $\\mathcal{O}_L$, where the prime $\\mathcal{O}_K$-ideals have prime decomposition in $\\mathcal{O}_L$ denoted $\\mathfrak{q}_i \\mathcal{O}_L = \\prod_{j=1}^d \\mathfrak{q}_{i,j}$.\n\nWe recall some facts about the extension ${\\mathcal{O}_L}_q$ of ${\\mathcal{O}_K}_q$. It is clear that the extension is cyclic of degree $d$, with Galois group generated by $\\theta$. By the CRT,\n\\begin{align*}\n {\\mathcal{O}_K}_q &\\cong \\prod_i \\mathcal{O}_K\/\\mathfrak{q}_i\n \\cong {\\mathbb{F}_q}^n \\\\\n {\\mathcal{O}_L}_q &\\cong \\prod_{i,j} \\mathcal{O}_L\/\\mathfrak{q}_{i,j}\n \\cong {\\mathbb{F}_q}^{nd}\n\\end{align*}\nwhere operations on the finite field products are applied coordinatewise. We represent the CRT decomposition of ${\\mathcal{O}_L}_q$ as $({\\mathbb{F}_q}^d)^n$, where each copy of ${\\mathbb{F}_q}^d$ corresponds to the extension $\\prod_j \\mathcal{O}_L\/\\mathfrak{q}_{i,j}$ of $\\mathcal{O}_K\/\\mathfrak{q}_i$. In the finite field representation of $\\prod_j \\mathcal{O}_L\/\\mathfrak{q}_{i,j}$, the elements of $\\mathcal{O}_K\/\\mathfrak{q}_i$ embed as elements of ${\\mathbb{F}_q}^d$ with the same entry in each coordinate, e.g. $(x,x,\\dots, x)$, corresponding to scalars over $(\\mathbb{F}_q)^d$, which can be seen from the following argument: for $k \\in \\mathcal{O}_K$, $k = x \\mod \\mathfrak{q}_i$ implies $k-x \\in \\mathfrak{q}_i$. Then it follows that $k -x \\in \\mathfrak{q}_{i,j}$ and thus $k = x \\mod \\mathfrak{q}_{i,j}$ for each $j$. Furthermore there is a simple, explicit, description of the action of $\\theta$ in this representation: since $\\theta$ cyclically shifts the ideals in the factorization of $\\mathfrak{q}_i$, one can order each copy of ${\\mathbb{F}_q}^d$ so that the action of $\\theta$ on $({\\mathbb{F}_q}^d)^n$ is a cyclical shift of the coordinates of each of the $n$ copies of ${\\mathbb{F}_q}^d$ concurrently. We exhibit this with a trivial example: set $d=3, n =2$. Then the action of $\\theta$ on $({\\mathbb{F}_q}^3)^2$ is\n\\begin{align*}\n \\theta(a_1,a_2,a_3,b_1,b_2,b_3) = (a_3, a_1, a_2, b_3, b_1, b_2).\n\\end{align*}\nA valid $\\mathcal{O}_K\/\\mathfrak{q}_i$ basis for $\\mathcal{O}_L\/\\mathfrak{q}_i\\mathcal{O}_L$ of size $d$ is $\\textbf{e}_1,\\dots,\\textbf{e}_d$, where $\\textbf{e}_i = (0,\\dots, 1, \\dots 0)$ denotes the $i^\\text{th}$ element of the standard basis of dimension $d$. Furthermore, this basis is orthonormal in the sense that $\\textbf{e}_i \\cdot \\textbf{e}_j = \\textbf{e}_i$ for $i = j$ and $0$ otherwise and cyclic\\footnote{As long as we choose the ordering in the right way.} in the sense that $\\theta(\\textbf{e}_i) = \\textbf{e}_{i+1}$ (e.g. normal), since the Galois group $\\langle \\theta \\rangle$ of $L$ over $K$ permutes the factors $\\mathfrak{q}_{i,j}$ of $\\mathfrak{q}_i\\mathcal{O}_L$ for each $i$. Because the CRT splits ${\\mathcal{O}_L}_q$ into a direct product within which operations are computed coordinatewise, we can extend this to a basis of ${\\mathcal{O}_L}_q$ over ${\\mathcal{O}_K}_q$ in the finite field representation by concatenating $n$ copies of this basis together, denoting by $\\textbf{e}_i^n$ the vector of dimension $nd$ $(\\textbf{e}_i, \\textbf{e}_i, \\dots, \\textbf{e}_i)$. This basis is still cyclic, with $\\theta$ operating independently on each of the $n$ copies of ${\\mathbb{F}_q}^d$ and hence the $n$ copies of $\\textbf{e}_i$. Concatenating the bases in this way also preserves the orthonormal property.\n\nDenote the above basis by $\\ell_1,\\dots, \\ell_d$. Recall that the CRT-like decomposition \\cref{CRTlike} splits each $u$ coordinate, an element of ${\\mathcal{O}_L}_q$, into its mod $\\mathfrak{q}_i \\mathcal{O}_L$ parts. However, we already know the mod $\\mathfrak{q}_i \\mathcal{O}_L$ parts of each $\\ell_j$ by construction. So, if we store elements of ${\\mathcal{O}_L}_q$ as $\\ell = \\sum_{j = 1}^d \\ell_j k_j$ for $k_j \\in {\\mathcal{O}_K}_q$ we can split $\\ell$ into its $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ components in time $O(d \\cdot n \\log n)$ as long as the $k_j$ elements are stored in the polynomial representation of ${\\mathcal{O}_K}_q$. Consequentially, we can perform the CRT style decomposition of an element in $\\Lambda_q$ whose $u$ coordinates are stored in this manner in time $O(d^2 \\cdot n \\log n) = O(N \\log (N\/d^2))$.\n\nNow we see a way to achieve fast multiplication in $\\Lambda_q$. We are required to perform the CRT in each of the $d$ $u$ coordinates, after which we can plug the rings $\\mathcal{R}_i$ into the fast multiplication algorithm of \\cite{caruso_fast_2017-4}. Since the CRT is an isomorphism and we know the image of $\\ell_i$ under the CRT, this reduces to $d$ copies of the CRT in $\\mathcal{O}_K$, each with complexity $O(dn \\log n)$, and therefore a total multiplication complexity of $O(N \\log (N\/d^2)) + O(Nd^{\\omega - 2})$. However, this algorithm comes with complications associated with the chosen representation of elements of ${\\mathcal{O}_L}_q$, which we handle in the next section.\n\n\\subsubsection{Handling Elements in the Representation}\nTo use the above multiplication algorithms in the scheme of \\cref{clwecrypto} we need to be able to store the elements compactly and sample the elements efficiently. Storing elements in this form turns out to be straightforward: each ${\\mathcal{O}_L}_q$ element requires storing $d$ elements of ${\\mathcal{O}_K}_q$. An element of $\\Lambda_q$ is $d$ elements of ${\\mathcal{O}_L}_q$, so in total we store $d^2$ elements of ${\\mathcal{O}_K}_q$, corresponding to one element of dimension $N = nd^2$, which is equivalent to storing $d$ elements of dimension $nd$.\n\nWe now discuss how to efficiently sample elements of $\\Lambda_q$ according to an appropriate error distribution. Recall from the security reduction of \\cref{sec3} that the error distributions we recommend in practice are spherical or elliptical Gaussians in the coordinates of the embedding $\\sigma_\\mathcal{A}$. We sample using the following result.\n\\begin{theorem}\\label{gaussianorth}\nLet $L\/K$ be a tower of number fields with $[K:\\mathbb{Q}] = n$ and $[L:K] = d$ where $K$ is a prime-power cyclotomic field. Let $q \\geq 2$ be a prime modulus which splits completely in $\\mathcal{O}_L$ and let $\\ell_1, \\dots, \\ell_d$ be the cyclic basis of ${\\mathcal{O}_L}_q$ over ${\\mathcal{O}_K}_q$ satisfying $\\ell_i \\cdot \\ell_j = \\ell_i$ if $i = j$ and $0$ otherwise. Then, the distribution on ${\\mathcal{O}_L}_q$ obtained by sampling $k_1, \\dots, k_d$ independently from a discrete Gaussian over ${\\mathcal{O}_K}_q$ in the polynomial representation and outputting $\\ell = \\sum_i \\ell_i k_i$ is a discrete Gaussian over ${\\mathcal{O}_L}_q$ in the $\\ell_2$ norm over $L_\\mathbb{R}$.\n\\end{theorem}\n\\begin{proof}\nRecall that in the case where $K$ is a prime power cyclotomic the power basis is a rotation and a scaling of the canonical basis (see e.g. \\cite{crockett_challenges_2016}), so a discrete Gaussian in the polynomial representation corresponds to a discrete Gaussian in the canonical basis as well. Order the canonical embedding of $\\mathcal{O}_L$ such that elements of $\\mathcal{O}_K$ embed as vectors of $n$ blocks of length $d$ that are the same in each block, e.g.\n\\begin{align*}\nk_1 = (k_{1,1}, k_{1,1} \\dots, k_{1,1}, k_{1,2}, \\dots, k_{1,n}),\n\\end{align*}\nwhere each entry $k_{i,j}$ of $k_i$ appears $d$ times. Since the $\\ell_i$ form a cyclic basis, in each $d$-block the entries of $\\ell_{i+1}$ are just a cyclic shift of those of $\\ell_i$ \\footnote{Again assuming a sensible ordering.}. For a fixed choice of basis the distribution in each $d$-block of $\\ell$ is independent, because the $k_{i,j}$ are sampled independently from a spherical Gaussian. So we can consider one $d$ block of $\\ell$ at a time, and write the $d$-block of $\\ell_1$ as $a_1, \\dots , a_d$. Since multiplication in the canonical embedding is coordinatewise and the $\\ell_i$ form a cyclic basis, the first block of $\\ell$ can be written as\n\\begin{align*}\n\\begin{pmatrix}\na_1 & a_2 & \\dots & a_d \\\\\na_d & a_1 & \\dots & a_{d-1} \\\\\n\\vdots & \\vdots & \\ddots & \\vdots \\\\\na_{2} & a_{3} & \\dots & a_1\n\\end{pmatrix} \\cdot\n\\begin{pmatrix}\nk_{1,1} \\\\\nk_{2,1} \\\\\n\\vdots \\\\\nk_{d,1}\n\\end{pmatrix}.\n\\end{align*}\nCall the left matrix $\\textbf{A}$ and the right vector $\\textbf{k}$. $\\textbf{k}$ is a Gaussian of parameter $r$, so $\\textbf{A} \\textbf{k}$ has has a Gaussian distribution with covariance matrix $r \\cdot \\textbf{A}\\textbf{A}^{\\dagger}$ by e.g. \\cite[Lemma 2.5]{luzzi_almost_2018}, and if this is diagonal and constant on the lead diagonal then we are done. Due to the structure of the canonical embedding and how we picked our basis in the $\\mathcal{O}_L\/\\langle q \\rangle$ representation, we have that $a_i = \\theta^i(a_1)$, and that for $i \\neq j$ $\\theta^i(a_1) \\cdot \\theta^j(a_1) = 0 \\mod q$. It follows that the off-diagonal entries of $\\textbf{A}\\textbf{A}^{\\dagger}$ are $0$ (since product being $0$ is preserved under representations) and the diagonal entries are $\\sum_{i=1}^{d} |a_i|^2$, where $\\vert \\cdot \\vert$ denotes the absolute value. Hence, the first $d$-block of $\\ell$ is a spherical Gaussian distribution, and since this analysis holds for any block it follows that each block of $\\ell$ is a spherical Gaussian. One also needs to show that the Gaussian distribution has the same variance in each block, but this follows from the fact that the $K$-embeddings permute the mod $\\mathfrak{q}_i$ values and fix the $\\ell_2$ norm of $K_\\mathbb{R}$. Explicitly, by construction each $K$ embedding modulo $\\langle q \\rangle$ can be extended `identically' onto $\\mathcal{O}_L \\mod \\langle q \\rangle$ in a way that fixes each $\\ell_i$, so they must have the same set of values in each block (this would not be the case if we considered their norm in a global sense, and the restriction modulo $q$ is strictly necessary).\n\\end{proof}\nNote that the statement does not define the resulting parameter of the Gaussian outputting $\\ell$, but the proof allows one to compute this: say each $k_i$ was chosen from a discrete Gaussian of parameter $r$. Then each element of $\\ell$ has parameter $\\sqrt{\\sum_i \\vert a_i\\vert^2} \\cdot r$. Computing $\\sqrt{\\sum_i \\vert a_i\\vert^2}$ is a one time cost for a fixed choice of $\\ell_1,\\dots,\\ell_d$, so one can sample the required Gaussian over ${\\mathcal{O}_L}_q$ of parameter $r'$ by sampling from the discrete Gaussian over ${\\mathcal{O}_K}_q$ of parameter $r = r'\/\\sqrt{\\sum_i \\vert a_i\\vert^2}$.\n\nFinally, to sample elements of $\\Lambda_q$ we merely sample each $u$ coordinate independently according to the above technique. If we wanted to use this method in the cryptosystem of \\cref{clwecrypto} to attain efficient operations then we would sample and store all elements using this representation over the cyclic basis $\\ell_1,\\dots \\ell_d$.\n\nUnfortunately, we are unable to generalize this theorem to the case where $\\mathfrak{q}_i$ remains prime, or even intermediate cases. In this case, there exist cyclic bases of $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ over $\\mathcal{O}_K\/\\mathfrak{q}_i$, but since $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is a finite field and thus has no zero-divisors the cyclic bases are not orthogonal. Consequentially, the matrix $\\textbf{A}$ does not in general give a diagonal $\\textbf{A} \\textbf{A}^T$ and thus the distribution of $\\textbf{A}\\textbf{k}$ has several potentially large covariance terms. If one were able to tolerate the covariance, the method can be extended in this case. It is also possible that a cyclic basis satisfying the condition that $\\textbf{A}\\textbf{A}^T$ is diagonal may exist for certain choices of field, but we were not able to find such a family of fields. We note that this question can be asked as a more generic question about finite fields: let $F = \\mathbb{F}_{q^d}$ be a finite field with $d > 1$ and let $\\theta$ denote the Frobenius automorphism of $F$. Does there exist a cyclic basis $b_1, \\dots, b_d$ with $b_j = \\theta^j (b_1)$ for $F$ over $\\mathbb{F}_q$ satisfying\n\\begin{align*}\n \\sum_{i=0}^{d-1} \\theta^i(b_1 \\cdot \\theta^{j-k}(b_1)) = 0\n\\end{align*}\nfor all $j \\neq k$ less than $d$? Here $j$ and $k$ correspond to $j,k^\\text{th}$ entry of $\\textbf{A} \\textbf{A}^T$. We were unable to come up with a basis satisfying this condition, but neither can we show that no such basis exists.\n\\begin{example}\nWe exhibit an example of the basis $\\ell_1, \\ell_2$ in the simplest setting, that of a degree $2$ extension of $\\mathbb{Q}$. Let $L = \\mathbb{Q}(i)$, with ring of integers $\\mathcal{O}_L = \\mathbb{Z}[i]$, and consider the ideal $\\langle 5 \\rangle$ of $\\mathcal{O}_L$. $5$ factorizes in $\\mathcal{O}_L$ as $5 = (2+i)(2-i)$, and it is clear that $\\langle 5 \\rangle = \\langle 2+i \\rangle \\cdot \\langle 2-i \\rangle$ is a decomposition into a product of prime ideals.\n\nUsing the notation $\\mathfrak{q}_1 := \\langle 2+i \\rangle, \\mathfrak{q}_2 := \\langle 2-i \\rangle$, it is easy to check that $2+i = -1 \\mod \\mathfrak{q}_2$ and thus $-(2+i) = -2-i$ is a valid choice for $\\ell_1$. Similarly, $-(2-i) = -2+i$ is an appropriate choice for $\\ell_2$. Correspondingly, the distribution obtained by sampling $k_1, k_2 \\leftarrow D_r$, the discrete Gaussian of parameter $r$ over $\\mathbb{Z}_5$, and outputting $k_1 \\cdot (-2 +i) + k_2 \\cdot (-2 -i)$ is a discrete Gaussian over $\\mathcal{O}_L \\mod \\langle 5 \\rangle$. Furthermore, to multiply two elements $k = k_1 \\ell_1 + k_2 \\ell_2$ and $g = g_1 \\ell_1 + g_2 \\ell_2$ modulo $5$ one outputs $kg = (k_1 g_1 \\mod 5) \\cdot \\ell_1 + (k_2 g_2 \\mod 5) \\cdot \\ell_2$, at a cost of two operations in $\\mathbb{Z}_5$, and performing the $\\mathcal{O}_L \\mod 5$ CRT on each $u$ coordinate of an element of the resulting natural order $\\Lambda_5$ can be done by merely reading off the $d^2 = 4$ values of $k_i$ and no additional computation.\n\nFurthermore, this is an example where the techniques of our next section may be advantageous. We will generalize the multiplication and CRT technique so that one is free to use any basis of $\\mathcal{O}_L$ over $\\mathbb{Z}$, for example the basis $\\lbrace 1, i \\rbrace$. In this basis it is particularly easy to sample a discrete Gaussian in the polynomial representation of $\\mathcal{O}_L \\mod \\langle 5 \\rangle \\cong \\frac{\\mathbb{Z}_5[x]}{x^2+1}$, but the resulting multiplication operation and CRT decomposition is not coordinatewise in the basis and so a small amount of efficiency is lost at a gain in parameter of the Gaussian. Specifically, to compute the CRT on an element $k = k_1 + k_2 \\cdot i$, one has to precompute\\footnote{Note that precomputing the image of $1$ is trivial.} the values $i = -2 \\mod \\mathfrak{q}_1, i = 2 \\mod \\mathfrak{q}_2$ and output\n\\begin{align*}\n (k_1 - 2 k_2 \\mod \\mathfrak{q}_1, 2 k_2 \\mod \\mathfrak{q}_2),\n\\end{align*}\nwhich requires additional operations over $\\mathbb{Z}_5$.\n\\end{example}\n\n\\subsection{Generalizing to non-Split $q$ and Arbitrary Bases}\nIn order to construct the cyclic, orthonormal, basis of \\cref{gaussianorth}, the previous section requires that $q$ be completely split in both $K$ and $L$. However, it is possible to drop the splitting condition in $L$ and obtain fast multiplication algorithms in the general case at only a small loss of efficiency. We demonstrate the technique in this section and then briefly describe cases where a general algorithm may be superior to the one requiring that $q$ splits by discussing alternatives to \\cref{gaussianorth}.\n\nObserve that, regardless of the prime ideal decomposition of each $\\mathfrak{q}_i\\mathcal{O}_L$, under the CRT decomposition the quotient ring $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ is a vector space of dimension $d$ over $\\mathbb{F}_q \\cong {\\mathcal{O}_K}\/\\mathfrak{q}_i$. Consequentially, an arbitrary ${\\mathcal{O}_K}_q$ basis $\\ell_1, \\dots, \\ell_d$ of ${\\mathcal{O}_L}_q$ can be decomposed into $n$ bases $\\ell_j = (\\ell_{1,j}, \\dots, \\ell_{n,j})$ so that each collection $\\ell_{i,1},\\dots,\\ell_{i,d}$ of $\\mathfrak{q}_i \\mathcal{O}_L$ parts is a vector space basis of dimension $d$ over $\\mathcal{O}_K\/\\mathfrak{q}_i$. Indeed, in the split case we constructed each $\\ell_i$ in this manner. Armed with this knowledge, we adapt the multiplication algorithm as follows.\n\nChoose an arbitrary integral $\\mathcal{O}_K$-basis $\\ell_1,\\dots, \\ell_d$ of $\\mathcal{O}_L$. As a precomputation phase, compute and store the images $\\ell_j \\mod \\mathfrak{q}_i \\mathcal{O}_L$ for each $i$ and $j$. The CRT-like decomposition of \\cref{CRTlike} splits each of the $u$ coordinates of an element of $\\Lambda_q$, an element of ${\\mathcal{O}_L}_q$, into its mod $\\mathfrak{q}_i \\mathcal{O}_L$ parts. Once again, we suggest an algorithm where elements of ${\\mathcal{O}_L}_q$ are stored in the form $\\ell = \\sum_{j = 1}^d \\ell_j k_j$ for $k_j \\in {\\mathcal{O}_K}_q$, e.g. on elements stored as $K$-combinations of this basis. We split ${\\ell \\in \\mathcal{O}_L}_q$ into its $\\mathcal{O}_L\/\\mathfrak{q}_i$ components in time $O(d \\cdot n \\log n)$, since\n\\begin{align*}\n\\sum_{j=1}^d \\ell_j k_j \\mod \\mathfrak{q}_i \\mathcal{O}_L= \\sum_{j=1}^d (\\ell_j \\mod \\mathfrak{q}_i\\mathcal{O}_L) \\cdot (k_j \\mod \\mathfrak{q}_i \\mathcal{O}_L),\n\\end{align*}\nwhere each $k_j \\mod \\mathfrak{q}_i$ can be computed in time $O(n \\log n)$ by the $K$-CRT and each $\\ell_j \\mod \\mathfrak{q}_i \\mod \\mathcal{O}_L$ was computed in the precomputation phase. Consequentially, we can perform the CRT style decomposition of an element in $\\Lambda_q$ whose $u$ coordinates are all stored in this manner in time $O(d^2 \\cdot n \\log n)$, since we must split $d^2$ elements of $\\mathcal{O}_K$. This decomposing complexity is the same as in the previous case where $q$ splits completely. Following this, each ring $\\mathcal{R}_i$ can be plugged in to the algorithm of \\cite{caruso_fast_2017-4} to compute the multiplication in time $O(Nd^{\\omega-2})$. However, since the $\\ell_i$ do not correspond to a standard orthonormal basis we incur an extra cost when reversing this transformation. Namely, each of the $u$ coordinates of each ring $\\mathcal{R}_i$ is output by the algorithm of \\cite{caruso_fast_2017-4} as an element $\\ell \\in \\mathcal{O}_L \\mod \\mathfrak{q}_i \\mathcal{O}_L$ expressed in an arbitrary normal basis. Before reversing the decomposition we must allow for the complexity of expressing each element of the output in the bases obtained by the images of $\\ell_1, \\dots, \\ell_d \\mod \\mathfrak{q}_i \\mathcal{O}_L$, as this basis was not necessarily normal. Since $\\mathcal{O}_L \\mod \\mathfrak{q}_i \\mathcal{O}_L$ is a vector space of dimension $d$ over $\\mathbb{F}_q$ this can be done via a precomputed change of basis matrix over $\\mathbb{F}_q$ in time $O(d^\\omega)$, and since there are $n$ rings with $d$ coordinates each the complexity of computing this on every coordinate is $O(nd^{\\omega+1})$. The resulting multiplication algorithm has total complexity $O(N \\log (N\/d^2)) + O(Nd^{\\omega-1})$. While this represents only a minor asymptotic loss, especially since we expect the first term to dominate the complexity, it is likely in practice that the extra step required to recover the basis representation would cause a tangible slowdown.\n\nAn unfortunate issue with this technique is that by replacing the orthonormal basis with an arbitrary basis we have lost \\cref{gaussianorth} and thus the efficient method for sampling a discrete Gaussian in the representation $\\ell = \\sum_j \\ell_j k_j$. However, this generalization allows for the use of an arbitrary basis $\\ell_1,\\dots, \\ell_d$, unlike in the split case in which we chose a specific basis. Since we require that elements of $\\Lambda_q$ are input into the algorithm with $u$ coordinates in the form $\\sum_j \\ell_j k_j$ this algorithm can be combined with the cryptosystem of \\cref{clwecrypto} in the case where there is a basis $g_1, \\dots, g_d$ of ${\\mathcal{O}_L}_q$ over ${\\mathcal{O}_K}_q$ in which one can compute the representation $\\ell = \\sum_j g_j k_j$ particularly efficiently. This is because one can just sample $\\ell$ from the usual Gaussian distribution over the polynomial basis of ${\\mathcal{O}_L}_q$, compute its representation as $\\ell = \\sum_j g_j k_j$, and then apply the multiplication algorithm in this form. More generally, the flexible choice of basis allows for both non-split $q$ and for a user to choose their favourite $\\mathcal{O}_L$ basis properties, such as a normal basis or a basis consisting of small elements. We remark that it is likely possible to construct a pair of fields $L\/K$ that allow for a basis $\\ell_1, \\dots, \\ell_d$ permitting a fast algorithm transforming from the polynomial representation of $\\mathcal{O}_L$ to the representation $\\sum_i \\ell_i k_i$ with each $k_i$ in polynomial representation, which would allow one to bypass the complications of sampling Gaussian distributions by just sampling in $\\mathcal{O}_L$ directly.\n\n\\subsection{Generalizing to Other Centers}\nIn the exposition of the previous section we required that $q$ splits completely in the center $K$. This corresponds to the requirement in the ring and module cases that $q$ splits completely in the field $K$, which allows the use of the NTT to compute multiplications over a direct product of finite fields. However, there has been recent progress in loosening this requirement for the NTT and allowing the modulus $q$ to be $1$ mod $n$ rather than $1$ mod $m$, where as usual $K$ is the $m^\\text{th}$ cyclotomic field of degree $n$. For example, in the second round specification of KYBER \\cite{avanzi_kyber_2019} $q$ is set as $3329$ and $n = 256$, yet they still support efficient NTT based multiplication. In such cases, $q$ is `well' split but not completely split, and the fast NTT operations use the method of \\cite{lyubashevsky_truly_2019}, where $q$ splits into some product of prime ideals $\\mathfrak{q}_i$ whose norms can be small powers of $q$.\n\nWe observe that our methods can be partially generalized to this case in the following manner. Say $\\langle q \\rangle = \\prod_i \\mathfrak{q}_i$ is a decomposition into prime ideals in $\\mathcal{O}_K$ and there exists an efficient algorithm for fast multiplication in ${\\mathcal{O}_K}_q$. We can replace our condition that $q$ splits completely in $\\mathcal{O}_L$ with the condition that each ideal $\\mathfrak{q}_i$ in the $\\mathcal{O}_K$-factorization of $q$ splits completely into a product of $d$ prime ideals $\\mathfrak{q}_i \\mathcal{O}_L = \\prod_{j=1}^d \\mathfrak{q}_{i,j}$ in $\\mathcal{O}_L$ of the same norm. Then, we can replicate the method of \\cref{qfast} to find a cyclic, orthonormal basis $\\textbf{e}_1,\\dots, \\textbf{e}_d$ of $\\mathcal{O}_L\/\\mathfrak{q}_i \\mathcal{O}_L$ over $\\mathcal{O}_K\/\\mathfrak{q}_i$ and concatenate together the bases for each $i$ to make the cyclic, orthonormal, basis $\\ell_1,\\dots,\\ell_d$ of ${\\mathcal{O}_L}_q$ over ${\\mathcal{O}_K}_q$. Since the basis is orthonormal, if $\\ell = \\sum_i \\ell_i k_i$ and $g = \\sum_i \\ell_i g_i$ with each $k_i, g_i \\in {\\mathcal{O}_K}_q$, then\n\\begin{align*}\n \\ell \\cdot g = \\sum_{i=1}^d \\ell_i (g_i \\cdot k_i).\n\\end{align*}\nSince the basis is cyclic,\n\\begin{align*}\n \\theta(\\ell) &= \\sum_i \\theta(\\ell_i) k_i \\\\\n &= \\sum_i \\ell_i k_{i-1}\n\\end{align*}\nwhere we define $k_0 := k_d$.\n\nNow we are able to use existing fast multiplication algorithms in ${\\mathcal{O}_K}_q$ to compute operations in ${\\mathcal{O}_L}_q$ by expressing elements in this basis. Represent each $x = \\sum_{i=0}^{d-1} u^i x_i \\in \\Lambda_q$ by expressing each $x_i \\in {\\mathcal{O}_L}_q$ in the $\\ell_j$ basis. Then, to multiply $x$ and $y$ in $\\Lambda_q$ one only has to compute multiplications in ${\\mathcal{O}_K}_q$, since the operations required are just computing the non-commutative relation $\\ell u = u \\theta(\\ell)$, which merely permutes the $\\ell_i$ using $\\theta$, and computing multiplication and addition, which can be done coordinatewise in the orthonormal $\\ell_i$ basis. Each $L$ multiplication requires $d$ multiplications in $K$, and each $u$ coordinate of $\\Lambda$ requires $d$ multiplications in $L$. Consequentially, naive multiplication in $\\Lambda_q$ takes $d^3$ instances of the efficient ${\\mathcal{O}_K}_q$-multiplication algorithm we have access to. For specific $K$-multiplication algorithms it is likely that this process can be streamlined; the intention of this section is merely to demonstrate that one can build efficient $\\Lambda_q$ operations from more general efficient operations over the center in the same manner that the techniques of \\cref{qfast} used the CRT method.\n\n\n\n\\footnotesize\n\\bibliographystyle{IEEEtran}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nLangevin dynamics originate in the study of statistical physics \\cite{coffey2012langevin}, and have a long history of applications to Markov Chain Monte Carlo (MCMC) sampling \\cite{roberts1996exponential}, non-convex optimization \\cite{gelfand1991recursive,borkar1999strong}, and machine learning \\cite{welling2011bayesian}. Langevin algorithms amount to gradient descent augmented with additive Gaussian noise. \nThis additive noise enables the algorithms to escape saddles and local minima.\nFor optimization and learning, this enables the algorithms to find near optimal solutions even when the losses are non-convex. For sampling, Langevin algorithms give a simple approach to produce samples that converge to target distributions which are not log-concave.\n\n\\paragraph{Related Work.}\nA large amount of progress on the non-asymptotic analysis of Langevin algorithms has been reported in recent years. This work has two main streams: 1) unconstrained non-convex problems and 2) constrained convex problems. These works will be reviewed below.\n\nThe bulk of the recent work on non-asymptotic analysis of Langevin algorithms has examined unconstrained problems \n\\cite{raginsky2017non,majka2020nonasymptotic,fehrman2020convergence,chen2020stationary,erdogdu2018global,durmus2017nonasymptotic,chau2019stochastic,xu2018global,cheng2018sharp,ma2019sampling}. The basic algorithm in the unconstrained case has the form:\n$$\n\\bx_{k+1} = \\bx_k-\\eta \\nabla_x f(\\bx_k,\\bz_k) + \\sqrt{\\frac{2\\eta}{\\beta}} \\bw_k,\n$$\nwhere $\\bx_k$ is the decision variable, $\\bz_k$ are external random variables, $\\bw_k$ is Gaussian noise, and $\\eta$ and $\\beta$ are parameters. In a learning context, $\\bz_k$ correspond to data, $\\bx_k$ are parameters of a model, and $f(x,z)$ is a loss function that describes how well the model parameters fit the data. With no Gaussian noise, $\\bw_k$, this algorithm reduces to stochastic gradient descent. \n\nA breakthrough was achieved in \\cite{raginsky2017non}, which gave non-asymptotic bounds in the case that $f(x,z)$ is non-convex in $x$ and $\\bz_k$ are independent identically distributed (IID). A wide number of improvements and variations on these results have since been obtained in works such as\n\\cite{majka2020nonasymptotic,fehrman2020convergence,chen2020stationary,erdogdu2018global,durmus2017nonasymptotic,chau2019stochastic,xu2018global,cheng2018sharp,ma2019sampling}. In particular, \\cite{chau2019stochastic} achieves tighter performance guarantees and extends to the case that $\\bz_k$ is a mixing process. \n\nFor problems with constraints, most existing work focuses convex losses over compact convex constraint sets with no external variables $\\bz_k$. Most closely related to our work is that of \\cite{bubeck2015finite,bubeck2018sampling} which augments the Langevin algorithm with a projection onto the constraint set. Proximal-type algorithms were examined \\cite{brosse2017sampling}. Variations on mirror descent were examined in \\cite{ahn2020efficient,hsieh2018mirrored,zhang2020wasserstein,krichene2017acceleration}. \n\nRecent work of \\cite{wang2020fast} examines Langevin dynamics on Riemannian manifolds. In this case, the losses may be non-convex, but still there are no external variables, $\\bz_k$. It utilizes results from diffusion theory to give convergence with respect to Kullback-Liebler (KL) divergence. Many of the ideas in that paper could likely be translated to the current setting. However, such KL divergence bounds become degenerate if the algorithm is initialized as a constant value, e.g. $\\bx_0=0$. \nIn contrast, our work focuses on bounds in the $1$-Wasserstien distance, which gives well-defined bounds as long as the initialization is feasible for the constraints.\n\n\n\\paragraph{Contributions.} This paper gives non-asymptotic convergence bounds for Langevin algorithms for problems that are constrained to a compact convex set. In particular, we examine a generalized version of the algorithm examined in \\cite{bubeck2018sampling,bubeck2015finite}. As discussed above, the existing works on constrained Langevin methods (aside from the Riemannian manifold results of \\cite{wang2020fast}) focus on convex loss functions, and none consider external random variables. This paper examines the case of non-convex losses with IID external randomness. For the purpose of sampling, it is shown that after $T$ steps, the error from the target in the $1$-Wasserstein is of $O(T^{-1\/4}(\\log T)^{1\/2})$. For optimization and learning, this bound is used to show that the algorithm can achieve a suboptimality of $\\epsilon$ in a number of steps that is polynomial in $\\epsilon$ and slightly superexponential in the dimension of $\\bx_k$. To derive the bounds, a novel result on contractions for reflected stochastic differential equations is derived. \n\n\\section{Setup}\n\n\\subsection{Notation and Terminology.}\n$\\bbR$ denotes the set of real numbers while $\\bbN$ denotes the set of non-negative integers. The Euclidean norm over $\\bbR^n$ is denoted by $\\|\\cdot \\|$. \n\nRandom variables will be denoted in bold. If $\\bx$ is a random variable, then $\\bbE[\\bx]$ denotes its expected value and $\\cL(\\bx)$ denotes its law. IID stands for independent, identically distributed.\nThe indicator function is denoted by $\\indic$. If $P$ and $Q$ are two probability measures over $\\bbR^n$, then the $1$-Wasserstein distance between them with respect the Euclidean norm is denoted by $W_1(P,Q)$. \n\nThroughout the paper, $\\cK$ will denote a compact convex subset of $\\bbR^n$ of diameter $D$ such that a ball of radius $r>0$ around the origin is contained in $\\cK$. The boundary of $\\cK$ is denoted by $\\partial \\cK$. The normal cone of $\\cK$ at a point $x$ is denoted by $N_{\\cK}(x)$. The convex projection onto $\\cK$ is denoted by $\\Pi_{\\cK}$. \n\\subsection{The Project Stochastic Gradient Langevin Algorithm}\n\nFor integers $k$ let $\\hat \\bw_k \\sim\\cN(0,I)$ be IID Gaussian random variables and let $\\bz_k$ be IID random variables whose properties will be described later. Assume that $\\bz_i$ and $\\hat \\bw_j$ are independent for all $i,j\\in\\bbN$.\n\nAssume that the initial value of $\\bx_0\\in\\cK$ is independent of $\\bz_i$ and $\\hat \\bw_j$. Then\nthe projected stochastic gradient Langevin algorithm has the form:\n\\begin{equation}\n \\label{eq:projectedLangevin}\n\\bx_{k+1} = \\Pi_{\\cK}\\left(\\bx_k -\\eta \\nabla_x f(\\bx_k,\\bz_k) +\n \\sqrt{\\frac{2\\eta}{\\beta}} \\hat\\bw_{k}\\right),\n\\end{equation}\nwith $k$ an integer. Here $\\eta>0$ is the step size parameter and $\\beta >0$ is a noise parameter.\n\nLet $\\bar f(x) = \\bbE[f(x,\\bz)]$, where the expectation is over $\\bz$, which has the same distribution as $\\bz_k$. We will assume that $\\nabla_x f(x,\\bz)-\\nabla_x \\bar f(x)$ are uniformly sub-Gaussian for each $x\\in\\mathbb{R}^n$. That is, there is a number $\\sigma >0$ such that for all $\\alpha\\in \\mathbb{R}^n$, the following bound holds:\n\\begin{equation}\n \\label{eq:subgaussian}\n \\bbE\\left[\n \\exp\\left(\n \\alpha^\\top \\left (\n \\nabla_x f(x,\\bz)-\\nabla_x \\bar f(x)\n \\right)\n \\right)\n \\right] \\le e^{\\sigma^2 \\|\\alpha\\|^2\/2}.\n\\end{equation}\nThe uniform sub-Gaussian property holds under the following conditions:\n\\begin{itemize}\n\\item {\\bf Gradient Noise:} $\\nabla_x f(x,\\bz) = \\nabla_x \\bar f(x) + \\bz$ with $\\bz$ sub-Gaussian.\n\\item {\\bf Lipschitz Gradients and Strongly Log-Concave $\\bz$:} $\\nabla_x f(x,z)$ is Lipschitz in $z$ and $\\bz$ has a density of the form $e^{-U(z)}$ with $\\nabla^2 U(z) \\succeq \\kappa I$ for all $z$. Here $\\kappa >0$ and the inequality is with respect to the positive semidefinite partial order. (See Theorem 5.2.15 of \\cite{vershynin2018high}.) \n\\item {\\bf Convex Gradients and Bounded $\\bz$:} Each component $\\frac{\\partial f(x,z)}{\\partial x_i}$ is convex in $z$ and $\\bz$ is bounded with independent components. (See Theorem 3.24 of \\cite{wainwright2019high}.)\n \\end{itemize}\n\n\n For learning, the last two conditions are the most useful, since they give general classes of losses and variables for which the method can be applied. \n %\n In particular, the second case applies to many common scenarios. It includes Gaussian $\\bz$ as a special case, and it can be applied to neural networks with smooth activation functions. \n \n A variety of more specialized cases in which the sub-Gaussian condition holds are presented in Chapter 5 of \\cite{vershynin2018high}.\n Future work will relax the uniform sub-Gaussian assumption and the requirement of IID $\\bz_k$. \n\n\n\nWe assume that for each $z$, $\\nabla_x f(x,z)$ is $\\ell$-Lipschitz in $x$, i.e. $\\|\\nabla_x f(x_1,z)-\\nabla_x f(x_2,z)\\| \\le \\ell \\|x_1-x_2\\|$. The mean function, $\\bar f$, is assumed to be $u$-smooth, so that $\\|\\nabla_x \\bar f(x)\\|\\le u$ for all $x\\in\\cK$. \nThe assumptions on $\\bar f$ imply that we can have $u\\le \\|\\nabla_x \\bar f(0)\\| + \\ell D$ and that $\\bar f$ is $u$-Lipschitz. \n\n\nIn \\cite{bubeck2018sampling}, the case with $\\bar f$ is convex and no $\\bz_k$ variables is\nstudied. \nIt is shown that by choosing the step size, $\\eta$, appropriately, the\nlaw of $\\bx_k$ is given approximately given by $\\pi_{\\beta \\bar f}$, which is\ndefined by\n\\begin{equation}\n \\label{eq:gibbs}\n \\pi_{\\beta \\bar f}(A) = \\frac{\\int_A e^{-\\beta \\bar f(x)} dx}{\\int_K e^{-\\beta \\bar f(x)} dx}.\n\\end{equation}\n\nIn this paper, we will bound the convergence of\n\\eqref{eq:projectedLangevin} to \\eqref{eq:gibbs} in the case of\nnon-convex $f$ with external random variables $\\bz_k$. \n\n\\section{Main Results}\n\n\n\\subsection{Convergence of the Law of the Iterates}\n\nThe following is the main result of the paper. It is proved in Subsection~\\ref{ss:mainProof}. \n\n\\begin{theorem}\n \\label{thm:nonconvexLangevin}\n \\const{globalContract}\n \\const{globalConst}\n Assume that $\\eta \\le 1\/2$. \n There are positive constants $a$, $c_{\\ref{globalContract}}$ and $c_{\\ref{globalConst}}$ such that for all integers $k\\ge 4$, the following bound holds:\n \\begin{equation*}\n W_1(\\cL(\\bx_k),\\pi_{\\beta \\bar f}) \\le c_{\\ref{globalContract}}e^{-\\eta a k} + c_{\\ref{globalConst}} (\\eta\\log k)^{1\/4}\n \\end{equation*}\n In particular, if $\\eta = \\frac{\\log T}{4aT}$ and $T\\ge 4$, then \n \\begin{equation*}\n \\label{eq:optEta}\n W_1(\\cL(\\bx_T),\\pi_{\\beta \\bar f}) \\le \\left(c_{\\ref{globalContract}}+\\frac{c_{\\ref{globalConst}}}{(4a)^{1\/4}}\\right) T^{-1\/4}(\\log T)^{1\/2}.\n \\end{equation*}\n\\end{theorem}\n\nThe constants depend on the dimension of $\\bx_k$, $n$, the noise parameter, $\\beta$, the Lipschitz constant, $\\ell$, the diameter, $D$, the size of the inscribed ball $r$, and the smoothness constant, $u$. The specific form of the constants will be derived in the proof. For applications, it is useful to know how the constants depend on the dimension, $n$, and the noise parameter, $\\beta$. \nThe result below indicates that the algorithm exhibits two distinct regimes in which convergence is fast and slow, respectively. It is proved in Appendix~\\ref{sec:constants}.\n\n\\begin{proposition}\n \\label{prop:constants}\n \\const{smallA}\n \\const{largeBeta}\nThe constants $c_{\\ref{globalContract}}$ and $c_{\\ref{globalConst}}$ grow linearly with $n$. \nIf $D^2\\ell \\beta <8$, then we can set $a=\\frac{4}{D^2\\beta}\\ge \\frac{\\ell}{2}$, while $c_{\\ref{globalContract}}$ and $c_{\\ref{globalConst}}$ grow polynomially with respect to $\\left(1-\\frac{D^2\\ell \\beta}{8}\\right)^{-2}$ and $\\beta^{-1\/4}$. \nIn general, we have a positive constant $c_{\\ref{smallA}}$ and a monotonically increasing polynomial $p$ (independent of $\\eta$ and $\\beta$) such that for all $\\beta>0$, the following bounds hold:\n\\begin{align*}\n a&\\ge c_{\\ref{smallA}} \\beta \\exp\\left(-\\frac{D^2\\ell \\beta}{4}\\right) \\\\\n \\max\\left\\{c_{\\ref{globalContract}},c_{\\ref{globalConst}}\\right\\} &\\le p(\\beta^{-1\/4})\n \\exp\\left(\\frac{3 D^2\\ell \\beta}{4}\\right).\n\\end{align*}\n\\end{proposition}\n\n\\subsection{Application to Optimization and Learning}\n\nThe following result shows that the $\\bx_k$ can be made arbitrarily near optimal, but the required time may be slightly super-exponential with respect to problem dimension, $n$. \nIt is proved in Appendix~\\ref{sec:nearOpt}.\n\\begin{proposition}\n \\const{subOpt}\n \\label{prop:suboptimality}\n Assume that $\\eta\\le 1\/2$.\n There is a positive constant, $c_{\\ref{subOpt}}$ such that for all $k\\ge 4$, the following bound holds:\n \\begin{equation*}\n \\bbE[\\bar f(\\bx_k)] \\le \\min_{x\\in \\cK} \\bar f(x) + uW_1(\\cL(\\bx_k),\\pi_{\\beta \\bar f}) + \\frac{n\\log(c_{\\ref{subOpt}}\\max\\{1,\\beta\\})}{\\beta}.\n \\end{equation*}\n In particular, given any $\\rho > 4$ and any $\\zeta > 1$, there are choices of $\\eta$, $\\beta$, and $T$, along with positive numbers $m(\\rho,\\zeta)$ and $\\alpha(\\rho,\\zeta)$, such that for any suboptimality level, $\\epsilon>0$, the following implication holds:\n \\begin{equation*}\n T\\ge \\frac{m(\\rho,\\zeta)}{\\epsilon^\\rho} \\exp\\left(\\alpha(\\rho,\\zeta) n^\\zeta\\right) \\implies \\bbE[\\bar f(\\bx_T)]\\le \\min_{x\\in \\cK} \\bar f(x) + \\epsilon.\n \\end{equation*}\n\\end{proposition}\n\n\\subsection{The Auxiliary Processes Used for the Main Bound}\n\\label{ss:processes}\n\nSimilar to other analyses of Langevin methods, e.g. \\cite{raginsky2017non,bubeck2018sampling,chau2019stochastic}, the proof of Theorem~\\ref{thm:nonconvexLangevin} utilizes a collection of auxiliary stochastic processes that fit between the algorithm iterates from (\\ref{eq:projectedLangevin}) and a stationary Markov process with state distribution given by (\\ref{eq:gibbs}). \n\nWe will embed the iterates of the algorithm into continuous time by setting $\\bx_t^A=\\bx_{\\floor*{t}}$. The $A$ superscript is used to highlight the connection between this process and the algorithm. The Gaussian variables $\\hat \\bw_k$ can be realized as $\\hat \\bw_k = \\bw_{k+1}-\\bw_k$ where $\\bw_t$ is a Brownian motion.\n\nWe will let $\\bx_t^C$ be a continuous approximation of $\\bx_t^A$ and we will let $\\bx_t^M$ be a variation on the process $\\bx_t^C$ in which averages out the effect of the $\\bz_k$ variables. The proof will proceed by showing that the law of $\\bx_t^M$ converges exponentially to \\eqref{eq:gibbs}, that $\\bx_t^C$ has a similar law to $\\bx_t^M$, and that $\\bx_t^A$ has a similar law to $\\bx_t^C$. Below we make these statements more precise. \n\nThe continuous approximation of the algorithm is defined by the following reflected stochastic differential equation (RSDE):\n\\begin{equation}\n \\label{eq:continuousProjectedLangevin}\n d\\bx^C_t = -\\eta \\nabla_x f(\\bx^C_t,\\bz_{\\floor*{t}}) dt +\n \\sqrt{\\frac{2\\eta}{\\beta}} d\\bw_t - \\bv_t^C d\\bmu^C(t).\n\\end{equation}\n\nHere $-\\int_0^t \\bv_s^Cd\\bmu^C(s)$ is a bounded variation reflection process that ensures that $\\bx_t^C\\in\\cK$ for all $t\\ge 0$, as long as $\\bx_0^C\\in\\cK$. In particular, the measure $\\bmu^C$ is such that $\\bmu^C([0,t])$ is finite, $\\bmu^C$ supported on $\\{s|\\bx_s^C\\in\\partial \\cK\\}$, and $\\bv_s^C\\in N_{\\cK}(\\bx_s^C)$ where $N_{\\cK}(x)$ is the normal cone of $\\cK$ at $x$. Under these conditions, the reflection process is uniquely defined and $\\bx^C$ is the unique solution to the Skorokhod problem for the process defined by:\n\\begin{equation*}\n \\by^C_t = \\bx_0^C + \\sqrt{\\frac{2\\eta}{\\beta}} \\bw_t - \\eta \\int_0^t \\nabla_x\n f(\\bx^C_s,\\bz_{\\floor*{s}}) ds\n\\end{equation*}\nSee Appendix~\\ref{appsec:skorohod} for more details on the Skorokhod\nproblem.\n\nFor compact notation, we denote the Skorkohod solution for given trajectory, $\\by$, by \n$\\cS(\\by)$. So, the fact that $\\bx^C$ is the solution to the Skorokhod\nproblem for $\\by^C$ will be denoted succinctly by $\\bx^C=\\cS(\\by^C)$. \n\n\nThe averaged version of $\\bx_t^C$, denoted by $\\bx_t^M$, where the $M$ corresponds to ``mean'', is \ndefined by:\n\\begin{equation}\n \\label{eq:averagedLangevin}\n d\\bx^M_t = -\\eta \\nabla_x \\bar{f}(\\bx^M_t) dt +\n \\sqrt{\\frac{2\\eta}{\\beta}} d\\bw_t - \\bv_t^M d\\bmu^M(t).\n\\end{equation}\nAgain $-\\int_0^t \\bv_s^Md\\bmu^M(s)$ is the unique reflection process that ensures that $\\bx_t^M\\in\\cK$ for all $t$ whenever $\\bx_0^M\\in\\cK$. \nBy construction, $\\bx_t^M$\nsatisfies the Skorokhod\nproblem for the continuous process defined by\n\\begin{equation*}\n \\by^M_t = \\bx_0^M + \\sqrt{\\frac{2\\eta}{\\beta}} \\bw_t - \\eta \\int_0^t \\nabla_x\n \\bar{f}(\\bx^M_s) ds.\n\\end{equation*}\nSee Appendix~\\ref{appsec:skorohod} for more details on the Skorokhod\nproblem.\n\nThe following lemmas describe the relationships between the laws all of these processes. They are proved in Sections~\\ref{sec:langevinDiffusionBound}, \\ref{sec:AtoC}, \\ref{sec:averaging} respectively. \n\\begin{lemma}\n \\label{lem:convergeToStationary}\n There are positive constants $c_{\\ref{globalContract}}$ and $a$ such that for all $t\\ge 0$\n \\begin{equation*}\n W_1(\\cL(\\bx_t^{M}),\\pi_{\\beta \\bar f})\\le c_{\\ref{globalContract}}e^{-\\eta at}.\n \\end{equation*}\n \\end{lemma}\n \n\n \\begin{lemma}\n \\label{lem:AtoC}\n \\const{AtoC}\n Assume that $\\bx_0^A=\\bx_0^C\\in\\cK$ and $\\eta \\le 1\/2$. There is a positive constant, \n$c_{\\ref{AtoC}}$, such that for all $t\\ge 4$,\n $$\n W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^C))\\le c_{\\ref{AtoC}} \\left( \\eta \\log t\\right)^{1\/4}.\n $$\n\\end{lemma}\n\n\\begin{lemma}\n \\label{lem:CtoM}\n \\const{CtoM}\n Assume that $\\bx_0^M=\\bx_0^C\\in\\cK$ and $\\eta\\le 1\/2$. There is a positive constant, $c_{\\ref{CtoM}}$ such that for all $t\\ge 0$,\n $$\n W_1(\\cL(\\bx_t^M),\\cL(\\bx_t^C))\\le c_{\\ref{CtoM}} \\eta^{1\/4}.\n $$\n\\end{lemma}\n\n\n\nMost of the rest of the paper focuses on proving these lemmas. Assuming that these lemmas hold, the main result now has a short proof, which we describe next. \n\n\\subsection{Proof of Theorem~\\ref{thm:nonconvexLangevin}}\n\\label{ss:mainProof}\nRecall that $\\bx_k^A=\\bx_k$ for all integers $k\\in\\bbN$. Assume that $\\bx_0=\\bx_0^A=\\bx_0^C=\\bx_0^M$. \nThe triangle inequality followed by Lemmas~\\ref{lem:convergeToStationary}, \\ref{lem:AtoC}, and \\ref{lem:CtoM} shows that\n\\begin{align*}\n W_1(\\cL(\\bx_k),\\pi_{\\beta f}) &\\le W_1(\\cL(\\bx_k^A),\\cL(\\bx_k^C))+W_1(\\cL(\\bx_k^C),\\cL(\\bx_k^M))+W_1(\\cL(\\bx_k^M),\\pi_{\\beta f}) \\\\\n & \\le c_{\\ref{globalContract}}e^{-\\eta ak} + c_{\\ref{AtoC}} \\left( \\eta \\log k\\right)^{1\/4} + c_{\\ref{CtoM}} \\eta^{1\/4}.\n\\end{align*}\nThe result now follows by noting that $\\log k \\ge 1$ for $k\\ge 4$ setting $c_{\\ref{globalConst}}=c_{\\ref{AtoC}}+c_{\\ref{CtoM}}$. The specific bound when $\\eta = \\frac{\\log T}{4aT}$ arises from direct computation. \n\\hfill$\\blacksquare$\n\n\n\\section{Contractions for the Reflected SDEs}\n\n\\label{sec:langevinDiffusionBound}\n\n\n\nIn this section, we will show how the laws of the processes $\\bx_t^C$ and $\\bx_t^M$ are contractive with respect to a specially constructed Wasserstein distance. By relating this specially constructed distance with $W_1$ we will prove Lemma~\\ref{lem:convergeToStationary} which states that $\\cL(\\bx_t^M)$ converges to $\\pi_{\\beta f}$ exponentially with respect to $W_1$. \nThe contraction will be derived by an extension of the\nreflection coupling argument of \\cite{eberle2016reflection} to the\ncase of reflected SDEs with external randomness (from $\\bz_k$). This result may be of independent\ninterest.\n\n\n\\begin{proposition}\n \\label{prop:W1contract}\n \\const{W1mult}\n There are positive\n constants $a$ and $c_{\\ref{W1mult}}$ such that for any two solutions,\n $\\bx_t^{C,1}$ and $\\bx_t^{C,2}$ to the\n continuous-time RSDE, \\eqref{eq:continuousProjectedLangevin},\n their laws converge according to\n \\begin{equation}\n \\label{eq:W1contract}\n W_1(\\cL(\\bx_t^{C,1}),\\cL(\\bx_t^{C,2}))\\le c_{\\ref{W1mult}} e^{-\\eta at} W_1(\\cL(\\bx_0^{C,1}),\\cL(\\bx_0^{C,2})) \n \\end{equation}\n\n \n To define the constants, let the natural frequency and damping\n ratio be given by\n \\begin{equation}\n \\label{eq:oscillatorConstants}\n \\omega_N = \\frac{\\sqrt{a\\beta}}{2} \\quad \\textrm{and} \\quad\n \\xi = \\frac{D\\ell}{4}\\sqrt{\\frac{\\beta}{a}}.\n \\end{equation}\n\n The constants can always be set to\n \\begin{align*}\n a&=\\frac{D^2\\ell^2\\beta}{16}\\left(1-\\tanh^2\\left(\n \\frac{D^2\\ell\\beta}{8}\\right)\\right) \\\\\n c_{\\ref{W1mult}}&= \\frac{e^{D\\omega_N \\xi}}{\\cosh(D\\omega_N\\sqrt{\\xi^2-1})-\\frac{\\xi}{\\sqrt{\\xi^2-1}}\\sinh(D\\omega_N\\sqrt{1-\\xi^2})}\n \\end{align*}\n \n When $D^2\\ell \\beta <8$, a larger decay constant, $a$, can be\n defined by setting \n \\begin{align*}\n a &= \\frac{4}{D^2\\beta} \\\\\n c_{\\ref{W1mult}} &= \\frac{e^{D\\omega_N \\xi}}{\\cos(D\\omega_N\\sqrt{1-\\xi^2})-\\frac{\\xi}{\\sqrt{1-\\xi^2}}\\sin(D\\omega_N\\sqrt{1-\\xi^2})}.\n \\end{align*}\n\\end{proposition}\n\n\\begin{proof}\n We will follow the main idea behind\n \\cite{eberle2016reflection}. We will correlate the\n solutions using reflection coupling, and then construct a distance\n function, $h$, from the coupling. Then $h$ will be used to construct a\n Wasserstein distance for which the laws $\\cL(\\bx_t^{C,1})$ and\n $\\cL(\\bx_t^{C,2})$ converge exponentially.\n The desired bound is found by\n comparing this auxiliary distance to the classical $W_1$ distance. \n\n Let $\\brho_t = \\bx_t^{C,1}-\\bx_t^{C,2}$, $\\bu_t = \\brho_t \/\n \\|\\brho_t\\|$ and $\\btau = \\inf\\{t | \\bx_t^{C,1}=\\bx_t^{C,2}\\}$. Note\n that $\\btau$. The \\emph{reflection coupling} between $\\bx_t^{C,1}$ and\n $\\bx_t^{C,2}$ is defined by: \n \\begin{subequations}\n \\label{eq:reflectionCoupling}\n \\begin{align}\n d\\bx_t^{C,1} &= -\\eta \\nabla_x\n f(\\bx_t^{C,1},\\bz_{\\floor*{t}})+\\sqrt{\\frac{2\\eta}{\\beta}}d\\bw_t\n -\\bv_t^{C,1}d\\bmu^{C,1}(t)\\\\\n d\\bx_t^{C,2} &= -\\eta \\nabla_x\n f(\\bx_t^{C,2},\\bz_{\\floor*{t}})+\\sqrt{\\frac{2\\eta}{\\beta}}(I-2\\bu_t\n \\bu_t^\\top\\indic(t < \\btau))d\\bw_t - \\bv_t^{C,2}d\\bmu^{C,2}(t).\n \\end{align}\n\\end{subequations}\nHere $I$ is the $n\\times n$ identity matrix. \n Also, $\\bvarphi_t^1=-\\int_0^t\\bv_s^{C,1}d\\bmu^{C,1}(s)$ and $\\bvarphi_t^2=-\\int_0^t\n \\bv_s^{C,2} d\\bmu^{C,2}(s)$ are the unique projection processes that\n ensure that respective\n Skorkhod problem solutions, $\\bx_t^{C,1}$ and $\\bx_t^{C,2}$,\n remain in $\\cK$.\n\n The processes from \\eqref{eq:reflectionCoupling} define a valid\n coupling because $\\int_0^T(I-2\\bu_s\\bu_s^\\top\\indic(s<\\btau))d\\bw_s$\n is a Brownian motion. Furthermore, for $t\\ge \\btau$, we have that\n $\\bx_t^{C,1}=\\bx_t^{C,2}$. \n\n Analogous to \\cite{eberle2016reflection}, we aim to construct a function\n $h:[0,D]\\to \\bbR$ such that $h(0)=0$, $h'(0)=1$, $h'(x)>0$, and $h''(x) <0$ and\n a constant $a>0$ such that $e^{\\eta at}h(\\|\\bz_t\\|)$ is a\n supermartingale. \n One simplifying assumption for the construction is\n that we only need to define $h$ over the compact set $[0,D]$, while\n \\cite{eberle2016reflection} requires $h$ to be defined over\n $[0,\\infty)$. This is due to the fact that our solutions will be\n contained in $\\cK$ which has diameter $D$, while in\n \\cite{eberle2016reflection} the solutions are unconstrained. \n \n Now we will describe why the construction of such\n an $h$ proves the lemma.\n The supermartingale property will ensure that\n \\begin{equation}\n \\label{eq:couplingContract}\n \\bbE[h(\\|\\brho_t\\|)] \\le e^{-\\eta at} \\bbE[h(\\|\\brho_0\\|)]\n \\end{equation}\n\n \n Let $W_h$ denote that $1$-Wasserstein distance corresponding to the\n function $d(x,y)=h(\\|x-y\\|)$ for $x,y\\in \\cK$. In other words, if\n $P$ and $Q$ are probability distributions on $\\cK$ and $C(P,Q)$ is\n the set of couplings between $P$ and $Q$, then\n \\begin{equation*}\n W_h(P,Q)=\\inf_{\\Gamma\\in C(P,Q)} \\int_{\\cK\\times \\cK} h(\\|x-y\\|)d\\Gamma(x,y).\n \\end{equation*}\n By the hypotheses on $h$,\n $d(x,y)=d(y,x)\\ge 0$ and $d(x,y)=0$ if and only if $x=y$. Thus, $W_h$ is\n a valid Wasserstein distance. \n\n Assume that $\\Gamma_0$ is an optimal coupling of the initial laws\n $C(\\cL(\\bx_0^{C,1}),\\cL(\\bx_0^{C,2}))$ so that\n $$\n W_h(\\cL(\\bx_0^{C,1}),\\cL(\\bx_0^{C,2})) = \\int_{\\cK\\times\n \\cK}h(\\|x-y\\|)d\\Gamma_0(x,y).\n $$\n Such a coupling exists by Theorem\n 4.1 of \\cite{villani2008optimal}. Then using this initial coupling on the\n right of \\eqref{eq:couplingContract} and minimizing over all couplings\n of the dynamics\n on the left shows that\n \\begin{equation}\n \\label{eq:auxWassersteinContract}\n W_h(\\cL(\\bx_t^{C,1}),\\cL(\\bx_t^{C,2}))\\le \\bbE[h(\\|\\brho_t\\|)] \\le\n e^{-\\eta at} W_h(\\cL(\\bx_0^{C,1}),\\cL(\\bx_0^{C,1})).\n \\end{equation}\n In other words, the law of the continuous-time RSDE is\n contractive with respect to $W_h$.\n\n By the assumptions that $h(0)=0$, $h'(0)=1$, $h'(x) >0$, and\n $h''(x)<0$, we have that for all $x\\in [0,D]$:\n \\begin{equation*}\n h'(D)x \\le h(x) \\le x.\n \\end{equation*}\n It then follows from the definition of $W_h$ and $W_1$ that for all\n probability measures $P$ and $Q$ over $\\cK$ that\n \\begin{equation*}\n h'(D) W_1(P,Q)\\le W_h(P,Q) \\le W_1(P,Q).\n \\end{equation*}\n Combining these inequalities with \\eqref{eq:auxWassersteinContract}\n gives \\eqref{eq:W1contract} with $c_{\\ref{W1mult}} = h'(D)^{-1}$.\n\n Now we will construct $h$. The restriction of $h$ to the domain of\n $[0,D]$, along with the Lipschitz bound on $\\nabla_x f$ will\n enable an explicit construction of $h$ as the solution to a simple\n harmonic oscillator problem. This is in contrast to the more\n abstract construction in terms of integrals from \\cite{eberle2016reflection}.\n\n To ensure that $e^{\\eta at}h(\\|\\brho_t\\|)$ is a supermartingale, we\n must ensure that this process is non-increasing on average. Recall\n that $\\btau$ is the coupling time so that $e^{\\eta\n at}h(\\|\\brho_t\\|)=0$ for $t\\ge \\btau$. So, it suffices to bound the\n behavior of the process for all $t< \\btau$. In this case,\n we require\n that non-martingale terms of $d\\left( e^{\\eta at}h(\\|\\brho_t\\|)\\right)$ are\n non-positive. \n By It\\^o's formula we have that\n \\begin{equation}\n \\label{eq:superDifferential}\n d(e^{\\eta at}h(\\|\\brho_t\\|)) = e^{\\eta at} \\eta ah(\\|\\brho_t\\|)dt +\n e^{\\eta at} h'(\\|\\brho_t\\|)d\\|\\brho_t\\| + \\frac{1}{2} e^{\\eta a t}\n h''(\\|\\brho_t\\|)(d\\|\\brho_t\\|)^2.\n \\end{equation}\n Thus, the desired differential is computed from $d\\|\\brho_t\\|$ and\n $(d\\|\\brho_t\\|)^2$. So, our next goal is to derive these terms.\n \n Let $\\bb_t$ be the one-dimensional Brownian motion defined by\n $d\\bb_t = \\bu_t^\\top d\\bw_t$. Then for $t<\\btau$, $d\\brho_t$ can be expressed as\n \\begin{multline}\n \\label{eq:differenceLin}\n d\\brho_t = \\eta (\\nabla_x f(\\bx_t^{C,2},\\bz_{\\floor*{t}})-\\nabla_x f(\\bx_t^{C,1},\\bz_{\\floor*{t}}))dt + \\\\\n \\sqrt{\\frac{8\\eta }{\\beta}} \\bu_td\\bb_t\n +\\bv_t^{C,2}d\\bmu^{C,2}(t)-\\bv_t^{C,1} d\\bmu^{C,1}(t).\n \\end{multline}\n Since $\\bvarphi_t^1$ and $\\bvarphi_t^2$ are bounded variation\n processes, the quadratic terms are given by\n \\begin{equation}\n \\label{eq:differenceQuad}\n (d\\brho_t)(d\\brho_t)^\\top = \\frac{8\\eta}{\\beta} \\bu_t \\bu_t^\\top dt.\n \\end{equation}\n \n If\n $u=\\rho\/\\|\\rho\\|$ and $\\rho\\ne 0$, then the gradient and Hessian of $\\|\\rho\\|$ are given by\n \\begin{equation}\n \\label{eq:normDerivatives}\n \\nabla \\|\\rho\\| = \\|\\rho\\|^{-1} \\rho = u \\quad \\textrm{and} \\quad \\nabla^2 \\|\\rho\\| = \\|\\rho\\|^{-1}\n I - \\|\\rho\\|^{-1}uu^\\top.\n \\end{equation}\n Plugging \\eqref{eq:differenceLin}, \\eqref{eq:differenceQuad}, and\n \\eqref{eq:normDerivatives} into It\\^o's formula and simplifying\n gives\n \n \\begin{align}\n \\nonumber\n d\\|\\brho_t\\|&= \\eta \\bu_t^\\top (\\nabla_x f(\\bx_t^{C,2},\\bz_{\\floor*{t}})-\\nabla_x\n f(\\bx_t^{C,1},\\bz_{\\floor*{t}}))dt +\\sqrt{\\frac{8\\eta}{\\beta}}d\\bb_t \\\\\n \\nonumber\n & +\n \\bu_t^\\top \\bv_t^{C,2}d\\bmu^{C,2}(t) -\\bu_t^\\top\n \\bv_t^{C,1}d\\bmu^{C,1}(t) \\\\\n \\label{eq:reflectionNormBound}\n &\\le \\eta \\ell Ddt + \\sqrt{\\frac{8\\eta}{\\beta}} d\\bb_t.\n \\end{align}\n The simplification in the equality arises because $(d\\brho_t)^\\top\n (\\nabla^2 \\|\\brho_t\\|) (d\\brho_t)=0$. The inequality uses two\n simplifications. The first term on the right arises due to the\n Lipschitz bound on $\\nabla_x f$ and the diameter bound on $\\cK$. The\n other terms can be removed since $\\bx_t^{C,1}$ and $\\bx_t^{C,2}$ are\n both in $\\cK$, so that $\\bv_t^2 \\in N_{\\cK}(\\bx_t^{C,2})$\n implies that $(\\bx_t^{C,1}-\\bx_t^{C,2})^\\top \\bv_t^2\\le 0$. Likewise,\n $\\bv_t^1\\in N_{\\cK}(\\bx_t^{C,1})$ implies that\n $-(\\bx_t^{C,1}-\\bx_t^{C,2})^\\top \\bv_t^1\\le 0$. Then since $\\bmu^1$\n and $\\bmu^2$ are non-negative measures, the corresponding terms are\n non-positive.\n\n Note that we also have that $(d\\|\\brho_t\\|)^2=\\frac{8\\eta}{\\beta}\n dt$. Plugging the bounds for $d\\|\\brho_t\\|$ and $(d\\|\\brho_t\\|)^2$ into\n \\eqref{eq:superDifferential} gives\n \\begin{multline}\n \\label{eq:supermartingaleRequirement}\n d(e^{\\eta at}h(\\|\\brho_t\\|))\\le \\frac{4\\eta}{\\beta} e^{\\eta at}\n \\left(\n \\frac{a\\beta}{4} h(\\|\\brho_t\\|) + \\frac{D\\ell\\beta}{4}\n h'(\\|\\brho_t\\|) + h''(\\|\\brho_t\\|)\n \\right)dt +\\\\\n \\sqrt{\\frac{8\\eta}{\\beta}}e^{\\eta a t} h'(\\|\\brho_t\\|)d\\bb_t.\n \\end{multline}\n Thus, we see that a sufficient condition for $e^{\\eta a\n t}h(\\|\\brho_t\\|)$ to be a supermartingale is that\n \\begin{equation}\n \\frac{a\\beta}{4} h(x) + \\frac{D\\ell\\beta}{4}\n h'(x) + h''(x)=0\n \\end{equation}\n for all $x\\in [0,D]$. This is precisely the simple harmonic\n oscillator equation for natural frequency and damping ratio defined\n by:\n \\begin{equation*}\n \\omega_N^2 = \\frac{a\\beta}{4} \\quad\\textrm{and} \\quad\n 2\\xi \\omega_N = \\frac{D\\ell\\beta}{4}.\n \\end{equation*}\n\n For any positive $a$, the simple harmonic oscillator has a solution with $h(0)=0$, and $h'(0)=1$. Lemma~\\ref{lem:oscillator} from Appendix~\\ref{sec:oscillator} gives explicit values of $a$ that lead to $h$ with $h'(x) >0$ and $h''(x) <0$ for all $x\\in D$, and gives explicit expressions for $c_{\\ref{W1mult}}=(h'(D))$ in these cases. The result follows by plugging in these values. \n\\end{proof}\n\nNote that the function $\\bar{f}(x)$ satisfies all of the same assumptions that $f(x,z)$ does, with the further property that it is independent of $z$. As a result, Proposition~\\ref{prop:W1contract} applies to $\\bx_t^M$ as well. We can use this fact to prove the exponential convergence with respect to $W_1$ result from \\ref{lem:convergeToStationary}. \n\n\\paragraph{Proof of Lemma~\\ref{lem:convergeToStationary}.}\nLemma \\ref{lem:invariance} from Appendix~\\ref{sec:invariance} implies that $\\pi_{\\beta \\bar f}$ is invariant with respect to the dynamics of the process $\\bx^M$.\n\nNow, apply Proposition~\\ref{prop:W1contract} to $\\bx^M=\\bx^{M,1}$ and $\\bx^{M,2}$ such that \n$\\cL(\\bx_0^{M,2})=\\pi_{\\beta \\bar f}$ to give\n$$\nW_1(\\cL(\\bx_t^M),\\pi_{\\beta \\bar f})\\le c_{\\ref{W1mult}}e^{-\\eta a t} W_1(\\cL(\\bx_0^M),\\pi_{\\beta \\bar f})\n\\le c_{\\ref{W1mult}} D e^{-\\eta a t} .\n$$\n The specific form from the lemma\n arises because in this case\n $\\cL(\\bx_t^{M,2})=\\pi_{\\beta \\bar f}$ for all $t\\ge 0$, and also that $W_1(\\cL(\\bx_0^M),\\pi_{\\beta \\bar f})\\le D$,\n since $\\cK$ has diameter $D$. \nSetting $c_{\\ref{globalContract}}=c_{\\ref{W1mult}}D$ gives the result.\n \\hfill$\\blacksquare$\n\n\\section{A Switching Argument for Uniform Bounds}\n\nThe following lemma, which is based on a method from \\cite{chau2019stochastic}, is useful for deriving $W_1$ bounds from $\\cL(\\bx_t^C)$ that hold uniformly over time. \nIt is proved in Appendix~\\ref{sec:lemProofs}.\n\n\\begin{lemma}\n \\label{lem:switch}\n Assume that $\\eta \\le 1\/2$. \n Let $\\hat \\bx$ be a process such that for all $0\\le s\\le t$, if $\\hat \\bx_s=\\bx_s^C$ then $W_1(\\cL(\\hat \\bx_t),\\cL(\\bx_t^C))\\le g(t-s)$, where $g$ is a monotonically increasing function. If $\\hat\\bx_0=\\bx_0^C$, then for all $t\\ge 0$, we have that \n \\begin{equation*}\n W(\\cL(\\hat\\bx_t),\\cL(\\bx_t^C))\\le g(\\eta^{-1})\\left(1+\\frac{c_{\\ref{W1mult}}}{1-e^{-a\/2}}\\right)\n \\end{equation*}\n\\end{lemma}\\\n\n\nWe will refer to this as the ``switching lemma'', as the proof follows by constructing a sequence of processes that switch from the dynamics of $\\hat\\bx$ to the dynamics of $\\bx^C$. \n\n\\section{Bounding the Algorithm from the Continuous RSDE}\n\\label{sec:AtoC}\n\nThe goal of this section is to prove Lemma~\\ref{lem:AtoC}, which states that the law of the algorithm, $\\bx_t^A$, is close to the law of the continuous reflected SDE, $\\bx_t^C$. \nTo derive this bound, we introduce an intermediate process $\\bx^D$, and show that its law is close to that of both $\\bx^C$ and $\\bx^A$.\n\nRecall the process $\\by^C$ defined in Subsection~\\ref{ss:processes}. For any initial $\\bx_0^D\\in\\cK$, we define the following iteration on the integers:\n$$\n\\bx_{k+1}^D=\\Pi_{\\cK}(\\bx_k^D+\\by^C_{k+1}-\\by^C_k),\n$$\nand set $\\bx_t^D=\\bx_{\\floor*{t}}^D$ for all $t\\in \\bbR$.\n\nThe process, $\\bx^D$, can also be interpreted as a Skorokhod solution. Indeed, let $\\cD$ be the discretization operator that sets $\\cD(x)_t = x_{\\floor*{t}}$ for any continuous-time trajectory, $x_t$. Then, provided that $\\bx_0^D=\\bx_0^C$, we have that $\\bx^D=\\cS(\\cD(\\by^C))$. Recall that $\\cS$ corresponds to the Skorokhod solution. See Appendix~\\ref{appsec:skorohod} for a more detailed explanation of this construction. \n\nThe following lemmas give the specific bounds on the differences between $\\cL(\\bx_t^C)$ and $\\cL(\\bx_t^D)$, and between $\\cL(\\bx_t^A)$ and $\\cL(\\bx_t^D)$, respectively. They are proved in Appendix~\\ref{sec:lemProofs}.\n\n\\begin{lemma}\n\\label{lem:tanakaMean}\n\\const{tanakaRt}\n\\const{tanakaConst}\nAssume that $\\bx_0^D=\\bx_0^C$ and $\\eta\\le 1$. \nThere are constants, $c_{\\ref{tanakaRt}}$ and $c_{\\ref{tanakaConst}}$ such that for all $t\\ge 0$, the following bound holds:\n\\begin{equation*}\nW_1(\\cL(\\bx_t^C),\\cL(\\bx_t^D))\\le \\bbE\\left[\\|\\bx_t^C-\\bx_t^D\\| \\right] \\le \\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4}\n \\left( c_{\\ref{tanakaRt}} \\sqrt{\\eta t} + c_{\\ref{tanakaConst}} \\right)\n\\end{equation*}\n The constants are given by:\n \\begin{align*}\n c_{\\ref{tanakaRt}} &= \\sqrt{2 \\left( \\frac{u+\\ell D}{2r} +\\frac{n \\sigma}{\\sqrt{2}r} +\\frac{2n\\sqrt{2}}{r\\sqrt{\\beta}}\\right)\n \\left(\n \\frac{n}{\\beta} + Du + 2Dn\\sigma\n \\right)}\n \\\\\n c_{\\ref{tanakaConst}} &=\n \\sqrt{2 \\left(Du + 2n\\sigma + \\frac{n}{\\beta} \\right)} + D \\sqrt{\\frac{u+\\ell D}{2r} +\\frac{n \\sigma}{\\sqrt{2}r} +\\frac{2n\\sqrt{2}}{r\\sqrt{\\beta} } }\n \\end{align*}\n\\end{lemma}\n\n\n\\begin{lemma}\n \\label{lem:linUpper}\n Assume that $\\bx_0^A=\\bx_0^D$ and $\\eta \\le 1$. Then for all $t\\ge 0$:\n $$\n W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^D)) \\le\n\\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4} \n \\left( c_{\\ref{tanakaRt}} \\sqrt{\\eta t} + c_{\\ref{tanakaConst}} \\right) ((1+\\eta\\ell)^t -1)\n $$\n\\end{lemma}\n\nNow Lemma~\\ref{lem:AtoC} can be proved by combining Lemmas~\\ref{lem:switch}, \\ref{lem:tanakaMean}, and \\ref{lem:linUpper}.\n\n\\paragraph{Proof of Lemma~\\ref{lem:AtoC}}\n Using the triangle inequality and Lemmas~\n \\ref{lem:tanakaMean} and \\ref{lem:linUpper} gives\n \\begin{align*}\n W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^C))\n &\\le\n W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^D)) + W(\\cL(\\bx_t^D),\\cL(\\bx_t^C)) \\\\\n &\\le \\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4} \n \\left( c_{\\ref{tanakaRt}} \\sqrt{\\eta t} + c_{\\ref{tanakaConst}} \\right) (1+\\eta\\ell)^t.\n \\end{align*}\n \n Now we will utilize the switching trick from Lemma~\\ref{lem:switch} to simplify the bound. Define $g:[0,t]\\to \\bbR$ by\n $g(s) = \\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4} \n \\left( c_{\\ref{tanakaRt}} \\sqrt{\\eta s} + c_{\\ref{tanakaConst}} \\right) (1+\\eta\\ell)^s.\n $\n Then applying Lemma~\\ref{lem:switch} using the bound from $g$ gives the desired bound:\n \\begin{align*}\n \\MoveEqLeft\n W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^C))\n \\\\\n &\\le \\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4} \n \\left( c_{\\ref{tanakaRt}} + c_{\\ref{tanakaConst}} \\right) (1+\\eta\\ell)^{1\/\\eta} \\left(1+\\frac{c_{\\ref{W1mult}}}{1-e^{-a\/2}}\\right) \n \\\\\n &\\le \\left( \\eta \\log(4\\max\\{1,t\\})\\right)^{1\/4} \n \\left( c_{\\ref{tanakaRt}} + c_{\\ref{tanakaConst}} \\right) e^\\ell \\left(1+\\frac{c_{\\ref{W1mult}}}{1-e^{-a\/2}}\\right) \n \\end{align*}\n The second inequality uses the fact that for all $\\eta >0$,\n \\begin{align*}\n (1+\\eta\\ell)^{1\/\\eta} \\le e^\\ell & \\iff \\frac{\\log(1+\\eta \\ell)}{\\eta} \\le \\ell\n \\end{align*}\n where the right inequality holds due to concavity of the logarithm. \n\n Now, for $t\\ge 4$ we have $\\log(4t)\\le 2\\log(t)$. So, setting\n $$\n c_{\\ref{AtoC}}=2^{1\/4} \\left( c_{\\ref{tanakaRt}} + c_{\\ref{tanakaConst}} \\right) e^\\ell \\left(1+\\frac{c_{\\ref{W1mult}}}{1-e^{-a\/2}}\\right) \n $$\n gives the bound $W_1(\\cL(\\bx_t^A),\\cL(\\bx_t^C))\\le c_{\\ref{AtoC}} (\\eta \\log t)^{1\/4}$.\n\\hfill$\\blacksquare$\n\n\\section{Averaging Out the External Variables}\n\\label{sec:averaging}\n\nNow we show that the dynamics of the continuous reflected SDE, $\\bx^C$, and its averaged version, $\\bx^M$, have similar laws. In particular, we will prove Lemma~\\ref{lem:CtoM}. The general strategy is similar to that of Section~\\ref{sec:AtoC}. Namely, we devise a new process, $\\bx^B$ that fits ``between'' $\\bx^C$ and $\\bx^M$. Then the desired bound is given by showing that $\\cL(\\bx_t^M)$ is close to $\\cL(\\bx_t^B)$ and that $\\cL(\\bx_t^B)$ is close to $\\cL(\\bx_t^C)$.\n\nThe new process is defined by $\\bx^B=\\cS(\\by^B)$ where\n\\begin{equation}\n \\label{eq:Ybetween}\n \\by_t^B = \\bx_0^B + \\sqrt{\\frac{2\\eta}{\\beta}} \\bw_t - \\eta \\int_0^t \\nabla_x\n f(\\bx^M_s,\\bz_{\\floor*{s}}) ds.\n\\end{equation}\nSo, we see that $\\bx^B$ has similar dynamics to $\\bx^C$, but $\\bx^M$ is used in place of $\\bx^C$ in the drift term.\n\nThe lemmas describing the relations between $\\cL(\\bx_t^M)$ and $\\cL(\\bx_t^B)$ and between $\\cL(\\bx_t^C)$ and $\\cL(\\bx_t^B)$ are stated below. They are proved in Appendix~\\ref{sec:lemProofs}.\n\n\\begin{lemma}\n \\label{lem:dudley}\n \\const{aveTanakaLin}\n \\const{aveTanakaRoot}\n \\const{aveTanakaTQ}\n Assume that $\\bx_0^M = \\bx_0^B$ and that $\\eta \\le 1$. Then is a positive constants, $c_{\\ref{aveTanakaLin}}$, $c_{\\ref{aveTanakaRoot}}$, abd $c_{\\ref{aveTanakaTQ}}$ such that for all $t\\ge 0$,\n \\begin{equation*}\nW_1(\\cL(\\bx_t^B),\\cL(\\bx_t^M))\\le \\bbE\\left[\\|\\bx_t^B-\\bx_t^M\\| \\right] \\le c_{\\ref{aveTanakaLin}} \\eta t^{1\/2} + c_{\\ref{aveTanakaRoot}} \\eta^{1\/2} t^{1\/4} + c_{\\ref{aveTanakaTQ}} \\eta t^{3\/4}\n \\end{equation*}\n \n \n \n \n The constants are given by:\n \\begin{align*}\n \\nonumber\n c_{\\ref{aveTanakaLin}} &=\n 2\\sigma \\sqrt{n} \\\\\n c_{\\ref{aveTanakaRoot}} &=\n\\sqrt{\\frac{64 n \\sigma D\\sqrt{2\\pi} }{r} } \\\\\n c_{\\ref{aveTanakaTQ}} &=\n\\sqrt{\\frac{128 n \\sigma\\sqrt{2\\pi}}{r} \\left(\n \\frac{n}{\\beta} + Du + 2Dn\\sigma\n \\right)} \n \n \n \\end{align*}\n\\end{lemma}\n\n\\begin{lemma}\n \\label{lem:gronwall}\n Assume that $\\bx_0^C=\\bx_0^B$ and $\\eta \\le 1$. Then for all $t\\ge 0$,\n \\begin{equation*}\n W_1(\\cL(\\bx_t^B),\\cL(\\bx_t^C)) \\le \\left( c_{\\ref{aveTanakaLin}} \\eta t^{1\/2} + c_{\\ref{aveTanakaRoot}} \\eta^{1\/2} t^{1\/4} + c_{\\ref{aveTanakaTQ}} \\eta t^{3\/4}\\right) (e^{\\eta \\ell t}-1).\n \\end{equation*}\n \\end{lemma}\n\n \\paragraph*{Proof of Lemma~\\ref{lem:CtoM}}\n Using the triangle inequality along with Lemmas~\\ref{lem:dudley} and \\ref{lem:gronwall} shows that\n \\begin{align*}\n W_1(\\cL(\\bx_t^M),\\cL(\\bx_t^C))\n &\\le\n W_1(\\cL(\\bx_t^M),\\cL(\\bx_t^B)) + W_1(\\cL(\\bx_t^B),\\cL(\\bx_t^C)) \\\\\n &\\le \\left( c_{\\ref{aveTanakaLin}} \\eta t^{1\/2} + c_{\\ref{aveTanakaRoot}} \\eta^{1\/2} t^{1\/4}+c_{\\ref{aveTanakaTQ}}\\eta t^{3\/4}\\right) e^{\\eta \\ell t}\n \\end{align*}\n Using Lemma~\\ref{lem:switch} along with the fact that $\\eta^{1\/2}\\le \\eta^{1\/4}$ gives $W_1(\\cL(\\bx_t^M),\\cL(\\bx_t^C))\\le c_{\\ref{CtoM}} \\eta ^{1\/4}$ with\n $$\n c_{\\ref{CtoM}} = (c_{\\ref{aveTanakaLin}} + c_{\\ref{aveTanakaRoot}} + c_{\\ref{aveTanakaTQ}}) e^{\\ell} \\left(1+\\frac{c_{\\ref{W1mult}}}{1-e^{-a\/2}}\\right).\n $$\n\\hfill$\\blacksquare$\n\n\n\\section{Conclusions and Future Work}\n In this paper, we have given non-asymptotic bounds for a projected stochastic gradient Langevin algorithm applied to non-convex functions with IID external random variables. In particular, we demonstrated convergence of sampling methods with respect to the $1$-Wasserstein distance and showed how the sampling results can be utilized for non-convex learning. The results were derived using a novel approach contraction analysis for reflected SDEs. The contraction analysis utilizes connections with simple harmonic oscillator problems to get explicit contraction rate bounds. Future work will include a variety of extensions. The assumption of a compact convex domain, $\\cK$, can likely be relaxed to a general class of non-convex non-compact domains. This would require use of more general analysis of Skorokhod problems as in \\cite{lions1984stochastic} along with a dissipativity condition to ensure that the reflected SDEs remain contractive. The assumptions that $\\bz_k$ are IID and that $\\nabla_x f(x,\\bz_k)$ is sub-Gaussian will also be relaxed in future work. The eventual goal will be to use the method for problems in time-series analysis, control, and reinforcement learning. \n\n \n \\acks{The author would like to thank Tyler Lekang, Jonah Roux, Suneel Sheikh, Chuck Hisamoto, and Michael Schmit for helpful discussions. The author acknowledges funding from NASA STTR 19-1-T4.03-3451 and NSF CMMI 1727096}\n\n\\if\\ARXIV0 \n\\newpage\n\\fi\n \n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}