%% ================================================================
\section{Overview}

Here I want to spell out in a little more detail than \cite{bib:lee3} what
sharps, flats, contraction, and tensor inner products look like in coordinates.
In particular, I want to show how things look in terms of row vectors, column
vectors, and matrices whenever possible.  I could work this out on scratch
paper (and I have done so), but (as is my wont) it seems a shame not to typeset
these useful things for legible future reference.

%% ================================================================
\newpage
\section{Notation}

In this section I spell out some details of the Einstein summation convention.
Let $(M,g)$ be a Riemannian $m$-manifold.  We are working in the category of
smooth manifolds, so when I say \emph{map} or \emph{section}, I mean
\emph{smooth map} and \emph{smooth section}.

\bfidx{Vector fields:}
Let $X,Y$ be vector fields on $M$.  These are sections of the tangent bundle
$TM$.  A \emph{collection of several vectors} will be indexed by subscripts.
In particular, in coordinates defined on an open subset of $M$, $TM$ is spanned
by
$$
	\frac{\D}{\Dx^1}, \ldots, \frac{\D}{\Dx^m}.
$$
Those look like superscripts but they're in the denominator so we think of them
as subscripts.

The \emph{components of a single vector} will be indexed by superscripts.  In
particular, the $m$ coordinates for a point $\vecq$ of $M$, in a given
coordinate chart, will be written
$$
	x^1, \ldots, x^m.
$$
Likewise, since the $\DDx^j$'s span $TM$, each $X$ is a linear combination
thereof with coefficients $X^j$:
$$
	X = \sum_{j=1}^m X^j \frac{\D}{\Dx^j}.
$$
The \bfidx{Einstein summation convention}\index{summation convention} is used:
If the same index appears repeated in an expression, once in a subscript
and once in a superscript, then the summation is implicit.  We write
$$
	X = X^j \frac{\D}{\Dx^j}.
$$

\bfidx{Covector fields:}
Let $\lambda,\mu$ be covector fields (1-forms) on $M$.  These are sections of
the tangent bundle $TM$.  A \emph{collection of several covectors} will be
indexed by subscripts.  In particular, in coordinates defined on an open subset
of $M$, $T^*M$ is spanned
by
$$
	dx^1, \ldots, dx^m.
$$

The \emph{components of a single covector} will be indexed by subscripts.
Since the $dx^i$'s span $T^*M$, each $\lambda$ is a linear combination
thereof with coefficients $X^i$:
$$
	\lambda = \sum_{i=1}^m \lambda_i dx^i.
$$
Again, using Einstein summation, this is
$$
	\lambda = \lambda_i dx^i.
$$

\bfidx{Tensor fields:} A tensor of type ${k \choose \ell}$ has $k$ covariant
components and $\ell$ contravariant components.  A covector field has type ${1
\choose 0}$ and is covariant:
$$
	\lambda \in T^1(M)
$$
a vector field has type ${0 \choose 1}$ and is
contravariant:
$$
	X \in T_1(M);
$$
The above index convention applies: the covariant components of
a tensor are superscripts (or denominator subscripts), and the contravariant
components of a tensor are subscript (or denominator superscripts).

\bfidx{Metric tensor fields:}  We usually call these simply \emph{metric
tensors}.  The metric 2-tensor on the Riemannian manifold $(M,g)$ is $g$.  It
is a symmetric positive-definite doubly covariant 2-tensor; it is a bilinear
map from $TM \times TM$ to $\R$.  We write
$$
	g(X,Y).
$$
Since $g$ is covariant, the components of $g$ are $g_{ij}$ for $1 \le i,j \le
m$.  Since the components of $X$ and $Y$ are $X^i$ and $Y^i$, respectively,
and using linearity, we have
\begin{align*}
	g(X,Y) &= g\left(X^i \frac{\D}{\Dx^i}, Y^j \frac{\D}{\D x^j}\right) \\
	&= X^i Y^j g\left(\frac{\D}{\Dx^i}, \frac{\D}{\D x^j}\right).
\end{align*}
We write
$$
	g_{ij} = g\left(\frac{\D}{\Dx^i}, \frac{\D}{\D x^j}\right).
$$
and call these the \emph{components} of $g$.
Then we have simply
$$
	g(X,Y) = g_{ij}X^i Y^j.
$$


%Below, I will sometimes write these indices
%
%Write $G$ for the matrix of $g$.

