Inferensys

Glossary

Lyapunov Function

A Lyapunov function is a scalar function used in stability analysis to prove the asymptotic stability of an equilibrium point for a dynamical system without explicitly solving its differential equations.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
STABILITY ANALYSIS

What is a Lyapunov Function?

A Lyapunov function is a mathematical tool used to prove the stability of equilibrium points in dynamical systems without solving the system's equations.

A Lyapunov function is a scalar, energy-like function, typically denoted V(x), used to prove the asymptotic stability of an equilibrium point for a dynamical system. For a stable system, this function must be positive definite (V(x) > 0 for x ≠ 0) and its time derivative along system trajectories must be negative definite (dV/dt < 0). This guarantees that the system's state will converge to the equilibrium over time, a principle formalized by Lyapunov's direct method.

In Safe Reinforcement Learning and robotics, Lyapunov functions provide a formal certificate of stability for learned control policies. They are foundational for designing Control Barrier Functions (CBFs) to enforce safety and are used in Constrained Markov Decision Processes (CMDPs) to guarantee that an agent's behavior remains within a stable, safe region of the state space, which is critical for Sim-to-Real transfer and runtime monitoring of autonomous systems.

MATHEMATICAL FOUNDATIONS

Key Properties of a Lyapunov Function

A Lyapunov function is a scalar energy-like function used to prove the stability of an equilibrium point for a dynamical system without solving its equations. Its properties provide a formal certificate of stability.

01

Positive Definiteness

A Lyapunov function, denoted as V(x), must be positive definite around the equilibrium point (typically the origin, x=0). This means:

  • V(0) = 0 (zero at the equilibrium).
  • V(x) > 0 for all x ≠ 0 in a region around the origin.

This property ensures the function acts like a measure of 'energy' or 'distance' from the equilibrium, where zero represents the desired stable state.

02

Negative Definiteness of the Derivative

The core stability proof lies in the time derivative of V(x) along the system's trajectories. For asymptotic stability, the derivative V̇(x) must be negative definite (or negative semi-definite with additional conditions). This means:

  • V̇(0) = 0.
  • V̇(x) < 0 for all x ≠ 0.

This property guarantees that the 'energy' V(x) is strictly decreasing over time, forcing the system state x(t) to converge to the equilibrium.

03

Radial Unboundedness (for Global Stability)

To prove global asymptotic stability, a Lyapunov function must be radially unbounded. This means:

  • ||x|| → ∞ implies V(x) → ∞.

This property ensures that as the system state moves infinitely far from the origin, the 'energy' measure becomes infinitely large. It guarantees that no state can diverge to infinity while still decreasing V(x), confining all trajectories to eventually converge to the equilibrium from any initial condition.

04

