## Covariant and contravariant basis, matric tensors
> [!Notice]
> - $Z = (Z^1, Z^2, Z^3)$: coordinates of a point in the space
> - $\mathbf{R}(Z)$: position vector as a function of coordinates
> - $\mathbf{Z}_i := \partial \mathbf{R} / \partial Z^i$: covariant basis vectors
> - $Z_{ij} := \mathbf{Z}_i \cdot \mathbf{Z}_j$: inner product–defined covariant components
> - $Z^{ij} := \mathbf{Z}^i \cdot \mathbf{Z}^j$: inner product–defined contravariant components
Here the entire discussion is in Euclidean space, although most of these concepts are still valid in other spaces. It is worth to emphasize that **Euclidean space** is not **Cartesian coordinates**. A space is independent of coordinates selection. The properties of a space is inherent, while the coordinates only act as the representation.
>[!Note]-
>Some properties of Euclidean space:
>1. $\textbf{Dimensionality}$: Euclidean space is denoted as $\mathbb{R}^n$, where $n$ represents the dimension.
>2. $\textbf{Distance}$: The distance between two points $\mathbf{p} = (p_1, p_2, \dots, p_n)$ and $\mathbf{q} = (q_1, q_2, \dots, q_n)$ is given by: $d(\mathbf{p}, \mathbf{q}) = \sqrt{(q_1 - p_1)^2 + (q_2 - p_2)^2 + \cdots + (q_n - p_n)^2}$
>3. $\textbf{Inner Product and Norm}$: The inner product of two vectors $\mathbf{u}, \mathbf{v} \in \mathbb{R}^n$ is defined as: $\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2 + \cdots + u_n v_n$ The norm of a vector $\mathbf{v}$ is: $ \| \mathbf{v} \| = \sqrt{\mathbf{v} \cdot \mathbf{v}}$
>4. $\textbf{Orthogonality}$: Two vectors are orthogonal if their inner product is zero, i.e., $\mathbf{u} \cdot \mathbf{v} = 0$.
>5. $\textbf{Coordinate System}$: Points in Euclidean space are represented by Cartesian coordinates $(x_1, x_2, \dots, x_n)$.
>6. $\textbf{Isometries}$: Transformations that preserve distances, such as translations, rotations, and reflections, are called isometries.
>
> One may imagine it as our physical space. But notice, the most critical difference is the zero curvature. Under coordinates variation, we do not necessarily have the lengths being seemingly "straight", and other geometrical measures could be different from intuitions and being not obvious.
The concepts introduced in this chapter is mostly variants, except for the position vector $\mathbf{R}$. As for invariants, we will discuss in [[General idea on tensor properties]].
### The position vector $\mathbf{R}$
The position vector is a vector $\mathbf{R}$ that represents the position of points in the Euclidean space with respect to an arbitrarily selected point $O$. This requires the vector being *straight*, while straightness is a characteristic of the Euclidean space. This is a concept that can only be properly defined in Euclidean space, and does not work on a spherical surface, etc. But keep in mind that the construction of such position vector does not have any restrictions on coordinate system. (after all coordinates is just how we represent)
We call objects that can be constructed without a reference to a coordinate system *geometric*. Those have to be constructed with coordinates but then become independent with the coordinates are called *invariant*. All invariant objects are geometric so these two words are used interchangeably in many cases, but finding the geometric description of some invariants could be very difficult.
Now we place our position vector into a coordinate system $Z^{i}$ in Euclidean space. The system is arbitrary and does not have to be Cartesian. In three dimensional Euclidean space, the index $i$ could be $1, 2, 3$, and $Z^{i}$ are $Z^{1}, Z^{2}, Z^{3}$. We assume the 3D case for following contents.
With each valid combination of $Z^{1}, Z^{2}, Z^{3}$, there corresponds a specific value of the position vector $\mathbf{R}$, denoted as $\mathbf{R}(Z)$. We may write
$\mathbf{R}=\mathbf{R}(Z)$
indicating that the position vector $\mathbf{R}$ (left hand side) is a function $\mathbf{R}$ (right hand side) of $Z$, the coordinates (three variables).
It is essential to treat $\mathbf{R}$ as a primary object that is subject to its own set of rules and operations and do not consider specific coordinate systems.
>[!Note]-
>If define the arc length $s$ and consider $\mathbf{R}(s)$, define $\mathbf{R}'(s)=1$, then $\mathbf{T}=\mathbf{R}'(s)$ is the unit tangent vector. This is the exercise 60 in the book. One may think from the aspect that directly based on the definition that $\mathbf{R}'(s)=\lim_{\delta s \rightarrow0} \frac{R(s+\delta s)-R(s)}{\Delta s}$. Remember $\mathbf{R}$ is the position vector as well as a function.
### The covariant basis and metric tensor
#### Covariant basis
> [!Tip]-
> **Where does the direction of "covariant" and "contravariant" come from?**
>
> The terms **covariant** and **contravariant** are not arbitrarily assigned based on the Jacobian matrix. Instead, they are derived from the requirement that **geometric objects must remain invariant under coordinate transformations**.
>
> **Step 1: Start from geometric invariance**
> Consider a vector $\mathbf{V}$, expressed in two coordinate systems:
> $
> \mathbf{V} = V^i \mathbf{Z}_i = V^{i'} \mathbf{Z}_{i'}.
> $
> This equality expresses a physical requirement: **the vector $\mathbf{V}$ does not change**, even if its components and basis do.
>
> **Step 2: Use chain rule to transform the basis**
> The covariant basis is defined as $\mathbf{Z}_i = \partial \mathbf{R}/\partial Z^i$. Using the chain rule:
> $
> \mathbf{Z}_{i'} = \frac{\partial \mathbf{R}}{\partial Z^{i'}} = \frac{\partial Z^i}{\partial Z^{i'}} \mathbf{Z}_i = J^i_{i'} \mathbf{Z}_i.
> $
> This is a **mathematical fact**, not a definitional choice.
>
> **Step 3: Demand invariance to solve for component transformation**
> Substituting into the invariance condition:
> $
> \mathbf{V} = V^{i'} \mathbf{Z}_{i'} = V^{i'} J^i_{i'} \mathbf{Z}_i = V^i \mathbf{Z}_i,
> $
> which implies:
> $
> V^i = V^{i'} J^i_{i'} \quad \Rightarrow \quad V^{i'} = V^i \frac{\partial Z^{i'}}{\partial Z^i} = V^i J^{i'}_i.
> $
> Thus, the **component must transform "in the opposite way"** compared to the basis.
>
> **Step 4: Naming based on transformation behavior**
> We then assign names:
> - Basis vectors $\mathbf{Z}_i$ follow the direction of coordinate transformation ⇒ **covariant**.
> - Components $V^i$ transform with the inverse Jacobian ⇒ **contravariant**.
>
> **The Jacobian direction is a result, not a premise**
> The Jacobians $J^i_{i'}$ and $J^{i'}_i$ are **mathematical inverses**. They are both valid, and the transformation is fully reversible.
>
> But in expressing how objects transform, we must define:
> - what is being transformed,
> - from which coordinate system to which.
>
> This **role assignment** — component vs. basis, old vs. new — gives rise to the **apparent directionality**.
>
> Therefore, the directionality of the Jacobian indices **emerges from the requirement of geometric consistency**, not from an arbitrary convention.
With the position vector, we can define the covariant basis as
$\mathbf{Z}_i = \frac{\partial \mathbf{R}({Z})}{\partial {Z}^i}$
the differentiation of $\mathbf{R}(Z)$ with respect to each of the coordinates. The covariant basis is a generalization of the affine coordinate basis to curvilinear coordinate systems. It is a local coordinates basis since it is position dependent and varies from the point selected.
From the expression, we can see that $\mathbf{Z}_i$ is a set of **vectors**. If write the live index explicitly, we have
$\begin{aligned} \mathbf{Z}_1 &= \frac{\partial \mathbf{R}(Z^1, Z^2, Z^3)}{\partial Z^1} \, ; \\ \mathbf{Z}_2 &= \frac{\partial \mathbf{R}(Z^1, Z^2, Z^3)}{\partial Z^2} \, ; \\ \mathbf{Z}_3 &= \frac{\partial \mathbf{R}(Z^1, Z^2, Z^3)}{\partial Z^3} \, . \end{aligned}$
and if collapse $\mathbf{Z}$, we have
$\begin{aligned} \mathbf{Z}_1 &= \frac{\partial \mathbf{R}({Z})}{\partial Z^1} \, ; \\ \mathbf{Z}_2 &= \frac{\partial \mathbf{R}({Z})}{\partial Z^2} \, ; \\ \mathbf{Z}_3 &= \frac{\partial \mathbf{R}({Z})}{\partial Z^3} \, . \end{aligned}$
In specific coordinates, they look like the followings,
![[Drawing 2024-10-12 23.45.22.excalidraw.svg]]
The covariant basis $\mathbf{Z}_{i}$ is a primary object, and although rely on coordinate systems, but do not have to be Cartesian or any specified systems. They are just vectors. These basis provides a convenient basis for decomposing other vectors. For example $\mathbf{V}$,
$\mathbf{V} = V^1 \mathbf{Z}_1 + V^2 \mathbf{Z}_2 + V^3 \mathbf{Z}_3$
or in tensor form,
$\mathbf{V} = V^i \mathbf{Z}_i$
Here the components $V^{i}$ of $\mathbf{V}$ are the scalar values, called the contravariant components of $\mathbf{V}$. With covariant basis they can be written in above forms.
#### Covariant metric tensor
>[!Notice]
>Here to match the book, we use the notation $Z_{ij}$ for metric tensors. In physics and many other cases, it is written as $g_{ij}$. Namely,
>$g_{ij}=\mathbf{Z}_{i}\cdot \mathbf{Z}_{j}$
>$g^{ij}=\mathbf{Z}^{i}\cdot \mathbf{Z}^{j}$
With covariant basis defined, we may have the covariant metric tensor $Z_{ij}$,
$Z_{ij} = \mathbf{Z}_i \cdot \mathbf{Z}_j$
The definition is given by the **inner product** of the covariant basis vectors. (This expression is written in contracted form, and it is actually not a very good definition cause in some cases inner product should be define later than the metric tensor, see the notice later) The inner product is well defined in Euclidean space (dot product), but for the definition of inner product, see [[Quick overview of algebraic structures#Bilinear form]]. Due to the fact that the inner product is commutative, the metric tensor is symmetric, so
$Z_{ij}=Z_{ji}$
>[!Note]
>The metric tensor is called the *fundamental tensor* in tensor calculus; In linear algebra it is called the *inner product matrix* or the *Gram matrix*.
>$G = \begin{pmatrix} \langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_1, \mathbf{v}_n \rangle \\ \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_2, \mathbf{v}_n \rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle \mathbf{v}_n, \mathbf{v}_1 \rangle & \langle \mathbf{v}_n, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_n, \mathbf{v}_n \rangle \end{pmatrix}$
>[!Notice]
>The definition is defined with **inner product**, this is a good and well defined definition in inner product space. But for **pseudo-Riemannian manifolds** (like Minkowski space), we lose the **positive definiteness**, so it is no longer a strictly defined inner product. However, with the commutative property established, the metric tensor expression is still valid if consider the operation as a commutative bilinear form.
>Having the metric tensor defined in more general space, including noncommutative geometry is far beyond the scope of this discussion and requires additional structures to have it defined.
>For Riemannian spaces, **it is the metric tensor first given**, then the inner product could be defined (as $\mathbf{u}\cdot \mathbf{v}=Z_{ij}u^{i}v^{j}$, see later formulas).
The covariant metric tensor carries the complete information about the **inner product** and is the main tool in measuring lengths, areas, volumes.
For example, two vectors $\mathbf{U}$ and $\mathbf{V}$ are located at the same point and have components $U^{i}$ and $V^{i}$, then the inner product could be defined as
$\mathbf{U} \cdot \mathbf{V} = Z_{ij} U^i V^j$
The proof is easy, just,
$\mathbf{U} \cdot \mathbf{V} = U^i \mathbf{Z}_i \cdot V^j \mathbf{Z}_j = (\mathbf{Z}_i \cdot \mathbf{Z}_j) U^i V^j = Z_{ij} U^i V^j$
> [!Notice]
> The properties of inner product is from its definition in Euclidean space. That is to say, the inner product is the operation that predefined, instead of metric tensor.
We may prove that the metric tensor (in well defined inner product space) is positive definite if written in matrix form. The proof relies on the positive definitive property of inner product (see [[Quick overview of algebraic structures#Bilinear form]]). One may notice that the inner product gives a quadratic form if we take $\mathbf{U}$ and $\mathbf{V}$ a same vector, $\mathbf{V}\cdot \mathbf{V}=Z_{ij} V^i V^j=\mathbf{V}^{\top} Z \mathbf{V}=Q(\mathbf{V})$.
> [!Proof]-
> To prove the positive definiteness, we should show for any non-zero vector $\mathbf{V}$, $\mathbf{V}^{^\top} Z \mathbf{V} > 0$. This $Z$ is the matrix form of $Z_{ij}$. If write the quadratic form as the matrix expression explicitly (**this is not suggested though, consider tensor operations from the beginning**), we should have
> $\mathbf{V}^{^\top} Z \mathbf{V}=\begin{pmatrix} V^1 & V^2 & \cdots & V^n \end{pmatrix} \begin{pmatrix} Z_{11} & Z_{12} & \cdots & Z_{1n} \\ Z_{21} & Z_{22} & \cdots & Z_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ Z_{n1} & Z_{n2} & \cdots & Z_{nn} \end{pmatrix} \begin{pmatrix} V^1 \\ V^2 \\ \vdots \\ V^n \end{pmatrix} = V^i V^j Z_{ij} $
> The result is $V^i V^j Z_{ij}$, from the definition, this is exactly $\mathbf{V}\cdot \mathbf{V}$. The metric tensor automatically links the quadratic form and inner product. Since inner product satisfies the positive definiteness, we have $\mathbf{V}\cdot \mathbf{V}>0$ for non-zero $\mathbf{V}$.
> Therefore, we proved the positive definiteness of covariant metric tensor $Z_{ij}$. This is valid as long as the strict inner product definition is satisfied. For pseudo-Riemannian manifold we no longer have this property. The positive definiteness of metric tensor ensures that all lengths (norms) are positive and provides physical significance for areas, volumes, etc.
With the positive definiteness, we can obtain the (Euclidean) lengths of vector $\mathbf{V}$ as Euclidean norm,
$\|\mathbf{V}\|=\sqrt{\mathbf{V}\cdot \mathbf{V}}=\sqrt{Z_{ij} V^i V^j}$
With inner product and lengths, the angle could be defined.
### The contravariant basis and metric tensor
The contravariant metric tensor $Z^{ij}$ is given by the matrix inverse,
$Z^{ij}Z_{jk}=\delta^{i}_{k}$
>[!Notice]
>From the matrix point of view, if we define $Z^{jk}$ as matrix $Z$, then the above equation is equivalent to
>$Z^{-1}\, Z=I$
>The tensor form is just writing the $n^{2}$ linear equation explicitly and applied the contracted notation. (we have two live index, so the number of equation is $n^{2}$)
>
> > [!Note]-
> > Write the dummy index explicitly,
> >$\sum_{j=1}^{n} Z^{ij}Z_{jk}=\delta^{i}_{k}$
> >This is equivalent to $Z^{-1}\, Z=I$ if
> >$Z = \begin{pmatrix} Z_{11} & Z_{12} & \cdots & Z_{1n} \\ Z_{21} & Z_{22} & \cdots & Z_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ Z_{n1} & Z_{n2} & \cdots & Z_{nn} \end{pmatrix}$
> >and
> >$Z^{-1} = \begin{pmatrix} Z^{11} & Z^{12} & \cdots & Z^{1n} \\ Z^{21} & Z^{22} & \cdots & Z^{2n} \\ \vdots & \vdots & \ddots & \vdots \\ Z^{n1} & Z^{n2} & \cdots & Z^{nn} \end{pmatrix}$
From the property of inverse matrix, we can change the contraction to the other index, namely
$Z^{ij}Z_{kj}=\delta^{i}_{k}$
Since the inverse of a symmetric matrix is also symmetric, the contravariant metric tensor is also symmetric, namely
$Z^{ij}=Z^{ji}$
This can be deduced from $Z^{ij}Z_{kj}=\delta^{i}_{k}$ too. Similarly to the proof we had before, we can also prove that the $Z^{ij}$ is positive definite.
From the contravariant metric tensor, we may get the contravariant basis,
$\mathbf{Z}^i = Z^{ij} \mathbf{Z}_j$From the symmetric property of the contravariant metric tensor, it can also be written as
$\mathbf{Z}^i = Z^{ji} \mathbf{Z}_j$
Examine the inner product of $\mathbf{Z}^{i}$ and $\mathbf{Z}_{j}$,
$\mathbf{Z}^i \cdot \mathbf{Z}_j =Z^{ik} \mathbf{Z}_k\cdot \mathbf{Z}_{j} = Z^{ik} Z_{jk}=\delta^i_j$
They are mutually orthonormal for $i\neq j$. This orthonormality is granted by inner product in Euclidean space.
We can also show, similar to the covariant basis,
$\mathbf{Z}^i \cdot \mathbf{Z}^j = Z^{ij}$
and from contravariant basis to covariant basis with contravariant metric tensor,
$\mathbf{Z}_i = Z_{ij} \mathbf{Z}^j$
### Decomposition with respect to a basis by dot product
With contravariant basis and covariant, one can find the components of the $\mathbf{V}$ after decomposition with respect to covariant or contravariant basis for non-orthogonal basis, namely
$\mathbf{V}=V^{i}\mathbf{Z}_{i}$
$\mathbf{V} \cdot \mathbf{Z}^i = {V}^j \mathbf{Z}_j \cdot \mathbf{Z}^i = {V}^j \delta_j^i = {V}^i$
Here $V^{i}$ is the contravariant component decomposed on covariant basis $\mathbf{Z}_{i}$, and
$\mathbf{V}=V_{i}\mathbf{Z}^{i}$
$\mathbf{V} \cdot \mathbf{Z}_{i} = {V}_{j} \mathbf{Z}^{j} \cdot \mathbf{Z}_{i} = {V}_{j} \delta_i^j = {V}_{i}$
Here $V_{i}$ is the covariant component decomposed on contravariant basis $\mathbf{Z}^{i}$.
>[!Note]
>The decomposition means turning a vector into the linear combinations of basis vectors. Since it is the inner product ensures the orthogonality. This means using inner product doing decomposition will automatically requires orthogonality.
>For orthonormal basis, this can be performed in an elegant manner, namely
>$\mathbf{V} = V_1 \mathbf{e}_1 + \cdots + V_N \mathbf{e}_N$
>$V_{i}=\mathbf{V}\cdot \mathbf{e}_{i}$
>But if the basis cannot meet the orthogonal requires, which is typical for our covariant and contravariant basis, then we cannot directly use the inner product. The method is to construct a pair of orthogonal basis, namely our covariant and contravariant basis.
>![[Drawing 2024-10-17 22.31.27.excalidraw.svg]]
>For example, the green vector cannot be properly decomposed simply using the projections. This is the reason we have the components (coefficients) being the contravariant while the basis being covariant (and vice versa). Using such combination, we can have the decomposition still satisfy the inner product operation.
### Metric tensor and measuring lengths
As shown before, the length is given by the inner product, $\|\mathbf{V}\|=\sqrt{\mathbf{V}\cdot \mathbf{V}}=\sqrt{Z_{ij} V^i V^j}$. Applying this to a curve with metric tensor property (will be discussed in [[The fundamental properties of tensors]]) considered, we may have for curve $L$,
$L = \int_a^b \sqrt{Z_{ij} \frac{\mathrm{d}Z^i}{dt} \frac{\mathrm{d}Z^j}{\mathrm{d}t}} \, \mathrm{d}t$
This expression in Cartesian coordinates is the familiar expression,
$L = \int_a^b \sqrt{\left( \frac{\mathrm{d}x}{\mathrm{d}t} \right)^2 + \left( \frac{\mathrm{d}y}{\mathrm{d}t} \right)^2 + \left( \frac{\mathrm{d}z}{\mathrm{d}t} \right)^2} \, \mathrm{d}t$
This also links the metric tensor and measuring length. The lengths of curves can be calculated from the metric tensor and *vice versa*.
Objects can be obtained by measuring distances and their derivatives is called ***intrinsic***. An example is metric tensor, so all objects that could be expressed with metric tensor and its derivatives are also intrinsic. [[The Christoffel symbol]] and Riemann-Christoffel tensors (yes, this is a tensor) are also intrinsic.
>[!Notice]
>In Riemannian geometry, the dot product is defined in terms of the metric tensor (really?). The properties of the space are dictated by the choice of the metric tensor. The metric tensor does not comes from the dot product definition we had above, but assigned with some conditions like symmetry and positive definiteness.
>A coordinate space in which the metric tensor field is a priori given is called a **Riemann space**.