"Source: Text/Ring/RngOrd.text";
"Line: 4911";
"Date: Fri Sep 26 14:51:59 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Ring/RngOrd.text, line: 4911
// Example: H39E18 ()
print "Example: H39E18";
ei := GetEchoInput();
SetEchoInput(true);
R<x> := PolynomialRing(Integers());
O := MaximalOrder(x^2-10);
C, m := ClassGroup(O);
C;
m(C.1);    
p := Decomposition(O, 31)[1][1];
p;
p @@ m;
assert IsId($1);
IsPrincipal(p);
assert $1;
p := Decomposition(O, 37)[1][1];
p @@ m;                            
IsPrincipal(p);
assert not $1;
MinkowskiBound(O);
assert $1 eq 3;
F, B := FactorBasis(O);
B;
r := Relations(O);
M := RelationMatrix(O);
[ Valuation(r[1][1], x) : x in F];
M[1];
f,g := IsPrincipal(m(C.1)^2);
f;
assert $1;
g;
ClassGroupCyclicFactorGenerators(O);                                         
K := NumberField(x^5-14*x^4+14*x^3-14*x^2+14*x-14);
MinkowskiBound(K);
assert $1 eq 21106;
BachBound(K);
assert $1 eq 7783;
GRHBound(K);
assert $1 le 259;
time C := ClassGroup(K); 
C;
assert #C eq 10;
K := NumberField(x^5-14*x^4+14*x^3-14*x^2+14*x-14);
time #ClassGroup(K : Proof := "GRH");
assert $1 eq 10;
K := NumberField(x^5-14*x^4+14*x^3-14*x^2+14*x-14);
time #ClassGroup(K : Bound := BachBound(K)); 
assert $1 eq 10;
SetEchoInput(ei);
