#import "/Templates/generic.typ": latex, header
#import "@preview/ctheorems:1.1.0": *
#import "/Templates/math.typ": *
#import "/Templates/assignment.typ": *
#show: doc => header(title: "Assignment 1", name: "<NAME>", doc)
#show: latex
#show: NumberingAfter
#show: thmrules
#let col(x, clr) = text(fill: clr)[$#x$]
#let pb() = {
  pagebreak(weak: true)
}
#set page(numbering: "1")
#let bar(el) = $overline(#el)$

*Sources consulted* \
Classmates: <NAME>, <NAME>, <NAME>. \
Texts: Class Notes, Algebraic Number Theory by Milne, Elementry and Analytic Theory of Algebraic Numbers by Narkiewicz.

= Question
== Statement
Write down a monic polynomial $f in ZZ[x]$ with $sqrt(2) + sqrt(3)$ as a root.
== Solution
The polynomial is
$
f(x) = x^4 - 10x^2 + 1
$
= Question
== Statement
Let $K = QQ(sqrt(d))$ with $d != 0,1$ a square free integer, and let $frak(p)$ be a nonzero prime ideal of the ring of integers $cal(O)_k$ that does not divide $(2d)$.
+ Show that $frak(p)$ can be written in the form $(p, alpha)$, with $(p) = frak(p) sect ZZ$ and $alpha in cal(O)_k$.
+ Show that $cal(O)_k quo frak(p) tilde.eq FF_q$ where $[ cal(O)_k : frak(p) ]$ is either $p$ or $p^2$. Give an explicit criteria in terms of $p$ and $d$ for which case occurs.
== Solution
We know that $frak(p)$ is an integral domain in $K$ which is an extension of an integral domain $frak(p) sect ZZ$. Since $frak(p)$ is prime so it is of the form $(p)$ for some prime $p$.

Now we have the integral extension
$
FF_p tilde.equiv ZZ quo (p) seq cal(O)_k quo frak(p)
$
so $cal(O)_k quo frak(p)$ is an integral extension of a field and thus itself a field. But now we know that
$
cal(O)_k = cases(ZZ[sqrt(d)] : d = 2\,3 mod 4, ZZ[(1+sqrt(d))/2] : d = 1 mod 4).
$
We check the two cases separately, if $d = 2,3 mod 4$ then $cal(O)_k = ZZ[x] quo (x^2-d)$ and so
$
cal(O)_k quo (p) iso ZZ[x] quo (x^2 - d, p) iso FF_p [x] quo (x^2 - d)
$
Now if $d$ is not a square in $FF_p$ then this polynomial does not split and so $cal(O)_k quo (p)$ is a field and thus $(p)$ is maximal hence $(p) = frak(p)$ so choosing $alpha = p$ makes $(p, alpha) = (p) = frak(p)$. If $d$ is a square then $x^2 - d$ factors as $(x-sqrt(d))(x+sqrt(d))$ and thus we get
$
cal(O)_k quo (p) iso FF_p times FF_p.
$
In this case we pick $alpha$ to be any representative of $(0,1)$ or $(0,1)$ in $cal(O)_k quo (p)$ and then get $cal(O)_k quo (p,alpha)$ is a maximal ideal hence prime.

On the other hand if $d = 1 mod 4$ then $cal(O)_k = ZZ[x] quo (x^2 - x + (1 - d)/4)$, so we do a similar calculation
$
cal(O)_k quo (p) iso ZZ[x] quo (x^2 - x + (1-d) / 4, p)
iso FF_p [x] quo (x^2 - x + (1-d) / 4)
$
Now again if $d$ is a square $mod p$ then this polynomial factors as
$
(x-(1+sqrt(d)) / 2)(x-(1-sqrt(d)) / 2)
$
and if not then we get a field, and the exact same reasoning follows in both cases. We thus get a solution to both parts of the question, in the case where $d$ is not a square in $FF_p$ we pick $alpha = p$ and get $cal(O)_k quo frak(p) iso FF_(p^2)$. In the case where $d = n^2 mod p$ we have $cal(O)_k quo (p) = FF_p times FF_p$ and picking $alpha$ to be a representative of $(0,1)$ we get $cal(O)_k quo (p, alpha) = FF_p$.

