## Coordinate change and Jacobian
Maintaining invariance during coordinate change is a main target of tensor analysis. And a Jacobian is a critical tool to achieve it.
The Jacobian is defined as
$J(\mathbf{f}) = \frac{\partial (f_1, f_2, \dots, f_m)}{\partial (x_1, x_2, \dots, x_n)} = \begin{pmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & \cdots & \frac{\partial f_1}{\partial x_n} \\ \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2} & \cdots & \frac{\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_m}{\partial x_1} & \frac{\partial f_m}{\partial x_2} & \cdots & \frac{\partial f_m}{\partial x_n} \end{pmatrix}$
Here $\mathbf{f}: \mathbb{R}^{n}\rightarrow \mathbb{R}^{m}$, namely
$\mathbf{f}(\mathbf{x}) = \begin{pmatrix} f_1(x_1, x_2, \dots, x_n) \\ f_2(x_1, x_2, \dots, x_n) \\ \vdots \\ f_m(x_1, x_2, \dots, x_n) \end{pmatrix}$
### Inverse functions in general
Before coming into tensors, we first check the general forms. By definition, the two functions are the inverses of each other if
$g(f(x)) \equiv x$
If calculate the derivative, one may see that
$g'(f(x)) f'(x) = 1$
or
$f'(x) = \frac{1}{g'(f(x))}$
If calculate the second order derivative,
$g''(f(x)) f'(x)^2 + g'(f(x)) f''(x) = 0$
Now we may adapt this format. Support that the set of functions $f(x,y)$, $g(x,y)$ and $F(X,Y)$, $G(X,Y)$ are the inverses of each other. By definition, we have
$\begin{aligned}
F(f(x, y), g(x, y)) &= x \\ G(f(x, y), g(x, y)) &= y
\end{aligned}$
Calculate the differentials, we have
$\begin{aligned} \frac{\partial F}{\partial X} \frac{\partial f}{\partial x} + \frac{\partial F}{\partial Y} \frac{\partial g}{\partial x} &= 1 \\ \frac{\partial F}{\partial X} \frac{\partial f}{\partial y} + \frac{\partial F}{\partial Y} \frac{\partial g}{\partial y} &= 0 \end{aligned}$
and
$\begin{aligned} \frac{\partial G}{\partial X} \frac{\partial f}{\partial x} + \frac{\partial G}{\partial Y} \frac{\partial g}{\partial x} &= 0 \\ \frac{\partial G}{\partial X} \frac{\partial f}{\partial y} + \frac{\partial G}{\partial Y} \frac{\partial g}{\partial y} &= 1 \end{aligned}$
If we write the result using matrix form, we have
$\begin{bmatrix} \frac{\partial F}{\partial X} & \frac{\partial F}{\partial Y} \\ \frac{\partial G}{\partial X} & \frac{\partial G}{\partial Y} \end{bmatrix} \begin{bmatrix} \frac{\partial f}{\partial x} & \frac{\partial f}{\partial y} \\ \frac{\partial g}{\partial x} & \frac{\partial g}{\partial y} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$
The left hand side is the Jacobians of both functions. It shows that the Jacobians $J$ and $J'$ for general coordinate changes are the matrix inverses of each another, provided they are evaluated at the same physical point. Later we may generalize this result into higher dimensions case with contracted notations.
>[!Note]-
>For general (multi-variables) functions, we have
>$\frac{\partial^2 F}{\partial X^2} \left( \frac{\partial f}{\partial x} \right)^2 + 2 \frac{\partial^2 F}{\partial X \partial Y} \frac{\partial f}{\partial x} \frac{\partial g}{\partial x} + \frac{\partial^2 F}{\partial Y^2} \left( \frac{\partial g}{\partial x} \right)^2 + \frac{\partial F}{\partial X} \frac{\partial^2 f}{\partial x^2} + \frac{\partial F}{\partial Y} \frac{\partial^2 g}{\partial x^2} = 0$
>by calculating the second order derivatives.
### The Jacobian property in contracted notations
Now consider two alternative coordinate systems $Z^{i}$ and $Z^{i'}$ in an $N$ -dimensional space. Note the prime is at the index $i$ (namely $i$ and $i'$, not $Z$ and $Z'$). Here we call the coordinates $Z^{i}$ *unprimed* and $Z^{i'}$ *primed*. The same symbols $Z^{i}$ and $Z^{i'}$ are also applied to denote the functions that give the relations between coordinates.
$\colorbox{#a5d8ff66}{\( Z^{i'} \)} = \colorbox{#ffa94d66}{\( Z^{i'}( \)}\colorbox{#a5d8ff66}{\( Z \)}\colorbox{#ffa94d66}{\( ) \)}$
$\colorbox{#a5d8ff66}{\( Z^i \)} = \colorbox{#ffa94d66}{\( Z^i( \)}\colorbox{#a5d8ff66}{\( Z' \)}\colorbox{#ffa94d66}{\( ) \)}$
Here we use different color to differentiate the meanings. The $\colorbox{#ffa94d66}{orange}$ terms denote functions doing the coordinates transform, while the $\colorbox{#87D4FF66}{blue}$ terms are the variables in each coordinates. Notice that the $\colorbox{#a5d8ff66}{\( Z \)}$ and $\colorbox{#a5d8ff66}{\( Z' \)}$ at right hand sides are variables with index $i$ and $i'$ suppressed. The original forms are $\colorbox{#a5d8ff66}{\( Z^{i} \)}$ and $\colorbox{#a5d8ff66}{\( Z^{i'} \)}$, independent variables in $N$ -dimensional space, so each equation represents $N$ relationships. The $i'$ and $i$ at right hand sides remain because they are live indices.
>[!Example]
>Above expression is just like $r(x, y) = \sqrt{x^2 + y^2}$ and $\theta(x, y) = \arctan\left(\frac{y}{x}\right)$. We are doing coordinates transformations between polar and Cartesian systems, the left hand sides are *new* variables and the right hand sides are *old* variables being transformed with certain functions.
If do the transformation twice we will come back to the original coordinate and that's how the inverse functions work. This can be expressed as
$\colorbox{#ffa94d66}{\( Z^i ( Z'( \)}\colorbox{#a5d8ff66}{\( Z \)}\colorbox{#ffa94d66}{\( ) )\)} \equiv \colorbox{#a5d8ff66}{\( Z^i \)}$$\colorbox{#ffa94d66}{\( Z^{i'} ( Z ( \)}\colorbox{#a5d8ff66}{\( Z' \)}\colorbox{#ffa94d66}{\( ) )\)} \equiv \colorbox{#a5d8ff66}{\( Z^{i'} \)}$
We also have the contracted conventions. The first two $Z$ in $\colorbox{#ffa94d66}{orange}$ are functions, and $\colorbox{#87D4FF66}{blue}$ terms are variables. In left hand side, after the live index, these index $i$ and $i'$ were suppressed. If write explicitly it would become $\colorbox{#ffa94d66}{\( Z^i ( Z^{i'}( \)}\colorbox{#a5d8ff66}{\( Z^{i} \)}\colorbox{#ffa94d66}{\( ) )\)} \equiv \colorbox{#a5d8ff66}{\( Z^i \)}$. And we see that $\colorbox{#ffa94d66}{\( Z^i\)}$ and $\colorbox{#ffa94d66}{\( Z^{i'}\)}$ are the inverses of each other.
>[!Example]
>This is just like what we had before,
>$\begin{aligned} F(f(x, y), g(x, y)) &= x \\ G(f(x, y), g(x, y)) &= y\end{aligned}$
>and
>$\begin{aligned} f\left(F(X, Y), G(X, Y)\right) &= X \\ g\left(F(X, Y), G(X, Y)\right) &= Y\end{aligned}$
Now let's have a closer look at the first expression, $\colorbox{#ffa94d66}{\( Z^i ( Z'( \)}\colorbox{#a5d8ff66}{\( Z \)}\colorbox{#ffa94d66}{\( ) )\)} \equiv \colorbox{#a5d8ff66}{\( Z^i \)}$. To get the Jacobians, what we did is doing differentiation. Here this equation represents $N$ relationships, and each of $N$ relationships can be differentiated (taking derivatives) with respect to each of the $N$ independent variables. And this will give $N^{2}$ relationships for first order partial derivatives. Notice we should do the differentiation with respect to $Z^{j}$, because we wanna calculate derivatives for $\colorbox{#ffa94d66}{\( Z^i ( Z'( \)}\colorbox{#a5d8ff66}{\( Z \)}\colorbox{#ffa94d66}{\( ) )\)} \equiv \colorbox{#a5d8ff66}{\( Z^i \)}$ with respect to each of the variables, this requires two live indices. Use the chain rule, we have
$\frac{\partial \colorbox{#ffa94d66}{\(Z^i\)} }{\partial \colorbox{#a5d8ff66}{\(Z^{i'} \)} } \frac{\partial \colorbox{#ffa94d66}{\(Z^{i'} \)} } {\partial \colorbox{#a5d8ff66}{\( Z^j\)} } = \frac{\partial \colorbox{#ffa94d66}{\(Z^i\)}}{\partial \colorbox{#a5d8ff66}{\(Z^{j} \)}}$
The left $\frac{\partial \colorbox{#ffa94d66}{\(Z^i\)} }{\partial \colorbox{#a5d8ff66}{\(Z^{i'} \)} }$, denominator can be considered as intermediate variables when applying the chain rule. But then this expression is differentiated by independent variables $\colorbox{#a5d8ff66}{\( Z^j\)}$.
Also notice this format, since we have the same index $i'$ at the left side at both super- and subscript, have Einstein summation convention applied, with $i'$ being the dummy index.
>[!Example]
>This is exactly what we did before,
>$\begin{aligned} \frac{\partial F}{\partial X} \frac{\partial f}{\partial x} + \frac{\partial F}{\partial Y} \frac{\partial g}{\partial x} &= 1 \\ \frac{\partial F}{\partial X} \frac{\partial f}{\partial y} + \frac{\partial F}{\partial Y} \frac{\partial g}{\partial y} &= 0 \end{aligned}$
>But with contraction. Both equations are expressed in a single line.
Notice that $i$ and $j$ are exactly equivalent (but different) live indices, and $i'$ is the dummy index. So the left hand side of $\frac{\partial Z^i}{\partial Z^{i'}} \frac{\partial Z^{i'}}{\partial Z^j} = \frac{\partial Z^i}{\partial Z^j}$ is two Jacobians, one from *primed* to *unprimed*, $\frac{\partial Z^i}{\partial Z^{i'}}$, and another from *unprimed* to *primed*, $\frac{\partial Z^{i'}}{\partial Z^j}$. (Also from later on, we try to understand these notation directly and do not have `\colorbox` marked.) This gives the two Jacobians ($i$, $j$ are equivalent, we just use $i$ for definition)
The one from $i'$ to $i$,
$J^i_{i'} = \frac{\partial Z^i(Z')}{\partial Z^{i'}}$
and another from $i$ to $i'$,
$J^{i'}_i = \frac{\partial Z^{i'}(Z)}{\partial Z^i}$
This makes the equation after taking derivatives becomes
$J^i_{i'} J^{i'}_j = \frac{\partial Z^i}{\partial Z^j}$
We must keep in mind that $J^{i}_{i'}$ and $J_{i}^{i'}$ must be evaluated at the same physical point.
Now we see that the left hand side is Jacobians, and the current target is to evaluate the right hand side. Since we know that $Z^{i}$, $Z^{j}$ are (equivalent) independent variables under the same coordinates, we have $\frac{\partial Z^i}{\partial Z^j}$ being $1$ if $Z^{i}$ and $Z^{j}$ are the same variable, and $0$ if they are different. This meet the definition of Kronecker delta,
$\delta^i_j = \begin{cases} 1, & \text{if } i = j \\ 0, & \text{if } i \neq j \end{cases}$
From the aspect of linear algebra, Kronecker delta can be considered as the identify matrix, actually we have the definition of $I_{n}$ as
$(I_{n})^{i}_{j}=\delta_{j}^{i}$
Therefore, we expressed the inverse relationships in contracted form as
$J^{i}_{i'} J^{i'}_{j} = \delta^{i}_{j}$
Doing the same for $Z^{i'}\left(Z(Z')\right) = Z^{i'}$, one may get
$J^{i'}_{i} J^{i}_{j'} = \delta^{i'}_{j'}$
> [!Note]
> Similarly Jacobian could be extended to second order partial derivatives, if define
> $J^{i}_{i'j'} = \frac{\partial^2 Z^{i}(Z')}{\partial Z^{i'} \partial Z^{j'}}$
> $J^{i'}_{ij} = \frac{\partial^2 Z^{i'}(Z)}{\partial Z^{i} \partial Z^{j}}$
> One may get
> $J^{i}_{i'j'} J^{i'}_{j'k} J^{j'}_{jk'} + J^{i}_{i'j} J^{i'}_{jk} = 0$
> $J^{i}_{i'j'} J^{i'}_j + J^{i}_{i'j} J^{k}_{jk'} J^{j'} = 0$
> $J^{i}_{i'j'} + J^{k}_{kj'} J^{i}_{k'} J^{j}_{j'} J^{k}_i = 0$
> >[!Proof]-
> >The proof is straightforward, that we do one more derivative from
> >$\frac{\partial Z^i}{\partial Z^{i'}} \frac{\partial Z^{i'}}{\partial Z^j} = \frac{\partial Z^i}{\partial Z^j}$
> >From how such expression works, we can see that the first part $\frac{\partial Z^i}{\partial Z^{i'}}$ is functions in *primed* coordinate, and the second part $\frac{\partial Z^{i'}}{\partial Z^j}$ is functions in *unprimed* coordinates. Now we wanna get the result in *unprimed* coordinate, so we do particular differentiation with respect to $k$, a new live index denoting all variables in *unprimed* coordinate.
> >$\partial \left( \frac{\partial Z^i}{\partial Z^{i'}} \frac{\partial Z^{i'}}{\partial Z^j} \right) / \partial Z^{k} = \partial\left( \frac{\partial Z^i}{\partial Z^j} \right) / \partial Z^{k}$
> >For product at left hand side, calculate separately and use chain rule if in different coordinate,.
> >$\begin{aligned}
> > \frac{\partial\left( \frac{\partial Z^i}{\partial Z^{i'}} \frac{\partial Z^{i'}}{\partial Z^j} \right)}{\partial Z^{k}} &= \frac{\partial\left( \frac{\partial Z^i}{\partial Z^j} \right)}{\partial Z^{k}}\\
> >\frac{\partial\left( \frac{\partial Z^i}{\partial Z^{i'}} \right)}{\partial Z^{k}}\frac{\partial Z^{i'}}{\partial Z^j}+ \frac{\partial\left( \frac{\partial Z^{i'}}{\partial Z^j} \right)}{\partial Z^{k}}\frac{\partial Z^i}{\partial Z^{i'}}&=\frac{\partial\delta^{i}_{j}}{\partial Z^{k}}\\
> >\end{aligned}$
> >For example, $\frac{\partial\left( \frac{\partial Z^i}{\partial Z^{i'}} \right)}{\partial Z^{k}}$, one see that the numerator is in *primed* and we are calculating derivatives with *unprimed* denominator. So we have to derivative with respect to another *primed* variables first, say $j'$,
> >$\frac{\partial\left( \frac{\partial Z^i}{\partial Z^{i'}} \right)}{\partial Z^{k}}=\frac{\partial^{2}Z^{i}}{\partial Z^{i'}\partial Z^{j'}}\frac{\partial Z^{j'}}{\partial Z^{k}}$
> >So above expression would be
> >$\begin{aligned}
> >\frac{\partial\left( \frac{\partial Z^i}{\partial Z^{i'}} \right)}{\partial Z^{k}}\frac{\partial Z^{i'}}{\partial Z^j}+ \frac{\partial\left( \frac{\partial Z^{i'}}{\partial Z^j} \right)}{\partial Z^{k}}\frac{\partial Z^i}{\partial Z^{i'}}&=\frac{\partial\delta^{i}_{j}}{\partial Z^{k}}\\
> >\frac{\partial^{2}Z^{i}}{\partial Z^{i'}\partial Z^{j'}}\frac{\partial Z^{j'}}{\partial Z^{k}}\frac{\partial Z^{i'}}{\partial Z^j} + \frac{\partial^{2} Z^{i'}}{\partial Z^{k} \partial Z^{j}}\frac{\partial Z^i}{\partial Z^{i'}} &= 0
> >\end{aligned}$
> >Replace these differentiations with Jacobians, we get the target expression,
> >$J^{i}_{i'j'} J^{i'}_{j'k} J^{j'}_{jk'} + J^{i}_{i'j} J^{i'}_{jk} = 0$
> >
> >The other two requires contracting both side with Jacobians then renaming indices.
>[!Note]
>One can write coordinate transformations among more coordinates, for example, from $Z^{i}$ to $Z^{i'}$ to $Z^{i''}$ then back to $Z^{i}$, we may write
>$J_i^{i'} J_i^{i''} J_j^{i''} = \delta_j^i$
>The proof is not difficult when differentiations are written explicitly.
>[!Notice]
>Define the quantity $J=|J_{i'}^{i}|$. (This $i$ could be replaced by any other letters). We call the coordinate change **orientation-preserving** if $J>0$, and **orientation-reversing** if $J<0$.
>This property is local and could vary by point selections.
>From the inverse property of Jacobians, we know that if one change of coordinate is orientation-preserving, so is its inverse. This is useful in [[The Voss-Weyl formula and Levi-Civita symbols]].
>If two coordinates are related by an orientation-preserving change, we say one of these coordinates is positively oriented. Such positivity is characterized by right-hand rule. A Cartesian coordinate system is positive if the basis vectors follow right-hand rule. And any other system is positive if it is positively oriented with respect to a positive Cartesian system.
### Kronecker symbol
As already applied in previous proof, the Kronecker delta $\delta^{i}_{j}$ has some special property to simplify the expressions.
- $T_{i}\delta^{i}_{j}=T_{j}$; $T^{i}\delta^{j}_{i}=T_{i}$
The proof is easy, expand the contractions into summation and non-zero elements get cancelled.
- $A_{ij} \delta^{i}_{k}=A_{kj}$
Also trivial.
- $\delta^{i}_{j} \delta^{j}_{k}=\delta^{i}_{k}$; $\delta^{i}_{j} \delta^{j}_{i}=n$; $\delta^{i}_{i} \delta^{j}_{j}=n^{2}$
The first one is obvious, the latter two we have
$\delta^{i}_{j}\delta_{i}^{j}=\sum_{i}\sum_{j}\delta^{i}_{j}\delta_{i}^{j}=\sum_{i}\delta^{i}_{i}=\sum_{j}\delta^{j}_{j}=n$
$\delta^{i}_{i}\delta_{j}^{j}=\sum_{i}\sum_{j}\delta^{i}_{i}\delta_{j}^{j}=\sum_{i}\sum_{j}1=n^{2}$
- $\delta^{i}_{j} S_{i} S^{j}=S_{i}S^{i}=S_{j}S^{j}=|\mathbf{S}|^{2}$
Cannot write it as $S_{i}^{i}$.
- $\delta^{r}_{i} \delta^{s}_{j} - \delta^{s}_{i} \delta^{r}_{j}$ is skew-symmetry in $i$ and $j$, also in $r$ and $s$. Skew-symmetry means $A^{T}=-A$ or $T_{ij}=-T_{ji}$
Changing $i$ with $j$ (also $r$ and $s$) we get the result.
>[!Notice]
>At the end one may see our transformation among coordinates systems are based on Jacobian. This requires the coordinates are differentiable. This could be easier in physics understand some assumption, but we could have coordinates with bad properties.
>Some tools could be applied like weak derivatives in Sobolev spaces or using non-smooth geometries like sub-Riemannian geometry or tread in Alexandorv space, or use some local techniques. Sometimes we could tread the such problems if the basis have some special structures. This is far out of our current scope.