% The LaTeX below is mostly computer-generated (for reasons of speed); don't expect it to be very readable. Sorry.

\documentclass[paper=a4, fontsize=12pt]{scrartcl}%
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{mathrsfs}
\usepackage{sectsty}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{framed}
\usepackage{ifthen}
\usepackage{lastpage}
\usepackage{mathdots}
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[height=10in,a4paper,hmargin={1in,0.8in}]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}%
\setcounter{MaxMatrixCols}{30}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Thursday, May 09, 2019 19:19:28}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\allsectionsfont{\centering \normalfont\scshape}
\setlength\parindent{20pt}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\DD}{{\mathbb{D}}}
\newcommand{\PP}{\mathbb{P}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\LL}{\mathbb{L}}
\newcommand{\MM}{\mathbb{M}}
\newcommand{\FF}{\mathbb{F}}
\newcommand{\Z}[1]{\mathbb{Z}/#1\mathbb{Z}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\id}{\operatorname{id}}
\newcommand{\op}{\operatorname{op}}
\newcommand{\tildot}{\left. \widetilde{\cdot} \right.}
\newcommand{\lcm}{\operatorname{lcm}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
\newcommand{\mapeq}[1]{\underset{#1}{\equiv}}
\newcommand{\eps}{\varepsilon}
\newcommand{\N}{\operatorname{N}}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\newcommand{\nnn}{\nonumber\\}
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{question}[theorem]{Question}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\newcommand{\myname}{Darij Grinberg}
\newcommand{\myid}{00000000}
\newcommand{\mymail}{dgrinber@umn.edu}
\newcommand{\psetnumber}{6}
\ihead{Solutions to homework set \#\psetnumber}
\ohead{page \thepage\ of \pageref{LastPage}}
\ifoot{\myname, \myid}
\ofoot{\mymail}
\begin{document}

\title{ \normalfont {\normalsize \textsc{University of Minnesota, School of
Mathematics} }\\[25pt] \rule{\linewidth}{0.5pt} \\[0.4cm] {\huge Math 4281: Introduction to Modern Algebra, }\\Spring 2019: Homework 6\\\rule{\linewidth}{2pt} \\[0.5cm] }
\author{Darij Grinberg}
\maketitle

%----------------------------------------------------------------------------------------
%	EXERCISE 1
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 1: The opposite ring}

Let $\mathbb{K}$ be a ring. We define a new binary operation $\left.
\widetilde{\cdot} \right.  $ on $\mathbb{K}$ by setting
\[
a \left.  \widetilde{\cdot} \right.  b = ba \qquad\text{for all } a, b
\in\mathbb{K} .
\]
(Thus, $\left.  \widetilde{\cdot} \right.  $ is the multiplication of
$\mathbb{K}$, but with the arguments switched.)

\begin{enumerate}
\item[\textbf{(a)}] Prove that the set $\mathbb{K}$, equipped with the
addition $+$, the multiplication $\left.  \widetilde{\cdot} \right.  $, the
zero $0_{\mathbb{K}}$ and the unity $1_{\mathbb{K}}$, is a ring.
\end{enumerate}

\noindent This new ring is called the \textit{opposite ring} of $\mathbb{K}$,
and is denoted by $\mathbb{K}^{\operatorname{op}}$.

Note that the \textbf{sets} $\mathbb{K}$ and $\mathbb{K}^{\operatorname{op}}$
are identical (so a map from $\mathbb{K}$ to $\mathbb{K}$ is the same as a map
from $\mathbb{K}$ to $\mathbb{K}^{\operatorname{op}}$); but the \textbf{rings}
$\mathbb{K}$ and $\mathbb{K}^{\operatorname{op}}$ are generally not the same
(so a ring homomorphism from $\mathbb{K}$ to $\mathbb{K}$ is not the same as a
ring homomorphism from $\mathbb{K}$ to $\mathbb{K}^{\operatorname{op}}$).

\begin{enumerate}
\item[\textbf{(b)}] Prove that the identity map $\operatorname{id} :
\mathbb{K} \to\mathbb{K}$ is a ring isomorphism from $\mathbb{K}$ to
$\mathbb{K}^{\operatorname{op}}$ if and only if $\mathbb{K}$ is commutative.

\item[\textbf{(c)}] Now, assume that $\mathbb{K}$ is the matrix ring
$\mathbb{L}^{n \times n}$ for some commutative ring $\mathbb{L}$ and some $n
\in\mathbb{N}$. Prove that the map
\[
\mathbb{K} \to\mathbb{K}^{\operatorname{op}}, \qquad A \mapsto A^{T}
\]
(where $A^{T}$, as usual, denotes the transpose of a matrix $A$) is a ring isomorphism.
\end{enumerate}

[\textbf{Hint:} In \textbf{(a)}, you only have to check the ring axioms that
have to do with multiplication. Similarly, in \textbf{(b)}, you are free to
check the one axiom relating to multiplication only. In \textbf{(c)}, you can
use \cite[Exercise 6.5]{detnotes} without proof.]

\subsection{Remark}

This exercise gives some examples of rings $\mathbb{K}$ that are isomorphic to
their opposite rings $\mathbb{K}^{\operatorname{op}}$. See
\url{https://mathoverflow.net/questions/64370/} for examples of rings that are not.

\subsection{Solution}

We shall follow the PEMDAS convention for the order of operations, treating
the new multiplication $\left.  \widetilde{\cdot}\right.  $ operation as a
multiplicative operation. Thus, the expression \textquotedblleft$a\left.
\widetilde{\cdot}\right.  b+c\left.  \widetilde{\cdot}\right.  d$%
\textquotedblright\ will mean \textquotedblleft$\left(  a\left.
\widetilde{\cdot}\right.  b\right)  +\left(  c\left.  \widetilde{\cdot
}\right.  d\right)  $\textquotedblright\ rather than \textquotedblleft%
$a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  \left.
\widetilde{\cdot}\right.  d$\textquotedblright.

We are in the slightly confusing situation of having two different
\textquotedblleft multiplications\textquotedblright\ on one and the same set
$\mathbb{K}$: the original multiplication $\cdot$ of the ring $\mathbb{K}$,
and the new multiplication $\left.  \widetilde{\cdot}\right.  $ of the ring
$\mathbb{K}^{\operatorname*{op}}$ (although we still have not shown that
$\mathbb{K}^{\operatorname*{op}}$ is actually a ring). Let us agree that if
$a,b\in\mathbb{K}$, then the notation \textquotedblleft$ab$\textquotedblright%
\ shall always mean \textquotedblleft$a\cdot b$\textquotedblright\ (that is,
the image of the pair $\left(  a,b\right)  $ under the original multiplication
$\cdot$, not under the new multiplication $\left.  \widetilde{\cdot}\right.  $).

The original ring $\mathbb{K}$ satisfies all eight ring axioms (since it is a ring).

\bigskip

\textbf{(a)} Clearly, the addition $+$ and the multiplication $\left.
\widetilde{\cdot}\right.  $ are binary operations on $\mathbb{K}$, and the
elements $0_{\mathbb{K}}$ and $1_{\mathbb{K}}$ indeed belong to $\mathbb{K}$.
It remains to prove that these two operations and these two elements make
$\mathbb{K}$ into a ring. In order to do so, we need to verify the ring
axioms. These axioms are the following:

\begin{itemize}
\item \textbf{Commutativity of addition:} We have $a+b=b+a$ for all
$a,b\in\mathbb{K}$.

\item \textbf{Associativity of addition:} We have $a+\left(  b+c\right)
=\left(  a+b\right)  +c$ for all $a,b,c\in\mathbb{K}$.

\item \textbf{Neutrality of zero:} We have $a+0_{\mathbb{K}}=0_{\mathbb{K}%
}+a=a$ for all $a\in\mathbb{K}$.

\item \textbf{Existence of additive inverses:} For any $a\in\mathbb{K}$, there
exists an element $a^{\prime}\in\mathbb{K}$ such that $a+a^{\prime}=a^{\prime
}+a=0_{\mathbb{K}}$.

\item \textbf{Associativity of multiplication:} We have $a\left.
\widetilde{\cdot}\right.  \left(  b\left.  \widetilde{\cdot}\right.  c\right)
=\left(  a\left.  \widetilde{\cdot}\right.  b\right)  \left.  \widetilde{\cdot
}\right.  c$ for all $a,b,c\in\mathbb{K}$. (Of course, we \textbf{cannot} use
\textquotedblleft$ab$\textquotedblright\ as an abbreviation for
\textquotedblleft$a\left.  \widetilde{\cdot}\right.  b$\textquotedblright,
since \textquotedblleft$ab$\textquotedblright\ already stands for the
different product $a\cdot b$.)

\item \textbf{Neutrality of one:} We have $a\left.  \widetilde{\cdot}\right.
1_{\mathbb{K}}=1_{\mathbb{K}}\left.  \widetilde{\cdot}\right.  a=a$ for all
$a\in\mathbb{K}$.

\item \textbf{Annihilation:} We have $a\left.  \widetilde{\cdot}\right.
0_{\mathbb{K}}=0_{\mathbb{K}}\left.  \widetilde{\cdot}\right.  a=0_{\mathbb{K}%
}$ for all $a\in\mathbb{K}$.

\item \textbf{Distributivity:} We have%
\[
a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =a\left.
\widetilde{\cdot}\right.  b+a\left.  \widetilde{\cdot}\right.
c\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(  a+b\right)  \left.
\widetilde{\cdot}\right.  c=a\left.  \widetilde{\cdot}\right.  c+b\left.
\widetilde{\cdot}\right.  c
\]
for all $a,b,c\in\mathbb{K}$.
\end{itemize}

The first four of these eight axioms do not involve the new multiplication
$\left.  \widetilde{\cdot}\right.  $. Thus, they say exactly the same thing as
the corresponding axioms for the original ring $\mathbb{K}$ (with the original
operations $+$ and $\cdot$). Hence, they are satisfied (since the
corresponding axioms for the original ring $\mathbb{K}$ are satisfied). It
thus remains to prove that the remaining four axioms are satisfied. Let us
check this:

[\textit{Proof of the \textquotedblleft Associativity of
multiplication\textquotedblright\ axiom:} Let $a,b,c\in\mathbb{K}$. We must
prove that $a\left.  \widetilde{\cdot}\right.  \left(  b\left.
\widetilde{\cdot}\right.  c\right)  =\left(  a\left.  \widetilde{\cdot
}\right.  b\right)  \left.  \widetilde{\cdot}\right.  c$.

The definition of the operation $\left.  \widetilde{\cdot}\right.  $ yields
$b\left.  \widetilde{\cdot}\right.  c=cb$ and $a\left.  \widetilde{\cdot
}\right.  b=ba$ and%
\begin{equation}
a\left.  \widetilde{\cdot}\right.  \left(  b\left.  \widetilde{\cdot}\right.
c\right)  =\underbrace{\left(  b\left.  \widetilde{\cdot}\right.  c\right)
}_{=cb}a=\left(  cb\right)  a \label{sol.ring.op.a.ass.1}%
\end{equation}
and%
\begin{equation}
\left(  a\left.  \widetilde{\cdot}\right.  b\right)  \left.  \widetilde{\cdot
}\right.  c=c\underbrace{\left(  a\left.  \widetilde{\cdot}\right.  b\right)
}_{=ba}=c\left(  ba\right)  . \label{sol.ring.op.a.ass.2}%
\end{equation}
But the original ring $\mathbb{K}$ satisfies the \textquotedblleft
Associativity of multiplication\textquotedblright\ axiom (since it is a ring);
thus, $\left(  cb\right)  a=c\left(  ba\right)  $. In other words, the right
hand sides of the two equalities \eqref{sol.ring.op.a.ass.1} and
\eqref{sol.ring.op.a.ass.2} are equal. Thus, their left hand sides are also
equal. In other words, $a\left.  \widetilde{\cdot}\right.  \left(  b\left.
\widetilde{\cdot}\right.  c\right)  =\left(  a\left.  \widetilde{\cdot
}\right.  b\right)  \left.  \widetilde{\cdot}\right.  c$. Thus, the
\textquotedblleft Associativity of multiplication\textquotedblright\ axiom is proven.]

[\textit{Proof of the \textquotedblleft Neutrality of one\textquotedblright%
\ axiom:} Let $a\in\mathbb{K}$. We must prove that $a\left.  \widetilde{\cdot
}\right.  1_{\mathbb{K}}=1_{\mathbb{K}}\left.  \widetilde{\cdot}\right.  a=a$.

But the original ring $\mathbb{K}$ satisfies the \textquotedblleft Neutrality
of one\textquotedblright\ axiom (since it is a ring); thus, $a1_{\mathbb{K}%
}=1_{\mathbb{K}}a=a$.

The definition of the operation $\left.  \widetilde{\cdot}\right.  $ yields
$a\left.  \widetilde{\cdot}\right.  1_{\mathbb{K}}=1_{\mathbb{K}}a=a$ and
$1_{\mathbb{K}}\left.  \widetilde{\cdot}\right.  a=a1_{\mathbb{K}}=a$.
Combining these two equalities, we find $a\left.  \widetilde{\cdot}\right.
1_{\mathbb{K}}=1_{\mathbb{K}}\left.  \widetilde{\cdot}\right.  a=a$. Thus, the
\textquotedblleft Neutrality of one\textquotedblright\ axiom is proven.]

[\textit{Proof of the \textquotedblleft Annihilation\textquotedblright%
\ axiom:} Let $a\in\mathbb{K}$. We must prove that $a\left.  \widetilde{\cdot
}\right.  0_{\mathbb{K}}=0_{\mathbb{K}}\left.  \widetilde{\cdot}\right.
a=0_{\mathbb{K}}$.

But the original ring $\mathbb{K}$ satisfies the \textquotedblleft
Annihilation\textquotedblright\ axiom (since it is a ring); thus,
$a0_{\mathbb{K}}=0_{\mathbb{K}}a=0_{\mathbb{K}}$.

The definition of the operation $\left.  \widetilde{\cdot}\right.  $ yields
$a\left.  \widetilde{\cdot}\right.  0_{\mathbb{K}}=0_{\mathbb{K}%
}a=0_{\mathbb{K}}$ and $0_{\mathbb{K}}\left.  \widetilde{\cdot}\right.
a=a0_{\mathbb{K}}=0_{\mathbb{K}}$. Combining these two equalities, we find
$a\left.  \widetilde{\cdot}\right.  0_{\mathbb{K}}=0_{\mathbb{K}}\left.
\widetilde{\cdot}\right.  a=0_{\mathbb{K}}$. Thus, the \textquotedblleft
Annihilation\textquotedblright\ axiom is proven.]

[\textit{Proof of the \textquotedblleft Distributivity\textquotedblright%
\ axiom:} Let $a,b,c\in\mathbb{K}$. We must prove that%
\[
a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =a\left.
\widetilde{\cdot}\right.  b+a\left.  \widetilde{\cdot}\right.
c\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(  a+b\right)  \left.
\widetilde{\cdot}\right.  c=a\left.  \widetilde{\cdot}\right.  c+b\left.
\widetilde{\cdot}\right.  c.
\]

But the original ring $\mathbb{K}$ satisfies the \textquotedblleft
Distributivity\textquotedblright\ axiom (since it is a ring); thus,%
\[
c\left(  a+b\right)  =ca+cb\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left(  b+c\right)  a=ba+ca.
\]

The definition of the operation $\left.  \widetilde{\cdot}\right.  $ yields
$a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =\left(  b+c\right)
a$ and $a\left.  \widetilde{\cdot}\right.  b=ba$ and $a\left.
\widetilde{\cdot}\right.  c=ca$. Thus,%
\[
a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =\left(  b+c\right)
a=ba+ca.
\]
Comparing this with $\underbrace{a\left.  \widetilde{\cdot}\right.  b}%
_{=ba}+\underbrace{a\left.  \widetilde{\cdot}\right.  c}_{=ca}=ba+ca$, we
obtain $a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =a\left.
\widetilde{\cdot}\right.  b+a\left.  \widetilde{\cdot}\right.  c$.

The definition of the operation $\left.  \widetilde{\cdot}\right.  $ yields
$\left(  a+b\right)  \left.  \widetilde{\cdot}\right.  c=c\left(  a+b\right)
$ and $a\left.  \widetilde{\cdot}\right.  c=ca$ and $b\left.  \widetilde{\cdot
}\right.  c=cb$. Thus,%
\[
\left(  a+b\right)  \left.  \widetilde{\cdot}\right.  c=c\left(  a+b\right)
=ca+cb.
\]
Comparing this with $\underbrace{a\left.  \widetilde{\cdot}\right.  c}%
_{=ca}+\underbrace{b\left.  \widetilde{\cdot}\right.  c}_{=cb}=ca+cb$, we
obtain $\left(  a+b\right)  \left.  \widetilde{\cdot}\right.  c=a\left.
\widetilde{\cdot}\right.  c+b\left.  \widetilde{\cdot}\right.  c$.

Thus, we have proven the equalities%
\[
a\left.  \widetilde{\cdot}\right.  \left(  b+c\right)  =a\left.
\widetilde{\cdot}\right.  b+a\left.  \widetilde{\cdot}\right.
c\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(  a+b\right)  \left.
\widetilde{\cdot}\right.  c=a\left.  \widetilde{\cdot}\right.  c+b\left.
\widetilde{\cdot}\right.  c.
\]
Hence, the \textquotedblleft Associativity of multiplication\textquotedblright%
\ axiom is proven.]

We have now shown that the set $\mathbb{K}$, equipped with the addition $+$,
the multiplication $\left.  \widetilde{\cdot}\right.  $, the zero
$0_{\mathbb{K}}$ and the unity $1_{\mathbb{K}}$, satisfies all the eight ring
axioms. Hence, it is a ring. This solves part \textbf{(a)} of the problem.

\bigskip

\textbf{(b)} $\Longrightarrow:$ Assume that $\operatorname{id}:\mathbb{K}%
\rightarrow\mathbb{K}$ is a ring isomorphism from $\mathbb{K}$ to
$\mathbb{K}^{\operatorname{op}}$. We must prove that $\mathbb{K}$ is commutative.

We have assumed that $\operatorname*{id}$ is a ring isomorphism from
$\mathbb{K}$ to $\mathbb{K}^{\operatorname{op}}$. Thus, in particular,
$\operatorname*{id}$ is a ring homomorphism from $\mathbb{K}$ to
$\mathbb{K}^{\operatorname{op}}$ (since any ring isomorphism must be a ring homomorphism).

Recall that if $\mathbb{U}$ and $\mathbb{V}$ are two rings, and if $f$ is a
ring homomorphism from $\mathbb{U}$ to $\mathbb{V}$, then%
\begin{equation}
f\left(  a\cdot b\right)  =f\left(  a\right)  \cdot f\left(  b\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{U}.
\label{sol.ring.op.b.fwd.1}%
\end{equation}
(Indeed, this is one of the four axioms in our definition of a ring
homomorphism.) But keep in mind that the two \textquotedblleft$\cdot
$\textquotedblright\ signs in the equality \eqref{sol.ring.op.b.fwd.1} have
different meanings: The \textquotedblleft$\cdot$\textquotedblright\ sign on
the left hand side stands for the multiplication of the ring $\mathbb{U}$,
whereas the \textquotedblleft$\cdot$\textquotedblright\ sign on the right hand
side stands for the multiplication of the ring $\mathbb{V}$. Thus,
\eqref{sol.ring.op.b.fwd.1} (applied to $\mathbb{U}=\mathbb{K}$,
$\mathbb{V}=\mathbb{K}^{\operatorname*{op}}$ and $f=\operatorname*{id}$)
yields%
\begin{equation}
\operatorname*{id}\left(  a\cdot b\right)  =\operatorname*{id}\left(
a\right)  \left.  \widetilde{\cdot}\right.  \operatorname*{id}\left(
b\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{K}
\label{sol.ring.op.b.fwd.2}%
\end{equation}
(since $\operatorname*{id}$ is a ring homomorphism from $\mathbb{K}$ to
$\mathbb{K}^{\operatorname{op}}$, and since the multiplication of the ring
$\mathbb{K}$ is denoted by \textquotedblleft$\cdot$\textquotedblright\ whereas
the multiplication of the ring $\mathbb{K}^{\operatorname*{op}}$ is denoted by
\textquotedblleft$\left.  \widetilde{\cdot}\right.  $\textquotedblright).

Now, if $a,b\in\mathbb{K}$, then%
\begin{align*}
ab  &  =a\cdot b=\operatorname*{id}\left(  a\cdot b\right)
=\underbrace{\operatorname*{id}\left(  a\right)  }_{=a}\left.
\widetilde{\cdot}\right.  \underbrace{\operatorname*{id}\left(  b\right)
}_{=b}\qquad\left(  \text{by \eqref{sol.ring.op.b.fwd.2}}\right) \\
&  =a\left.  \widetilde{\cdot}\right.  b=ba\qquad\left(  \text{by the
definition of the operation }\left.  \widetilde{\cdot}\right.  \right)  .
\end{align*}
In other words, the ring $\mathbb{K}$ satisfies the \textquotedblleft
Commutativity of multiplication\textquotedblright\ axiom. In other words, the
ring $\mathbb{K}$ is commutative. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of part \textbf{(b)}.

$\Longleftarrow:$ Assume that $\mathbb{K}$ is commutative. We must prove that
$\operatorname{id}:\mathbb{K}\rightarrow\mathbb{K}$ is a ring isomorphism from
$\mathbb{K}$ to $\mathbb{K}^{\operatorname{op}}$.

If $a,b\in\mathbb{K}$, then%
\begin{align*}
a\left.  \widetilde{\cdot}\right.  b  &  =ba\qquad\left(  \text{by the
definition of the operation }\left.  \widetilde{\cdot}\right.  \right) \\
&  =ab\qquad\left(  \text{since the ring }\mathbb{K}\text{ is commutative}%
\right) \\
&  =a\cdot b.
\end{align*}
Thus, the binary operation $\left.  \widetilde{\cdot}\right.  $ is identical
with the binary operation $\cdot$.

But the only difference between the rings $\mathbb{K}$ and $\mathbb{K}%
^{\operatorname*{op}}$ is that $\mathbb{K}^{\operatorname*{op}}$ has the
multiplication $\left.  \widetilde{\cdot}\right.  $ while $\mathbb{K}$ has the
multiplication $\cdot$. (All the remaining structure of $\mathbb{K}$ and
$\mathbb{K}^{\operatorname*{op}}$ is the same.) But since we have shown that
$\left.  \widetilde{\cdot}\right.  $ is identical with $\cdot$, we see that
this difference is not actually a difference either; the multiplications of
$\mathbb{K}$ and $\mathbb{K}^{\operatorname*{op}}$ are also the same. Hence,
the ring $\mathbb{K}^{\operatorname*{op}}$ is completely identical to the ring
$\mathbb{K}$ (not just as sets, but as rings with all their structure).

But recall that $\operatorname*{id}:\mathbb{K}\rightarrow\mathbb{K}$ is a ring
isomorphism from $\mathbb{K}$ to $\mathbb{K}$. Since the ring $\mathbb{K}%
^{\operatorname*{op}}$ is completely identical to the ring $\mathbb{K}$, we
can replace the last \textquotedblleft$\mathbb{K}$\textquotedblright\ in this
sentence by \textquotedblleft$\mathbb{K}^{\operatorname*{op}}$%
\textquotedblright\ without changing its meaning. Thus, we obtain that
$\operatorname*{id}:\mathbb{K}\rightarrow\mathbb{K}$ is a ring isomorphism
from $\mathbb{K}$ to $\mathbb{K}^{\operatorname*{op}}$. This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of part
\textbf{(b)}.

\bigskip

\textbf{(c)} Let us quote the following fact from \cite[Exercise
6.5]{detnotes} (except that we are replacing $\mathbb{K}$ by $\mathbb{L}$):

\begin{proposition}
\label{prop.sol.ring.op.c.transp.helper}Let $\mathbb{L}$ be a commutative
ring. In this proposition, all matrices are over $\mathbb{L}$.

\textbf{(a)} If $u$, $v$ and $w$ are three nonnegative integers, if $P$ is a
$u\times v$-matrix, and if $Q$ is a $v\times w$-matrix, then%
\[
\left(  PQ\right)  ^{T}=Q^{T}P^{T}.
\]

\textbf{(b)} Every $u\in\mathbb{N}$ satisfies%
\[
\left(  I_{u}\right)  ^{T}=I_{u}.
\]

\textbf{(c)} If $u$ and $v$ are two nonnegative integers, if $P$ is a $u\times
v$-matrix, and if $\lambda\in\mathbb{L}$, then%
\[
\left(  \lambda P\right)  ^{T}=\lambda P^{T}.
\]

\textbf{(d)} If $u$ and $v$ are two nonnegative integers, and if $P$ and $Q$
are two $u\times v$-matrices, then%
\[
\left(  P+Q\right)  ^{T}=P^{T}+Q^{T}.
\]

\textbf{(e)} If $u$ and $v$ are two nonnegative integers, and if $P$ is a
$u\times v$-matrix, then%
\[
\left(  P^{T}\right)  ^{T}=P.
\]

\end{proposition}

Now, let $\mathbf{T}$ be the map%
\[
\mathbb{K}\rightarrow\mathbb{K}^{\operatorname{op}},\qquad A\mapsto A^{T}.
\]
We must prove that $\mathbf{T}$ is a ring isomorphism.

In class\footnote{specifically, Proposition 5.10.5 in
\href{http://www.cip.ifi.lmu.de/~grinberg/t/19s/notes.pdf}{the class notes};
but the numbering may change}, we have proven that any invertible ring
homomorphism is a ring isomorphism. Hence, it suffices to prove that
$\mathbf{T}$ is an invertible ring homomorphism.

Let us first prove that $\mathbf{T}$ is a ring homomorphism. In order to do
so, we need to verify the following four claims:

\begin{statement}
\textit{Claim 1:} We have $\mathbf{T}\left(  a+b\right)  =\mathbf{T}\left(
a\right)  +\mathbf{T}\left(  b\right)  $ for all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 2:} We have $\mathbf{T}\left(  0_{\mathbb{K}}\right)
=0_{\mathbb{K}^{\operatorname*{op}}}$.
\end{statement}

\begin{statement}
\textit{Claim 3:} We have $\mathbf{T}\left(  ab\right)  =\mathbf{T}\left(
a\right)  \left.  \widetilde{\cdot}\right.  \mathbf{T}\left(  b\right)  $ for
all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 4:} We have $\mathbf{T}\left(  1_{\mathbb{K}}\right)
=1_{\mathbb{K}^{\operatorname*{op}}}$.
\end{statement}

(Note the \textquotedblleft$\left.  \widetilde{\cdot}\right.  $%
\textquotedblright\ sign on the right hand side of Claim 3; this is because
$\mathbf{T}\left(  a\right)  $ and $\mathbf{T}\left(  b\right)  $ are being
considered as elements of $\mathbb{K}^{\operatorname*{op}}$, and the
multiplication of the ring $\mathbb{K}^{\operatorname*{op}}$ is $\left.
\widetilde{\cdot}\right.  $.)

Let us now prove these claims:

[\textit{Proof of Claim 3:} Let $a,b\in\mathbb{K}$. Then, $a\in\mathbb{K}%
=\mathbb{L}^{n\times n}$ and $b\in\mathbb{K}=\mathbb{L}^{n\times n}$. Hence,
$a$ and $b$ are two $n\times n$-matrices over $\mathbb{L}$. The definition of
$\mathbf{T}$ yields $\mathbf{T}\left(  ab\right)  =\left(  ab\right)  ^{T}$
and $\mathbf{T}\left(  a\right)  =a^{T}$ and $\mathbf{T}\left(  b\right)
=b^{T}$. The definition of the operation $\left.  \widetilde{\cdot}\right.  $
yields $\mathbf{T}\left(  a\right)  \left.  \widetilde{\cdot}\right.
\mathbf{T}\left(  b\right)  =\underbrace{\mathbf{T}\left(  b\right)  }%
_{=b^{T}}\underbrace{\mathbf{T}\left(  a\right)  }_{=a^{T}}=b^{T}a^{T}$. But
$\mathbf{T}\left(  ab\right)  =\left(  ab\right)  ^{T}=b^{T}a^{T}$ (by
Proposition \ref{prop.sol.ring.op.c.transp.helper} \textbf{(a)}, applied to
$u=n$, $v=n$, $w=n$, $P=a$ and $Q=b$). Comparing these two equalities, we
obtain $\mathbf{T}\left(  ab\right)  =\mathbf{T}\left(  a\right)  \left.
\widetilde{\cdot}\right.  \mathbf{T}\left(  b\right)  $. This proves Claim 3.]

[\textit{Proof of Claim 1:} Let $a,b\in\mathbb{K}$. Then, $a\in\mathbb{K}%
=\mathbb{L}^{n\times n}$ and $b\in\mathbb{K}=\mathbb{L}^{n\times n}$. Hence,
$a$ and $b$ are two $n\times n$-matrices over $\mathbb{L}$. The definition of
$\mathbf{T}$ yields $\mathbf{T}\left(  a+b\right)  =\left(  a+b\right)  ^{T}$
and $\mathbf{T}\left(  a\right)  =a^{T}$ and $\mathbf{T}\left(  b\right)
=b^{T}$. But $\underbrace{\mathbf{T}\left(  a\right)  }_{=a^{T}}%
+\underbrace{\mathbf{T}\left(  b\right)  }_{=b^{T}}=a^{T}b^{T}$. But
$\mathbf{T}\left(  a+b\right)  =\left(  a+b\right)  ^{T}=a^{T}+b^{T}$ (by
Proposition \ref{prop.sol.ring.op.c.transp.helper} \textbf{(d)}, applied to
$u=n$, $v=n$, $P=a$ and $Q=b$). Comparing these two equalities, we obtain
$\mathbf{T}\left(  a+b\right)  =\mathbf{T}\left(  a\right)  +\mathbf{T}\left(
b\right)  $. This proves Claim 1.]

[\textit{Proof of Claim 2:} We have $0_{\mathbb{K}}=0_{n\times n}$ (by the
definition of the ring $\mathbb{K}=\mathbb{L}^{n\times n}$). Applying the map
$\mathbf{T}$ to both sides of this equality, we obtain $\mathbf{T}\left(
0_{\mathbb{K}}\right)  =\mathbf{T}\left(  0_{n\times n}\right)  =\left(
0_{n\times n}\right)  ^{T}$ (by the definition of $\mathbf{T}$). But the
definition of the transpose of a matrix easily yields $\left(  0_{n\times
n}\right)  ^{T}=0_{n\times n}$. Hence, $\mathbf{T}\left(  0_{\mathbb{K}%
}\right)  =\left(  0_{n\times n}\right)  ^{T}=0_{n\times n}$. But the
definition of the ring $\mathbb{K}^{\operatorname*{op}}$ yields $0_{\mathbb{K}%
^{\operatorname*{op}}}=0_{\mathbb{K}}=0_{n\times n}$. Comparing the latter two
equalities, we obtain $\mathbf{T}\left(  0_{\mathbb{K}}\right)  =0_{\mathbb{K}%
^{\operatorname*{op}}}$. This proves Claim 2.]

[\textit{Proof of Claim 4:} We have $1_{\mathbb{K}}=I_{n}$ (by the definition
of the ring $\mathbb{K}=\mathbb{L}^{n\times n}$). Applying the map
$\mathbf{T}$ to both sides of this equality, we obtain $\mathbf{T}\left(
1_{\mathbb{K}}\right)  =\mathbf{T}\left(  I_{n}\right)  =\left(  I_{n}\right)
^{T}$ (by the definition of $\mathbf{T}$). But Proposition
\ref{prop.sol.ring.op.c.transp.helper} \textbf{(b)} (applied to $u=n$) yields
$\left(  I_{n}\right)  ^{T}=I_{n}$. Hence, $\mathbf{T}\left(  1_{\mathbb{K}%
}\right)  =\left(  I_{n}\right)  ^{T}=I_{n}$. But the definition of the ring
$\mathbb{K}^{\operatorname*{op}}$ yields $1_{\mathbb{K}^{\operatorname*{op}}%
}=1_{\mathbb{K}}=I_{n}$. Comparing the latter two equalities, we obtain
$\mathbf{T}\left(  1_{\mathbb{K}}\right)  =1_{\mathbb{K}^{\operatorname*{op}}%
}$. This proves Claim 4.]

We have now proven all four Claims 1, 2, 3 and 4. Hence, $\mathbf{T}$ is a
ring homomorphism from $\mathbb{K}$ to $\mathbb{K}^{\operatorname*{op}}$ (by
the definition of a ring homomorphism).

Let us next prove that the map $\mathbf{T}$ is invertible. In proving this, we
do not need to concern ourselves with the ring structures (i.e., the
additions, multiplications, zeroes and unities) of $\mathbb{K}$ and
$\mathbb{K}^{\operatorname*{op}}$, but can simply consider $\mathbb{K}$ and
$\mathbb{K}^{\operatorname*{op}}$ as sets (because the invertibility of a map
has nothing to do with any ring structures).

Recall that $\mathbb{K}^{\operatorname*{op}}=\mathbb{K}$ \textbf{as sets}.
Thus, the map $\mathbf{T}$ is a map from $\mathbb{K}$ to $\mathbb{K}$ (since
$\mathbf{T}$ is a map from $\mathbb{K}$ to $\mathbb{K}^{\operatorname*{op}}$).
Hence, the map $\mathbf{T}\circ\mathbf{T}:\mathbb{K}\rightarrow\mathbb{K}$ is
well-defined. Moreover, each $P\in\mathbb{K}$ satisfies%
\begin{align*}
\left(  \mathbf{T}\circ\mathbf{T}\right)  \left(  P\right)   &  =\mathbf{T}%
\left(  \underbrace{\mathbf{T}\left(  P\right)  }_{\substack{=P^{T}\\\text{(by
the definition of }\mathbf{T}\text{)}}}\right)  =\mathbf{T}\left(
P^{T}\right)  =\left(  P^{T}\right)  ^{T}\qquad\left(  \text{by the definition
of }\mathbf{T}\right) \\
&  =P\qquad\left(  \text{by Proposition \ref{prop.sol.ring.op.c.transp.helper}
\textbf{(e)} (applied to }u=n\text{ and }v=n\text{)}\right) \\
&  =\operatorname*{id}\left(  P\right)  .
\end{align*}
In other words, $\mathbf{T}\circ\mathbf{T}=\operatorname*{id}$. Hence, the
maps $\mathbf{T}:\mathbb{K}\rightarrow\mathbb{K}$ and $\mathbf{T}%
:\mathbb{K}\rightarrow\mathbb{K}$ are mutually inverse. Thus, the map
$\mathbf{T}:\mathbb{K}\rightarrow\mathbb{K}$ is invertible. In other words,
the map $\mathbf{T}:\mathbb{K}\rightarrow\mathbb{K}^{\operatorname*{op}}$ is
invertible (since $\mathbb{K}=\mathbb{K}^{\operatorname*{op}}$ as sets).

So we have proven that the map $\mathbf{T}:\mathbb{K}\rightarrow
\mathbb{K}^{\operatorname*{op}}$ is an invertible ring homomorphism from
$\mathbb{K}$ to $\mathbb{K}^{\operatorname*{op}}$. Thus, this map $\mathbf{T}$
is a ring isomorphism from $\mathbb{K}$ to $\mathbb{K}^{\operatorname*{op}}$
(since any invertible ring homomorphism is a ring isomorphism). This solves
part \textbf{(c)} of the exercise.

%----------------------------------------------------------------------------------------
%	EXERCISE 2
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 2: More ring isomorphisms}

\subsection{Problem}

\begin{enumerate}
\item[\textbf{(a)}] Let $\mathbb{L}$ be a ring. Let $w \in\mathbb{L}$ be an
invertible element. Prove that the map
\[
\mathbb{L} \to\mathbb{L} , \qquad a \mapsto waw^{-1}
\]
is a ring isomorphism.

\item[\textbf{(b)}] Let $\mathbb{K}$ be a ring. Let $W$ be the $n \times
n$-matrix
\[
\left(  \left[  i + j = n + 1 \right]  \right)  _{1\leq i\leq n,\ 1\leq j\leq
n} =
\begin{pmatrix}
0 & \cdots & 0 & 0 & 1\\
0 & \cdots & 0 & 1 & 0\\
0 & \cdots & 1 & 0 & 0\\
\vdots & \iddots & \vdots & \vdots & \vdots\\
1 & \cdots & 0 & 0 & 0
\end{pmatrix}
\in\mathbb{K}^{n \times n}
\]
(where we are using \href{https://en.wikipedia.org/wiki/Iverson_bracket}{the
Iverson bracket notation} again).

Prove that $W = W^{-1}$.

\item[\textbf{(c)}] Let $A = \left(  a_{i,j} \right)  _{1\leq i\leq n,\ 1\leq
j\leq n} \in\mathbb{K}^{n \times n}$ be any $n \times n$-matrix. Prove that
\[
WAW^{-1} = \left(  a_{n+1-i,n+1-j} \right)  _{1\leq i\leq n,\ 1\leq j\leq n}.
\]
(In other words, $WAW^{-1}$ is the $n \times n$-matrix obtained from $A$ by
reversing the order of the rows and also reversing the order of the columns.)
\end{enumerate}

\subsection{Remark}

The map
\[
\mathbb{L} \to\mathbb{L} , \qquad a \mapsto waw^{-1}
\]
in part \textbf{(a)} of this exercise is called \textit{conjugation by $w$}.
It is best known in the case of a matrix ring, where it corresponds to a
change of basis for an endomorphism of a vector space. When $\mathbb{K}$ is a
field, the \textbf{only} ring isomorphisms $\mathbb{K}^{n \times n}
\to\mathbb{K}^{n \times n}$ are conjugations by invertible matrices; this is
the Noether--Skolem theorem (in one of its less general variants).

\subsection{Solution}

\textbf{(a)} Let $f$ be the map%
\[
\mathbb{L}\rightarrow\mathbb{L},\qquad a\mapsto waw^{-1}.
\]
We must prove that $f$ is a ring isomorphism.

In class, we have proven that any invertible ring homomorphism is a ring
isomorphism. Hence, it suffices to prove that $f$ is an invertible ring homomorphism.

Let us first prove that $f$ is a ring homomorphism. In order to do so, we need
to verify the following four claims:

\begin{statement}
\textit{Claim 1:} We have $f\left(  a+b\right)  =f\left(  a\right)  +f\left(
b\right)  $ for all $a,b\in\mathbb{L}$.
\end{statement}

\begin{statement}
\textit{Claim 2:} We have $f\left(  0\right)  =0$.
\end{statement}

\begin{statement}
\textit{Claim 3:} We have $f\left(  ab\right)  =f\left(  a\right)  f\left(
b\right)  $ for all $a,b\in\mathbb{L}$.
\end{statement}

\begin{statement}
\textit{Claim 4:} We have $f\left(  1\right)  =1$.
\end{statement}

Let us now prove these claims:

[\textit{Proof of Claim 1:} Let $a,b\in\mathbb{L}$. The definition of $f$
yields $f\left(  a\right)  =waw^{-1}$ and $f\left(  b\right)  =wbw^{-1}$ and
$f\left(  a+b\right)  =w\left(  a+b\right)  w^{-1}$. Hence,%
\begin{align*}
f\left(  a+b\right)   &  =w\underbrace{\left(  a+b\right)  w^{-1}%
}_{\substack{=aw^{-1}+bw^{-1}\\\text{(by distributivity)}}}=w\left(
aw^{-1}+bw^{-1}\right)  =\underbrace{waw^{-1}}_{=f\left(  a\right)
}+\underbrace{wbw^{-1}}_{=f\left(  b\right)  }\qquad\left(  \text{by
distributivity}\right) \\
&  =f\left(  a\right)  +f\left(  b\right)  .
\end{align*}
This proves Claim 1.]

[\textit{Proof of Claim 2:} The definition of $f$ yields $f\left(  0\right)
=w\underbrace{0w^{-1}}_{=0}=w0=0$. This proves Claim 2.]

[\textit{Proof of Claim 3:} Let $a,b\in\mathbb{L}$. The definition of $f$
yields $f\left(  a\right)  =waw^{-1}$ and $f\left(  b\right)  =wbw^{-1}$ and
$f\left(  ab\right)  =w\left(  ab\right)  w^{-1}$. Hence,%
\[
\underbrace{f\left(  a\right)  }_{=waw^{-1}}\ \ \underbrace{f\left(  b\right)
}_{=wbw^{-1}}=wa\underbrace{w^{-1}w}_{=1}bw^{-1}=wabw^{-1}=w\left(  ab\right)
w^{-1}=f\left(  ab\right)  .
\]
In other words, $f\left(  ab\right)  =f\left(  a\right)  f\left(  b\right)  $.
This proves Claim 3.]

[\textit{Proof of Claim 4:} The definition of $f$ yields $f\left(  1\right)
=w\underbrace{1w^{-1}}_{=w^{-1}}=ww^{-1}=1$. This proves Claim 4.]

We have now proven all four Claims 1, 2, 3 and 4. Hence, $f$ is a ring
homomorphism from $\mathbb{L}$ to $\mathbb{L}$ (by the definition of a ring homomorphism).

Let us next prove that the map $f$ is invertible.

Indeed, let $g$ be the map%
\[
\mathbb{L}\rightarrow\mathbb{L},\qquad a\mapsto w^{-1}aw.
\]

Then, each $a\in\mathbb{L}$ satisfies%
\begin{align*}
\left(  g\circ f\right)  \left(  a\right)   &  =g\left(  f\left(  a\right)
\right)  =w^{-1}\underbrace{f\left(  a\right)  }_{\substack{=waw^{-1}%
\\\text{(by the definition of }f\text{)}}}w\qquad\left(  \text{by the
definition of }g\right) \\
&  =\underbrace{w^{-1}w}_{=1}a\underbrace{w^{-1}w}_{=1}=a=\operatorname*{id}%
\left(  a\right)  .
\end{align*}
In other words, $g\circ f=\operatorname*{id}$.

Also, each $a\in\mathbb{L}$ satisfies%
\begin{align*}
\left(  f\circ g\right)  \left(  a\right)   &  =f\left(  g\left(  a\right)
\right)  =w\underbrace{g\left(  a\right)  }_{\substack{=w^{-1}aw\\\text{(by
the definition of }g\text{)}}}w^{-1}\qquad\left(  \text{by the definition of
}f\right) \\
&  =\underbrace{ww^{-1}}_{=1}a\underbrace{ww^{-1}}_{=1}=a=\operatorname*{id}%
\left(  a\right)  .
\end{align*}
In other words, $f\circ g=\operatorname*{id}$.

Now, the two maps $f$ and $g$ are mutually inverse (since $f\circ
g=\operatorname*{id}$ and $g\circ f=\operatorname*{id}$). Thus, the map $f$ is invertible.

So we have proven that the map $f$ is an invertible ring homomorphism. Thus,
this map $f$ is a ring isomorphism (since any invertible ring homomorphism is
a ring isomorphism). This solves part \textbf{(a)} of the exercise.

\bigskip

\textbf{(b)} We first show two auxiliary claims about how multiplication by
$W$ changes a matrix:

\begin{statement}
\textit{Claim 5:} Let $A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}\in\mathbb{K}^{n\times n}$ be any $n\times n$-matrix. Then,%
\[
WA=\left(  a_{n+1-i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}.
\]

\end{statement}

\begin{statement}
\textit{Claim 6:} Let $A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}\in\mathbb{K}^{n\times n}$ be any $n\times n$-matrix. Then,%
\[
AW=\left(  a_{i,n+1-j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}.
\]

\end{statement}

[\textit{Proof of Claim 5:} We have $W=\left(  \left[  i+j=n+1\right]
\right)  _{1\leq i\leq n,\ 1\leq j\leq n}$ and $A=\left(  a_{i,j}\right)
_{1\leq i\leq n,\ 1\leq j\leq n}$. Hence, the definition of the multiplication
of matrices yields%
\begin{equation}
WA=\left(  \sum_{k=1}^{n}\left[  i+k=n+1\right]  a_{k,j}\right)  _{1\leq i\leq
n,\ 1\leq j\leq n}. \label{sol.ring.matrix.W-conj.b.c5.pf.1}%
\end{equation}

Now, let $\left(  i,j\right)  \in\left\{  1,2,\ldots,n\right\}  ^{2}$. Thus,
$i,j\in\left\{  1,2,\ldots,n\right\}  $. From $i\in\left\{  1,2,\ldots
,n\right\}  $, we obtain $n+1-i\in\left\{  1,2,\ldots,n\right\}  $. Now,%
\begin{align}
&  \sum_{k=1}^{n}\left[  i+k=n+1\right]  a_{k,j}\nonumber\\
&  =\sum_{k\in\left\{  1,2,\ldots,n\right\}  }\left[  i+k=n+1\right]
a_{k,j}\nonumber\\
&  =\underbrace{\left[  i+\left(  n+1-i\right)  =n+1\right]  }%
_{\substack{=1\\\text{(since }i+\left(  n+1-i\right)  =n+1\text{)}%
}}a_{n+1-i,j}+\sum_{\substack{k\in\left\{  1,2,\ldots,n\right\}  ;\\k\neq
n+1-i}}\underbrace{\left[  i+k=n+1\right]  }_{\substack{=0\\\text{(since
}i+k\neq n+1\\\text{(because }k\neq n+1-i\text{))}}}a_{k,j}\nonumber\\
&  \qquad\qquad\left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend for }k=n+1-i\text{ from the sum}\\
\text{(since }n+1-i\in\left\{  1,2,\ldots,n\right\}  \text{)}%
\end{array}
\right) \nonumber\\
&  =a_{n+1-i,j}+\underbrace{\sum_{\substack{k\in\left\{  1,2,\ldots,n\right\}
;\\k\neq n+1-i}}0a_{k,j}}_{=0}=a_{n+1-i,j}.
\label{sol.ring.matrix.W-conj.b.c5.pf.2}%
\end{align}

Now, forget that we fixed $\left(  i,j\right)  $. We thus have proven
\eqref{sol.ring.matrix.W-conj.b.c5.pf.2} for each $\left(  i,j\right)
\in\left\{  1,2,\ldots,n\right\}  ^{2}$. Thus, we have%
\[
\left(  \sum_{k=1}^{n}\left[  i+k=n+1\right]  a_{k,j}\right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  a_{n+1-i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
Hence, \eqref{sol.ring.matrix.W-conj.b.c5.pf.2} becomes%
\[
WA=\left(  \sum_{k=1}^{n}\left[  i+k=n+1\right]  a_{k,j}\right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  a_{n+1-i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
This proves Claim 5.]

[\textit{Proof of Claim 6:} We have $A=\left(  a_{i,j}\right)  _{1\leq i\leq
n,\ 1\leq j\leq n}$ and $W=\left(  \left[  i+j=n+1\right]  \right)  _{1\leq
i\leq n,\ 1\leq j\leq n}$. Hence, the definition of the multiplication of
matrices yields%
\begin{equation}
AW=\left(  \sum_{k=1}^{n}a_{i,k}\left[  k+j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}. \label{sol.ring.matrix.W-conj.b.c6.pf.1}%
\end{equation}

Now, let $\left(  i,j\right)  \in\left\{  1,2,\ldots,n\right\}  ^{2}$. Thus,
$i,j\in\left\{  1,2,\ldots,n\right\}  $. From $j\in\left\{  1,2,\ldots
,n\right\}  $, we obtain $n+1-j\in\left\{  1,2,\ldots,n\right\}  $. Now,%
\begin{align}
&  \sum_{k=1}^{n}a_{i,k}\left[  k+j=n+1\right] \nonumber\\
&  =\sum_{k\in\left\{  1,2,\ldots,n\right\}  }a_{i,k}\left[  k+j=n+1\right]
\nonumber\\
&  =a_{i,n+1-j}\underbrace{\left[  \left(  n+1-j\right)  +j=n+1\right]
}_{\substack{=1\\\text{(since }\left(  n+1-j\right)  +j=n+1\text{)}}%
}+\sum_{\substack{k\in\left\{  1,2,\ldots,n\right\}  ;\\k\neq n+1-j}%
}a_{i,k}\underbrace{\left[  k+j=n+1\right]  }_{\substack{=0\\\text{(since
}k+j\neq n+1\\\text{(because }k\neq n+1-j\text{))}}}\nonumber\\
&  \qquad\qquad\left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend for }k=n+1-j\text{ from the sum}\\
\text{(since }n+1-j\in\left\{  1,2,\ldots,n\right\}  \text{)}%
\end{array}
\right) \nonumber\\
&  =a_{i,n+1-j}+\underbrace{\sum_{\substack{k\in\left\{  1,2,\ldots,n\right\}
;\\k\neq n+1-j}}a_{i,k}0}_{=0}=a_{i,n+1-j}.
\label{sol.ring.matrix.W-conj.b.c6.pf.2}%
\end{align}

Now, forget that we fixed $\left(  i,j\right)  $. We thus have proven
\eqref{sol.ring.matrix.W-conj.b.c6.pf.2} for each $\left(  i,j\right)
\in\left\{  1,2,\ldots,n\right\}  ^{2}$. Thus, we have%
\[
\left(  \sum_{k=1}^{n}a_{i,k}\left[  k+j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  a_{i,n+1-j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
Hence, \eqref{sol.ring.matrix.W-conj.b.c6.pf.2} becomes%
\[
AW=\left(  \sum_{k=1}^{n}a_{i,k}\left[  k+j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  a_{i,n+1-j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
This proves Claim 6.]

Let us now come back to part \textbf{(b)} of this exercise. Recall the
definition of the identity matrix $I_{n}\in\mathbb{K}^{n\times n}$. Namely,
$I_{n}$ is defined by
\[
I_{n}=\left(  \delta_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}%
,\qquad\text{where }\delta_{i,j}=%
\begin{cases}
1, & \text{if }i=j;\\
0, & \text{if }i\neq j
\end{cases}
.
\]
(Note that $\delta_{i,j}$ can also be written as $\left[  i=j\right]  $ using
the Iverson bracket notation.)

Now, $W=\left(  \left[  i+j=n+1\right]  \right)  _{1\leq i\leq n,\ 1\leq j\leq
n}$. Hence, Claim 6 (applied to $A=W$ and $a_{i,j}=\left[  i+j=n+1\right]  $)
yields%
\begin{equation}
WW=\left(  \left[  \left(  n+1-i\right)  +j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}. \label{sol.ring.matrix.W-conj.b.WW=}%
\end{equation}
Now, let $\left(  i,j\right)  \in\left\{  1,2,\ldots,n\right\}  ^{2}$. Thus,
$i,j\in\left\{  1,2,\ldots,n\right\}  $. Now, the statement \textquotedblleft%
$\left(  n+1-i\right)  +j=n+1$\textquotedblright\ is equivalent to
\textquotedblleft$i=j$\textquotedblright\ (since $\left(  \left(
n+1-i\right)  +j\right)  -\left(  n+1\right)  =j-i$). Thus,%
\begin{align}
\left[  \left(  n+1-i\right)  +j=n+1\right]   &  =\left[  i=j\right]  =%
\begin{cases}
1, & \text{if }i=j\text{ is true;}\\
0, & \text{if }i=j\text{ is false}%
\end{cases}
\nonumber\\
&  \qquad\left(  \text{by the definition of the Iverson bracket notation}%
\right) \nonumber\\
&  =%
\begin{cases}
1, & \text{if }i=j;\\
0, & \text{if }i\neq j
\end{cases}
=\delta_{i,j}. \label{sol.ring.matrix.W-conj.b.1}%
\end{align}

Forget that we fixed $\left(  i,j\right)  $. We thus have proven
\eqref{sol.ring.matrix.W-conj.b.1} for each $\left(  i,j\right)  \in\left\{
1,2,\ldots,n\right\}  ^{2}$. Thus, we have%
\[
\left(  \left[  \left(  n+1-i\right)  +j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  \delta_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
Hence, \eqref{sol.ring.matrix.W-conj.b.WW=} becomes%
\[
WW=\left(  \left[  \left(  n+1-i\right)  +j=n+1\right]  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}=\left(  \delta_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}=I_{n}.
\]

Now, the matrix $W$ is an inverse of $W$ (since $WW=I_{n}$ and $WW=I_{n}$).
Thus, the matrix $W$ is invertible, and its inverse is $W^{-1}=W$. This solves
part \textbf{(b)} of the exercise.

\bigskip

\textbf{(c)} We have $A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}$. Thus, Claim 5 yields%
\[
WA=\left(  a_{n+1-i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}.
\]
Hence, Claim 6 (applied to $WA$ and $a_{n+1-i,j}$ instead of $A$ and $a_{i,j}%
$) yields%
\[
WAW=\left(  a_{n+1-i,n+1-j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}.
\]
But part \textbf{(b)} of this exercise yields $W=W^{-1}$. Hence,
$WA\underbrace{W}_{=W^{-1}}=WAW^{-1}$, so that
\[
WAW^{-1}=WAW=\left(  a_{n+1-i,n+1-j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}.
\]
This solves part \textbf{(c)} of the exercise.

%----------------------------------------------------------------------------------------
%	EXERCISE 3
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 3: Entangled inverses}

Let $\mathbb{K}$ be a ring.

A \textit{left inverse} of an element $x \in\mathbb{K}$ is defined to be a $y
\in\mathbb{K}$ such that $yx = 1$.

A \textit{right inverse} of an element $x \in\mathbb{K}$ is defined to be a $y
\in\mathbb{K}$ such that $xy = 1$.

Let $a$ and $b$ be two elements of $\mathbb{K}$. Prove the following:

\begin{enumerate}
\item[\textbf{(a)}] If $c$ is a left inverse of $1 - ab$, then $1 + bca$ is a
left inverse of $1 - ba$.

\item[\textbf{(b)}] If $c$ is a right inverse of $1 - ab$, then $1 + bca$ is a
right inverse of $1 - ba$.

\item[\textbf{(c)}] If $c$ is an inverse of $1 - ab$, then $1 + bca$ is an
inverse of $1 - ba$.
\end{enumerate}

Here and in the following, the word ``\textit{inverse}'' (unless qualified
with an adjective) means ``multiplicative inverse''.

\subsection{Solution}

\textbf{(a)} Assume that $c$ is a left inverse of $1-ab$. Thus, $c\left(
1-ab\right)  =1$ (by the definition of a left inverse).

Now, the laws of distributivity\footnote{When we say \textquotedblleft the
laws of distributivity\textquotedblright\ here, we mean not just the axiom of
distributivity (which says that $u\left(  v+w\right)  =uv+uw$ and $\left(
u+v\right)  w=uw+vw$ for all $u,v,w\in\mathbb{K}$), but also its analogue for
subtraction (which says that $u\left(  v-w\right)  =uv-uw$ and $\left(
u-v\right)  w=uw-vw$ for all $u,v,w\in\mathbb{K}$). The latter analogue is not
one of the ring axioms, but follows easily from them.} yield%
\[
a\left(  1-ba\right)  =a-aba=\left(  1-ab\right)  a,
\]
thus%
\[
c\underbrace{a\left(  1-ba\right)  }_{=\left(  1-ab\right)  a}%
=\underbrace{c\left(  1-ab\right)  }_{=1}a=1a=a.
\]
Hence, using the distributivity axiom, we obtain%
\[
\left(  1+bca\right)  \left(  1-ba\right)  =\left(  1-ba\right)
+b\underbrace{ca\left(  1-ba\right)  }_{=a}=\left(  1-ba\right)  +ba=1.
\]
In other words, $1+bca$ is a left inverse of $1-ba$ (by the definition of a
left inverse). This solves part \textbf{(a)} of the exercise.

\bigskip

\textbf{(b)} Assume that $c$ is a right inverse of $1-ab$. Thus, $\left(
1-ab\right)  c=1$ (by the definition of a right inverse).

Now, the laws of distributivity yield%
\[
\left(  1-ba\right)  b=b-bab=b\left(  1-ab\right)  ,
\]
thus%
\[
\underbrace{\left(  1-ba\right)  b}_{=b\left(  1-ab\right)  }%
c=b\underbrace{\left(  1-ab\right)  c}_{=1}=b1=b.
\]
Hence, using the distributivity axiom, we obtain%
\[
\left(  1-ba\right)  \left(  1+bca\right)  =\left(  1-ba\right)
+\underbrace{\left(  1-ba\right)  bc}_{=b}a=\left(  1-ba\right)  +ba=1.
\]
In other words, $1+bca$ is a right inverse of $1-ba$ (by the definition of a
right inverse). This solves part \textbf{(b)} of the exercise.

\bigskip

\textbf{(c)} Assume that $c$ is an inverse of $1-ab$. In other words, $c$ is a
multiplicative inverse of $1-ab$. Thus, $\left(  1-ab\right)  c=c\left(
1-ab\right)  =1$ (by the definition of a multiplicative inverse).

From $c\left(  1-ab\right)  =1$, we conclude that $c$ is a left inverse of
$1-ab$. Hence, part \textbf{(a)} of this exercise shows that $1+bca$ is a left
inverse of $1-ba$. In other words, $\left(  1+bca\right)  \left(  1-ba\right)
=1$.

From $\left(  1-ab\right)  c=1$, we conclude that $c$ is a right inverse of
$1-ab$. Hence, part \textbf{(b)} of this exercise shows that $1+bca$ is a
right inverse of $1-ba$. In other words, $\left(  1-ba\right)  \left(
1+bca\right)  =1$.

Combining $\left(  1+bca\right)  \left(  1-ba\right)  =1$ with $\left(
1-ba\right)  \left(  1+bca\right)  =1$, we obtain
\[
\left(  1-ba\right)  \left(  1+bca\right)  =\left(  1+bca\right)  \left(
1-ba\right)  =1.
\]
In other words, $1+bca$ is a multiplicative inverse of $1-ba$ (by the
definition of a multiplicative inverse). In other words, $1+bca$ is an inverse
of $1-ba$. This solves part \textbf{(c)} of the exercise.

%----------------------------------------------------------------------------------------
%	EXERCISE 4
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 4: Composition of ring homomorphisms}

\subsection{Problem}

Let $\mathbb{K}$, $\mathbb{L}$ and $\mathbb{M}$ be three rings. Prove the following:

\begin{enumerate}
\item[\textbf{(a)}] If $f : \mathbb{K} \to\mathbb{L}$ and $g : \mathbb{L}
\to\mathbb{M}$ are two ring homomorphisms, then $g \circ f : \mathbb{K}
\to\mathbb{M}$ is a ring homomorphism.

\item[\textbf{(b)}] If $f : \mathbb{K} \to\mathbb{L}$ and $g : \mathbb{L}
\to\mathbb{M}$ are two ring isomorphisms, then $g \circ f : \mathbb{K}
\to\mathbb{M}$ is a ring isomorphism.
\end{enumerate}

\subsection{Solution}

\textbf{(a)} Let $f:\mathbb{K}\rightarrow\mathbb{L}$ and $g:\mathbb{L}%
\rightarrow\mathbb{M}$ be two ring homomorphisms. We must prove that $g\circ
f:\mathbb{K}\rightarrow\mathbb{M}$ is a ring homomorphism.

We have assumed that $f:\mathbb{K}\rightarrow\mathbb{L}$ is a ring
homomorphism. In other words, $f$ satisfies the four axioms in our definition
of a ring homomorphism. In other words, the following four claims hold:

\begin{statement}
\textit{Claim 1:} We have $f\left(  a+b\right)  =f\left(  a\right)  +f\left(
b\right)  $ for all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 2:} We have $f\left(  0\right)  =0$.
\end{statement}

\begin{statement}
\textit{Claim 3:} We have $f\left(  ab\right)  =f\left(  a\right)  f\left(
b\right)  $ for all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 4:} We have $f\left(  1\right)  =1$.
\end{statement}

Similarly, from the assumption that $g:\mathbb{L}\rightarrow\mathbb{M}$ is a
ring homomorphism, we conclude that the following four claims hold:

\begin{statement}
\textit{Claim 5:} We have $g\left(  a+b\right)  =g\left(  a\right)  +g\left(
b\right)  $ for all $a,b\in\mathbb{L}$.
\end{statement}

\begin{statement}
\textit{Claim 6:} We have $g\left(  0\right)  =0$.
\end{statement}

\begin{statement}
\textit{Claim 7:} We have $g\left(  ab\right)  =g\left(  a\right)  g\left(
b\right)  $ for all $a,b\in\mathbb{L}$.
\end{statement}

\begin{statement}
\textit{Claim 8:} We have $g\left(  1\right)  =1$.
\end{statement}

Now, we must prove that $g\circ f:\mathbb{K}\rightarrow\mathbb{M}$ is a ring
homomorphism. In other words, we must prove that $g\circ f$ satisfies the four
axioms in our definition of a ring homomorphism. In other words, we must prove
that the following four claims hold:

\begin{statement}
\textit{Claim 9:} We have $\left(  g\circ f\right)  \left(  a+b\right)
=\left(  g\circ f\right)  \left(  a\right)  +\left(  g\circ f\right)  \left(
b\right)  $ for all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 10:} We have $\left(  g\circ f\right)  \left(  0\right)  =0$.
\end{statement}

\begin{statement}
\textit{Claim 11:} We have $\left(  g\circ f\right)  \left(  ab\right)
=\left(  g\circ f\right)  \left(  a\right)  \left(  g\circ f\right)  \left(
b\right)  $ for all $a,b\in\mathbb{K}$.
\end{statement}

\begin{statement}
\textit{Claim 12:} We have $\left(  g\circ f\right)  \left(  1\right)  =1$.
\end{statement}

But this is straightforward:

[\textit{Proof of Claim 9:} For all $a,b\in\mathbb{K}$, we have%
\begin{align*}
\left(  g\circ f\right)  \left(  a+b\right)   &  =g\left(
\underbrace{f\left(  a+b\right)  }_{\substack{=f\left(  a\right)  +f\left(
b\right)  \\\text{(by Claim 1)}}}\right)  =g\left(  f\left(  a\right)
+f\left(  b\right)  \right)  =\underbrace{g\left(  f\left(  a\right)  \right)
}_{=\left(  g\circ f\right)  \left(  a\right)  }+\underbrace{g\left(  f\left(
b\right)  \right)  }_{=\left(  g\circ f\right)  \left(  b\right)  }\\
&  \qquad\left(  \text{by Claim 5, applied to }f\left(  a\right)  \text{ and
}f\left(  b\right)  \text{ instead of }a\text{ and }b\right) \\
&  =\left(  g\circ f\right)  \left(  a\right)  +\left(  g\circ f\right)
\left(  b\right)  .
\end{align*}
Thus, Claim 9 is proven.]

[\textit{Proof of Claim 10:} We have $\left(  g\circ f\right)  \left(
0\right)  =g\left(  \underbrace{f\left(  0\right)  }_{\substack{=0\\\text{(by
Claim 2)}}}\right)  =g\left(  0\right)  =0$ (by Claim 6). Thus, Claim 10 is proven.]

[\textit{Proof of Claim 11:} The proof of Claim 11 is analogous to the proof
of Claim 9, except that we need to use Claims 3 and 7 instead of Claims 1 and 5.]

[\textit{Proof of Claim 12:} The proof of Claim 12 is analogous to the proof
of Claim 10, except that we need to use Claims 4 and 8 instead of Claims 2 and 6.]

Thus, all four Claims 9, 10, 11 and 12 are proven. As we explained, this shows
that $g\circ f$ is a ring homomorphism. Hence, part \textbf{(a)} of the
exercise is solved.

\bigskip

\textbf{(b)} Let $f:\mathbb{K}\rightarrow\mathbb{L}$ and $g:\mathbb{L}%
\rightarrow\mathbb{M}$ be two ring isomorphisms. We must show that $g\circ
f:\mathbb{K}\rightarrow\mathbb{M}$ is a ring isomorphism.

The map $f$ is a ring isomorphism. In other words, $f$ is invertible and both
$f$ and $f^{-1}$ are ring homomorphisms (by the definition of a ring isomorphism).

The map $g$ is a ring isomorphism. In other words, $g$ is invertible and both
$g$ and $g^{-1}$ are ring homomorphisms (by the definition of a ring isomorphism).

Now we know that $f:\mathbb{K}\rightarrow\mathbb{L}$ and $g:\mathbb{L}%
\rightarrow\mathbb{M}$ are two ring homomorphisms. Hence, part \textbf{(a)} of
this exercise shows that $g\circ f:\mathbb{K}\rightarrow\mathbb{M}$ is a ring homomorphism.

Also, we know that $g^{-1}:\mathbb{M}\rightarrow\mathbb{L}$ and $f^{-1}%
:\mathbb{L}\rightarrow\mathbb{K}$ are two ring homomorphisms. Hence, part
\textbf{(a)} of this exercise (applied to $\mathbb{M}$, $\mathbb{K}$, $g^{-1}$
and $f^{-1}$ instead of $\mathbb{K}$, $\mathbb{M}$, $f$ and $g$) shows that
$f^{-1}\circ g^{-1}:\mathbb{M}\rightarrow\mathbb{K}$ is a ring homomorphism.

But the maps $f$ and $g$ are invertible. Hence, it is well-known that their
composition $g\circ f$ is invertible as well, and its inverse is $\left(
g\circ f\right)  ^{-1}=f^{-1}\circ g^{-1}$. Hence, $\left(  g\circ f\right)
^{-1}$ is a ring homomorphism (since $f^{-1}\circ g^{-1}$ is a ring homomorphism).

Now, we know that the map $g\circ f$ is invertible and both $g\circ f$ and
$\left(  g\circ f\right)  ^{-1}$ are ring homomorphisms. In other words,
$g\circ f$ is a ring isomorphism (by the definition of a ring isomorphism).
This solves part \textbf{(b)} of the exercise.

%----------------------------------------------------------------------------------------
%	EXERCISE 5
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 5: Squares in finite fields I}

\subsection{Problem}

Let $\mathbb{F}$ be a field.

\begin{enumerate}
\item[\textbf{(a)}] Prove that if $a, b \in\mathbb{F}$ satisfy $ab = 0$, then
$a = 0$ or $b = 0$.

\item[\textbf{(b)}] Prove that if $a, b \in\mathbb{F}$ satisfy $a^{2} = b^{2}%
$, then $a = b$ or $a = -b$.
\end{enumerate}

Recall that an element $\eta\in\mathbb{F}$ is called a \textit{square} if
there exists some $\alpha\in\mathbb{F}$ such that $\eta= \alpha^{2}$.

From now on, assume that $2 \cdot1_{\mathbb{F}} \neq0_{\mathbb{F}}$ (that is,
$1_{\mathbb{F}} + 1_{\mathbb{F}} \neq0_{\mathbb{F}}$). Note that this is
satisfied whenever $\mathbb{F} = \mathbb{Z} / p$ for a prime $p > 2$ (but also
for various other finite fields), but fails when $\mathbb{F} = \mathbb{Z} / 2$.

\begin{enumerate}
\item[\textbf{(c)}] Prove that $a \neq-a$ for every nonzero $a \in\mathbb{F}$.
\end{enumerate}

From now on, assume that $\mathbb{F}$ is finite.

\begin{enumerate}
\item[\textbf{(d)}] Prove that the number of squares in $\mathbb{F}$ is
$\dfrac{1}{2} \left(  \left|  \mathbb{F} \right|  + 1 \right)  $.

\item[\textbf{(e)}] Conclude that $\left|  \mathbb{F} \right|  $ is odd.
\end{enumerate}

[\textbf{Hint:} For part \textbf{(d)}, argue that each nonzero square in
$\mathbb{F}$ can be written as $\alpha^{2}$ for exactly two $\alpha
\in\mathbb{F}$.]

\subsection{Solution}

We have assumed that $\mathbb{F}$ is a field. Hence, $\mathbb{F}$ is a
commutative skew field (by the definition of a field). Every nonzero element
of $\mathbb{F}$ is invertible (since $\mathbb{F}$ is a skew field).

\bigskip

\textbf{(a)} Let $a,b\in\mathbb{F}$ be such that $ab=0$. We must prove that
$a=0$ or $b=0$.

Assume the contrary. Thus, neither $a=0$ nor $b=0$ holds. In other words, we
have $a\neq0$ and $b\neq0$. Thus, the elements $a$ and $b$ of $\mathbb{F}$ are
nonzero, and therefore invertible (since every nonzero element of $\mathbb{F}$
is invertible). Hence, their inverses $a^{-1}$ and $b^{-1}$ are well-defined.
Comparing the equalities $\underbrace{a^{-1}a}_{=1}b=b$ and $a^{-1}%
\underbrace{ab}_{=0}=a^{-1}0=0$, we obtain $b=0$. This contradicts $b\neq0$.
This contradiction shows that our assumption was false. This completes the
solution to part \textbf{(a)} of the exercise.

\bigskip

\textbf{(b)} Let $a,b\in\mathbb{F}$ satisfy $a^{2}=b^{2}$. We must prove that
$a=b$ or $a=-b$.

Since $\mathbb{F}$ is commutative, we have $ab=ba$. Now, multiplying out
$\left(  a-b\right)  \left(  a+b\right)  $ (by applying the distributivity
laws several times), we obtain%
\[
\left(  a-b\right)  \left(  a+b\right)  =\underbrace{aa}_{=a^{2}=b^{2}%
}+\underbrace{ab}_{=ba}-ba-\underbrace{bb}_{=b^{2}}=b^{2}+ba-ba-b^{2}=0.
\]
Thus, part \textbf{(a)} of this exercise (applied to $a-b$ and $a+b$ instead
of $a$ and $b$) shows that $a-b=0$ or $a+b=0$. In other words, $a=b$ or
$a=-b$. Thus, part \textbf{(b)} of the exercise is solved.

\bigskip

\textbf{(c)} Let $a\in\mathbb{F}$ be nonzero. We must prove that $a\neq-a$.

Assume the contrary. Thus, $a=-a$, so that $a+a=0$. Now,%
\[
\underbrace{\left(  2\cdot1_{\mathbb{F}}\right)  }_{=1_{\mathbb{F}%
}+1_{\mathbb{F}}}a=\left(  1_{\mathbb{F}}+1_{\mathbb{F}}\right)
a=\underbrace{1_{\mathbb{F}}a}_{=a}+\underbrace{1_{\mathbb{F}}a}_{=a}=a+a=0.
\]

The element $2\cdot1_{\mathbb{F}}$ of $\mathbb{F}$ is nonzero (since
$2\cdot1_{\mathbb{F}}\neq0_{\mathbb{F}}$), and thus invertible (since every
nonzero element of $\mathbb{F}$ is invertible). Hence, it has a well-defined
inverse $\left(  2\cdot1_{\mathbb{F}}\right)  ^{-1}$.

Now,%
\[
\left(  2\cdot1_{\mathbb{F}}\right)  ^{-1}\cdot\underbrace{\left(
2\cdot1_{\mathbb{F}}\right)  a}_{=0}=\left(  2\cdot1_{\mathbb{F}}\right)
^{-1}\cdot0=0.
\]
Comparing this with $\underbrace{\left(  2\cdot1_{\mathbb{F}}\right)
^{-1}\cdot\left(  2\cdot1_{\mathbb{F}}\right)  }_{=1}a=1a=a$, we obtain $a=0$.
This contradicts the fact that $a$ is nonzero. This contradiction shows that
our assumption was false. Hence, $a\neq-a$. Thus, part \textbf{(c)} of the
exercise is solved.

\bigskip

\textbf{(d)} We have the following:

\begin{statement}
\textit{Claim 1:} Let $c\in\mathbb{F}$. Then:

\textbf{(i)} If $c$ is a nonzero square, then%
\[
\left\vert \left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert =2.
\]

\textbf{(ii)} If $c$ is not a square, then%
\[
\left\vert \left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert =0.
\]

\textbf{(iii)} If $c=0$, then%
\[
\left\vert \left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert =1.
\]

\end{statement}

[\textit{Proof of Claim 1:} \textbf{(i)} Assume that $c$ is a nonzero square.
Thus, there exists a $g\in\mathbb{F}$ such that $c=g^{2}$ (since $c$ is a
square). Consider this $g$. Moreover,
\[
\left(  -g\right)  ^{2}=\left(  -g\right)  \left(  -g\right)
=-\underbrace{\left(  \left(  -g\right)  g\right)  }_{=-gg}=-\left(
-gg\right)  =gg=g^{2}=c
\]
(since $c=g^{2}$). Hence, $c=\left(  -g\right)  ^{2}$.

If we had $g=0$, then we would have $c=\underbrace{g}_{=0}\ ^{2}=0^{2}=0$,
which would contradict our assumption that $c$ is nonzero. Hence, we cannot
have $g=0$. Thus, $g$ is nonzero. Therefore, $g\neq-g$ (by part \textbf{(c)}
of this exercise, applied to $a=g$). Hence, the elements $g$ and $-g$ of
$\mathbb{F}$ are distinct. Thus, $\left\vert \left\{  g,-g\right\}
\right\vert =2$.

But $g\in\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  $ (since
$g\in\mathbb{F}$ and $c=g^{2}$) and $-g\in\left\{  d\in\mathbb{F}%
\ \mid\ c=d^{2}\right\}  $ (since $-g\in\mathbb{F}$ and $c=\left(  -g\right)
^{2}$). Combining these two facts, we obtain
\begin{equation}
\left\{  g,-g\right\}  \subseteq\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}%
\right\}  . \label{sol.ffields.squares1.c1.pf.1}%
\end{equation}

On the other hand, let us prove that $\left\{  d\in\mathbb{F}\ \mid
\ c=d^{2}\right\}  \subseteq\left\{  g,-g\right\}  $. Indeed, let
$a\in\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  $. Thus, $a$ is a
$d\in\mathbb{F}$ such that $c=d^{2}$. In other words, $a$ is an element of
$\mathbb{F}$ and satisfies $c=a^{2}$. Hence, $a^{2}=c=g^{2}$. Thus, part
\textbf{(b)} of this exercise (applied to $b=g$) yields that $a=g$ or $a=-g$.
In other words, $a\in\left\{  g,-g\right\}  $. Now, forget that we fixed $a$.
We thus have shown that $a\in\left\{  g,-g\right\}  $ for each $a\in\left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  $. In other words, $\left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \subseteq\left\{  g,-g\right\}  $.
Combining this with \eqref{sol.ffields.squares1.c1.pf.1}, we obtain%
\[
\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  =\left\{  g,-g\right\}  .
\]
Hence,%
\[
\left\vert \left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert
=\left\vert \left\{  g,-g\right\}  \right\vert =2.
\]
This proves Claim 1 \textbf{(i)}.

\textbf{(ii)} Assume that $c$ is not a square. Then, there exists no
$\alpha\in\mathbb{F}$ such that $c=\alpha^{2}$ (by the definition of a
square). In other words, there exists no $d\in\mathbb{F}$ such that $c=d^{2}$
(here, we have renamed the index $\alpha$ as $d$). In other words, $\left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  =\varnothing$. Hence, $\left\vert
\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert =\left\vert
\varnothing\right\vert =0$. This proves Claim 1 \textbf{(ii)}.

\textbf{(iii)} Assume that $c=0$. Then, $0\in\left\{  d\in\mathbb{F}%
\ \mid\ c=d^{2}\right\}  $ (since $0\in\mathbb{F}$ and $c=0=0^{2}$) and thus
$\left\{  0\right\}  \subseteq\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}
$.

On the other hand, let us show that $\left\{  d\in\mathbb{F}\ \mid
\ c=d^{2}\right\}  \subseteq\left\{  0\right\}  $.

Indeed, let $a\in\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  $. Then, $a$
is a $d\in\mathbb{F}$ such that $c=d^{2}$. In other words, $a$ is an element
of $\mathbb{F}$ and satisfies $c=a^{2}$. Hence, $aa=a^{2}=c=0$. Thus, part
\textbf{(a)} of this exercise (applied to $b=a$) yields that $a=0$ or $a=0$.
In other words, $a=0$. In other words, $a\in\left\{  0\right\}  $. Now, forget
that we fixed $a$. We thus have shown that $a\in\left\{  0\right\}  $ for each
$a\in\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  $. In other words,
$\left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \subseteq\left\{  0\right\}
$. Combining this with $\left\{  0\right\}  \subseteq\left\{  d\in
\mathbb{F}\ \mid\ c=d^{2}\right\}  $, we obtain $\left\{  d\in\mathbb{F}%
\ \mid\ c=d^{2}\right\}  =\left\{  0\right\}  $. Hence, $\left\vert \left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert =\left\vert \left\{
0\right\}  \right\vert =1$. This proves Claim 1 \textbf{(iii)}.]

Now, let us count all pairs $\left(  c,d\right)  \in\mathbb{F}\times
\mathbb{F}$ satisfying $c=d^{2}$. We shall count these pairs in two ways:

\begin{itemize}
\item The first way is to split this count according to the value of $c$ (that
is, first count all such pairs $\left(  c,d\right)  $ with a given $c$, and
then sum the result up over all $c\in\mathbb{F}$). Thus, we find%
\begin{align*}
&  \left(  \text{the number of all }\left(  c,d\right)  \in\mathbb{F}%
\times\mathbb{F}\text{ such that }c=d^{2}\right) \\
&  =\sum_{c\in\mathbb{F}}\underbrace{\left(  \text{the number of all }%
d\in\mathbb{F}\text{ such that }c=d^{2}\right)  }_{=\left\vert \left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert }\\
&  =\sum_{c\in\mathbb{F}}\left\vert \left\{  d\in\mathbb{F}\ \mid
\ c=d^{2}\right\}  \right\vert \\
&  =\sum_{\substack{c\in\mathbb{F};\\c=0}}\underbrace{\left\vert \left\{
d\in\mathbb{F}\ \mid\ c=d^{2}\right\}  \right\vert }_{\substack{=1\\\text{(by
Claim 1 \textbf{(iii)})}}}+\sum_{\substack{c\in\mathbb{F};\\c\text{ is a
nonzero}\\\text{square}}}\underbrace{\left\vert \left\{  d\in\mathbb{F}%
\ \mid\ c=d^{2}\right\}  \right\vert }_{\substack{=2\\\text{(by Claim 1
\textbf{(i)})}}}\\
&  \qquad+\sum_{\substack{c\in\mathbb{F};\\c\text{ is not a}\\\text{square}%
}}\underbrace{\left\vert \left\{  d\in\mathbb{F}\ \mid\ c=d^{2}\right\}
\right\vert }_{\substack{=0\\\text{(by Claim 1 \textbf{(ii)})}}}\\
&  \qquad\left(
\begin{array}
[c]{c}%
\text{because each }c\in\mathbb{F}\text{ satisfies exactly one of the three
statements}\\
\text{\textquotedblleft}c=0\text{\textquotedblright, \textquotedblleft}c\text{
is a nonzero square\textquotedblright\ and \textquotedblleft}c\text{ is not a
square\textquotedblright}%
\end{array}
\right) \\
&  =\underbrace{\sum_{\substack{c\in\mathbb{F};\\c=0}}1}%
_{\substack{=1\\\text{(since this sum has}\\\text{exactly one addend)}%
}}+\underbrace{\sum_{\substack{c\in\mathbb{F};\\c\text{ is a nonzero}%
\\\text{square}}}2}_{=2\cdot\left(  \text{the number of nonzero squares in
}\mathbb{F}\right)  }+\underbrace{\sum_{\substack{c\in\mathbb{F};\\c\text{ is
not a}\\\text{square}}}0}_{=0}\\
&  =1+2\cdot\left(  \text{the number of nonzero squares in }\mathbb{F}\right)
+0\\
&  =1+2\cdot\left(  \text{the number of nonzero squares in }\mathbb{F}\right)
.
\end{align*}

\item The second way is to split this count according to the value of $d$
(that is, first count all such pairs $\left(  c,d\right)  $ with a given $d$,
and then sum the result up over all $d\in\mathbb{F}$). Thus, we find%
\begin{align*}
&  \left(  \text{the number of all }\left(  c,d\right)  \in\mathbb{F}%
\times\mathbb{F}\text{ such that }c=d^{2}\right) \\
&  =\sum_{d\in\mathbb{F}}\underbrace{\left(  \text{the number of all }%
c\in\mathbb{F}\text{ such that }c=d^{2}\right)  }_{\substack{=1\\\text{(since
there is exactly one }c\in\mathbb{F}\text{ such that }c=d^{2}\text{ (namely,
}c=d^{2}\text{))}}}\\
&  =\sum_{d\in\mathbb{F}}1=\left\vert \mathbb{F}\right\vert \cdot1=\left\vert
\mathbb{F}\right\vert .
\end{align*}

\end{itemize}

Comparing these two equalities, we obtain%
\[
\left\vert \mathbb{F}\right\vert =1+2\cdot\left(  \text{the number of nonzero
squares in }\mathbb{F}\right)  .
\]
Solving this for $\left(  \text{the number of nonzero squares in }%
\mathbb{F}\right)  $, we find%
\[
\left(  \text{the number of nonzero squares in }\mathbb{F}\right)
=\dfrac{\left\vert \mathbb{F}\right\vert -1}{2}.
\]

Now, there are two kinds of squares in $\mathbb{F}$: namely, the nonzero
squares (of which there are exactly $\dfrac{\left\vert \mathbb{F}\right\vert
-1}{2}$ many, as we just proved) and the zero squares (of which there is only
$1$, namely $0^{2}=0$). Thus, the total number of squares in $\mathbb{F}$ is
$\dfrac{\left\vert \mathbb{F}\right\vert -1}{2}+1=\dfrac{\left\vert
\mathbb{F}\right\vert +1}{2}=\dfrac{1}{2}\left(  \left\vert \mathbb{F}%
\right\vert +1\right)  $. This solves part \textbf{(d)} of the exercise.

\bigskip

\textbf{(e)} Part \textbf{(d)} of this exercise shows that the number of
squares in $\mathbb{F}$ is $\dfrac{1}{2}\left(  \left\vert \mathbb{F}%
\right\vert +1\right)  $. Thus,%
\[
\dfrac{1}{2}\left(  \left\vert \mathbb{F}\right\vert +1\right)  =\left(
\text{the number of squares in }\mathbb{F}\right)  \in\mathbb{N}%
\]
(since a number that counts something is always $\in\mathbb{N}$). Therefore,
$\dfrac{1}{2}\left(  \left\vert \mathbb{F}\right\vert +1\right)  \in
\mathbb{N}\subseteq\mathbb{Z}$, so that the integer $\left\vert \mathbb{F}%
\right\vert +1$ is even. This shows that $\left\vert \mathbb{F}\right\vert $
is odd. This solves part \textbf{(e)} of the exercise.

%----------------------------------------------------------------------------------------
%	EXERCISE 6
%----------------------------------------------------------------------------------------
\rule{\linewidth}{0.3pt} \\[0.4cm]

\section{Exercise 6: The characteristic of a field}

\subsection{Problem}

Let $\mathbb{F}$ be a field. Recall that we have defined $na$ to mean
$\underbrace{a + a + \cdots+ a}_{n \text{ times}}$ whenever $n \in\mathbb{N}$
and $a \in\mathbb{F}$.

Assume that there exists a positive integer $n$ such that $n \cdot
1_{\mathbb{F}} = 0$. Let $p$ be the \textbf{smallest} such $n$.

Prove that $p$ is prime.

[\textbf{Hint:} $\left(  a \cdot1_{\mathbb{F}} \right)  \cdot\left(  b
\cdot1_{\mathbb{F}} \right)  = ab \cdot1_{\mathbb{F}}$ for all $a, b
\in\mathbb{N}$.]

\subsection{Remark}

The $p$ we just defined is called the \textit{characteristic} of the field
$\mathbb{F}$ when it exists. (Otherwise, the characteristic of the field
$\mathbb{F}$ is defined to be $0$.)

Thus, for each prime $p$, the finite field $\mathbb{Z} / p$, as well as the
finite field of size $p^{2}$ that we constructed in class, have characteristic
$p$.

\subsection{Solution sketch}

We have assumed that $\mathbb{F}$ is a field. Hence, $\mathbb{F}$ is a
commutative skew field (by the definition of a field). We have $0_{\mathbb{F}%
}\neq1_{\mathbb{F}}$ (since $\mathbb{F}$ is a skew field).

We have defined $p$ to be the \textbf{smallest} positive integer $n$ such that
$n\cdot1_{\mathbb{F}}=0$. Thus, $p$ is a positive integer which itself
satisfies $p\cdot1_{\mathbb{F}}=0$. Furthermore, if $n$ is a positive integer
such that $n\cdot1_{\mathbb{F}}=0$, then%
\begin{equation}
n\geq p \label{sol.field.char.prime.1}%
\end{equation}
(since $p$ is the \textbf{smallest} positive integer $n$ such that
$n\cdot1_{\mathbb{F}}=0$).

If we had $p=1$, then we would have $p\cdot1_{\mathbb{F}}=1\cdot1_{\mathbb{F}%
}=1_{\mathbb{F}}\neq0_{\mathbb{F}}$ (since $0_{\mathbb{F}}\neq1_{\mathbb{F}}%
$), which would contradict $p\cdot1_{\mathbb{F}}=0=0_{\mathbb{F}}$. Thus, we
cannot have $p=1$. Therefore, we have $p>1$ (since $p$ is a positive integer).

We shall now show that the only positive divisors of $p$ are $1$ and $p$.
Indeed, assume the contrary. Thus, $p$ has a positive divisor other than $1$
and $p$. Consider such a divisor, and denote it by $d$. Thus, $d$ is a
positive divisor of $p$ that is distinct from $1$ and $p$. In other words, $d$
is a positive divisor of $p$ and satisfies $d\neq1$ and $d\neq p$. We have
$d\leq p$ (since $d$ is a positive divisor of the positive integer $p$).
Combining this with $d\neq p$, we obtain $d<p$. Also, $d\in\mathbb{Z}$ (since
$d$ is an integer) and $\dfrac{p}{d}\in\mathbb{Z}$ (since $d$ is a divisor of
$p$).

Now, for all $a,b\in\mathbb{Z}$, we have%
\[
\left(  a\cdot1_{\mathbb{F}}\right)  \cdot\left(  b\cdot1_{\mathbb{F}}\right)
=a\cdot\underbrace{\left(  1_{\mathbb{F}}\cdot\left(  b\cdot1_{\mathbb{F}%
}\right)  \right)  }_{=b\cdot1_{\mathbb{F}}}=a\cdot\left(  b\cdot
1_{\mathbb{F}}\right)  =ab\cdot1_{\mathbb{F}}.
\]
Applying this to $a=d$ and $b=\dfrac{p}{d}$, we obtain%
\[
\left(  d\cdot1_{\mathbb{F}}\right)  \cdot\left(  \dfrac{p}{d}\cdot
1_{\mathbb{F}}\right)  =\underbrace{d\cdot\dfrac{p}{d}}_{=p}\cdot
1_{\mathbb{F}}=p\cdot1_{\mathbb{F}}=0.
\]
Thus, Exercise 5 \textbf{(a)} (applied to $a=d\cdot1_{\mathbb{F}}$ and
$b=\dfrac{p}{d}\cdot1_{\mathbb{F}}$) shows that $d\cdot1_{\mathbb{F}}=0$ or
$\dfrac{p}{d}\cdot1_{\mathbb{F}}=0$.

If we had $d\cdot1_{\mathbb{F}}=0$, then we would have $d\geq p$ (by
\eqref{sol.field.char.prime.1}, applied to $n=d$), which would contradict
$d<p$. Hence, we cannot have $d\cdot1_{\mathbb{F}}=0$. Thus, we have
$\dfrac{p}{d}\cdot1_{\mathbb{F}}=0$ (since $d\cdot1_{\mathbb{F}}=0$ or
$\dfrac{p}{d}\cdot1_{\mathbb{F}}=0$). But $\dfrac{p}{d}$ is an integer (since
$\dfrac{p}{d}\in\mathbb{Z}$) and is positive (since $p$ and $d$ are positive);
thus, $\dfrac{p}{d}$ is a positive integer. Hence,
\eqref{sol.field.char.prime.1} (applied to $n=\dfrac{p}{d}$) yields $\dfrac
{p}{d}\geq p$ (since $\dfrac{p}{d}\cdot1_{\mathbb{F}}=0$). Since $d$ is
positive, we can multiply this inequality by $d$, and thus obtain $p\geq pd$.
Since $p$ is positive, we can divide this inequality by $p$, and thus obtain
$1\geq d$. Hence, $d=1$ (since $d$ is a positive integer). This contradicts
$d\neq1$.

This contradiction shows that our assumption was false. Hence, the only
positive divisors of $p$ are $1$ and $p$. Thus, $p$ is a prime (since $p$ is
an integer satisfying $p>1$). Qed.

\subsection{Remark}

We have never used the commutativity of multiplication (in $\mathbb{F}$) in
the above proof. Thus, we can replace \textquotedblleft
field\textquotedblright\ by \textquotedblleft skew field\textquotedblright\ in
this exercise.

\begin{thebibliography}{99999999}                                                                                %

%Feel free to add your sources -- or copy some from the source code
%of the class notes ( http://www.cip.ifi.lmu.de/~grinberg/t/19s/notes.tex ).

%This is the bibliography: The list of papers/books/articles/blogs/...
%cited. The syntax is: "\bibitem[name]{tag}Reference",
%where "name" is the name that will appear in the compiled
%bibliography, and "tag" is the tag by which you will refer to
%the source in the TeX file. For example, the following source
%has name "GrKnPa94" (so you will see it referenced as
%"[GrKnPa94]" in the compiled PDF) and tag "GKP" (so you
%can cite it by writing "\cite{GKP}").

%I've commented the below references out, since I'm not citing
%them above.

%\bibitem[GrKnPa94]{GKP}Ronald L. Graham, Donald E. Knuth, Oren Patashnik,
%\textit{Concrete Mathematics, Second Edition}, Addison-Wesley 1994.\\
%See \url{https://www-cs-faculty.stanford.edu/~knuth/gkp.html} for errata.

\bibitem[Grinbe19]{detnotes}Darij Grinberg, \textit{Notes on the combinatorial
fundamentals of algebra}, 10 January 2019. \newline%
\url{http://www.cip.ifi.lmu.de/~grinberg/primes2015/sols.pdf} \newline The
numbering of theorems and formulas in this link might shift when the project
gets updated; for a ``frozen'' version whose numbering is guaranteed to match
that in the citations above, see
\url{https://github.com/darijgr/detnotes/releases/tag/2019-01-10} .
\end{thebibliography}

\end{document}


\section{Making a Dummy THICC Atmospheric Model*}
* The naming of this section is decided by the stream name, I did not come up with this \cite{twitch}. During this stream, a lot of plotting improvements have been made, which is not the scope of
this manual and hence has been left out. The plan was to add vertical momentum and advection, though things did not go according to plan\dots

\subsection{Discovering That Things Are Broken}
While trying to add vertical momentum, it appears that some parts of the model are broken in their current state. The horizontal advection is one of the things that is broken. If you recall,
we needed to use the Laplacian operator in the advection equations (as shown in \autoref{eq:diffusion}, diffusion is considered a part of advection since diffusion transports energy and matter
which is what advection does as well). The Laplacian operator (as shown in \autoref{alg:laplacian layer}) did not work. This is because there was a misplaced bracket causing weird numerical errors.
This has been fixed in the code (but was never present in the manual, yay for me) and can be safely enabled, though for this stream we disabled the Laplacian operator as it has a small effect on
the total advection (and because it was at this time broken). %The Laplacian has been re-enabled in Stream 8 (\autoref{sec:stream8}).

Another thing that we found out was broken is the vertical momentum. We tried to add it, ran into problems and just set it to 0 to fix the other problems that occured. One of those problems was
a wrong initialisation of the density. We basically told the model that the density is the same on every layer of the atmosphere, which is obviously not true. Hence we need to adjust that. The
new initialisation is described in \autoref{alg:density}. Note that the $\rho[:,: i]$ notation means that for every index in the first and second dimension, only change the value for the index $i$
in the third dimension. As soon as the vertical momentum has been fixed it will be fixed in the correct spot. If a lot of the code changes then it will probably be in another section and I will
insert a reference to that section.

\begin{algorithm}
    $\rho[:, :, 0] \leftarrow 1.3$ \;
    \For{$i \in [1, nlevels-1]$}{
        $\rho[:, :, i] \leftarrow 0.1\rho[:, :, i - 1]$
    }
    \caption{Initialisation of the air density $\rho$}
    \label{alg:density}
\end{algorithm}


\chapter{Math}

\cpbookimport{MatExp.h}
\cpbookimport{Combinatorics.h}
\cpbookimport{DarkBitsMagic.h}
\cpbookimport{fft.h}
\cpbookimport{Fraction.h}
\cpbookimport{MatrixOps.h}
\cpbookimport{SimpsonsRule.h}
\cpbookimport{Simplex.h}
\cpbookimport{DiapEq.h}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% how to typeset algorithms
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Algorithms}

% USE THE TEMPLATE BELOW FOR YOUR ALGORITHMS
%============================================
%
% \begin{algorithm}
%
% \SetKwInOut{Input}{Input}
% \SetKwInOut{Output}{Output}
%
% \Indm
% \Input{Description of the input to the algorithm.}
% \Output{Description of the output from the algorithm.}
% \Indp
%
% \BlankLine
%
%   % main algorithm code here
%
% \caption{Algorithm example}
% \label{alg}
%
% \end{algorithm}

\begin{algorithm}

\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}

\SetKwData{Left}{left}
\SetKwData{This}{this}
\SetKwData{Up}{up}
\SetKwFunction{Union}{Union}
\SetKwFunction{FindCompress}{FindCompress}

\Indm
\Input{Description of the input to the algorithm.}
\Output{Description of the output from the algorithm.}
\Indp

\BlankLine

\emph{special treatment of the first line}\;
\For{$i\leftarrow 2$ \KwTo $l$}{
  \emph{special treatment of the first element of line $i$}\;
  \For{$j\leftarrow 2$ \KwTo $w$}{\label{forins}
    \Left$\leftarrow$ \FindCompress{$Im[i,j-1]$}\;
    \Up$\leftarrow$ \FindCompress{$Im[i-1,]$}\;
    \This$\leftarrow$ \FindCompress{$Im[i,j]$}\;
    \If{\Left compatible with \This}{\label{lt}
      \lIf{\Left $<$ \This}{\Union{\Left,\This}}\;
      \lElse{\Union{\This,\Left}\;}
    }
    \If{\Up compatible with \This}{\label{ut}
      \lIf{\Up $<$ \This}{\Union{\Up,\This}}\;
      \lElse{\Union{\This,\Up}}
    }
  }
  \lForEach{element $e$ of the line $i$}{\FindCompress{p}}
}

\caption[Do not end short caption with full-stop]{Algorithm example}
\label{alg}

\end{algorithm}

\begin{algorithm}[t]
%\SetAlgoNoLine
 \Input{A tree $T$ represented by an array {\sf Parent}$[1,\ldots,n]$.}
\Output{A minimum secure dominating set of $T$, represented by a boolean array $X$.}
\For{$i\leftarrow 1$ to $n$}{
{\sf A3Label}$[i] \leftarrow$ {\sc False}\;
$X[i] \leftarrow$ {\sc F\SetKwInOut{Input}{Input}
	\SetKwInOut{Output}{Output}

	\SetKwData{Left}{left}
	\SetKwData{This}{this}
	\SetKwData{Up}{up}
	\SetKwFunction{Union}{Union}
	\SetKwFunction{FindCompress}{FindCompress}

	\Indm
	\Input{Description of the input to the algorithm.}
	\Output{Description of the output from the algorithm.}
	\Indp

	\BlankLine

	\emph{special treatment of the first line}\;
	\For{$i\leftarrow 2$ \KwTo $l$}{
		\emph{special treatment of the first element of line $i$}\;
		\For{$j\leftarrow 2$ \KwTo $w$}{\label{forins}
			\Left$\leftarrow$ \FindCompress{$Im[i,j-1]$}\;
			\Up$\leftarrow$ \FindCompress{$Im[i-1,]$}\;
			\This$\leftarrow$ \FindCompress{$Im[i,j]$}\;
			\If{\Left compatible with \This}{\label{lt}
				\lIf{\Left $<$ \This}{\Union{\Left,\This}}\;
				\lElse{\Union{\This,\Left}\;}
			}
			\If{\Up compatible with \This}{\label{ut}
				\lIf{\Up $<$ \This}{\Union{\Up,\This}}\;
				\lElse{\Union{\This,\Up}}
			}
		}
		\lForEach{element $e$ of the line $i$}{\FindCompress{p}}
	}

	\caption[Do not end short caption with full-stop]{Algorithm example}
	\label{alg}
	alse}\;
{\sf Labels}$[i] \leftarrow [0,0,0,0,0,0,0]$\;
{\bf if} vertex $i$ is a anchor of $T$ {\bf then} {\sf Branch}$[i] \leftarrow$ {\sc True}\;
{\sf Previous1Label}$[i] \leftarrow 0$\;
}
\For{$i\leftarrow n$ down to $2$}{
$\ell \leftarrow$ {\sf\bf EffectiveLabel}({\sf Labels}[$i$])\;
{\bf if} $\ell$ is odd {\bf then} $X[i] \leftarrow ${\sc True}\;
{\sf Labels$[$Parent$[i],\ell(i)+1 \ (\rm{mod}\ 7)]$} $++$\;
\If{$\ell=2$ {\bf and} {\sf Branch$[$Parent$[i]]$}}{
{\sf A3Label[Parent}$[i]] \leftarrow$ {\sc True}\;
{\sf prev} $\leftarrow$ {\sf Previous1Label$[$Parent$[i]]$}\;
{\bf if} {\sf prev} $>0$ {\bf then} $X[${\sf prev}$] \leftarrow$ {\sc True}\;
}
\If{$\ell=0$ {\bf and} {\sf Branch$[$Parent$[i]]$}}{
\If{{\sf A3Label$[$Parent$[i]]$}}{
$X[i] \leftarrow$ {\sc True}\;
}
\Else{
{\sf prev} $\leftarrow$ {\sf Previous1Label$[$Parent$[i]]$}\;
{\bf if} {\sf prev} $>0$ {\bf then} $X[${\sf prev}$] \leftarrow$ {\sc True}\;
{\sf Previous1Label$[$Parent$[i]] \leftarrow i$}\;
}
}
}
$\ell \leftarrow$ {\sf\bf EffectiveLabel}({\sf Labels}[$1$])\;
{\bf if} $\ell$ is odd {\bf then} $X[1] \leftarrow ${\sc True}\;
{\bf if}  {\sf Labels}$[1,j]=0$ for $j=1,3,4,5,6$ {\bf then} $X[1] \leftarrow$ {\sc True}\;
{\bf if} {\sf Labels}$[1,j]=0$ for $j=1,3,5,6$ {\bf and} {\sf Labels}$[1,0] \geq |${\sf Labels}$[1]-1|$  {\bf then} $X[1] \leftarrow$ {\sc True}\;
\If{$\ell=3$}{
{\sf prev} $\leftarrow$ {\sf Previous1Label$[1]$}\;
{\bf if} {\sf prev} $ > 0$ {\bf then} $X[$\sf{prev}$]$ $\leftarrow$ {\sc True}\;
}
\Return[$X$]\;
\caption[{{Do not end short caption with full-stop}}]{{\sf\bf DefendTree}}
\label{Alg:Tree}
\end{algorithm}


\section{Theoretical stellar grid}\label{sec:grid}

\subsection{Grid computation}

We compute a stellar model grid as the training dataset. We aim to cover stars with approximate solar mass on the main-sequence and the subgiant phases. The mass range is set up as 0.8 -- 1.2$\rm M_{\odot}$. The computation of evolutionary tracks starts at the Hayashi line and terminates at the base of red-giant branch (RGB) where $\log g$ = 3.6 dex. Note that we only use models after the zero-age-main-sequence (ZAMS). We define ZAMS as the point where core-hydrogen burning contributes over 99.9\% of the total luminosity.
%
The stellar gird considers four independent fundamental inputs which are stellar mass ($M$), initial helium fraction ($Y_{\rm init}$), initial metallicity ([Fe/H]$_{\rm init}$), and the mixing-length parameter ($\alpha_{\rm MLT}$).
%
We calculated three model grids. First, a primary grid covers the whole input range. Uniform grid step is applied for $M$, $Y_{\rm init}$, $\alpha_{\rm MLT}$, and we use tow different grid steps for [Fe/H]$_{\rm init}$ below and above 0.2 dex.  Second, an additional grid is computed for $M$ > 1.05$\rm M_{\odot}$. Grid points of this grid are in between of the primary grid to increase the resolution for tracks with the 'hook'.
Third, we compute off-grid models with random fundamental input values as an independent dataset for validating and testing GP models.
%4,880 tracks with input parameters that are randomly sampled in the grid ranges for validating GPR models. The evolution time step was mainly controlled by the set-up tolerances on changes in surface effective temperature and luminosity. We also saved structural models for computing theoretical oscillation models.
%
Details of the computation are listed in Table \ref{tab:grid}.

\begin{table}
	\centering
	\caption{Computation of Stellar model grid.}
	\label{tab:grid}
	\begin{tabular}{llll} % four columns, alignment for each
		\hline
		\multicolumn{3}{c}{Primary Grid}\\
		\hline
		Input Parameter & Range & Increment \\
        \hline
	$M$ ($\rm M_{\odot}$) & 0.80 -- 1.20 &  0.01\\
        $\rm{[Fe/H]}$ (dex) & -0.5 -- 0.2/0.2 -- 0.5 & 0.1/0.05\\
        	$Y_{\rm init}$ & 0.24 -- 0.32 & 0.02\\
        $\alpha_{\rm{MLT}}$  & 1.7 -- 2.5&  0.2\\
        \hline
       \multicolumn{3}{c}{Additional Grid}\\
	\hline
	Input Parameter & Range & Increment \\
        \hline
	$M$ ($\rm M_{\odot}$)  & 1.055 -- 1.195 &  0.01\\
        $\rm{[Fe/H]}$ (dex) & 0.25 -- 0.45 & 0.1\\
        	$Y_{\rm init}$ & 0.25 -- 0.31 & 0.02\\
        $\alpha_{\rm{MLT}}$  & 1.8-- 2.4&  0.2\\
        \hline
        \multicolumn{3}{c}{Off-grid Models}\\
        \hline
        \multicolumn{3}{c}{Input Parameters} &N\\
        \hline
         \multicolumn{3}{l}{Random $M$, [Fe/H]$_{\rm init}$ = 0.0, $Y_{\rm init}$ = 0.28, $\alpha_{\rm MLT}$ = 2.1 } & 44\\
        \multicolumn{3}{l}{Random $M$ and [Fe/H]$_{\rm init}$, $Y_{\rm init}$ = 0.28, $\alpha_{\rm MLT}$ = 2.1 }&174\\
        \multicolumn{3}{l}{Random $M$, [Fe/H]$_{\rm init}$, $Y_{\rm init}$, and $\alpha_{\rm MLT}$}&4880\\
	\hline
	\end{tabular}
\end{table}

%\subsection{Stellar models and input physics}\label{subsec:stellar_model}

We use the stellar code Modules for Experiments in Stellar Astrophysics
(\textsc{MESA}, version 12115) to construct stellar grids.
\textsc{MESA} is an open-source stellar evolution package which is undergoing active development.
Descriptions of input physics and numerical methods
can be found in \citet{2011ApJS..192....3P,2013ApJS..208....4P, 2015ApJS..220...15P}.
We adopted the solar chemical mixture [$(Z/X)_{\odot}$ = 0.0181]
provided by \citet{2009ARA&A..47..481A}.
The initial helium fraction ($Y_{\rm init}$) and initial metallicity ($\rm{[Fe/H]_{init}}$) are independent inputs.
The initial chemical composition is calculated with
\begin{equation}
\log (Z_{\rm{init}}/X_{\rm{init}}) = \log (Z/X)_{\odot} + \rm{[Fe/H]_{init}}.  \\
\end{equation}
We use the \textsc{MESA} $\rho-T$ tables based on the 2005
update of OPAL EOS tables \citep{2002ApJ...576.1064R} and OPAL opacity
supplemented by low-temperature opacity \citep{2005ApJ...623..585F}.
The grey Eddington $T-\tau$ relation is used to determine boundary conditions for modelling the atmosphere.
The mixing-length theory is implemented and the convection is adjusted by the mixing-length parameter ($\alpha_{\rm MLT}$).
We also apply the \textsc{MESA} predictive mixing scheme \citep{2018ApJS..234...34P,2019ApJS..243...10P}, which improves model structures at the convective boundary.
Atomic diffusion of helium and heavy elements was also taken into account. MESA calculates particle diffusion and gravitational settling by solving Burger's equations using the method and diffusion coefficients of \citet{Thoul94}.
%We considered 8 classes of species (H1, He3, He4, C12, N14, O16, Ne20, and Mg24) We considered 8 classes of species (H1, He3, He4, C12, N14, O16, Ne20, and Mg24)
We consider eight elements (${}^1{\rm H}, {}^3{\rm He}, {}^4{\rm He}, {}^{12}{\rm C}, {}^{14}{\rm N}, {}^{16}{\rm O}, {}^{20}{\rm Ne}$, and ${}^{24}{\rm Mg}$)
for diffusion calculations, and have the charge calculated by the MESA ionization module, which estimates the typical ionic charge as a function of $T$, $\rho$, and free electrons per nucleon from \citet{Paquette1986}.
The \textsc{MESA} inlist used for the computation is available on \url{https://github.com/litanda/mesa_inlist}.

%\subsection{Oscillation models and seismic $\Delta \nu$}\label{subsec:seismo_model}

%Theoretical stellar oscillations were calculated with the \textsc{GYRE} code (version 5.1), which was developed by \citet{2013MNRAS.435.3406T}. And we computed radial modes (for $\ell$ = 0) by solving the adiabatic stellar pulsation equations with the structural models generated by \textsc{MESA}. We computed a seismic large separation($\Delta \nu$) for each model with theoretical radial modes to avoid the systematic offset of the scaling relation. We derived $\Delta \nu$ with the approach given by \citet{2011ApJ...743..161W}, which is a weighted least-squares fit to the radial frequencies as a function of $n$.

\subsection{Equivalent Evolutionary Phase}

For training GP models, we need to convert stellar age, whose dynamical range varies track by track, into a uniform range. The fractional age is an option. However, we find that global parameters (e.g. effective temperature) sharply change with the fractional age around the 'hook' and the turn-off point (left panel in Figure~\ref{fig:eep}). It requires a complex and spiky kernel function to fit the curvatures in this area and hence difficult for GP to learn. \citet{2016ApJS..222....8D} has introduced a quantity Equivalent Evolutionary Phase ({\it EEP}), which numbers evolutionary stages and transform stellar tracks onto a uniform basis. We follow this idea but define {\it EEP} in a different way.
%
On each evolutionary track, we compute the displacement between model $n$ and model $n-1$ on the $T_{\rm eff} - \log g$ diagram as
\begin{equation}\label{eq:disp}
\delta d_{n} = ((T_{\rm eff, n} - T_{\rm eff, n-1}) ^{2} + (\log g _{n} - \log g_{n-1})^{2}))^{f},
\end{equation}
and the total displacement of model $n$ from the ZAMS (model 0) can be calculated with
\begin{equation}
d_{n} = \sum_{i = 0}^{i = n} \delta d_{i} .
\end{equation}
We then normalise $d_{n}$ to the 0 --1 range and define it as {\it EEP}. On the same evolutionary track, {\it EEP} equals to 0 at the ZAMS and 1 on the RGB where $\log$ = 3.6 $dex$. The factor $f$ in Eq. \ref{eq:disp} is adjustable for modulating {\it EEP} to avoid obvious gap in the data space, and we find that $f$ = 0.18 gives the best data distribution.
%
In Figure~\ref{fig:eep}, we demonstrate how the effective temperature changes with fractional age and {\it EEP}. It can be seen that the usage of {\it EEP} significantly smoothes the sharp features at the 'hook' and the turn-off point.

\begin{figure*}
        \includegraphics[width=1.\columnwidth]{2d_fage_data.pdf}
	\includegraphics[width=1.\columnwidth]{2d_EEP_data.pdf}
     \caption{Surface plots of model effective temperature on the mass-fractional age (left) and mass-EEP (right) diagrams. Models in this figure are from the primary grid with fixed initial metallicity ($\rm [Fe/H]_{init}$ = 0.0), helium fraction ($Y_{\rm init}$ = 0.28) and mixing-length parameter ($\alpha_{\rm MLT}$ = 2.1). It can be seen that the effective temperature changes much smoother on the mass-EEP diagram at the hook and turn-off points.}
    \label{fig:eep}
\end{figure*}

\subsection{Data Selection}\label{sec:selection}

We need three types of data for training, validating, and testing GP models.
%
Evolutionary tracks in the primary and additional grids are the training data. Off-grid tracks are divided 50-to-50 as validating and testing data .
%Note that validating and testing datasets are not on the same evolutionary tracks so they are independent to each other.
%Validating dataset is for validating the GP model in the training process and is mainly used for early stopping, which is a form of regularisation for avoiding overfitting. We choose off-grid models but not on-grid models as validating data because the grid is equally spaced. Without additional information between grid points, an optimiser could either use a smooth function or a periodic function to fit the data and find no obvious differences in the likelihood. We describe how we use validating data in Section \ref{sec:training}. Lastly, testing dataset is independent on the training process and used for evaluating the final GP models.
There is a limitation of the data size in the GP framework, because the computational and memory complexity exponentially increase with the number of data points. In practice, the typical data size is on an order of $10^{4}$. Given that the grid contents $\sim 10,000,000$ stellar models, only a small subset can be used. The sampling method is hence critical.
%
 A flat sampling is not appropriate, because the evolving step is not uniform at different evolutionary stages due to the \textsc{MESA} step-control strategy. For instance, stellar models are dense at the main-sequence and lower RGB but quite sparse at the subgiant stage. We test a few methods and find that using the displacement ($\delta d_{n}$) defined in Eq.~\ref{eq:disp} as the weight of sampling give a relatively uniform data distribution.
%meets the above two requirements.
%Firstly, we want the data to uniformly cover the parameter space for the best efficiency. Secondly, we need to highly weight models at phases where sharp changes present, e.g., models around the hook and turn-off points.


\documentclass{memoir}
\usepackage{notestemplate}

% \begin{figure}[ht]
%     \centering
%     \incfig{riemmans-theorem}
%     \caption{Riemmans theorem}
%     \label{fig:riemmans-theorem}
% \end{figure}

\begin{document}
\section{Subring, Ideals, Quotient rings, Ring homomorphisms}
\begin{defn}[Subring]
	A subring is a subset \(S\) of a ring \(R\) which is a ring under the restriction of the operations in \(R\). We denote this by \(S\leq R\).
\end{defn}

\begin{rmrk}
\(S\leq R\) nonempty is a subring if and only if \(a,b \in S \implies a+b, ab, -a \in S\). This is equivalent to \(a,b \in S \implies a-b, ab \in S\).
\end{rmrk}

\begin{defn}[Ideal]
	An ideal is a subring \(I \leq R\) which is closed under multiplication with elements of \(R\). Notationally, we say that \(I \triangleleft R\).
\end{defn}

\begin{rmrk}
\(I\) nonempty is an ideal if and only if \(a,b \in I \implies a-b \in I\), which is equivalent to \(a \in I, r \in R \implies ar, ra \in I\).
\end{rmrk}

\begin{hw}
Show that a field has only trivial ideals.
\end{hw}

\begin{defn}[Principal Ideal]
	If \(R\) is commutative and has an identity, then the principal ideal generated by \(c\) is the ideal \((c) = \left\{rc \mid r \in R \right\} \).
\end{defn}
This is the smallest ideal containing \(c\).
\end{document}

Abstract Algebra - Introductory/Algebra I/Notes/source/2020-02-12-Subrings.tex


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[cache=false]{minted}

\title{Basic Computation in Python}
\author{Guillaume Macneil}

\begin{document}
\maketitle

\begin{abstract}
This is the first lesson on the 'Introduction to Python' course. This course is loosely based around the 'MIT Introduction to Computer Science - Fall 2016' course. The course is more focused towards the Python programming side of things.
\end{abstract}

\section{An Overview}
Programming is just the creation of instruction sets for a computer in order to achieve a desired output. Fundamentally, all the computer does is perform basic calculations - \textbf{billions per second} - and stores the result. All of these calculations are defined by you as the programmer and the computer will only do what you tell it to. \medskip

So let's start with some of the very basics of Python, though this is applicable to almost every programming language. A program is a series of definitions that are evaluated and commands that are executed. So what executes the commands? The commands are executed by the \textit{'interpreter'} - a program that \textit{interprets} the high-level commands that you gave and makes the computer perform them. Programs can be thought of as cooking recipies, where the computer is the chef that diligently follows the instructions \textbf{very accurately}. \medskip

\section{Objects and Types}
Programs manipulate and perform calculations of data objects. All objects have a type that defines what calculations the computer can do to them. Here are the fundamental scalar (cannot be subdivided) objects.
\begin{itemize}
\item \textbf{\textit{int} -} integers, eg. \textit{6}
\item \textbf{\textit{float} -} floating point (decimal) numbers (real), eg. \textit{3.97}
\item \textbf{\textit{bool} -} boolean values, either \textit{True} or \textit{False}
\item \textbf{\textit{NoneType} -} an object that only has the value \textit{None}
\end{itemize}

You can use the \textit{type()} function (you'll find out about these later) to determine the type of a given object. For example:

\begin{minted}{python}
type(3)
# Returns 'int'

type(7.0)
# Returns 'float'

type(True)
# Returns bool
\end{minted}

As a quick note, the above lines that start with \textit{\#} are called comments, the interpreter ignores these, they are just notes for programmers reading the code. \medskip

Certain objects can have their types converted into other types (also called 'type casting'). These type conversions can be performed with functions like \textit{float()} and \textit{int()} which convert certain objects into \textit{float} and \textit{int} types respectively:

\begin{minted}{python}
float(5)
# Converts the int 3 into the float 5.0

int(2.6)
# Truncates the float 2.6 into the int 3
\end{minted}

One of the most useful commands that you can use is the \textit{print()} function that \textit{prints} the given object for the user to see:

\begin{minted}{python}
print(7)
# Prints 7

print(2+5)
# Prints 7
\end{minted}

\section{Operators and variables}
Operators are in Python are the mostly the same as those that we use in every day life, like \textbf{\textit{+}} and \textbf{\textit{-}}. Here's a list of the ones that can be performed on \textit{ints} and \textit{floats}: \medskip

\begin{itemize}
\item \textbf{x + y -}  x plus y
\item \textbf{x - y -}  x minus y
\item \textbf{x * y -}  x times y
\item \textbf{x / y -}  x divided by y
\item \textbf{x \% y -}  the remainder of x divided by y
\item \textbf{x ** y -}  x to the power of y
\end{itemize}

Just like in normal mathematics, parentheses can be used to tell Python which operations to do first. Python follows the 'BODMAS' (or equivalent) order of operations - \textbf{B}rackets, \textbf{O}rders, \textbf{D}ivision, \textbf{M}ultiplication, \textbf{A}ddition and \textbf{S}ubtraction. \medskip

This is all well and good, but what happens if we want to store some information? This is where variables come in. Variables are, in essence, boxes in which we can store objects. Variables can be assigned values using the \textit{=} sign. For example:

\begin{minted}{python}
pi = 3.14159
type(pi)
# Returns 'float'

year = 2020
type(year)
# Returns 'int'
\end{minted}

Variables store values in the computer's memory. The above assignments bind a value to a given name, this allows the values to be invoked by using the variable name. We use variables in order to reuse names instead of values, this makes it easier to work with the program.

\begin{minted}{python}
a = 56
b = 32
a = a + b
# An equivalent statement would be 'a += b'

print(a)
# Prints '88'
\end{minted}

As shown above, variables can be re-bound, meaning that names can be assigned to new values. The previous value may still be stored in memory, but the variable no longer \textit{points} to it.
\end{document}