\documentclass[11pt]{article}

\usepackage{amsmath,amssymb,amsthm}

\usepackage{xcolor}

%\usepackage{systeme}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}


\theoremstyle{definition}
\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{eg}[thm]{Example}
\newtheorem{ex}[thm]{Exercise}
\newtheorem{defn}[thm]{Definition}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{remark}[thm]{Remark}
\newtheorem{question}[thm]{Question}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usepackage{tikz-cd}
\tikzstyle{ball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=1.3pt]
\tikzstyle{miniball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=0.5pt]
\tikzstyle{mminiball} = [circle,shading=ball, ball color=black,
    minimum size=0.6mm,inner sep=0.1pt]
\usetikzlibrary{arrows.meta}
\tikzset{>={Latex[length=2mm,width=1.5mm]}}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\usetikzlibrary{decorations.pathmorphing}    
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{arrows.meta,calc}
\usetikzlibrary{bending}
\usetikzlibrary{decorations.markings,shapes.geometric}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\tikzset{-|-/.style={decoration={markings, mark=at position #1 with
  {\arrow{stealth}}},postaction={decorate}}}
\tikzset{movearrow/.style 2 args ={
        decoration={markings,
	  mark= at position {#1} with {\arrow{#2}} ,
        },
        postaction={decorate}
    }
}

%\usepackage{graphicx}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{enumitem}
%\setlist[enumerate]{leftmargin=*}
\setlist[enumerate]{itemsep=1pt}

%\allowdisplaybreaks

\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

%\usepackage{algorithm}
%\usepackage[noend]{algpseudocode}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\newcommand{\incid}{\mathcal{I}(P)}
\newcommand{\tL}{\widetilde{L}}
\newcommand{\tV}{\widetilde{V}}
\newcommand{\F}{\mathcal{F}}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\wt}{\mathrm{wt}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}
\DeclareMathOperator{\Div}{\mathrm{Div}}
\DeclareMathOperator{\Pic}{\mathrm{Pic}}
\DeclareMathOperator{\Jac}{\mathrm{Jac}}
\DeclareMathOperator{\cok}{\mathrm{cok}}
\DeclareMathOperator{\sgn}{\mathrm{sgn}}
\DeclareMathOperator{\outdeg}{\mathrm{outdeg}}
\DeclareMathOperator{\supp}{\mathrm{supp}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 361 lecture for Friday, Week 3}
\bigskip

\centerline{Bases for algebraic integers}
\bigskip

Recall that if $M$ is a module over a ring $R$, it may or may not be the case
that $M$ has a basis, i.e., an $R$-linearly independent spanning set. If $M$
does have a basis, we say $M$ is a \emph{free $R$-module}.  Its \emph{rank} is
then defined to be the cardinality of any basis.  (It is a fact that the notion
of \emph{rank} is well-defined.)

\begin{thm}
  Let~$K$ be a number field of degree~$n$ over~$\Q$, i.e., $[K\mathbin{:}\Q]=n$.
  Then its ring of integers $\mathfrak{O}_{K}$ is a free $\Z$-module of rank~$n$.