= Question
== Statement
Let $K = QQ(zeta_5)$ be the number field generated by a primitive 5th root of unity $zeta_5$. Show that $K times.circle_QQ RR$ is isomorphic to $RR^4$ as an $RR$-vector space but not as an $RR$-algebra.
== Solution
Clearly $1 times.circle 1, zeta_5 times.circle 1, zeta_5^2 times.circle 1, zeta_5^3 times.circle 1$ form a basis for $K times.circle_QQ RR$ as an $RR$-vector space, so it is isomorphic to $RR^4$. Now consider the action of an element in $(a,b,c,d) in RR^4$ on $RR^4$, it is not possible that $(a,b,c,d)$ has an order of $5$ because that would mean $a^5 = b^5 = c^5 = d^5 = 1$ and that would imply that $a = b = c = d = 1$ making it order $1$. However, $zeta_5$ does have an order of $5$ as an action on $K times.circle_QQ RR$, so the two algebras cannot be isomorphic.

= Question
== Statement
Show that the ring $A = ZZ[sqrt(2)]$ is euclidean.
== Solution
We define the norm $abs(a + b sqrt(2)) = abs(a^2 - 2b^2)$, let us check that it is multiplicative.
$
abs((a + b sqrt(2))(c + d sqrt(2)))
&= abs(a c + 2 b d + (a d + b c) sqrt(2))
\ &= (a c + 2 b d)^2 - 2(a d + b c)^2
\ &= a^2 c^2 + 4 a b c d + 4 b^2 d^2 - 2 a^2 d^2 - 4a b c d - 2 b^2 c^2
\ &= a^2 c^2 + 4 b^2 d^2 - 2 a^2 d^2 - 2 b^2 c^2
$
and
$
abs(a+b sqrt(2)) abs(c + d sqrt(2))
= (a^2 - 2b^2)(c^2 - 2d^2)
= a^2 c^2 - 2b^2 c^2 - 2a^2d^2 + 4b^2 d^2
$

We check now that it is a euclidean norm, assume we are given $x,y in ZZ[sqrt(2)]$ and set $z = x/y in QQ(sqrt(2))$. We write $z = a + b sqrt(2)$ for $a,b in QQ$, then round $a,b$ to the nearest integers to get $n,m$, we then have
$
abs((n + m sqrt(2)) - (a + b sqrt(2)))
&= abs((n - a) + (m - b)sqrt(2))
\ &= abs((n-a)^2 - 2(m - b)^2)
\ &<= abs(n-a)^2 + 2 abs(m - b)^2
\ &<= 1 / 4 + 2 / 4 = 3 / 4
$
Now set $q = n + m sqrt(2)$ and compute
$
abs(x - q y) = abs(y(x/y- q)) = abs(y) abs(x/y - q) = abs(y) abs(z - q) <= 3 / 4 abs(y)
$
so indeed this norm is euclidean.

= Question
== Statement
Show that the units of $A = ZZ[sqrt(2)]$ are given by $plus.minus (1 + sqrt(2))^n, n in ZZ$.
== Solution
We use again the norm we had before and note that if $a + b sqrt(2)$ is a unit then it must have norm 1. Now solving for that we get
$
a^2 - 2b^2 = plus.minus 1
$
which we need to analyze the solutions of. We will do this by an infinite descent method, it is clear that for $a = 1$ the only solutions are $b=-1,0,1$, so we assume that $abs(a) > 1$. We can also assume WLOG that $a$ and $b$ are positive, as otherwise we can replace them with the conjugate to force that to be the case. We now multiply $a + b sqrt(2)$ by $1 - sqrt(2)$, expanding this we get
$
(a + b sqrt(2)) (1 - sqrt(2)) = (a - 2b) + (b - a) sqrt(2).
$
We now claim that $abs(a - 2b) < abs(a)$, if this is not the case then we must have $abs(b) >= abs(a)$, but since $a^2 - 2b^2 = plus.minus 1$ then
$
a^2 + 1 >= 2 b^2 >= 2 a^2
$
which is not possible if $abs(a) > 1$. We thus have that after this multiplication $abs(a)$ became strictly smaller, so we can repeat this until we get $abs(a) = 1$. Thus we get
$
(a+b sqrt(2)) (1 - sqrt(2))^n = -1,1
$
which when rearranged proves exactly the result.

