Special Relativity

Four-Vector

One time component, three space components, one invariant length — the natural variable of relativity

A four-vector groups time and space into a single Lorentz-covariant object. The invariant length s² = c²t² − x² − y² − z² is identical in every inertial frame.

  • Positionx^μ = (ct, x, y, z)
  • Invariants² = c²Δt² − Δr² (frame-independent)
  • 4-momentump^μ = (E/c, p), p·p = m²c²
  • 4-velocityu^μ = γ(c, v), u·u = c²
  • 4-currentj^μ = (cρ, J), ∂_μ j^μ = 0
  • Metric (mostly-minus)η = diag(+1, −1, −1, −1)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

From 3-vector to 4-vector

In Newtonian mechanics, the position of a particle is described by a 3-vector r = (x, y, z) and time t is a separate, universal parameter. Rotations mix the spatial components while time is unaffected. Length |r| is preserved by rotations.

In special relativity, Einstein's two postulates force time and space to mix under changes of inertial frame. The natural object is the 4-vector:

x^μ = (ct, x, y, z)    for μ = 0, 1, 2, 3

The factor of c is there to make all four components have units of length. The set of linear transformations that preserve the quadratic form

s² = c²t² − x² − y² − z²    (mostly-minus convention)

is the Lorentz group. Boosts (transformations between frames moving relative to each other) and ordinary rotations are its two main subgroups. Any quantity that transforms like x^μ under this group is a 4-vector.

The cast of important four-vectors

NameComponentsInvariant length²
4-position(ct, x, y, z)c²t² − r² (sign tells timelike / null / spacelike)
4-velocity u^μγ(c, v)c² (always; timelike, unit-magnitude in c)
4-acceleration a^μdu^μ/dτ≤ 0 (spacelike or null); a·u = 0
4-momentum p^μ(E/c, p)m²c² (mass-shell relation)
4-current j^μ(cρ, J)(cρ_proper)² in the rest frame of charges
4-potential A^μ(φ/c, A)Gauge-dependent; ∂_μ A^μ = 0 in Lorenz gauge
4-wavevector k^μ(ω/c, k)0 for light, m²c²/ℏ² for massive de Broglie waves

Every entry in this table is just a row of four numbers that obey the same Lorentz transformation law. Their invariants are the physically meaningful, frame-independent quantities.

Worked example — proton at LHC

A proton at the Large Hadron Collider has energy E = 7 TeV per beam after the 2022 ramp-up.

  • Rest mass: m_p c² = 938.272 MeV.
  • γ = E / (mc²) = 7 × 10¹² eV / 938.272 × 10⁶ eV ≈ 7460.
  • Velocity: v/c = √(1 − 1/γ²) ≈ 1 − 9 × 10⁻⁹. The proton lags light by ~9 ppb.
  • Momentum: p = √(E² − m²c⁴) / c ≈ E/c (since E ≫ mc²) ≈ 7 TeV/c.
  • 4-momentum: p^μ ≈ (7000 GeV, 7000 GeV·n̂) where n̂ is the direction.
  • Invariant: p·p = E² − (pc)² ≈ (7000 GeV)² − (7000 GeV)² ≈ 0 within numerical precision. The correct value is (mc²)² = (0.938 GeV)² ≈ 0.88 GeV² — exact, just dwarfed.

Boost to a lab frame where the proton appears stationary: every individual component shrinks dramatically, but the invariant mass m_p = 0.938 GeV/c² is the same. That is why particle physicists report invariant masses, not energies — they want frame-independent identity.

Lorentz transformation of a four-vector

A boost with velocity v along the x-axis transforms components:

A^0' = γ(A^0 − β A^1)
A^1' = γ(A^1 − β A^0)
A^2' = A^2
A^3' = A^3
where γ = 1/√(1 − β²), β = v/c

The transverse components are unaffected; the time and longitudinal-space components mix. The combination (A^0)² − (A^1)² is preserved exactly — substitute and verify.

Equivalently, in matrix form Λ^μ_ν, the transformation is x^μ' = Λ^μ_ν x^ν, and the invariance condition is η = Λᵀ η Λ.

Why "covariance" matters physically

Writing a physical equation in 4-vector form makes it automatically true in every inertial frame — you don't have to re-derive it for moving observers. Maxwell's equations become ∂_μ F^μν = µ₀ j^ν (covariant), with F^μν the antisymmetric field tensor and j^ν the 4-current. The conservation law ∂_μ j^μ = 0 is one equation that captures both ∂ρ/∂t + ∇·J = 0 (3D continuity) and the same statement in any boosted frame. Quantum field theory takes the same path: every Lagrangian is constructed from 4-vectors and tensors, ensuring relativistic invariance by inspection.