%% ================================================================
\newpage
\section{Matrix view of vectors, covectors, linear transformations, and
metrics}

\begin{rem}
Recall that $\lambda(X)$ is, in coordinates,
$$
	\lambda(X) = \lambda_i X^i.
$$
Since covectors are row vectors and vectors are column vectors, we have
$$
	\lambda(X) =
		\pcmatrix{\lambda_1 & \ldots & \lambda_m}
		\pcmatrix{X^1 \\ \vdots\\ X^m}.
$$
\end{rem}

\begin{rem}
Let $A$ be a linear transformation on $TM$.
Recall that $A(X)$ is, in coordinates,
$$
	A(X) = A^i_j X^j.
$$
From the matrix point of view, we have
$$
	A(X) =
		\pcmatrix{
			A^1_1  & \ldots & A^1_m  \\
			\vdots &        & \vdots \\
			A^m_1  & \ldots & A^m_m  \\
		}
		\pcmatrix{X_1 \\ \vdots\\ X_m}.
$$
That is, a matrix times a column vector is another column vector.
\end{rem}

\begin{rem}
Likewise, if $\lambda$ is a row vector, then $\lambda A$ is another
row vector:  In coordinates,
$$
	\lambda A = \lambda_i A^i_j.
$$
From the matrix point of view, we have
$$
	\lambda A =
		\pcmatrix{\lambda_1 & \ldots & \lambda_m}
		\pcmatrix{
			A^1_1  & \ldots & A^1_m  \\
			\vdots &        & \vdots \\
			A^m_1  & \ldots & A^m_m  \\
		}.
$$
\end{rem}

\begin{rem}
We can think of a linear transformation as a \bfidx{mixed tensor} of type
1-1.  This means it must consume a covector and a vector, as follows:
$$
	A(\lambda,X) = \lambda A X.
$$
Note that the expression on the right is well-defined without parentheses
due to the commutativity of matrix multiplication.
In coordinates,
$$
	\lambda A X = \lambda_i A^i_j X^j.
$$
From the matrix point of view, we have
$$
	\lambda A X =
		\pcmatrix{\lambda_1 & \ldots & \lambda_m}
		\pcmatrix{
			A^1_1  & \ldots & A^1_m  \\
			\vdots &        & \vdots \\
			A^m_1  & \ldots & A^m_m  \\
		}
		\pcmatrix{X_1 \\ \vdots\\ X_m}.
$$
\end{rem}

\begin{rem}
This is superficially similar to computing $g(X,Y)$:
$$
	g(X,Y) = g_{ij}X^i Y^j.
$$
Now, $g$ does \emph{not} change coordinates in the same way as a matrix $A$;
$g$ is of type ${2 \choose 0}$ and $A$ is of type ${1 \choose 1}$.
Nonetheless, for fixed coordinates, if we think of the two-dimensional
array $g_{ij}$ as a matrix $G$, then we can think of $g(X,Y)$ as
$$
	g(X,Y) = X^t G Y.
$$
\end{rem}

%% ================================================================
\newpage
\section{Contraction, flats, and sharps}

\begin{defn}
The \bfidx {flat operator} or \bfidx{index-lowering operator} takes vectors to
covectors:
$$
	X \mapsto X^\flat
$$
such that for all $Y$,
$$
	X^\flat(Y) = g(X,Y).
$$
\end{defn}

\begin{rem}
In coordinates, the right-hand side is
$$
	g(X,Y) = g_{ij} X^i Y^j
$$
and the left-hand side is (since $X^\flat$ is a covector)
$$
	X^\flat(Y) = X^\flat_j Y^j.
$$
Setting these two equal means that
$$
	X^\flat_j = g_{ij} X^i.
$$
According to \cite{bib:lee3}, it is standard practice to write
$$
	X^\flat = X_j dx^j,
$$
so we have simply
$$
	X_j = g_{ij} X^i.
$$
As matrices, we have
$$
	X^\flat = X^t G.
$$
\end{rem}

\begin{defn}
The \bfidx{sharp operator} or \bfidx{index-raising operator} takes covectors to
vectors:
$$
	\lambda \mapsto \lambda^\sharp
$$
such that for all $Y$,
$$
	\lambda(Y) = g(\lambda^\sharp,Y).
$$
\end{defn}
This is constructed to be the inverse of the flat operator.

\begin{rem}
In coordinates, the left-hand side is
$$
	\lambda(Y) = \lambda_j Y^j
