// yz_saturation.m -- lattice part of Lemma 2.6 / Corollary 2.5 of Yu-Zhu, arXiv:2609.26862v1, as // reusable functions (used by 07_aut.m for X_{-1}; 05_ns_lattice.m has the same algorithm inline, // together with the output of explicit witnesses). // // NData(G, hidx): G = integer Gram matrix (intersection matrix) of a generating set c_1..c_m of a // sublattice M of NS(X) (NS(X) is torsion free, so M = Z^m / ker G); hidx = indices with // h = sum_{i in hidx} c_i the hyperplane class. Returns rank M, |det M| and an LLL-reduced Gram // matrix GN of N = M cap h^perp (negative definite, asserted even). NData := function(G, hidx) rk := Rank(G); H := HermiteForm(G); Bm := RowSubmatrix(H, 1, rk); ok, T := IsConsistent(G, Bm); assert ok; ok, Xc := IsConsistent(Bm, G); assert ok; GM := T*G*Transpose(T); assert Xc*GM*Transpose(Xc) eq G; hM := &+[ Xc[i] : i in hidx ]; Kn := KernelMatrix(Matrix(Integers(), rk, 1, Eltseq(GM*Transpose(Matrix(hM))))); GNp, TL := LLLGram(-(Kn*GM*Transpose(Kn)) : Delta := 0.999); GN := -GNp; assert &and[ IsEven(GN[i,i]) : i in [1..Nrows(GN)] ]; return rk, Abs(Determinant(GM)), GN; end function; // SaturationCheck(GN, b): GN an even negative definite Gram matrix, b = 2(d-2). For every prime // p | disc N and every subgroup H = of order p of N^vee/N (y = (sum c_i z_i)/p, z_i an F_p-basis // of ker(GN mod p)) decide whether H is isotropic (c^T W c = 0 mod 2p^2, W = Z GN Z^T) and, if so, // whether N_H = N + Z y contains a vector x outside N with -x^2 <= b: // (1) N_H is integral and even; an LLL-reduced basis (delta = 0.999) of N_H contains vectors // outside N, and a basis vector outside N with -x^2 <= b is a witness; // (2) otherwise all vectors of N_H with -x^2 <= b are enumerated (ShortVectors). // Isotropic subgroups of order p with p^2 not dividing disc N cannot exist (disc N_H = disc N/p^2) // and are flagged as a failure. Returns [ ] and a boolean (Lemma 2.6 criterion satisfied). SaturationCheck := function(GN, b) rN := Nrows(GN); dN := Abs(Determinant(GN)); res := []; allok := true; for fp in Factorization(dN) do p := fp[1]; Fp := GF(p); Z := ChangeRing(KernelMatrix(ChangeRing(GN, Fp)), Integers()); r := Nrows(Z); W := Z*GN*Transpose(Z); nsub := 0; niso := 0; nlll := 0; nsv := 0; for idx in [1..p^r - 1] do c := IntegerToSequence(idx, p); c cat:= [ 0 : l in [1..r - #c] ]; if [ a : a in c | a ne 0 ][1] ne 1 then continue; end if; // one generator per subgroup nsub +:= 1; v := Vector(Integers(), c); if (v*W, v) mod (2*p^2) ne 0 then continue; end if; // not isotropic niso +:= 1; if fp[2] lt 2 then allok := false; continue; end if; z := v*Z; z := Vector(Integers(), [ z[j] mod p : j in [1..rN] ]); HB := HermiteForm(VerticalJoin(p*IdentityMatrix(Integers(), rN), Matrix(Integers(), 1, rN, Eltseq(z)))); BH := RowSubmatrix(HB, 1, rN); // N_H = (rows of BH)/p GHp := BH*GN*Transpose(BH); assert &and[ e mod p^2 eq 0 : e in Eltseq(GHp) ]; GH := Matrix(Integers(), rN, rN, [ e div p^2 : e in Eltseq(GHp) ]); GL2, TL2 := LLLGram(-GH : Delta := 0.999); if exists{ i : i in [1..rN] | GL2[i,i] le b and not IsZero(ChangeRing(Vector(Integers(), Eltseq(TL2[i]))*BH, Fp)) } then nlll +:= 1; continue; end if; SV := ShortVectors(LatticeWithGram(GL2), b); if exists{ e : e in SV | not IsZero(ChangeRing(Vector(Integers(), Eltseq(Coordinates(e[1])))*TL2*BH, Fp)) } then nsv +:= 1; else allok := false; end if; end for; Append(~res, ); end for; return res, allok; end function;