= Question
== Statement
Show that the discriminant $Delta_k$ of a number field $K$ is always $0,1 mod 4$.
== Solution
We know that $Delta_k$ can be written as $det (rho_i alpha_j)^2$ where $rho_i$ are embeddings of $K$ into $CC$. Now a determinant can be written as a sum
$
det (rho_i alpha_j)
= sum_(sigma in S_n) op("sgn")(sigma) product_(i=1)^n rho_i alpha_(sigma(j))
$
now we can split this sum into the even positive terms and negative terms, we call $A$ the sum of positive terms and $-B$ the sum of negative terms. Then we can write
$
Delta_k = (A-B)^2 = (A + B)^2 - 4 A B
$
Now the action of an element $phi$ in the Galois group permutes the $rho_i$'s either in an even or odd fashion, if it is even then it fixes $A$ and $B$, otherwise it swaps them. Either way $A + B$ and $A B$ are fixed. Now $A + B$ is then fixed by the Galois group and is thus a rational number, but it is also by a sum of integral elements and thus integral, so we know it is an integer, similarly for $A B$. We thus have that $Delta_k mod 4 = (A + B)^2 mod 4 = 0,1 mod 4$.

= Question
== Statement
Show that the ideals in the ring $ZZ[sqrt(-3)]$ do not necessarily factor uniquely into products of prime ideals.
== Solution
Consider the ideal $(2, 1 + sqrt(-3))$, we have
$
(2, 1 + sqrt(-3)) (2,1 + sqrt(-3))
&= (4,2+2sqrt(-3),-2+2sqrt(-3))
= (4, 2 + 2 sqrt(-3))
\ &= (2)(2, 1 + sqrt(-3)).
$
Thus if both $(2, 1 + sqrt(-3))$ and $(2)$ are uniquely factored into prime ideals then $(2, 1 + sqrt(-3))^2$ definitely cannot be.

= Question
== Statement
Let $K = QQ(2^(1 slash 3))$. Show that $O_K$ is monogenic (with generator $theta = 2^(1/3)$).
== Solution
#let al = $2^(1 slash 3)$
#let al2 = $2^(2 slash 3)$
First we compute the discriminant, it turns out to be
$
det mat(3,0,0;0,0,6;0,6,0) = - 108.
$
Now assume that $2 divides [ O_K : ZZ[2^(1 slash 3)]]$, then we have
$
(a_0 + a_1 al + a_2 al2) / 2 in O_K
$
for some $a_0, a_1, a_2$ of which at least one does not divide 2, if it is $a_0$ then we have
$
al2 (a_0 + a_1 al + a_2 al2) / 2 = a_0 / 2 al2 + (a_1 + a_2 al)
$
so we have $a_0 al2 / 2 in O_K$. If it is instead $a_1$ or $a_2$ that does not divide $2$ then a similar calculation shows that $a_1 al2 / 2$ or $a_2 al2 / 2$ are in $O_K$, we shall assume WLOG it is $a_0$. We thus have
$
8 N_(K quo QQ) (a_0 al2 / 2) = N_(K quo QQ) (a_0 al2) = a_0^3 N_(K quo QQ) (
  al
)^2
$
But we know that $N_(K quo QQ) (al)$ is equal (up to a sign) to the constant term in the minimal polynomial of $al$ which is $2$. So we get
$
2 N_(K quo QQ) (a_0 al2 / 2) = a_0^3
$
and so $2$ does infact divide $a_0$, contradicting the choice of $a_0$, proving that $2 divides.not [O_k | ZZ[al]]$.

We now replace the minimal polynomial $f(x) = x^3 - 2$ with $f(x+2) = x^3 + 6x^2 + 12 x + 6$. Now the roots of this polynomial in the algebraic closure have all been shifted, but since we have the formula $product_(i,j) (theta_i - theta_j)^2$ for the descriminant where $theta_i$ are the roots, then we know that the discriminant has not changed. Now assume that $3 divides [O_K : ZZ[al]]$, then we have that
$
(b_0 + b_1 (al - 2) + b_2 (al - 2)^2) / 3 in O_k
$
for some $b_0,b_1,b_2$ such that at least one is not divisible by $3$. By the exact same argument as before we have for some $b_i$ that is not divisible by 3
$
27 N_(K quo QQ) (b_i ((al - 2)^2) / 3)
= N_(K quo QQ) (b_i (al - 2)^2)
= b_i^3 (N_(K quo QQ) (al - 2))^2
$
and again we know that $N_(K quo QQ) (al - 2) = 6$ up to a sign. This gives us
$
3 N_(K quo QQ) (b_i ((al - 2)^2) / 3) = 4 b_i^3
$
and so $b_i$ is divisible by 3. This shows that $3 divides.not [O_k : ZZ[al]]$, so since $[O_k : ZZ[al]] divides 108$ this shows that $[O_k : ZZ[al]] = 1$. Hence $O_k = ZZ[al]$ so $O_k$ is monogenic.

