The Lyapunov comparison lemma, formalized — L2 of the LeanPunov stream
Why this theorem, and why these definitions
The thesis’s stability story is cascade-shaped. The framing paper (giordano2019coordinated) decouples the dynamics into a linear CoM subsystem feeding a coupled attitude-and-end-effector subsystem — its eq 22a/22b triangular structure — and closes the loop with a cascaded-stability argument. The mathematical machinery for such arguments is the Panteley–Loría pair: panteley1998global and panteley2001growth, the two densest Lyapunov sources in our corpus.
Strip those papers to their quantitative core and one scalar object does the heavy lifting: a differential inequality for the Lyapunov function along solutions. Proposition 1 of panteley2001growth shows every uniformly globally asymptotically stable system admits a Lyapunov function with (their eq 14)
and the boundedness engine inside their Lemma 2 runs on the perturbed version (their eq 35)
where the driving subsystem’s state injects a disturbance. Everything else in those papers — class- bookkeeping, growth conditions, integrability — exists to manufacture or exploit an inequality of this shape. So when Mathlib offers no Lyapunov layer at all (verified absent 2026-07-04: no Lyapunov, no passivity, no LaSalle, no ISS), the first stone to lay is exactly this: the comparison lemma that turns a decrease inequality into an explicit exponential bound. The definitions in the Lean file are the two hypotheses this one theorem consumes — nothing more. We deliberately do not define – stability yet: no theorem in this file would consume the definition, and a definition without a theorem is dead weight (the design rule for this stream: the theorem drives the definitions).
Sources and provenance
- panteley2001growth (Panteley & Loría, Automatica 37, 2001): cascade setup eqs 1–3, Lyapunov hypotheses eqs 10–12, Proposition 1 (eqs 13–15), Lemma 2 and its eq 35. Verbatim statements extracted from the rendered corpus page 2026-07-05.
- panteley1998global (Panteley & Loría, Syst. Control Lett. 33, 1998): cascade setup eqs 4–5, Theorems 1–3, the class-/UGAS vocabulary.
- giordano2019coordinated (framing paper): decoupled dynamics eq 22a/22b, passivity property eq 23, Lyapunov function eq 37, derivative eq 38, Proposition IV.1.
- Mathlib substrate:
Mathlib.Analysis.ODE.Gronwall—gronwallBoundandle_gronwallBound_of_liminf_deriv_right_le(no sign restriction onK; the file’s own header notes the inequality holds “with any sign ofK xandf x”). - The names “comparison lemma” and “ultimate bound(edness)” are Khalil’s (Nonlinear Systems; the book is on the digestion queue, so we cite the concepts by name and defer precise section numbers until the OCR lands — flagged, not fabricated).
The precise statements
Work in a real normed vector space . All four Lean declarations live in Lyapunov.lean beside this document; here is their mathematical content.
Definition (Lyapunov decrease along a field). Let be differentiable, a vector field, and . We say decreases along at rate up to when for every
where is the Fréchet derivative of at . With and this is precisely the conclusion of panteley2001growth Proposition 1; with it majorizes the interconnection term of their Lemma 2 on a horizon where .
Definition (quadratic sandwich). Constants sandwich when for all . This is the quadratic instance of the class- bounds (panteley2001growth eq 10) — and the framing paper’s Lyapunov function (eq 37)
satisfies it with half the extreme eigenvalues of on any region where the inertia stays bounded.
Theorem (comparison bound). Let be a solution of (continuous on , right-differentiable with derivative on ), and let be differentiable with the decrease property above. Then for all
(for ; the Lean statement covers uniformly via Mathlib’s
gronwallBound, which degenerates to there).
Three corollaries, each one inequality away: with , exponential decay (the Proposition-1 shape); with , the right side tends to — the ultimate bound, the cascade’s noise floor; and under the quadratic sandwich, the state-level bound
which after dividing by is exponential stability with overshoot constant and rate in the norm — the Lyapunov direct method’s exponential conclusion in the quadratic case. (The Lean statement stays division-free and square-level; taking square roots is a paper step.)
Scratch work — where the bound comes from
Pretend for a moment the inequality were an equality: . This linear ODE is solved by the integrating factor : multiply through and the left side becomes a perfect derivative,
and integrating from to gives . So the claimed bound is exactly the solution of the comparison system — the equality case. The whole content of the theorem is that solutions of the inequality stay below solutions of the equality. That is the comparison lemma; Grönwall’s inequality is its workhorse.
Proof (paper version, teacher-verifiable)
Assume is differentiable with on ; here , whose differentiability and derivative value come from the chain rule applied to the differentiable and the solution . Define, for , the deviation from the comparison solution:
Since is a product of differentiable functions, it is differentiable, and
By the decrease hypothesis the parenthesis is at most zero, and , so : the function is nonincreasing. Therefore , and unwinding the definition of ,
as claimed. For the state-level corollary, chain the sandwich inequalities: , using for the last step.
How the Lean proof differs — and why it is stronger. The paper proof above assumes differentiable everywhere on the interval. Mathlib’s le_gronwallBound_of_liminf_deriv_right_le needs only a right lower-slope condition at each interior point (a liminf of forward difference quotients), plus continuity — strictly weaker hypotheses, the textbook-honest setting for Lyapunov derivatives that are only Dini-differentiable along trajectories. The Lean route: chain rule (HasFDerivAt.comp_hasDerivWithinAt) turns the field-level decrease into the trajectory-level slope bound with (Mathlib’s Grönwall file explicitly permits negative ), and gronwallBound evaluates to the display above via at . Same proof skeleton, weaker hypotheses, machine-checked.
Post-proof analysis
The moral. One scalar inequality carries the entire quantitative content of cascaded-systems stability: the rate and the disturbance ceiling enter once, and the geometry of the state space never appears. This is why Panteley–Loría can run their entire program in class- bookkeeping above this engine room — and why it is the right first stone for a Lyapunov layer in Mathlib.
What this does not prove — the honest boundary. The framing paper’s Proposition IV.1 is not an instance of this theorem. Giordano’s Lyapunov derivative (eq 38) is only negative semidefinite — , flat in the directions — and the proof closes with LaSalle’s invariance principle plus cascade theorems for compact invariant sets (their ref [13], El-Hawwary & Maggiore 2013). The same relaxation appears as A1.2 (eq 11, with positive semidefinite) in panteley2001growth, whose Remark 1 flags it explicitly. Formalizing LaSalle — -limit sets, invariance, Barbashin–Krasovskii — is the genuine L3 wall; it exists in no proof assistant’s mainline library that we know of, and this stream’s charter treats it as a phase of its own, not a lemma to rush.
Design note on the definitions. LyapunovDecrease is stated at the field level (a property of and alone, quantified over the state space), not along a specific trajectory — so one hypothesis serves every solution, matching how the papers state A1.2/Prop 1. The junk-value trap of Mathlib’s total fderiv (which returns for non-differentiable , making the decrease predicate vacuously satisfiable) is disarmed by the explicit Differentiable ℝ V hypothesis in every theorem that consumes the definition.
The machine seal
Lyapunov.lean in this directory holds the two definitions, the comparison theorem, and the three corollaries; the #print axioms output for all four theorems is recorded on the stream note (~/Code/tasks/streams/leanpunov.md). The build copy lives at ~/lean/leanpunov/Leanpunov/Lyapunov.lean; this directory’s copy is the tracked source of truth.