Using the Lorentz transformations and the index notation,
[math]
\begin{cases}
t'=\gamma (t-vz/c^2) \\
x'=x' \\
y'=y' \\
z'=\gamma (z-vt)
\end{cases}
[/math]
[math]\begin{bmatrix}
x'^0 \\
x'^1 \\
x'^2\\
x'^3
\end{bmatrix}=
\begin{bmatrix}
\gamma (x^0-vx^3/c) \\
x^1 \\
x^2 \\
\gamma (x^3-vx^0)
\end{bmatrix}
=
\begin{bmatrix}
\gamma (x^0-\beta x^3) \\
x^1 \\
x^2 \\
\gamma (x^3-vx^0)
\end{bmatrix}[/math]
Where [math]\beta \equiv \frac{v}{c}[/math]
This can be expressed in matrix form as
[math]\begin{bmatrix}
x'^0 \\
x'^1 \\
x'^2\\
x'^3
\end{bmatrix}=
\begin{bmatrix}
\gamma & 0 & 0 & -\gamma \beta \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
-\gamma \beta & 0 & 0 & \gamma
\end{bmatrix}
\cdot
\begin{bmatrix}
x^0 \\
x^1 \\
x^2 \\
x^3
\end{bmatrix}[/math]
Letting the indices run from 0 to 3, we can write
[math]\mathbf x'^{\mu}=\sum_{\nu=0}^3 (\Lambda_{\nu}^{\mu}) \mathbf x^{\nu}[/math]
Where [math]\Lambda[/math] is the Lorentz transformation matrix for motion in the z direction.
The Lorentz transformations are also invariant in that they are just a rotation, i.e. Det [math]\Lambda=1[/math]. The inner product is preserved,
[math]\Lambda_{\nu}^{\mu} \eta_{\nu}^{\mu} \Lambda_{\mu}^{\nu}=\eta_{\nu}^{\mu}[/math]
[math]
\begin{bmatrix}
\gamma & 0 & 0 & -\gamma \beta \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
-\gamma \beta & 0 & 0 & \gamma
\end{bmatrix}\cdot
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}\cdot
\begin{bmatrix}
\gamma & 0 & 0 & -\gamma \beta \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
-\gamma \beta & 0 & 0 & \gamma
\end{bmatrix}^T=
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}[/math]
[math]
\begin{bmatrix}
\gamma^2-\beta^2 \gamma^2 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -\gamma^2+\beta^2 \gamma^2
\end{bmatrix}=
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}[/math]
[math]
\begin{bmatrix}
\gamma^2(1-\beta^2) & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -\gamma^2(1-\beta^2)
\end{bmatrix}=
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}[/math]
Where [math]\gamma \equiv \frac{1}{\sqrt{1-\beta^2}}[/math]
[math]
\begin{bmatrix}
\frac{\gamma^2}{\gamma^2} & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -\frac{\gamma^2}{\gamma^2}
\end{bmatrix}=
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}[/math]
[math]
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}=
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &-1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{bmatrix}[/math]