arnaucube
arnaucube/mathPublic Self-hosted repository
math/lattices.tex
lattices.texRaw
  1\documentclass{article}
  2\usepackage[utf8]{inputenc}
  3\usepackage{amsfonts}
  4% \usepackage{yfonts} % WIP
  5\usepackage{amsthm}
  6\usepackage{amsmath}
  7\usepackage{enumerate}
  8\usepackage{hyperref}
  9\usepackage{amssymb}
 10\usepackage{tikz} % diagram
 11\usepackage{changepage} % for adjustwidth
 12
 13\begin{filecontents}[overwrite]{lattices.bib}
 14@misc{chris-peikert,
 15  author = {Chris Peikert},
 16  title = {{A decade of lattice cryptography}},
 17  year = {2016}
 18}
 19@misc{slides-micciano,
 20  author = {Daniele Micciancio},
 21  title = {{Introduction to Lattices}},
 22  year = {2024}
 23}
 24@misc{micciano-regev,
 25  author = {Daniele Micciancio and Oded Regev},
 26  title = {{Lattice-based Cryptography}},
 27  year = {2008}
 28}
 29@misc{matan,
 30  author = {Matan Prasma},
 31  title = {{Lattices, an elementary and rigurous account}},
 32  year = {2024}
 33}
 34@misc{menezes,
 35  author = {Alfred Menezes},
 36  title = {{A Gentle Introduction to Lattice-Based Cryptography}},
 37  year = {2026}
 38}
 39@misc{cynthia-dwork,
 40  author = {Cynthia Dwork},
 41  title = {{Lattices and Their Application to Cryptography}},
 42  year = {1998}
 43}
 44\end{filecontents}
 45\nocite{*}
 46
 47
 48\theoremstyle{definition}
 49
 50\newtheorem{thm}{Theorem}[section]
 51\newtheorem{lemma}[thm]{Lemma}
 52\newtheorem{prop}[thm]{Proposition}
 53\newtheorem{cor}[thm]{Corollary}
 54\newtheorem{defn}[thm]{Definition}
 55\newtheorem{remark}[thm]{Remark}
 56\newtheorem{ex}[thm]{Example}
 57
 58\newcommand{\Rr}{\mathbb{R}}
 59\newcommand{\Zz}{\mathbb{Z}}
 60\newcommand{\Ll}{\mathcal{L}}
 61
 62\title{Notes on Lattices}
 63\author{arnaucube}
 64\date{2026}
 65
 66\begin{document}
 67
 68\maketitle
 69
 70\begin{abstract}
 71    Notes taken while studying lattice-based cryptography.
 72
 73    Usually while reading books and papers I take handwritten notes in paper notebooks, this document contains some of them re-written to $LaTeX$.
 74\end{abstract}
 75
 76\tableofcontents
 77
 78\section{Lattices}
 79\subsection{Hard problems}
 80
 81\begin{defn}[SVP (Shortest Vector Problem)]
 82find a shortest non-zero vector $x \in \Ll$, ie. that minimizes the Euclidean norm $||x||$, that is $\lambda_1(\Ll)=||x||$.
 83\end{defn}
 84
 85\begin{defn}[CVP (Closest Vector Problem)]
 86given a vector $y \in \Rr^n$ with $y \not\in \Ll$, find a nonzero vector $x \in \Ll$ that is closest to $y$, ie. that minimizes the Euclidean norm $||y-x||$.
 87\end{defn}
 88
 89\begin{defn}[NTRU key recovery problem]
 90Given $h(x)$, find ternary polynomials $f, g \in \mathcal{T}$ satisfying
 91$$f(x) \cdot h(x) = g(x) \pmod q \in R_q$$
 92Where $R_q = \Zz_q[X]/(X^n-1)$.
 93\end{defn}
 94
 95\begin{defn}[SIS (Short Integer Solution)]
 96Given $q \in \Zz$ and matrix $A \in \Zz_q^{m \times n}$, find a non-zero short $z \in \Zz^n$ s.th.
 97$$A \cdot z = 0 \pmod q$$
 98
 99\small{"short": $z \in \{B, B\}^n$ for some bound $B$, often $z \in \{-1, 0, 1 \}^n$.}
