We introduce here the necessary definitions and results which lie behind the methods presented. Most of the content is taken from V. V. Nikulin (1979).

# Primitive embeddings in even lattices

## Nikulin's theory

Given an embedding $i\colon S\hookrightarrow T$ of non-degenerate integral integer lattices, we call $i$ *primitive* if its cokernel $T/i(S)$ is torsion free. Two primitive embeddings $i_1\colon S\hookrightarrow M_1$ and $i_2\colon S \hookrightarrow M_2$ of $S$ into two lattices $M_1$ and $M_2$ are called *isomorphic* if there exists an isometry $M_1 \to M_2$ which restricts to the identity of $S$. Moreover, if there exists an isometry between $M_1$ and $M_2$ which maps $S$ to itself (not necessarily identically), we say that $i_1$ and $i_2$ defines *isomorphic primitive sublattices* V. V. Nikulin (1979).

In his paper, V. V. Nikulin gives necessary and sufficient condition for an even integral lattice $M$ to embed primitively into an even unimodular lattice with given invariants (see Theorem 1.12.2 in V. V. Nikulin (1979)). More generally, the author also provides methods to compute primitive embeddings of any even lattice into an even lattice in a given genus (see Proposition 1.15.1 in V. V. Nikulin (1979)). In the latter proposition, it is explained how to classify such embeddings as isomorphic embeddings or as isomorphic sublattices.

Such a method can be algorithmically implemented, however it tends to be slow and inefficient in general for large rank or determinant. But, in the case where the discriminant groups are (elementary) $p$-groups, the method can be more efficient.

We provide 4 kinds of output:

- A boolean, which only returns whether there exists a primitive embedding;
- A single primitive embedding as soon as the algorithm computes one;
- A list of representatives of isomorphism classes of primitive embeddings;
- A list of representatives of isomorphism classes of primitive sublattices.

`primitive_embeddings`

— Method```
primitive_embeddings(L::ZZLat, M::ZZLat; classification::Symbol = :sublat,
check::Bool = true)
-> Bool, Vector{Tuple{ZZLat, ZZLat, ZZLat}}
```

Given an even integer lattice `L`

, which is unique in its genus, and an even integer lattice `M`

, return whether `M`

embeds primitively in `L`

.

The first input of the function is a boolean `T`

stating whether or not `M`

embeds primitively in `L`

. The second output `V`

consists on triples `(L', M', N')`

where `L'`

is isometric to `L`

, `M'`

is a primitive sublattice of `L'`

isometric to `M`

, and `N'`

is the orthogonal complement of `M'`

in `L'`

.

If `T == false`

, then `V`

will always be the empty list. If `T == true`

, then the content of `V`

actually depends on the value of the symbol `classification`

. There are 4 possibilities:

`classification = :none`

:`V`

is the empty list;`classification = :first`

:`V`

consists on the first primitive embedding found;`classification = :sublat`

:`V`

consists on representatives for all isomorphism classes of primitive embeddings of`M`

in`L`

, up to the actions of $\bar{O}(M)$ and $O(q)$ where`q`

is the discriminant group of`L`

;`classification = :emb`

:`V`

consists on representatives for all isomorphism classes of primitive sublattices of`L`

isometric to`M`

up to the action of $O(q)$ where`q`

is the discriminant group of`L`

.

If `check`

is set to true, the function determines whether `L`

is in fact unique in its genus.

**Examples**

We can use such primitive embeddings algorithm to classify embedding in unimodular lattices

```
julia> E8 = root_lattice(:E,8);
julia> A4 = root_lattice(:A,4);
julia> bool, pe = primitive_embeddings(E8, A4)
(true, Tuple{ZZLat, ZZLat, ZZLat}[(Integer lattice of rank 8 and degree 8, Integer lattice of rank 4 and degree 8, Integer lattice of rank 4 and degree 8)])
julia> pe
1-element Vector{Tuple{ZZLat, ZZLat, ZZLat}}:
(Integer lattice of rank 8 and degree 8, Integer lattice of rank 4 and degree 8, Integer lattice of rank 4 and degree 8)
julia> genus(pe[1][2]) == genus(pe[1][3])
true
```

To be understood here that there exists a unique class of embedding of the root lattice $A_4$ in the root lattice $E_8$, and the orthogonal primitive sublattice is isometric to $A_4$.

Note that the previous two functions require the first lattice of the input to be unique in its genus. Otherwise, one can specify a genus, or its invariants, as a first input:

`primitive_embeddings`

— Method```
primitive_embeddings(G::ZZGenus, M::ZZLat; classification::Symbol = :sublat)
-> Bool, Vector{Tuple{ZZLat, ZZLat, ZZLat}}
```

Given a genus symbol `G`

for even integer lattices and an even integer lattice `M`

, return whether `M`

embeds primitively in a lattice in `G`

.

The first input of the function is a boolean `T`

stating whether or not `M`

embeds primitively in a lattice in `G`

. The second output `V`

consists on triples `(L', M', N')`

where `L'`

is a lattice in `G`

, `M'`

is a sublattice of `L'`

isometric to `M`

, and `N'`

is the orthogonal complement of `M'`

in `L'`

.

If `T == false`

, then `V`

will always be the empty list. If `T == true`

, then the content of `V`

actually depends on the value of the symbol `classification`

. There are 4 possibilities:

`classification = :none`

:`V`

is the empty list;`classification = :first`

:`V`

consists on the first primitive embedding found;`classification = :sublat`

