In mathematics, a lattice is a discrete subgroup of Euclidean space that spans the space. Lattices can also be defined in other mathematical contexts, such as in group theory or cryptography. In physics, lattices are often used to model the structure of crystals, where the lattice points represent the positions of atoms or molecules. Lattice theory is the branch of mathematics that studies lattices and their properties, including order theory, algebraic structures, and geometry. Lattices have applications in fields such as computer science, coding theory, and number theory.