100\end{defn}
101
102The set of all solutions to the SIS problem forms the (q-ary) lattice
103$$\Lambda^{\perp}_q(A) = \{ z \in \Zz^n ~|~ A \cdot z = 0 \pmod q \}$$
104where the SIS problem becomes the SVP for $\Lambda_q^{\perp}(A)$
105
106\begin{itemize}
107\item LLL algorithm is used to solve SVP and CVP.
108
109  \item Both SVP and CVP become computationally difficult (NP hard*) as the lattice dimension $n$ grows.
110\end{itemize}
111
112
113\begin{defn}[Ring SIS (Ring Short Integer Solution)]
114given a uniformly random matrix $A \in^R R_q^n$, with elements $a_i \in R_q$, find a non-zero integer vector $z \in R^n$ of norm $||z|| \leq \beta$ such that
115
116$$A z = \sum_i a_i \cdot z_i = 0 \in R_q$$
117\end{defn}
118
119\begin{defn}[MSIS (Module Short Integer Solution)]
120given a uniformly random matrix $A \in^R R_q^{m \times n}$, with columns $a_i \in R_q^m$, find a non-zero integer vector $z \in R^n$ of norm $||z|| \leq \beta$ such that
121
122$$A z = 0 \in R_q^m$$
123$$ie.~ \sum_i a_{ij} \cdot z_j = 0 \in R_q, ~~for~ i=1, \ldots, m$$
124\end{defn}
125
126Notice that Module-SIS is a Ring-SIS with $rank=1$ ($m=1$).
127
128\subsection{Dual lattices}
129
130From previous section, we have LWE-Lattice and SIS-Lattice:
131\begin{defn}[LWE Lattice] \label{lwe-lattice}
132  A LWE-Lattice $\Ll$ is defined
133  \begin{align*}
134    \Ll &= \{ A^T s ~|~ s \in \Zz_q^n \} + q \Zz^m\\
135	&= \{ A^T s + qz ~|~ s \in \Zz_q^n, z \in \Zz^m \}
136  \end{align*}
137\end{defn}
138
139\begin{defn}[SIS-Lattice] \label{sis-lattice}
140  A SIS-Lattice $\Ll$ is defined
141$$\Ll^\perp = \{ z \in \Zz^m ~|~ Az=0 \in \Zz_q^n \} \supseteq q \Zz^m$$
142\end{defn}
143
144
145\begin{defn}[Dual of a lattice] \label{dual}
146    For a lattice $\Ll$, its dual is
147    $$\Ll^* = \{ y \in \Rr^m ~|~ \langle y, x \rangle \in \Zz ~\forall~ x \in \Ll \}$$
148\end{defn}
149
150\begin{lemma}
151    $$\Ll = q \Ll^{\perp *} ~\text{ie.}~ \frac{1}{q} \Ll = \Ll^{\perp *}$$
152\end{lemma}
153\begin{proof}
154    \begin{enumerate}[i.]
155    \item
156    Take $y \in \frac{1}{q} \Ll$, then $\exists s \in \Zz^n, z \in \Zz^m$ such that
157    $$y = \frac{1}{q} (A^Ts + qz) = \frac{1}{q} A^T s +z$$
158
159    Let $x \in \Ll^\perp$. By definition (\ref{sis-lattice}) $Ax=0 \pmod q$, therefore $\exists~ k \in \Zz^n$ such that $Ax = qk$.
160
161    Compute
162    \begin{align*}
163	\langle y, x \rangle &= \langle \frac{1}{q} A^T s + z, x \rangle\\
164			     &= \frac{1}{q} \langle A^T s, x \rangle + \langle z, x \rangle\\
165			     &= \frac{1}{q} \langle s, Ax \rangle + \langle z, x \rangle\\
166			     &= \frac{1}{q} \langle s, qk \rangle + \langle z, x \rangle\\
167			     &= \langle s, k \rangle + \langle z, x \rangle
168    \end{align*}
169    and $\langle s, k \rangle + \langle z, x \rangle \in \Zz$, since each of $s, k, z, x \in \Zz$.
170
171    Thus $\langle y, x \rangle \in \Zz$, hence by \ref{dual}, $y \in \Ll^{\perp *}$.
172
173    We started from $y \in \frac{1}{q}\Ll$, so, now we have
174    $$y \in \Ll^{\perp *} ~\forall~ y \in \frac{1}{q} \Ll$$
175    therefore
176    $$\Ll^{\perp *} \supseteq \frac{1}{q} \Ll$$
177    
178    \item
179    Now we prove the reverse inclusion. Take $y \in \Ll^{\perp *}$.
180
181    Observe that $q \Zz \subseteq \Ll^\perp$, because
182    $$\forall z \in \Zz^m,~ A(qz) = qAz = q 0 = 0 \pmod q$$
183
184    Since $y \in \Ll^{\perp *}$, we must have $\langle y, qz \rangle \in \Zz ~\forall~ z \in \Zz^m$.
185
186    Let $e_i \in \Zz^m$ be the $i-th$ standard basis vector, ie. $e_i=(0, \ldots, 0, 1, 0, \ldots, 0)$ (where one is at the i-th position).
187
188    We know that $\langle y, qz \rangle \in \Zz ~\forall z \in \Zz^m$ (including $z=e_i$), thus\\
189    $q e_i = (0, \ldots, 0, q, 0, \ldots, 0)$. Therefore,
190    $$\langle y, q e_i \rangle = q \langle y, e_i \rangle = q \cdot y_i$$
191    since $\langle y, e_i \rangle = y_i$ (extracts the i-th position from $y$).
192
193    So, since $\langle y, qz \rangle \in \Zz ~\forall z \in \Zz^m$, and $\langle y, q e_i \rangle = q y_i$, then $q y_i \in \Zz$
194
195    This argument works $\forall i \in [m]$, that is, $q y_1, \ldots, q y_m \in \Zz$. Therefore
196    $$qy \in \Zz^m ~\forall~ y \in \Ll^{\perp *}$$
197
198    $qy \pmod q$ is orthogonal to $ker(A)$.  %TODO
199
200    Let $\overline{x} \in ker(A) \subseteq \Zz_q^m$.
201    Since $A \overline{x}=0$, then $Ax =0 \pmod q$, thus $x \in \Ll^\perp$.
202
203    Since $y \in \Ll^{\perp *}$, by the definition of $\Ll^{\perp *}$, $\langle y, x \rangle \in \Zz$. Multiply it by $q$,
204    $$ q \langle y, x \rangle = \langle qy, x \rangle \in q \Zz$$
205    hence $\langle qy, x \rangle = 0 \pmod q$, thus $qy \pmod q \in ker(A)^\perp$.
206
207    \begin{adjustwidth}{4em}{0pt}
208	Observe: $ker(A)^\perp = im(A^T)$, proof:
209	let $A: \Zz_q^m \longrightarrow \Zz_q^n$, define
210	$$ker(A) = \{ x \in \Zz_q^m ~|~ Ax=0 \} = \Ll^\perp(A)$$
211
212	Define the orthogonal complement
213	$$(ker(A))^\perp = \{ y \in \Zz_q^m ~|~ \langle y, x \rangle =0 \pmod q ~\forall~ x \in ker(A) \}$$
214	$$im(A^T) = \{ A^T s ~|~ s \in \Zz_q^n \}$$
215
216	Then, $(ker(A))^\perp = im(A^T)$.
217    \end{adjustwidth}
218
219    Continuing from $qy \pmod q \in (ker(A))^\perp$, we've just seen that $(ker(A))^\perp = im(A^T)$, thus
220    $$\exists s \in \Zz^n ~\text{s.th.}~ qy=A^Ts \pmod q$$
221
222    Therefore, for some
223    $$z \in \Zz^m, ~ qy=A^Ts +qz$$
224    which means that $qy \in \Ll$, by definition of $\Ll$ (\ref{lwe-lattice}). Divide that by $q$, obtaining
225    $$y \in \frac{1}{q} \Ll$$
226
227    Thus, $\forall y \in \Ll^{\perp *}$, we have $y \in \frac{1}{q} \Ll$.
228
229    Hence $\Ll^{\perp *} \subseteq \frac{1}{q} \Ll$.
230    \end{enumerate}
231
232    \vspace{0.6cm}
233    Putting together $(i).~ \Ll^{\perp *} \supseteq \frac{1}{q} \Ll$, and $(ii).~ \Ll^{\perp *} \subseteq \frac{1}{q} \Ll$, we have
234    $$\Ll^{\perp *} = \frac{1}{q} \Ll$$
235\end{proof}
236
237
238\bibliographystyle{unsrt}
239\bibliography{lattices.bib}
240
241\end{document}