\end{thm}
\begin{proof}
  Recall that we have already shown that $K$ has a $\Q$-basis consisting of
  algebraic integers.  (Use the primitive element theorem to
  write~$K=\Q(\theta)=Q[\theta]$ where~$\theta$ is an algebraic integer.  Then
  $1,\theta,\theta^{2},\ldots,\theta^{n-1}$ is a $\Q$-basis.  

  We have shown that the discriminant of a $\Q$-basis for $K$ consisting of
  algebraic integers is a nonzero rational integer. Among all~$\Q$-bases
  consisting of algebraic integers, for~$K$, let $\alpha_{1},\ldots,\alpha_{n}$ be
  one such that $|\Delta[\alpha_{1},\ldots,\alpha_{n}]|$ is minimal.
  For sake of contradiction, suppose that $\alpha_{1},\ldots,\alpha_{n}$ is not
  a~$\Z$-basis for $\mathfrak{O}_{K}$.  Then there exists $\alpha\in\mathfrak{O}_{K}$
  such that
  \[
    \alpha = c_{1}\alpha_{1}+\cdots+c_{n}\alpha_{n}
  \]
  with~$c_{i}\in \Q$ but with not all $c_{i}\in\Z$.  Without loss of
  generality, suppose $c_{1}\in\Q\setminus\Z$.  Write
  $c_{1}=c+r$ where~$c=\lfloor c_{1}\rfloor$ and $0<r<1$.
  Then
  \[
    \alpha = (c+r)\alpha_{1}+c_{2}\alpha_{2}+\cdots+c_{n}\alpha_{n}.
  \]
  Next, define
  \[
    \psi_{1} := \alpha-c\alpha_{1}= r\alpha_{1}+c_{2}\alpha_{2}+\cdots+c_{n}\alpha_{n}.
  \]
  and for~$i=2,\ldots,n$, let $\psi_{i}:=\alpha_{i}$.  Then
  $\psi_{1},\ldots,\psi_{n}$ is a $\Q$-basis for $K$ consisting of algebraic
  integers (check: explain why $\psi_{1}$ an algebraic integer).  To get a contradiction, we compare the discriminants of our two
  bases.  Let $C$ denote the change of basis matrix:
  \[
    \left(\begin{array}{c}
	\psi_{1} \\
	\psi_{2} \\
	\psi_{3} \\
	\vdots \\
	\psi_{n}
    \end{array}\right)
    =
    \underbrace{  \left(\begin{array}{ccccc}
	  r & c_{2} & c_{3} & \ldots & c_{n} \\
	  0 & 1 & 0 & \ldots & 0 \\
	  0 & 0 & 1 & \ldots & 0 \\
	  \vdots & \vdots & \vdots &\ddots  & \vdots \\
	  0 & 0 & 0 &\ldots  & 1
    \end{array}\right)}_{C}
    \left(\begin{array}{c}
	\alpha_{1} \\
	\alpha_{2} \\
	\alpha_{3} \\
	\vdots \\
	\alpha_{n}
    \end{array}\right).
  \]
  We have
  \[
    |\Delta[\psi_{1},\ldots,\psi_{n}]|=|(\det
    C)^{2}\Delta[\alpha_{1},\ldots,\alpha_{n}]|
    = r^{2}|\Delta[\alpha_{1},\ldots,\alpha_{n}]|
  \]
  contradicting the minimality of $|\Delta[\alpha_{1},\ldots,\alpha_{n}]|$.  The
  result follows.
\end{proof}

We now show that all integral bases for $\mathfrak{O}_{K}$ have the same
discriminant. Suppose that $\alpha_{1},\ldots,\alpha_{n}$ and
$\beta_{1},\ldots,\beta_{n}$ are two $\Z$-bases for~$\mathfrak{O}_{K}$.  Let $C$
be the change of basis matrix from the $\alpha_{i}$ to the $\beta_{i}$, and
let~$D$ be the change of basis matrix from the $\beta_{i}$ to the~$\alpha_{i}$.
Then both~$C$ and~$D$ have integer entries (since we are talking about
$\Z$-bases), and $CD = I_n$.  So, in fact, $D=C^{-1}$.  We
have~$1-\det(I)=\det(C)\det(D)$ with $\det(C),\det(D)\in\Z$.  It follows that
$\det(C)=\pm 1$.  Hence,
\[
 \Delta[\beta_{i},\ldots,\beta_{n}]=\det(C)^{2}\Delta[\alpha_{1},\ldots,\alpha_{n}]=\Delta[\alpha_{1},\ldots,\alpha_{n}].
\]

\begin{defn}
  The \emph{discriminant} of a number field~$K$, denoted $\Delta(K)$ is the
  discriminant of any integral basis for $\mathfrak{O}_{K}$.
\end{defn}

\begin{eg}
  Let $K=\Q(\sqrt{d})$ where $d\in\Z$ and $d\neq0,1$.  We have seen that
  $1,\sqrt{d}$ is an integral basis for~$\mathfrak{O}_{K}$ if $d\neq1\bmod 4$,
  and $1,\frac{1+\sqrt{5}}{2}$ is an integral basis if $d=1\bmod 4$.  We have
  \[
    \det
    \left(\begin{array}{rr}
	1 & \sqrt{d} \\
	1 & -\sqrt{d}
    \end{array}\right)
    = -2\sqrt{d}
    \quad\text{and}\quad
    \left(\begin{array}{cc}
	1 & \frac{1+\sqrt{5}}{2} \\
	1 & \frac{1-\sqrt{5}}{2}
    \end{array}\right)
    =-\sqrt{d}.
  \]
  Therefore,
  \[
    \Delta(K)
    =
    \begin{cases}
      4d&\text{if $d\neq1\bmod 4$}\\
      d&\text{if $d=1\bmod 4$}.
    \end{cases}
  \]
\end{eg}

\begin{prop}
  Suppose that $\alpha_{1},\ldots,\alpha_{n}$ is a $\Q$-basis for $K$ consisting
  of algebraic integers.  If $\Delta[\alpha_{1},\ldots,\alpha_{n}]$ is
  square-free, then $\alpha_{1},\ldots,\alpha_{n}$ is a $\Z$-basis
  for~$\mathfrak{O}_{K}$.
\end{prop}
\begin{proof}
  Let~$\beta_{1,},\ldots,\beta_{n}$ be an integral basis for~$\mathfrak{O}_{K}$.
  Then since the~$\alpha_{i}$ are algebraic integers, there exists an $n\times n$
  matrix $C$ with integer entries such that
  \[
    \left(\begin{array}{c}
	\alpha_{1} \\
	\vdots \\
	\alpha_{n}
    \end{array}\right)
    =
    C
    \left(\begin{array}{c}
	\beta_{1} \\
	\vdots \\
	\beta_{n}
    \end{array}\right).
  \]
  It follows that
  \[
    \Delta[\alpha_{1},\ldots,\alpha_{n}]=\det(C)^{2}\Delta[\beta_{1},\ldots,\beta_{n}].
  \]
  Since the~$\alpha_{i}$ and $\beta_{i}$ are algebraic integers, these
  discriminants are rational integers, i.e., elements of~$\Z$.  Since
  $\Delta[\alpha_{1},\ldots,\alpha_{n}]$ is square-free, ~$\det(C)=\pm1$.
  Since~$C$ is an integer matrix, it follows that~$C$ is invertible over the
  integers, and hence, the $\beta_{i}$ are integer linear combinations of
  that~$\alpha_{i}$.  It follows that the $\alpha_{i}$ form a $\Z$-basis
  for~$\mathfrak{O}_{K}$.
\end{proof}
We will see an example later demonstrating that the converse of this proposition is
not true.
\end{document}