$$
and the right-hand side is (since $\lambda^\sharp$ is a vector)
$$
	g(\lambda^\sharp,Y) = g_{ij} (\lambda^\sharp)^i Y^j.
$$
Setting these two equal means that
$$
	\lambda_j = g_{ij} (\lambda^\sharp)^i.
$$
Apparently, it is also standard practice to write
$$
	\lambda^\sharp = \lambda^i \frac{\D}{\Dx^i}.
$$
Then we write simply
$$
	\lambda_j = g_{ij} \lambda^i.
$$
As matrices, we have
$$
	\lambda = (\lambda^\sharp)^t G.
$$
Now, since $G$ is invertible, this is the same as
$$
	\lambda G^{-1} = (\lambda^\sharp)^t
$$
which as a sum is
$$
	\lambda_i g^{ij} = \lambda^j
$$
as long as we define $g_{ij}$ to be the components of $G$ and $g^{ij}$ to be
the components of $G^{-1}$.
\textbf{Note:}  This doesn't match Lee, but I can't find my mistake (or his).
\end{rem}

\begin{defn}
\bfidx{trace} or \bfidx{contraction} \ldots .
\end{defn}

%% ================================================================
\newpage
\section{Formulas}

These are formulas involving metrics, covariant derivatives, Christoffel
symbols, and various types of curvature.

%% ----------------------------------------------------------------
\subsection{Notation}

Throughout let
$$
	\{E_i\}_{i=1}^n
$$
be a local frame on an $n$-dimensional Riemannian manifold $(M,g)$.
In particular,
$$
	\left\{\fracD{x^i}\right\}_{i=1}^n
$$
is a local frame with respect to a coordinate $\vecx$.
For brevity, I will write this as
$$
	\left\{\D_i\right\}_{i=1}^n.
$$
Note that the denominator superscript $i$ has become a subscript $i$
outside of a fraction, in keeping with the Einstein convention.

The \bfidx{Lie bracket} of two vector fields $X$ and $Y$ is
\begin{align}
	[X,Y] = XY - YX.
\end{align}

The \bfidx{product rule} gives
\begin{align}
	X(fY) = X(f) Y + f X Y.
\end{align}

Tensors are listed as type ${k \choose \ell}$ where the upper valence is
covariant and the lower valence is contravariant.  In particular, a $k$-form is
a tensor of type ${k \choose 0}$, a vector field is of type ${0 \choose 1}$,
and the Riemannian metric is of type ${2 \choose 0}$.

%% ----------------------------------------------------------------
\subsection{Riemannian metric}

The \bfidx{Riemannian metric}:
\begin{eqnarray}
	g_{ij} = g(E_i, E_j).
\end{eqnarray}
Recall that $g_{ij}$ is symmetric in $i$ and $j$.  This is an $n \times n$
array.  Treated as a matrix, it has an inverse (since it is positive definite).
This is written
\begin{eqnarray}
	g^{ij}.
\end{eqnarray}

%% ----------------------------------------------------------------
\subsection{Christoffel symbols, connections, and covariant derivatives}

\bfidx{Christoffel symbols} in terms of the metric:
\begin{eqnarray}
	\Gamma_{ij}^k &=& \frac{1}{2} g^{km}\left(
		\D_i g_{jm} + \D_j g_{im} - \D_m g_{ij}
		\right).
\end{eqnarray}
Recall that $\Gamma_{ij}^k$ is symmetric in $i$ and $j$.

A \bfidx{connection} $\nabla_X Y$ satisifies:
\begin{align}
	\nabla_{fX}Y   &= f\nabla_X Y          &\;\textrm{ and additivity in X} \\
	\nabla_{X}(fY) &= X(f) Y + f \nabla_X Y&\;\textrm{ and additivity in Y} \\
\end{align}

This defines a connection $\nabla$:
\begin{align}
	\nabla_{E_i} E_j = \Gamma_{ij}^k E_k
\end{align}
with extension by linearity.  xxx fill in the steps:
\begin{align}
	\nabla_X Y = (XY^k + X^i Y^j \Gamma_{ij}^k) E_k.
\end{align}

\bfidxtwo{Compability}{compatibility} of covariant derivative $\nabla$
and metric $g$:
\begin{align}
	\D_k g\left(\D_i, \D_j\right)
		&= g\left(\nabla_{\D_k} \D_i, \D_j \right)
		+  g\left(\D_i, \nabla_{\D_k} \D_j \right).