:`V`

consists on representatives for all isomorphism classes of primitive embeddings of`M`

in lattices in`G`

, up to the actions of $\bar{O}(M)$ and $O(q)$ where`q`

is the discriminant of a lattice in`G`

;`classification = :emb`

:`V`

consists on representatives for all isomorphism classes of primitive sublattices of lattices in`G`

isometric to`M`

, up to the action of $O(q)$ where`q`

is the discriminant group of a lattice in`G`

.

`primitive_embeddings`

— Method```
primitive_embeddings(q::TorQuadModule, sign::Tuple{Int, Int}, M::ZZLat;
classification::Symbol = :sublat)
-> Bool, Vector{Tuple{ZZLat, ZZLat, ZZLat}}
```

Given a tuple `sign`

of non-negative integers and a torsion quadratic module `q`

which define a genus symbol `G`

for even integer lattices, return whether the even integer lattice `M`

embeds primitively in a lattice in `G`

.

The first input of the function is a boolean `T`

stating whether or not `M`

embeds primitively in a lattice in `G`

. The second output `V`

consists on triples `(L', M', N')`

where `L'`

is a lattice in `G`

, `M'`

is a sublattice of `L'`

isometric to `M`

, and `N'`

is the orthogonal complement of `M'`

in `L'`

.

If `T == false`

, then `V`

will always be the empty list. If `T == true`

, then the content of `V`

actually depends on the value of the symbol `classification`

. There are 4 possibilities:

`classification = :none`

:`V`

is the empty list;`classification = :first`

:`V`

consists on the first primitive embedding found;`classification = :sublat`

:`V`

consists on representatives for all isomorphism classes of primitive embeddings of`M`

in lattices in`G`

, up to the actions of $\bar{O}(M)$ and $O(q)$ where`q`

is the discriminant group of a lattice in`G`

;`classification = :emb`

:`V`

consists on representatives for all isomorphism classes of primitive sublattices of lattices in`G`

isometric to`M`

, up to the action of $O(q)$ where`q`

is the discriminant group of a lattice in`G`

.

If the pair `(q, sign)`

does not define a non-empty genus for integer lattices, an error is thrown.

In order to compute such primitive embeddings of a lattice `M`

into a lattice `L`

, one first computes the possible genera for the orthogonal of `M`

in `L`

(after embedding), and for each lattice `N`

in such a genus, one computes isomorphism classes of *primitive extensions* of $M \perp N$ modulo $\bar{O}(N)$ (and $\bar{O}(M)$ in the case of classification of primitive sublattices of `L`

isometric to `M`

).

We recall that a *primitive extension* of the orthogonal direct sum of two integral integer lattices `M`

and `N`

is an overlattice `L`

of $M\perp N$ such that both `M`

and `N`

embed primitively in `L`

(via the natural embeddings $M,N \to M\perp N\subseteq L$). Such primitive extensions are obtained, and classified, by looking for *gluings* between anti-isometric subgroups of the respective discriminant groups of `M`

and `N`

. The construction of an overlattice is determined by the graph of such glue map.

## Admissible equivariant primitive extensions

The following function is an interesting tool provided by Simon Brandhorst, Tommy Hofmann (2023). Given a triple of integer lattices with isometry `((A, a), (B, b), (C, c))`

and two prime numbers `p`

and `q`

(possibly equal), if `(A, B, C)`

is `p`

-admissible, this function returns representatives of isomorphism classes of equivariant primitive extensions $(A, a)\perp (B, b)\to (D, d)$ such that the type of $(D, d^p)$ is equal to the type of $(C, c)$ (see `type(::ZZLatWithIsom)`

).

`admissible_equivariant_primitive_extensions`

— Method```
admissible_equivariant_primitive_extensions(Afa::ZZLatWithIsom,
Bfb::ZZLatWithIsom,
Cfc::ZZLatWithIsom,
p::Integer,
q::Integer = p; check::Bool = true)
-> Vector{ZZLatWithIsom}
```

Given a triple of lattices with isometry `(A, fa)`

, `(B, fb)`

and `(C, fc)`

and a prime number `p`

, such that `(A, B, C)`

is `p`

-admissible, return a set of representatives of the double coset $G_B\backslash S/G_A$ where:

- $G_A$ and $G_B$ are the respective images of the morphisms $O(A, fa) \to O(q_A, \bar{fa})$ and $O(B, fb) \to O(q_B, \bar{fb})$;
- $S$ is the set of all primitive extensions $A \perp B \subseteq C'$ with isometry $fc'$ where $p\cdot C' \subseteq A\perp B$ and such that the type of $(C', fc'^q)$ is equal to the type of
`(C, fc)`

.

If `check == true`

the input triple is checked to a `p`

-admissible triple of integral lattices (with isometry) with `fA`

and `fB`

having relatively coprime irreducible minimal polynomials and imposing that `A`

and `B`

are orthogonal if `A`

, `B`

and `C`

lie in the same ambient quadratic space.

An *equivariant primitive extension* of a pair of integer lattices with isometries $(M, f_M)$ and $(N, f_N)$ is a primitive extension of `M`

and `N`

obtained by gluing two subgroups which are respectively $\bar{f_M}$ and $\bar{f_N}$ stable along a glue map which commutes with these two actions. If such a gluing exists, then the overlattice `L`

of $M\perp N$ is equipped with an isometry $f_L$ which preserves both `M`

and `N`

, and restricts to $f_M$ and $f_N$ respectively.