JavaScript — Lorentz boost of 4-vectors

const c = 299792458;  // m/s

function lorentzBoost(A, vx) {
  // A = [A0, A1, A2, A3] in (mostly-minus) convention
  const beta = vx / c;
  if (Math.abs(beta) >= 1) throw new Error('Boost exceeds c');
  const gamma = 1 / Math.sqrt(1 - beta * beta);
  return [
    gamma * (A[0] - beta * A[1]),
    gamma * (A[1] - beta * A[0]),
    A[2],
    A[3],
  ];
}

function invariant(A) {
  return A[0]*A[0] - A[1]*A[1] - A[2]*A[2] - A[3]*A[3];
}

// 4-position of an event 1 ns after t=0, 0.2m away in x
const event = [c * 1e-9, 0.2, 0, 0];
console.log('Event:', event);
console.log('Invariant s²:', invariant(event).toFixed(6), 'm²');  // 0.0019... – just c²t² − x²
const boosted = lorentzBoost(event, 0.5 * c);  // boost at v = 0.5c
console.log('Boosted event:', boosted);
console.log('Invariant after boost:', invariant(boosted).toFixed(6), 'm²');  // identical

// 4-momentum of an electron at rest vs at 0.99c
function fourMomentum(restMass_kg, vx) {
  const beta = vx / c;
  const gamma = 1 / Math.sqrt(1 - beta * beta);
  const E = gamma * restMass_kg * c * c;
  const px = gamma * restMass_kg * vx;
  return [E / c, px, 0, 0];
}

const me = 9.10938356e-31;  // kg
const p_rest = fourMomentum(me, 0);
const p_fast = fourMomentum(me, 0.99 * c);
console.log('p_rest:', p_rest);
console.log('p_fast:', p_fast);
console.log('Invariant rest:', invariant(p_rest).toExponential(3));   // (mc)² ≈ 7.5e-44
console.log('Invariant fast:', invariant(p_fast).toExponential(3));   // SAME

// Energy-momentum invariant gives rest mass
function massFromFourMomentum(p) {
  const inv = invariant(p);  // = (mc)²
  return Math.sqrt(Math.max(0, inv)) / c;  // kg
}
console.log('Recovered m:', massFromFourMomentum(p_fast).toExponential(3), 'kg (electron ≈ 9.11e-31)');

// 4-velocity always has u·u = c²
function fourVelocity(vx) {
  const beta = vx / c;
  const gamma = 1 / Math.sqrt(1 - beta * beta);
  return [gamma * c, gamma * vx, 0, 0];
}
console.log('u·u at 0.9c:', invariant(fourVelocity(0.9 * c)).toExponential(3), '(should = c²)');

// Composing boosts: two 0.5c boosts in the same direction don't give c
function composeTwo(v1, v2) {
  return (v1 + v2) / (1 + (v1 * v2) / (c * c));
}
console.log('0.5c + 0.5c =', (composeTwo(0.5*c, 0.5*c) / c).toFixed(3), 'c');  // 0.800c
console.log('0.9c + 0.9c =', (composeTwo(0.9*c, 0.9*c) / c).toFixed(4), 'c');  // 0.9945c

Where four-vectors matter

  • Particle physics. Every collider experiment reports invariant masses √(p·p) — that's literally the modulus of a 4-momentum vector. Mandelstam variables s, t, u are 4-vector contractions.
  • Electromagnetism. Maxwell's equations become two short Lorentz-covariant equations once you bundle (φ, A) into A^μ and (ρ, J) into j^μ.
  • Cosmology and astrophysics. Photon redshift, Doppler shifts, and gravitational redshift all reduce to comparing 4-wavevectors in different frames.
  • Quantum field theory. Free-field equations (Klein-Gordon, Dirac, Maxwell) are constructed from 4-vectors and 4-derivatives so they hold in every frame.
  • GPS and high-precision timing. GPS satellites carry 4-vectors of position-time signals; the receiver solves a 4-vector intersection problem.
  • Accelerator design. Beam optics, RF cavities, and bending magnets are designed using 4-momentum bookkeeping to ensure energy and momentum are conserved across collisions.

