# Random Mathematical Function: Lattice Generation
## Description
A lattice in n-dimensional space is a regular arrangement of points. The simplest example of a lattice in n-dimensional space is \( \mathbb{Z}^n \), the set of all n-dimensional vectors with integer entries. More generally, a lattice is the result of applying a nonsingular linear transformation \(B \in \mathbb{R}^{d \times n}\) to the integer lattice \(\mathbb{Z}^n\), to obtain the set \(B(\mathbb{Z}^n) = \{B \mathbf{x} : \mathbf{x} \in \mathbb{Z}^n\}\).
## Definition
Let \(B = [\mathbf{b}_1, \mathbf{b}_2, \ldots, \mathbf{b}_k] \in \mathbb{R}^{d \times n}\) be linearly independent vectors in \(\mathbb{R}^d\). The lattice generated by \(B\) is the set
$$
\dot{{\bf{x}}}=[\begin{array}{c}{\dot{{\bf{p}}}}_{{\mathcal{W}}{\mathcal{B}}}\\ {\dot{{\bf{q}}}}_{{\mathcal{W}}{\mathcal{B}}}\\ {\dot{{\bf{v}}}}_{{\mathcal{W}}}\\ {\dot{{\boldsymbol{\omega }}}}_{{\mathcal{B}}}\\ \dot{{\boldsymbol{\Omega }}}\end{array}]=\left[\begin{array}{c}{{\bf{v}}}_{{\mathcal{W}}}\\ {{\bf{q}}}_{{\mathcal{W}}{\mathcal{B}}}\cdot [\begin{array}{c}0\\ {{\boldsymbol{\omega }}}_{{\mathcal{B}}}/2\end{array}]\\ \frac{1}{m}({{\bf{q}}}_{{\mathcal{W}}{\mathcal{B}}}\odot ({{\bf{f}}}_{{\rm{p}}{\rm{r}}{\rm{o}}{\rm{p}}}+{{\bf{f}}}_{{\rm{a}}{\rm{e}}{\rm{r}}{\rm{o}}}))+{{\bf{g}}}_{{\mathcal{W}}}\\ {J}^{-1}({{\boldsymbol{\tau }}}_{{\rm{p}}{\rm{r}}{\rm{o}}{\rm{p}}}+{{\boldsymbol{\tau }}}_{{\rm{m}}{\rm{o}}{\rm{t}}}+{{\boldsymbol{\tau }}}_{{\rm{a}}{\rm{e}}{\rm{r}}{\rm{o}}}+{{\boldsymbol{\tau }}}_{{\rm{i}}{\rm{n}}{\rm{e}}{\rm{r}}})\\ \frac{1}{{k}_{{\rm{m}}{\rm{o}}{\rm{t}}}}({{\boldsymbol{\Omega }}}_{{\rm{s}}{\rm{s}}}-{\boldsymbol{\Omega }})\end{array}\right],
$$
The matrix \(B\) is called a basis for the lattice \(L(B)\). The integer \(n\) is called the dimension or rank of the lattice. If \(n = k\), then \(L(B)\) is called a full-rank lattice.
## Properties
- **Lattice Representation**: Lattices can be represented by a basis matrix \(B\). In computer science applications, the basis matrix typically has integer or rational entries and can be easily represented as an array of integers.
- **Vector Space Relation**: The definition of a lattice \(L(B) = \{B \cdot \mathbf{x} : \mathbf{x} \in \mathbb{Z}^n\}\) is similar to the definition of a vector space generated by \(B\), i.e., \(\text{span}(B) = \{B \cdot \mathbf{x} : \mathbf{x} \in \mathbb{R}^n\}\). In a vector space, you can combine the columns of \(B\) with arbitrary real coefficients, while in a lattice, only integer coefficients are allowed, resulting in a discrete set of points.
## Example
For example, consider the basis \(B = [(2, 0)^T, (1, 2)^T]\). The lattice generated by this basis is
## LaTeX Representation
$$
L(B) = \left\{ B \mathbf{x} : \mathbf{x} \in \mathbb{Z}^n \right\} = \left\{ \sum_{i=1}^n x_i \mathbf{b}_i : x_i \in \mathbb{Z} \right\}
$$
This formula represents the lattice as the set of all integer linear combinations of the columns of the basis matrix \(B\).