<<FindStatCollectionQueriesMacro>>

Definition & Example
====================

-   A (finite) **lattice** is a finite set $P$ together with a partial order $\leq$ satisfying
    -   $\leq$ is *reflexive*: $x \leq x$ for all $x \in P$,
    -   $\leq$ is *transitive*, $x \leq y \leq z$ implies $x \leq z$ for all $x,y,z \in P$,
    -   $\leq$ is *antisymmetric*, $x \leq y \Rightarrow y \not\leq x$ for $x,y \in P$ such that $x \neq y$,

    such that any two elements $x$ and $y$ have a least upper bound $x \vee y$, called join, and a greatest lower bound $x \wedge y$, called meet.

-   One often writes $a < b$ for $a \leq b$ and $a \neq b$.


-   A **cover relation** $a \prec b$ is a pair of elements $a < b$ such that there exists no $c \in P$ for which $a < c < b$ <<Reference("Wei14", "E. Weisstein", "Cover relation", "Math World (2014)")>>.

<<FindStatSmallElementsMacro>>

-   Lattices are graphically represented by their **Hasse diagram** which is the directed graph of cover relations.


-   Two lattices $(P,\leq_P)$ and $(P',\leq_{P'})$ are **isomorphic** if there exists a bijection $\pi: P\ \tilde\longrightarrow\ P'$ such that $x \leq_P y$ if and only if $\pi(x) \leq_{P'} \pi(y)$ for all $x,y \in P$.


-   This project considers **unlabelled lattices**. This is, two lattices are considered to be equal if they are isomorphic.


-   For the number of unlabelled lattices see [OEIS:A006966](https://oeis.org/A006966).

Additional information
======================

Notations
---------

-   $x,y \in P$ are called **comparable** if $x \leq y$ or $y \leq x$. A poset is called **linear**, **linearly ordered**, or **totally ordered** if any two elements are comparable.

References
==========

<<Reference>>

Sage examples
=============

{{{#!sagecell
def FiniteLattices(n):
if n <= 2:
for P in Posets(n):
if P.is_lattice():
yield LatticePoset(P).relabel()
else:
for P in Posets(n-2):
Q = P.with_bounds()
if Q.is_lattice():
yield LatticePoset(Q).relabel()

for n in [3,4,5,6]:
Ps = FiniteLattices(n)
print(n, sum(1 for P in Ps))

for P in FiniteLattices(5):
print((P.cover_relations(), P.cardinality()))
}}}

Technical information for database usage
========================================

-   A lattice is uniquely represented as a tuple `(E,n)` where `E` is the sorted list of cover relations and `n` is the number of elements. For this representation, we consider a **canonical labelling** of a poset. This is, a labelling of the elements by $\{0,1,\ldots,n-1\}$ such that any two lattices are isomorphic if and only if their canonical labellings coincide.
-   Lattices are graded by the number of elements.
-   The database contains all posets of size at most 9.
