"Source: Text/Ring/FldNum.text";
"Line: 292";
"Date: Fri Sep 26 12:10:11 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Ring/FldNum.text, line: 292
// Example: H36E1 ()
print "Example: H36E1";
ei := GetEchoInput();
SetEchoInput(true);
R<x> := PolynomialRing(Integers());
f := x^4 - 420*x^2 + 40000;
K<y> := NumberField(f);
Degree(K);
assert Degree(K) eq 4;
K;
y^4 - 420*y^2;
assert $1 eq -40000;
assert Evaluate(DefiningPolynomial(K), y) eq 0;
z := y^5/11;
z;
R<y> := PolynomialRing(K);
f := y^2 + y + 1;
L := ext<K | f>;
L;
KL := NumberField([x^2 + x + 1, x^4 - 420*x^2 + 40000]);
KL;
LK := NumberField([x^4 - 420*x^2 + 40000, x^2 + x + 1]);
LK;
K1 := NumberField(x^3-2 : Global);
K2 := NumberField(x^3-2 : Global);
L1 := NumberField(x^3-2);
L2 := NumberField(x^3-2);
K1 eq K2;
assert $1;
K1 eq L1;
assert not $1;
L1 eq L2;
K1!K2.1;
AdjoinRoot := function(K, p: DoLinearExtension := false)
  f := CyclotomicPolynomial(p);
  f := Polynomial(K, f);
  f := Factorisation(f)[1][1];
  return ext<K|f : DoLinearExtension := DoLinearExtension>;
end function;
K := NumberField(x^2+x+1);
E1 := AdjoinRoot(K, 3);
E1;       
E2 := AdjoinRoot(K, 3 : DoLinearExtension);
E2;
Norm(E1.1);
assert $1 eq 1;
Norm(E2.1);
Norm($1);
assert $1 eq 1;
SetEchoInput(ei);
