Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 1 (as proved): the logarithmic error of the car obeys a linear autonomous equation

Proved
InvariantEKF.car_log_error_linear

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

control-theorykalman-filterlie-groupsnonlinear-observersriccati-equation

Consider two trajectories (θt,xt1,xt2)(\theta_t,x^1_t,x^2_t)(θt​,xt1​,xt2​) and (θˉt,xˉt1,xˉt2)(\bar\theta_t,\bar x^1_t,\bar x^2_t)(θˉt​,xˉt1​,xˉt2​), t≥0t\ge0t≥0, of the non-holonomic car with the same inputs:

θ˙=ωt,x˙1=cos⁡(θt)ut,x˙2=sin⁡(θt)ut.\dot\theta=\omega_t,\qquad\dot x^1=\cos(\theta_t)u_t,\qquad\dot x^2=\sin(\theta_t)u_t.θ˙=ωt​,x˙1=cos(θt​)ut​,x˙2=sin(θt​)ut​.

Let ξt=(Δθt, 12Δθt [a(Δθt)I2−J2] R(−θˉt)(Xt−Xˉt))\xi_t=\big(\Delta\theta_t,\ \tfrac12\Delta\theta_t\,[a(\Delta\theta_t)I_2-J_2]\,R(-\bar\theta_t)(X_t-\bar X_t)\big)ξt​=(Δθt​, 21​Δθt​[a(Δθt​)I2​−J2​]R(−θˉt​)(Xt​−Xˉt​)) be the error (2), where Δθ=θ−θˉ\Delta\theta=\theta-\bar\thetaΔθ=θ−θˉ and a(s)=sin⁡s/(1−cos⁡s)a(s)=\sin s/(1-\cos s)a(s)=sins/(1−coss). The factor 12s a(s)\tfrac12 s\,a(s)21​sa(s) is taken equal to its limit 111 at s=0s=0s=0. Assume that either Δθ0=0\Delta\theta_0=0Δθ0​=0 or cos⁡Δθ0≠1\cos\Delta\theta_0\ne1cosΔθ0​=1. Then for every t≥0t\ge0t≥0,

ddtξt=(00000ωtut−ωt0)ξt.\frac{d}{dt}\xi_t=\begin{pmatrix}0&0&0\\0&0&\omega_t\\u_t&-\omega_t&0\end{pmatrix}\xi_t .dtd​ξt​=​00ut​​00−ωt​​0ωt​0​​ξt​.

So a non-linear function of the two trajectories obeys a linear, state-independent equation.

Formalization Note The paper prints the entry −ut-u_t−ut​ in the bottom-left corner. That is a sign error: the proof's line δθtJ2(ut,0)T\delta\theta_tJ_2(u_t,0)^Tδθt​J2​(ut​,0)T equals δθt(0,ut)T\delta\theta_t(0,u_t)^Tδθt​(0,ut​)T, not δθt(0,−ut)T\delta\theta_t(0,-u_t)^Tδθt​(0,−ut​)T. The matrix AtA_tAt​ of Section 4.2.3 also has +vt+v_t+vt​ there, and a numerical check confirms +ut+u_t+ut​. The error (2) is undefined when Δθ∈2πZ∖{0}\Delta\theta\in2\pi\mathbb Z\setminus\{0\}Δθ∈2πZ∖{0}, so that case is excluded. Δθ\Delta\thetaΔθ is constant in time, so it suffices to state the hypothesis at t=0t=0t=0. Derivatives at t=0t=0t=0 are one-sided.

Preamble
import Mathlib
import Definitions.Def_InvariantEKF_Basic

open MeasureTheory Matrix Filter Topology
Formal statement
namespace InvariantEKF