\end{align}

\bfidxtwo{Torsion}{torsion} ${2 \choose 1}$-tensor:
\begin{align}
	\tau(X,Y) = \nabla_X Y - \nabla_Y X - [X,Y].
\end{align}

xxx cmt on torsion-freeness of the Levi-Civita connection:
\begin{align}
	\nabla_X Y - \nabla_Y X = [X,Y].
\end{align}

%% ----------------------------------------------------------------
\subsection{Section title TBD}

\bfidxtwo{Shape operator}{shape operator}:

10-09 notes:  II stuff \ldots .

xxx:
\begin{align}
	II(X,Y) = g(X,Y) \nhat
\end{align}
with $(\tilde M, \tilde g)$ and $(M, g)$ setup.

%% ----------------------------------------------------------------
\subsection{Section title TBD}

\bfidx{Riemann measure}:
\begin{align}
	\left| \sqrt{\det(g)} \, dx^1 \wedge \cdots \wedge dx^n \right|.
\end{align}

\bfidx{Riemann volume}:
\begin{align}
	\sqrt{\det(g)} \, dx^1 \wedge \cdots \wedge dx^n.
\end{align}

%% ----------------------------------------------------------------
\subsection{Curvatures}

xxx:
\begin{align}
	R(X,Y)Z = \nabla_X \nabla_Y Z - \nabla_Y \nabla_X Z - \nabla_{[X,Y]} Z.
\end{align}

xxx (or $\mathrm{Rm}$?):
\begin{align}
	R(X,Y,Z,W) &= g(R(X,Y)Z, W) \\
	&= R_{ijk\ell} X^i Y^j Z^k W^\ell
\end{align}

Dimension 2:  There is only one sectional curvature $R_{1221}$.
\begin{align}
	\Ric(X,Y) = K g(X,Y); S=2K.
\end{align}

10-11 notes: principal, mean, sectional curvatures

10-11 notes:  \bfidx{Gauss equation}

10-16 notes:  Ric and $R$ on a frame.

\bfidx{Bianchi identities}:
Define
$$
	\nabla_R(X,Y,Z,W,V) = \nabla_V R(X,Y,Z,W).
$$
Then
\begin{align}
	R(X,Y,Z,W) + R(Y,Z,X,W) + R(Z,X,Y,W) &= 0 \\
	\nabla_R(X,Y,Z,V,W) +
	\nabla_R(Y,V,Z,W,X) +
	\nabla_R(V,X,Z,W,Y) &= 0.
\end{align}

xxx 3 symmetries of $R$:
\begin{align}
	R(X,Y,Z,W) &= -R(Y,X,Z,W) \\
	R(X,Y,Z,W) &= -R(X,Y,W,Z) \\
	R(X,Y,Z,W) &= +R(W,Z,X,Y).
\end{align}

\bfidxtwo{Sectional curvature}{sectional curvature}:
\begin{align}
	K(X,Y) = \frac{R(X,Y,Y,X)}{g(X,X)+g(Y,Y)-g(X,Y)^2}.
\end{align}

xxx:
\begin{align}
	R_{ijk}{}^{\ell} &=
		\D_i \Gamma_{jk}^\ell - \D_j \Gamma_{ij}^\ell
		+ \Gamma_{ik}^m \Gamma_{jm}^\ell
		- \Gamma_{jk}^m \Gamma_{im}^\ell.
\end{align}

xxx:
\begin{align}
	R = \nabla_X \nabla_Y - \nabla_Y \nabla_X - \nabla_{[X,Y]}.
\end{align}

\bfidxtwo{Scalar curvature}{scalar curvature} $S$ or $R$:
\begin{align}
	S = g^{ij} R_{ij} = g^{k\ell}g^{ij} R_{kij\ell}.
\end{align}

\bfidx{Ricci flow}:
\begin{align}
	\frac{\D}{\D t} g_{ij} = -2 R_{ij}.
\end{align}

%% ----------------------------------------------------------------
\subsection{To be filed}

xxx comment on (with $\phi$ a 1-form):
\begin{align}
	d\phi(X,Y) = X \phi(Y) - Y \phi(X) - \phi([X,Y]).
\end{align}

xxx ??:
\begin{align}
	g\left(\nabla_X Y, Z\right) = \frac{1}{2}\left(
		X g(Y,Z) + \ldots \textrm{(look up in Lee)}
		\right).
\end{align}
