// Example // CheckLeopoldt(x^3 - 3001*x + 2, 3); intrinsic CheckLeopoldt(f, p: prec:=8)-> Bool {} q := p; if prec gt 100 then return "Precision too high. Something is odd"; end if; g := f; f := PolynomialRing(Rationals())!f; k := NumberField(f); if not IsTotallyReal(k) then return "not totally real"; end if; if not IsNormal(k) then return "not normal"; end if; A, _, mA := AutomorphismGroup(k); s := [mA(x) : x in A]; // s contains all automorphisms assert s[1](k.1) eq k.1; // check that s[1] is the identity M := MaximalOrder(k); // Compute some units U such that has full rank. _ := ClassGroup(M: Bound := 2500); U, mU := SUnitGroup(1*Integers(k)); // Get one embedding p := Decomposition(k, p); p := p[1][1]; C, mC := Completion(k, p); C`DefaultPrecision := prec * RamificationIndex(C, PrimeRing(C)); d := Degree(k); e := Matrix(d, d, [ : i in [2..d]]); e[d,1] := 1; for i in [1..d] do for j in [2..d] do e[i,j] := s[j](e[i,1]); end for; end for; m := Matrix(d,d,[:i,j in [1..d]]); for i in [1..d] do m[d,i] := 1; end for; if IsZero(CoefficientRing(m)!Determinant(m)) then prec := 2*prec; return CheckLeopoldt(g, q: prec := prec); end if; return "true"; end intrinsic;