#counter(heading).step()
= Question
== Statement
Consider $O_K$ for $K = QQ[theta]$ where $theta$ is a root of $f(X) = X^3 - X - 4$, is it monogenic? Explain.
== Solution
We compute the discriminant, to do so we need to get the minimal polynomial for $theta^2,theta^3$ and $theta^4$. For $theta^2$ we get
$
theta^4 = theta(theta + 4) = theta^2 + 4 theta\
theta^6 = (theta + 4)^2 = theta^2 + 8 theta + 16
$
so
$
(theta^2)^3 - 2 (theta^2)^2 + theta^2 - 16 = 0
$
for $theta^3$ we get
$
theta^3 = theta + 4 \
theta^6 = theta^2 + 8 theta + 16 \
theta^9 = (theta + 4)^3 = theta^3 + 12 theta^2 + 48 theta + 64
= 12 theta^2 + 49 theta + 68
$
so
$
(theta^3)^3 - 12 (theta^3)^2 = -47 theta - 124\
(theta^3)^3 - 12 (theta^3)^2 + 47 (theta^3) = 64.
$
Finally for $theta^4$ we have
$
theta^4 = theta^2 + 4 theta\
theta^8 = (theta^2 + 4 theta)^2 = theta^4 + 8 theta^3 + 16 theta^2
= theta^2 + 4 theta + 8 theta + 32 + 16 theta^2
= 17 theta^2 + 12 theta + 32\
theta^12 = (theta + 4)^4 = theta^4 + 16 theta^3 + 96 theta^2 + 256 theta + 256
= 97 theta^2 + 276 theta + 320
$
so we get
$
(theta^4)^3 - 2 (theta^4)^2 - 63 (theta^4) - 256 = 0.
$

Now the trace is equal to the negative of second coefficient in the minimal polynomial, so we we get $tr(theta) = 0, tr(theta^2) = 2, tr(theta^3) = 12, tr(theta^4) = 2$. Plugging this into a matrix gives us

Now I claim that $ZZ[(theta+theta^2)/2] seq O_K$, first note that if $alpha = (theta + theta^2)/2$ then
$
alpha^2 = (2 theta^2 + 6 theta + 8) / 4\
alpha^3 = 1 / 8 (2 theta^2 + 6 theta + 8)(theta + theta^2)
= 1 / 8 (2 theta^4 + 2 theta^3 + 6 theta^3 + 6 theta^2 + 8theta^2 + 8 theta)
\ = 1 / 8 (2 theta^2 + 8 theta + 8 theta + 32 + 14theta^2 + 8 theta) = 1 / 8 (
  16theta^2 + 24 theta + 32
) = 2 theta^2 + 3 theta + 4.
$
Thus we have that $alpha$ is a root of
$
X^3 - X^2 - 3 X - 2 = 0
$
and thus clearly in $O_K$. Now $theta in ZZ[alpha]$ because
$
((theta+theta^2) / 2)^2
- (theta + theta^2) / 2
= (theta^4 + 2 theta^3 + theta^2) / 4 - (theta + theta^2) / 2
\ = (theta^2 + 4theta + 2theta + 8 + theta^2) / 4 - (2theta + 2theta^2) / 4
= (4theta + 8) / 4
= theta + 2
$
so we can consider the discriminant of $1,theta,alpha$. We have
$
tr(theta) = 0, \
tr(alpha) = (tr(theta^2) + tr(theta)) / 2 = 1,\
tr(theta^2) = 2,\
tr(alpha^2) = (2 tr(theta^2) + 6 tr(theta) + tr(8)) / 4 = (4 + 0 +24) / 4 = 7, \
tr(theta alpha) = (tr(theta^3 + theta^2)) / 2
= (tr(theta + 4 + theta^2)) / 2
= (2 + 12) / 2 = 7.
$
This gives us
$
Delta(1,theta,alpha) = det mat(3,0,1;0,2,7;1,7,7) = -107
$
which is prime and thus square free and thus equal to $Delta_K$, meaning that $O_K = ZZ[alpha]$ is monogenic.

