// This function takes as input // a ternary lattice L1 and a lattice L2 // and determines if L2 has a sublattice isometric // to L1. It is used by univquats5.txt to enumerate // odd universal quaternaries that do not represent // any universal ternary. function IsEmbeddable(L1,L2); ret := false; done := false; D1 := Determinant(L1); ret2 := []; if done eq false then v1 := L1.1; v2 := L1.2; v3 := L1.3; // Find all subsets {w1, w2, w3} of // L2 so that N(v1) = N(w1), N(v2) = N(w2) and // N(v3) = N(w3) S1 := ShortVectors(L2,InnerProduct(v1,v1),InnerProduct(v1,v1)); S2 := ShortVectors(L2,InnerProduct(v2,v2),InnerProduct(v2,v2)); S3 := ShortVectors(L2,InnerProduct(v3,v3),InnerProduct(v3,v3)); T := [ {w1[1], w2[1], w3[1]} : w1 in S1, w2 in S2, w3 in S3 ]; //printf "There are %o possibilities to try.\n",#T; n := 1; while (n le #T and done eq false) do L := sub; if Rank(L) eq 3 and Determinant(L) eq D1 then if IsIsometric(L,L1) then Append(~ret2,L); done := true; ret := true; end if; end if; n := n + 1; end while; end if; return ret, ret2; end function;