Common mistakes

  • Treating a list of 4 numbers as automatically a 4-vector. (mass, charge, lifetime, …) is just 4 numbers, not a 4-vector — none of those transform under Lorentz boosts.
  • Forgetting the metric sign. The squared length uses η_μν, not Euclidean dot product. Skipping the minus signs gives nonsense like 4-velocity·4-velocity = 4γ²c².
  • Mixing conventions. Particle physicists use (+,−,−,−), most relativists use (−,+,+,+). Pick one and stick to it.
  • Confusing E with energy of rest mass. The energy in p^0 = E/c is total relativistic energy γmc², not the kinetic energy or rest mass alone.
  • Treating 4-acceleration as just du/dt. It's du/dτ (derivative wrt proper time), and it's always orthogonal to 4-velocity: a·u = 0.
  • Confusing covariant and contravariant components. A^μ and A_μ have different signs on spatial parts in (+,−,−,−); the metric "raises and lowers" indices for you.

Frequently asked questions

What is a four-vector?

A four-vector is a quantity with four components A^μ = (A⁰, A¹, A², A³) that transforms under Lorentz boosts and spatial rotations exactly as the position 4-vector (ct, x, y, z) does. Equivalently, it is a vector in 4-dimensional Minkowski space with metric η_μν = diag(+1, −1, −1, −1) (or its opposite sign convention). What makes a list of four numbers a "four-vector" is the transformation law, not the labelling.

Why is the invariant length s² = c²t² − x² − y² − z²?

Einstein's second postulate — that light moves at c in every inertial frame — is equivalent to saying that the quadratic form c²t² − x² − y² − z² = 0 for any photon path is preserved by changes of frame. The most general linear transformations that preserve this quadratic form for any 4-vector are the Lorentz transformations. So s² = c²t² − x² − y² − z² is, by construction, the same in every inertial frame — it is the spacetime analogue of distance. Note: with the (+,−,−,−) signature this is positive for timelike intervals; some textbooks use (−,+,+,+) which flips signs everywhere.

What is the energy-momentum four-vector?

For a particle with rest mass m, the 4-momentum is p^μ = mu^μ = (E/c, p_x, p_y, p_z), where E = γmc² is the relativistic energy and p = γmv is the relativistic 3-momentum. Its invariant length is p·p = E²/c² − |p|² = m²c² — the mass-shell relation, equivalent to E² = (pc)² + (mc²)². Every frame measures different E and p, but every frame agrees on m. Massless particles like photons have p·p = 0; they live on the light cone of momentum space.

What other four-vectors do physicists use?

4-velocity u^μ = γ(c, v_x, v_y, v_z) with u·u = c² (always); 4-acceleration a^μ = du^μ/dτ with a·u = 0 (orthogonal to velocity); 4-current j^μ = (cρ, J_x, J_y, J_z) carrying charge density and current density; 4-potential A^μ = (φ/c, A_x, A_y, A_z) combining scalar and vector potentials in electrodynamics; 4-wave vector k^μ = (ω/c, k_x, k_y, k_z) for plane waves, with k·k = 0 for light. Any quantity that transforms like (ct, x, y, z) is a 4-vector.

How do you compute the invariant length in practice?

Given any 4-vector A^μ = (A⁰, A¹, A², A³), compute A·A = (A⁰)² − (A¹)² − (A²)² − (A³)² in the (+,−,−,−) convention. For a 4-position difference between events: Δx·Δx = c²(Δt)² − (Δr)². For 4-momentum: p·p = (E/c)² − |p|² = (mc)². The value should be the same in any frame — recomputing it after a Lorentz boost is a useful check that you transformed correctly.

What does covariant vs contravariant mean?

A 4-vector has both contravariant components A^μ (with upper index) and covariant components A_μ = η_μν A^ν (with lower index, obtained by lowering with the metric). In (+,−,−,−), A_0 = A⁰ but A_i = −A^i for spatial components. The inner product is A·B = A_μ B^μ = η_μν A^μ B^ν — automatic Lorentz scalar. The distinction matters for tensors of higher rank (e.g. F^μν vs F_μν vs F^μ_ν) but for a single 4-vector you can mostly remember "lower an index flips the spatial signs".

Are four-vectors used in general relativity?

Yes, but the global Lorentz symmetry is replaced by local symmetry: a 4-vector at a point still transforms as a Lorentz vector in any locally inertial frame at that point, but parallel-transporting it along a path is now governed by the curved-spacetime metric g_μν(x) and the Christoffel symbols. The invariant length A^μ A_μ is preserved by parallel transport; this is what makes the metric ds² = g_μν dx^μ dx^ν the foundation of GR. Special-relativistic 4-vectors are recovered in the tangent space of any GR spacetime.