Invariance Principle (LaSalle's Theorem)

When V̇(x) is only negative semi-definite (V̇(x) ≤ 0), asymptotic stability can still be proven using LaSalle's Invariance Principle. It states that the system will converge to the largest invariant set contained within the set where V̇(x) = 0.

This is critical for systems with conserved quantities (like mechanical energy) where the Lyapunov function derivative is zero not only at the equilibrium but along certain motions. The principle shows convergence to a set, not just a point.

05

Construction Methods

Finding a valid Lyapunov function is often non-trivial. Common construction methods include:

  • Quadratic Forms: For linear systems, V(x) = xᵀPx, where P is a positive definite matrix. Stability is checked by solving the Lyapunov equation AᵀP + PA = -Q.
  • Sum of Squares (SOS) Programming: For polynomial systems, uses semidefinite programming to search for a polynomial Lyapunov function.
  • Energy-Based Methods: For mechanical/electrical systems, using total energy (kinetic + potential) as a starting candidate.
  • Computational Lyapunov Functions: Using machine learning (e.g., neural networks) to approximate Lyapunov functions for complex systems.
SAFETY AND FAILURE MODE SIMULATION

How Lyapunov Stability Analysis Works

Lyapunov stability analysis provides a formal, mathematical framework for proving the stability of dynamical systems—such as robotic controllers—without solving their complex differential equations, a cornerstone for ensuring safety in simulation-based training.

A Lyapunov function is a scalar, energy-like function, V(x), constructed for a dynamical system to prove the asymptotic stability of an equilibrium point. The core theorem states that if V(x) is positive definite and its time derivative along system trajectories, V̇(x), is negative definite, then the equilibrium is stable. This allows engineers to certify a controller's safety by analyzing the function's properties, not by simulating every possible trajectory, which is computationally infeasible for complex systems.

In sim-to-real transfer learning, a Lyapunov function acts as a formal safety certificate. Engineers design or learn a candidate function within a high-fidelity physics simulation. If the function's conditions hold under domain randomization, it provides strong evidence that the real-world robotic policy will not diverge into unsafe states. This mathematical guarantee is critical for validating policies before physical deployment, directly linking to safety integrity levels and constrained Markov decision processes in safe reinforcement learning.

SAFETY AND FAILURE MODE SIMULATION

Applications in AI, Robotics, and Control

Lyapunov functions are not just theoretical constructs; they are practical tools for certifying stability and safety in autonomous systems. This section details their critical applications in modern AI, robotics, and control engineering.

01

Stability Proofs for Control Policies

In robotics and autonomous systems, a Lyapunov function provides a formal certificate of asymptotic stability for an equilibrium point (e.g., a robot standing upright or a drone hovering). Engineers design controllers and then construct a candidate Lyapunov function V(x) to prove that the closed-loop system's state x will converge to the desired equilibrium. This is foundational for nonlinear control and adaptive control systems, ensuring that learned or designed policies do not lead to unstable, divergent behavior.

02

Safe Reinforcement Learning (Safe RL)

Lyapunov functions are used to formulate safety constraints within Constrained Markov Decision Processes (CMDPs). A Lyapunov-based safety critic can be learned or designed to estimate the risk of leaving a safe set. The core idea is to restrict the RL agent's policy to actions that guarantee the Lyapunov function is non-increasing, thereby ensuring the system state remains within a region of attraction or a predefined safe region. This provides a mathematically rigorous alternative to heuristic penalty methods.

03

Control Barrier Functions (CBFs)

While Lyapunov functions certify stability, Control Barrier Functions (CBFs) are closely related constructs that certify safety (forward invariance of a safe set). They are often used in tandem. A CBF h(x) defines a safe region (where h(x) >= 0). The controller is synthesized to ensure the derivative of h(x) satisfies a condition that keeps the state safe. This framework is central to provably safe motion planning for autonomous vehicles and robots, enabling them to avoid obstacles while maintaining stability.

04

Sim-to-Real Transfer Verification

Before deploying a simulation-trained policy to physical hardware, a Lyapunov analysis can verify its robustness to the reality gap. By analyzing the policy's behavior in simulation with a Lyapunov function, engineers can bound the expected performance degradation due to model mismatch or unmodeled dynamics. If the function remains valid under bounded disturbances, it increases confidence that the policy will remain stable in the real world, a key step in safety-critical validation.

05

Neural Network Controller Verification

When control policies are parameterized by deep neural networks (e.g., Neural Lyapunov Functions, Learning-based MPC), verifying their stability is challenging. Techniques like Lyapunov-based training jointly learn a policy and a candidate Lyapunov function. Post-training, tools from formal verification and sum-of-squares programming can be used to check the Lyapunov conditions over a continuous region of the state space, providing certificates for neural network-controlled systems.

06

Fault Tolerance and Graceful Degradation

In systems subject to actuator failures or sensor faults, a family of Lyapunov functions can be used to design switched controllers that maintain stability. Each controller, paired with its Lyapunov function, is valid for a specific system mode (e.g., a drone with a failed motor). A supervisory system detects the fault and switches to the appropriate controller, ensuring graceful degradation rather than catastrophic failure. This is a core method in fault-tolerant control design for aerospace and industrial systems.

LYAPUNOV FUNCTION

Frequently Asked Questions

A Lyapunov function is a foundational mathematical tool in stability analysis for dynamical systems, particularly critical for ensuring the safety of autonomous and robotic systems trained in simulation. These FAQs address its core principles, applications in safety engineering, and relationship to modern AI safety techniques.

A Lyapunov function is a scalar, energy-like function, typically denoted V(x), used to prove the asymptotic stability of an equilibrium point (like a robot's desired pose) for a dynamical system without explicitly solving its differential equations. For a system to be stable, the function must be positive definite (V(x) > 0 for x ≠ 0, V(0)=0) and its time derivative along the system's trajectories must be negative definite (dV/dt < 0 for x ≠ 0). This guarantees that the system's state will converge to the equilibrium over time, much like a ball rolling to the bottom of a bowl. In Safety and Failure Mode Simulation, Lyapunov functions provide formal, mathematical certificates that a control policy will not drive a system into unsafe regions, forming the bedrock of provable stability guarantees for simulated robotic training.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.