theorem car_log_error_linear (u ω θ x1 x2 θbar xbar1 xbar2 : ℝ → ℝ)
    (hθ : ∀ t, 0 ≤ t → HasDerivWithinAt θ (ω t) (Set.Ici 0) t)
    (hx1 : ∀ t, 0 ≤ t → HasDerivWithinAt x1 (Real.cos (θ t) * u t) (Set.Ici 0) t)
    (hx2 : ∀ t, 0 ≤ t → HasDerivWithinAt x2 (Real.sin (θ t) * u t) (Set.Ici 0) t)
    (hθbar : ∀ t, 0 ≤ t → HasDerivWithinAt θbar (ω t) (Set.Ici 0) t)
    (hxbar1 : ∀ t, 0 ≤ t → HasDerivWithinAt xbar1 (Real.cos (θbar t) * u t) (Set.Ici 0) t)
    (hxbar2 : ∀ t, 0 ≤ t → HasDerivWithinAt xbar2 (Real.sin (θbar t) * u t) (Set.Ici 0) t)
    (hdef : θ 0 - θbar 0 = 0 ∨ Real.cos (θ 0 - θbar 0) ≠ 1) :
    ∀ t, 0 ≤ t →
      HasDerivWithinAt (fun s => carLogError (θ s) (x1 s) (x2 s) (θbar s) (xbar1 s) (xbar2 s))
        (carErrorMatrix (u t) (ω t) *ᵥ carLogError (θ t) (x1 t) (x2 t) (θbar t) (xbar1 t) (xbar2 t))
        (Set.Ici 0) t := by sorry

end InvariantEKF
Source
Barrau and Bonnabel, The invariant extended Kalman filter as a stable observer, arXiv:1410.1465v4 (2015), Section 2.1, Proposition 1, eqs. (2)-(3), p. 4
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. The statement concerns eight arbitrary real-valued functions of time t∈Rt \in \mathbb{R}t∈R:

  • inputs u(t)u(t)u(t) and ω(t)\omega(t)ω(t);
  • a first "car" state (θ(t),x1(t),x2(t))(\theta(t), x^1(t), x^2(t))(θ(t),x1(t),x2(t));
  • a second car state (θˉ(t),xˉ1(t),xˉ2(t))(\bar\theta(t), \bar x^1(t), \bar x^2(t))(θˉ(t),xˉ1(t),xˉ2(t)).

No continuity, measurability or boundedness is assumed for any of them, in particular not for uuu or ω\omegaω. Only the values on [0,∞)[0,\infty)[0,∞) enter the hypotheses and the conclusion.

Hypotheses. For every t≥0t \ge 0t≥0, each of the following holds as a derivative taken within [0,∞)[0,\infty)[0,∞), which is one-sided (from the right) at t=0t = 0t=0:

θ˙(t)=ω(t),x˙1(t)=cos⁡(θ(t)) u(t),x˙2(t)=sin⁡(θ(t)) u(t),\dot\theta(t) = \omega(t), \qquad \dot x^1(t) = \cos(\theta(t))\,u(t), \qquad \dot x^2(t) = \sin(\theta(t))\,u(t),θ˙(t)=ω(t),x˙1(t)=cos(θ(t))u(t),x˙2(t)=sin(θ(t))u(t), θˉ˙(t)=ω(t),xˉ˙1(t)=cos⁡(θˉ(t)) u(t),xˉ˙2(t)=sin⁡(θˉ(t)) u(t).\dot{\bar\theta}(t) = \omega(t), \qquad \dot{\bar x}^1(t) = \cos(\bar\theta(t))\,u(t), \qquad \dot{\bar x}^2(t) = \sin(\bar\theta(t))\,u(t).θˉ˙(t)=ω(t),xˉ˙1(t)=cos(θˉ(t))u(t),xˉ˙2(t)=sin(θˉ(t))u(t).

Both states are therefore driven by the same inputs uuu and ω\omegaω. Nothing relates their initial values except the last hypothesis:

θ(0)−θˉ(0)=0orcos⁡(θ(0)−θˉ(0))≠1.\theta(0) - \bar\theta(0) = 0 \quad\text{or}\quad \cos\big(\theta(0) - \bar\theta(0)\big) \neq 1.θ(0)−θˉ(0)=0orcos(θ(0)−θˉ(0))=1.

