Emmy, the Algebra System: Lorentz Covariant Mechanics

A single particle in the four flat dimensions of Special Relativity
Published

January 11, 2026

TODO: Make a button for @path-dimension to make dimensions switchable from 4 -> 2

I investigate a Lorentz covariant Lagrangian that is not widely known. It is discussed in the textbooks of Greiner, “Systems of Particles and Hamiltonian Mechanics” (chapter 21), and also on-line in: Cline, “Variational Principles in Classical Mechanics”.

Then I derive, along deBroglie’s argument, the momentum-wavelength relation of a free particle.

Extended Lagrangian

I start with the conventional case

(define ((L-free-particle mass) local)
  (let ((v (velocity local)))
    (* 1/2 mass (square v))))
(define (test-path t)
  (up (+ (* 4 t) 7)
      (+ (* 3 t) 5)
      (+ (* 2 t) 1)))
(show-tex-expression
  (test-path 't))

\[\begin{pmatrix}\displaystyle{4\,t + 7} \cr \cr \displaystyle{3\,t + 5} \cr \cr \displaystyle{2\,t + 1}\end{pmatrix}\]

(Lagrangian-action (L-free-particle 3.0) test-path 0.0 10.0)
435.0

The extended Lagrangian:

(define ((Lc-free-particle mass c) local)
  (let ((v (velocity local)))
    (* 1/2 mass (square c)
       (- (* (/ 1 (square c))
             (square (apply up (rest v))))
          (square (ref v 0))
          1))))

According to chapter 4.3.2 of Struckmeier “Extended Lagrange and Hamilton Formalism for Point Mechanics and Covariant Hamilton Field Theory”, this “case is largely disregarded in the literature covering the extended Hamilton- Lagrange formalism (cf., for instance, Lanczos, 1949; Dirac, 1950; Synge, 1960; Goldstein et al., 2002; Johns, 2005), namely there exist extended Lagrangians that are related to a given conventional Lagrangian without being homogeneous forms in the n + 1 velocities”.

(define (Lc-test-path s)
  (up s
      (+ (* 4 s) 7)
      (+ (* 3 s) 5)
      (+ (* 2 s) 1)))
(show-tex-expression
  (Lc-test-path 's))

\[\begin{pmatrix}\displaystyle{s} \cr \cr \displaystyle{4\,s + 7} \cr \cr \displaystyle{3\,s + 5} \cr \cr \displaystyle{2\,s + 1}\end{pmatrix}\]

(Lagrangian-action (Lc-free-particle 3.0 1.0) Lc-test-path 0.0 10.0)
405.0

That’s 30 less, let’s see where we lost those 30

(show-tex-expression
  ((Gamma test-path) 't))

\[\begin{pmatrix}\displaystyle{t} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{4\,t + 7} \cr \cr \displaystyle{3\,t + 5} \cr \cr \displaystyle{2\,t + 1}\end{pmatrix}} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{4} \cr \cr \displaystyle{3} \cr \cr \displaystyle{2}\end{pmatrix}}\end{pmatrix}\]

Can you guess the following? (if not, use the sidebar!)

^{:kindly/kind :kind/hidden}
(show-tex-expression
  ((Gamma Lc-test-path) 's))
(show-tex-expression
  ((Gamma three-path) 't))

\[\begin{pmatrix}\displaystyle{t} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{x\left(t\right)} \cr \cr \displaystyle{y\left(t\right)} \cr \cr \displaystyle{z\left(t\right)}\end{pmatrix}} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{Dx\left(t\right)} \cr \cr \displaystyle{Dy\left(t\right)} \cr \cr \displaystyle{Dz\left(t\right)}\end{pmatrix}}\end{pmatrix}\]

(show-tex-expression
  ((compose (L-free-particle 'm) (Gamma three-path)) 't))

\[\frac{1}{2}\,m\,{\left(Dx\left(t\right)\right)}^{2} + \frac{1}{2}\,m\,{\left(Dy\left(t\right)\right)}^{2} + \frac{1}{2}\,m\,{\left(Dz\left(t\right)\right)}^{2}\]

(show-tex-expression
  ((Gamma four-path) 's))

\[\begin{pmatrix}\displaystyle{s} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{s} \cr \cr \displaystyle{x\left(s\right)} \cr \cr \displaystyle{y\left(s\right)} \cr \cr \displaystyle{z\left(s\right)}\end{pmatrix}} \cr \cr \displaystyle{\begin{pmatrix}\displaystyle{1} \cr \cr \displaystyle{Dx\left(s\right)} \cr \cr \displaystyle{Dy\left(s\right)} \cr \cr \displaystyle{Dz\left(s\right)}\end{pmatrix}}\end{pmatrix}\]

Note the number 1 on top of the last 4-tuple. This will be relaxed later.

(show-tex-expression
  ((compose (Lc-free-particle 'm_0 'c) (Gamma four-path)) 's))

\[- {c}^{2}\,m_0 + \frac{1}{2}\,m_0\,{\left(Dx\left(s\right)\right)}^{2} + \frac{1}{2}\,m_0\,{\left(Dy\left(s\right)\right)}^{2} + \frac{1}{2}\,m_0\,{\left(Dz\left(s\right)\right)}^{2}\]

In calculating the Lagrangian action above, \(m_0\) was \(3\), \(c\) set to \(1\) and time was \(10\). Thus the \(-30\) stems from the \(-m_0 c^2\).

(define ((Lagrange-equations Lagrangian) w)
  (- (D (compose ((partial 2) Lagrangian) (Gamma w)))
     (compose ((partial 1) Lagrangian) (Gamma w))))
(show-tex-expression
  (((Lagrange-equations (L-free-particle 'm)) three-path) 't))

\[\begin{bmatrix}\displaystyle{m\,{D}^{2}x\left(t\right)}&\displaystyle{m\,{D}^{2}y\left(t\right)}&\displaystyle{m\,{D}^{2}z\left(t\right)}\end{bmatrix}\]

(show-tex-expression
  (((Lagrange-equations (Lc-free-particle 'm_0 'c)) four-path) 's))

\[\begin{bmatrix}\displaystyle{0}&\displaystyle{m_0\,{D}^{2}x\left(s\right)}&\displaystyle{m_0\,{D}^{2}y\left(s\right)}&\displaystyle{m_0\,{D}^{2}z\left(s\right)}\end{bmatrix}\]

The first \(0\) is because we set \(t=s\) for the path. This reduces the extended Lagrangian to the “conventional” case. Reassuring. Now we can allow arbitrary functions \(t(s)\), making the path truely 4-dimensional.

(show-tex-expression
  (((Lagrange-equations (Lc-free-particle 'm_0 'c)) Lc-path) 's))

\[\begin{bmatrix}\displaystyle{- {c}^{2}\,m_0\,{D}^{2}t\left(s\right)}&\displaystyle{m_0\,{D}^{2}x\left(s\right)}&\displaystyle{m_0\,{D}^{2}y\left(s\right)}&\displaystyle{m_0\,{D}^{2}z\left(s\right)}\end{bmatrix}\]

State the Lagrangian.

(show-tex-expression
  ((compose (Lc-free-particle 'm_0 'c) (Gamma Lc-path)) 's))

\[\frac{-1}{2}\,{c}^{2}\,m_0\,{\left(Dt\left(s\right)\right)}^{2} + \frac{-1}{2}\,{c}^{2}\,m_0 + \frac{1}{2}\,m_0\,{\left(Dx\left(s\right)\right)}^{2} + \frac{1}{2}\,m_0\,{\left(Dy\left(s\right)\right)}^{2} + \frac{1}{2}\,m_0\,{\left(Dz\left(s\right)\right)}^{2}\]

According to Struckmeier p80, “In contrast to the non-relativistic description, the constant rest energy term \(− 1/2 mc^2\) in the extended Lagrangian is essential”. I guess this constant term makes the Lagrangian “not being a homogeneous form in the velocities”.

It is very interesting that a constant term can lead to a new formalism. Cline: “It provides a plausible manifestly-covariant Lagrangian for the one-body system, but serious problems exist extending this to the N-body system when N>1”.

Nobody possesses a Lorentz covariant N-body mechanics. Goldstein “Classical Mechanics”, chapter 7.9: “Hitherto, there does not exist a satisfying description of the relativistic many body system.”

The Constraint on the four dimensional path

The Lagranian above looks very nice because it is symmtreic in t, x, y, z. But there is a caveat which ultimately brings it in line with the orthodox formulation.

Non-homogeneous but symmetric Lagrangians of this type require a general implicit constraint: \(L - pv = 0\) (Cline Eq. 17.6.12, Struckmeier Eq. 21.9)

(define (Lc-Lagrange-constraint Lagrangian)
  (- Lagrangian (* ((partial 2) Lagrangian) velocity)))

Applied to the free particle (and multiplication with a constant factor), leads to (Struckmeier Eq. 21.12):

(define Lc-constraint-s
  (down (constantly 0) (compose (* (/ 2 (square 'c) 'm_0)
                      (Lc-Lagrange-constraint (Lc-free-particle 'm_0 'c)))
                   (Gamma Lc-path))))

\[\begin{bmatrix}\displaystyle{0}&\displaystyle{=}&\displaystyle{\frac{{c}^{2}\,{\left(Dt\left(s\right)\right)}^{2} - {c}^{2} - {\left(Dx\left(s\right)\right)}^{2} - {\left(Dy\left(s\right)\right)}^{2} - {\left(Dz\left(s\right)\right)}^{2}}{{c}^{2}}}\end{bmatrix}\]

The above is a constraint, i.e. needs to be zero, needs to vanish for all physical paths.

Contrary to constraints that depend on position, this constraint (being about velocity) cannot be easily treated via Lagrange multipliers.

We proceed to explicitely calculate \((Dt(s))^2\)

(define t (literal-function 't))
(define Dt-squared
  ((eq-transformation
     #(- (square (D t)) %))
   Lc-constraint-s))

\[\begin{bmatrix}\displaystyle{{\left(Dt\left(s\right)\right)}^{2}}&\displaystyle{=}&\displaystyle{\frac{{c}^{2} + {\left(Dx\left(s\right)\right)}^{2} + {\left(Dy\left(s\right)\right)}^{2} + {\left(Dz\left(s\right)\right)}^{2}}{{c}^{2}}}\end{bmatrix}\]

The above is meant as an equality.

We now upgrade the parameter \(s\) to a function \(s(t)\) which is the inverse of \(t(s)\), \(s = t^{-1}\).

(define s (literal-function 's))

Inverse means that \(t(s(y)) = y\). While in the math rendering there is a minor risk of confusion, in the underlying code we do not need the auxilary y, the function t and the symbol 't are clearly distinct:

(define t°s (down (comp t s) identity))
(show-eq
  (t°s 't))

\[\begin{bmatrix}\displaystyle{t\left(s\left(t\right)\right)}&\displaystyle{=}&\displaystyle{t}\end{bmatrix}\]

The derivative results in the number one

(show-eq
  ((D t°s) 't))

\[\begin{bmatrix}\displaystyle{Dt\left(s\left(t\right)\right)\,Ds\left(t\right)}&\displaystyle{=}&\displaystyle{1}\end{bmatrix}\]

With this interlude, we return to the constraint. Just by formally replacing \(s \rightarrow s(t)\), it reads as

(show-eq
  (Dt-squared (s 't)))

\[\begin{bmatrix}\displaystyle{{\left(Dt\left(s\left(t\right)\right)\right)}^{2}}&\displaystyle{=}&\displaystyle{\frac{{c}^{2} + {\left(Dx\left(s\left(t\right)\right)\right)}^{2} + {\left(Dy\left(s\left(t\right)\right)\right)}^{2} + {\left(Dz\left(s\left(t\right)\right)\right)}^{2}}{{c}^{2}}}\end{bmatrix}\]

We’d like to get rid of the function t and only keep the symbol/parameter 't. For this, we multiply the above equation by \((Ds(t))^2\)

(define eq1
  ((eq-transformation
     #(* ((square (D s)) 't) %))
   (* (Dt-squared (s 't)))))
(show-eq eq1)

\[\begin{bmatrix}\displaystyle{{\left(Dt\left(s\left(t\right)\right)\right)}^{2}\,{\left(Ds\left(t\right)\right)}^{2}}&\displaystyle{=}&\displaystyle{\frac{{c}^{2}\,{\left(Ds\left(t\right)\right)}^{2} + {\left(Ds\left(t\right)\right)}^{2}\,{\left(Dx\left(s\left(t\right)\right)\right)}^{2} + {\left(Ds\left(t\right)\right)}^{2}\,{\left(Dy\left(s\left(t\right)\right)\right)}^{2} + {\left(Ds\left(t\right)\right)}^{2}\,{\left(Dz\left(s\left(t\right)\right)\right)}^{2}}{{c}^{2}}}\end{bmatrix}\]

We introduce the following slighly sloppy notation

(show-eq
  ((down three-path (comp three-path s)) 't))

\[\begin{bmatrix}\displaystyle{\begin{pmatrix}\displaystyle{x\left(t\right)} \cr \cr \displaystyle{y\left(t\right)} \cr \cr \displaystyle{z\left(t\right)}\end{pmatrix}}&\displaystyle{=}&\displaystyle{\begin{pmatrix}\displaystyle{x\left(s\left(t\right)\right)} \cr \cr \displaystyle{y\left(s\left(t\right)\right)} \cr \cr \displaystyle{z\left(s\left(t\right)\right)}\end{pmatrix}}\end{bmatrix}\]

The derivative of this definition is

(show-eq
  ((D (down three-path (comp three-path s))) 't))

\[\begin{bmatrix}\displaystyle{\begin{pmatrix}\displaystyle{Dx\left(t\right)} \cr \cr \displaystyle{Dy\left(t\right)} \cr \cr \displaystyle{Dz\left(t\right)}\end{pmatrix}}&\displaystyle{=}&\displaystyle{\begin{pmatrix}\displaystyle{Ds\left(t\right)\,Dx\left(s\left(t\right)\right)} \cr \cr \displaystyle{Ds\left(t\right)\,Dy\left(s\left(t\right)\right)} \cr \cr \displaystyle{Ds\left(t\right)\,Dz\left(s\left(t\right)\right)}\end{pmatrix}}\end{bmatrix}\]

With this the constraint becomes

(show-eq
  constraint-1)

\[\begin{bmatrix}\displaystyle{1}&\displaystyle{=}&\displaystyle{\frac{{c}^{2}\,{\left(Ds\left(t\right)\right)}^{2} + {\left(Dx\left(t\right)\right)}^{2} + {\left(Dy\left(t\right)\right)}^{2} + {\left(Dz\left(t\right)\right)}^{2}}{{c}^{2}}}\end{bmatrix}\]

Remember that, as shown above, the number one appears because of \(s = t^{-1}\)

Isolating \(Ds(t)\) on the right hand side

(show-eq
  ((eq-transformation
     #(sqrt (- % (/ ((square (D three-path)) 't) (square 'c)))))
   constraint-1))
NoteOUT
2026-01-14T21:27:25.027Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (non-negative? (+ (expt c 2) (* -1 (expt ((D x) t) 2)) (* -1 (expt ((D y) t) 2)) (* -1 (expt ((D z) t) 2)))) in e3
2026-01-14T21:27:25.036Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (non-negative? (expt c 2)) in e3
2026-01-14T21:27:25.038Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (sqrt (expt c 2)) (expt c 1)) in simsqrt1
2026-01-14T21:27:25.051Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (sqrt (expt ((D s) t) 2)) (expt ((D s) t) 1)) in simsqrt1

\[\begin{bmatrix}\displaystyle{\frac{\sqrt {{c}^{2} - {\left(Dx\left(t\right)\right)}^{2} - {\left(Dy\left(t\right)\right)}^{2} - {\left(Dz\left(t\right)\right)}^{2}}}{c}}&\displaystyle{=}&\displaystyle{Ds\left(t\right)}\end{bmatrix}\]

The above equation, which is just another expression of the constraint \(L - pv = 0\), is conventionally written as below, introducing the famous \(\gamma\) factor of Special Relativity.

\[\frac{ds}{dt} = \sqrt{1- \frac{v^2}{c^2}} = \sqrt{1 - \beta ^ 2} = \frac{1}{\gamma}\]

Thus, the function \(s(t)\) is nothing but the proper time.

The deBroglie wavelength

In the following I follow deBroglies arguments. There is also a version with infix notation.

Internal Vibrations

as always with Einstein, we start with E = mc^2

(define (E0 m) (* m (square 'c)))
(show-tex
  (E0 'm))

\[m\,{c}^{2}\]

deBroglies first hypothesis was to assume that every particle has a hypothetical internal vibration at frequency nu0 which relates to the rest energy in rest frame of particle (only there this energy-frequency relation holds)

(define (nu_naught E0) (/ E0 'h))

particle travels at velocity vp

(define (vp beta) (* beta  'c))
(define (beta v) (/ v 'c))
(define (gamma beta) (/ 1 (sqrt (- 1 (square beta)))))

time dilation: internal vibration is slower for observer. so the frequency-energy relation does not hold: the frequency indeed decreases instead of increasing with energy. this is the conundrum deBroglie solved. so hang on.

(define (nu_one nu_naught gamma) (/ nu_naught gamma))

sine formula for internal vibration. we do not know what exactly vibrates so we set the amplitude to one

(define ((internal-swing nu_one) t)
 (sin (* 2 'pi nu_one t)))
(show-tex
  ((internal-swing 'nu_one) 't))

\[\sin\left(2\,\pi\,{\nu}_{one}\,t\right)\]

calculate the phase of the internal swing at particle point x = v * t

(define ((internal-phase nu_one v) x)
 (asin ((internal-swing nu_one) (/ x v))))
(is-equal (* 2 'pi 'nu_one (/ 'x 'v))
          ((internal-phase 'nu_one 'v) 'x))
NoteOUT
2026-01-14T21:27:25.077Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (asin (sin (/ (* 2 nu_one pi x) v))) (/ (* 2 nu_one pi x) v)) in asin-sin

\[2\,\pi\,{\nu}_{one}\,\left(\frac{x}{v}\right)\]

personal note: to me, this is the sine-part of a standing wave, the standing vibration.

A general Wave

now for something completely different: general definition of a wave

(define ((wave omega k) x t)
 (sin (- (* omega t) (* k x))))

with the usual definition of omega

(define (omega nu) (* 2 'pi nu))

and the simplest possible definition for the wave-vector k: a dispersion free wave traveling at phase-velocity V

(define (k omega V) (/ omega V))

calculate the phase of the wave

(define ((wave-phase nu V) x t)
 (asin ((wave (omega nu) (k (omega nu) V)) x t)))
(is-equal (* 2 'pi 'nu (- 't (/ 'x 'V)))
          ((wave-phase 'nu 'V) 'x 't))
NoteOUT
2026-01-14T21:27:25.091Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (asin (sin (/ (+ (* 2 V nu pi t) (* -2 nu pi x)) V))) (/ (+ (* 2 V nu pi t) (* -2 nu pi x)) V)) in asin-sin

\[2\,\pi\,\nu\,\left(t - \left(\frac{x}{V}\right)\right)\]

Phase difference

calculate the phase difference between the vibration and some wave at time t = x / v as a function of the ratio of the frequencies

(define ((phase-difference x v nu V) ratio)
  (- ((internal-phase (* ratio nu) v) x)
     ((wave-phase nu V) x (/ x v))))
(is-equal (* 2 'pi 'nu (+ (* (- 'ratio 1) (/ 'x 'v)) (/ 'x 'V)))
          ((phase-difference 'x 'v 'nu 'V) 'ratio))
NoteOUT
2026-01-14T21:27:25.103Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (asin (sin (/ (* 2 nu pi ratio x) v))) (/ (* 2 nu pi ratio x) v)) in asin-sin
2026-01-14T21:27:25.104Z runnervmi13qx WARN [emmy.util.logic:22] - Assuming (= (asin (sin (/ (+ (* 2 V nu pi x) (* -2 nu pi v x)) (* V v)))) (/ (+ (* 2 V nu pi x) (* -2 nu pi v x)) (* V v))) in asin-sin

\[2\,\pi\,\nu\,\left(\left(\mathsf{ratio} - 1\right)\,\left(\frac{x}{v}\right) + \left(\frac{x}{V}\right)\right)\]

state the general ratio of frequencies that keeps the vibration of the particle in phase with some wave of velocity V in terms of the velocity of the particle

(define (phase-ratio v V) (- 1 (/ v V)))
(solves (phase-ratio 'v 'V)
        (phase-difference 'x 'v 'nu 'V))

\[\mathsf{root:}\,\left(1 - \left(\frac{v}{V}\right)\right)\]

the Energy of the particle for the observer

(define (Ev E0 gamma) (* E0 gamma))

we assume the deBroglie wave has the frequency: energy divided by Planck’s constant. reminder: this relation holds in every frame of reference, especially for the observer who is not in the rest frame.

(define (nu Ev) (/ Ev 'h))

now that nu is set, calculate the physically viable ratio of the frequencies in terms of beta

(define (physical-ratio beta)
  (/ (nu_one (nu_naught 'E0) (gamma beta))
     (nu (Ev 'E0 (gamma beta)))))
(is-equal (- 1 (square 'beta))
          (physical-ratio 'beta))

\[1 - {\beta}^{2}\]

state, in terms of the particle velocity beta, the value of the physical phase-velocity V that keeps the vibration and the deBroglie wave in phase

(define (phase-velocity beta) (/ 'c beta))
(solves (phase-velocity 'beta)
        (lambda (V) (- (physical-ratio 'beta)
                       (phase-ratio (vp 'beta) V))))

\[\mathsf{root:}\,\left(\frac{c}{\beta}\right)\]

note: the phase-velocity is always greater than the speed of light. It is independent of the position x and the mass of the particle

the relativistic momentum is defined as

(define (p m v gamma)
 (* m v gamma))

calculate the deBroglie wavelength (by dividing the phase-velocity by the frequency) and show that it indeed is h divided by the momentum

(define de-broglie-wavelength
  (/ (phase-velocity (beta 'v))
     (nu (Ev (E0 'm) 'gamma))))
(is-equal (/ 'h (p 'm 'v 'gamma))
          de-broglie-wavelength)

\[\frac{h}{m\,v\,\gamma}\]

(repl/scittle-sidebar)
source: src/mentat_collective/emmy/silcm_ch01.clj