This excludes exactly the initial heading differences 2πk2\pi k2πk with kkk a nonzero integer. Since θ\thetaθ and θˉ\bar\thetaθˉ have the same derivative on [0,∞)[0,\infty)[0,∞), the difference Δθ=θ−θˉ\Delta\theta = \theta - \bar\thetaΔθ=θ−θˉ is constant there. The hypotheses are satisfiable, for example with all eight functions constant and u=ω=0u = \omega = 0u=ω=0.

The error vector. For the state pair at time sss, write Δθ=θ(s)−θˉ(s)\Delta\theta = \theta(s) - \bar\theta(s)Δθ=θ(s)−θˉ(s). Let (p,q)(p, q)(p,q) be the position difference rotated by −θˉ(s)-\bar\theta(s)−θˉ(s):

p=cos⁡θˉ (x1−xˉ1)+sin⁡θˉ (x2−xˉ2),q=−sin⁡θˉ (x1−xˉ1)+cos⁡θˉ (x2−xˉ2).p = \cos\bar\theta\,(x^1 - \bar x^1) + \sin\bar\theta\,(x^2 - \bar x^2), \qquad q = -\sin\bar\theta\,(x^1 - \bar x^1) + \cos\bar\theta\,(x^2 - \bar x^2).p=cosθˉ(x1−xˉ1)+sinθˉ(x2−xˉ2),q=−sinθˉ(x1−xˉ1)+cosθˉ(x2−xˉ2).

Define the scalar coefficient

c(σ)={1σ=0,σsin⁡σ2(1−cos⁡σ)σ≠0.c(\sigma) = \begin{cases} 1 & \sigma = 0, \\[2pt] \dfrac{\sigma \sin\sigma}{2(1 - \cos\sigma)} & \sigma \neq 0. \end{cases}c(σ)=⎩⎨⎧​12(1−cosσ)σsinσ​​σ=0,σ=0.​

At σ=2πk\sigma = 2\pi kσ=2πk with k≠0k \neq 0k=0 the denominator vanishes. There the formula is evaluated with the convention that division by zero gives 000, so c(2πk)=0c(2\pi k) = 0c(2πk)=0.

The error vector ξ(s)∈R3\xi(s) \in \mathbb{R}^3ξ(s)∈R3 is

ξ(s)=(Δθ,  c(Δθ) p+Δθ2 q,  c(Δθ) q−Δθ2 p).\xi(s) = \Big(\Delta\theta,\; c(\Delta\theta)\,p + \tfrac{\Delta\theta}{2}\,q,\; c(\Delta\theta)\,q - \tfrac{\Delta\theta}{2}\,p\Big).ξ(s)=(Δθ,c(Δθ)p+2Δθ​q,c(Δθ)q−2Δθ​p).

The matrix. For real numbers uuu and ω\omegaω, define

M(u,ω)=(00000ωu−ω0).M(u, \omega) = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & \omega \\ u & -\omega & 0 \end{pmatrix}.M(u,ω)=​00u​00−ω​0ω0​​.

Conclusion. For every t≥0t \ge 0t≥0, the map s↦ξ(s)s \mapsto \xi(s)s↦ξ(s) has derivative within [0,∞)[0,\infty)[0,∞) at ttt (one-sided at t=0t = 0t=0) equal to M(u(t),ω(t)) ξ(t)M(u(t), \omega(t))\,\xi(t)M(u(t),ω(t))ξ(t). Componentwise, this reads

ξ˙1(t)=0,ξ˙2(t)=ω(t) ξ3(t),ξ˙3(t)=u(t) ξ1(t)−ω(t) ξ2(t).\dot\xi_1(t) = 0, \qquad \dot\xi_2(t) = \omega(t)\,\xi_3(t), \qquad \dot\xi_3(t) = u(t)\,\xi_1(t) - \omega(t)\,\xi_2(t).ξ˙​1​(t)=0,ξ˙​2​(t)=ω(t)ξ3​(t),ξ˙​3​(t)=u(t)ξ1​(t)−ω(t)ξ2​(t).

The (3,1)(3,1)(3,1) entry of MMM is +u(t)+u(t)+u(t).

Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me