fmeneguiPTEN

Article in English · PT / EN changes navigation only.

Searching for Lyapunov: Part 1

Control Theory
Mathematics
Lean
AI
Notes on feedback control, Lyapunov stability, and the use of AI agents and Lean to study mathematical proofs.
Author

Felipe Meneguitti Dias

Published

November 2, 2026

A black-and-white comic reinterpretation of the Searching for Bobby Fischer poster. A young character hugs a raised knee, with hands near the face and an oversized sneaker in the foreground. The title Searching for Lyapunov is at the lower right beside a V-shaped chess piece.
Searching for Lyapunov. A comic reinterpretation of the pose and framing of the Searching for Bobby Fischer poster.

After seeing OpenAI announce a solution to the Navier–Stokes existence and smoothness problem, one of the Millennium Prize Problems, alongside other mathematical advances, I went looking for a better explanation of how they had done it. [1], [2]

From what I understood, they organized groups of AI agents to explore different approaches, run code and share results. A swarm of agents attacking the problem together. The argument they found was then formalized and checked in a language called Lean. [1]

I had never heard of Lean.

What interested me was the possibility of checking a mathematical argument with a computer. If an agent gives me a long proof, I still need a way to know whether its steps follow. Lean lets us write the statement and its proof in a form that the computer can check against explicit logical rules. It can also be used to prove properties of programs. [3]

Three panels. A researcher says I have an idea. A group says We have three hundred. Another researcher feeds a formal proof into a machine labeled Lean and says Let's check.
Agents explore ideas. Lean checks formalized proofs.

As I read more, I discovered that Lean's creator, Leonardo de Moura, is Brazilian and studied at PUC-Rio. I recommend The Proof in the Code, by Kevin Hartnett, for anyone interested in that story. [4]

The Navier–Stokes mathematics was another matter. Even with my engineering background and doctoral research, I could not follow the argument in detail. There were too many mathematical tools I did not know.

So I started thinking about a question closer to electrical engineering. What could we try with this combination of agents and Lean?

That brought me to control theory. And, eventually, to Lyapunov.

This is Part 1 of that journey. We'll study control, learn Lean and work our way toward Lyapunov's ideas about stability. I want to build the connections slowly enough that we can understand what we are asking the computer to prove.

Let's start with a room.

We want to keep it at 23 °C. Imagine a simplified air conditioner that can either be off or cool at a fixed intensity.

If we leave it cooling continuously, the room may become colder than we want. We need to decide when to stop.

Temperature over time. With the air conditioner off, a room initially at 30 degrees warms toward 32 degrees. With constant fixed cooling, it crosses the 23-degree target and continues cooling.
Illustrative simulation with 32 °C outdoors. Fixed cooling continues past the target.

First, we need a thermometer. We cannot make that decision without knowing the room's temperature.

Then we can make a rule: leave the air conditioner on until the thermometer reads 23 °C. After that, turn it off.

But the day is hot. Heat keeps entering through the walls and windows after we switch the unit off. The room starts warming again.

At what point should we turn it back on?

Let's choose 27 °C. At 27 °C, turn it on. At 23 °C, turn it off.

There. Problem solved.

For now, assume the cooling can overcome the incoming heat and switching happens immediately.

Now watch what we have actually asked it to do. The room cools to 23 °C, warms to 27 °C, then cools again. The air conditioner keeps switching on and off because that is the rule we gave it.

The same room in three panels. At 27 degrees, the character says On. At 23 degrees, Off. Back at 27 degrees, Again. The caption reads Yes. That was the plan.
Switch on at 27 °C and off at 23 °C. The repeated cycle follows the chosen rule.

We wanted 23 °C, but our first solution accepts a range.

Keeping the two switching temperatures apart helps avoid rapid switching around a single threshold. That gap is called a hysteresis band. While the temperature is inside the band, the controller keeps its previous on/off state. [5]

At 25 °C, the unit might be on because the room is cooling from 27 °C. Or it might be off because the room is warming from 23 °C. The same temperature can lead to different actions because the history matters.

The upper panel shows initial cooling from 30 to 23 degrees, followed by repeated warming to 27 and cooling to 23. The lower panel shows the AC command switching between one and zero at those same times.
After initial cooling, the controller cycles between 23 °C and 27 °C. The lower panel shows the corresponding on/off command.

We have already built something from control theory. We measure the room, use that measurement to make a decision, act on the room, and measure it again.

The decision rule is our controller. Feeding the resulting temperature back into the next decision is feedback.

A feedback loop connects a controller, the room and air conditioner, and a thermometer. Switching limits enter the controller. Its on/off rule also uses the previous state. The cooling command affects the room, and measured temperature returns to the controller so it can apply the rule again. Entering heat also affects the room.
The controller uses the measured temperature and its previous state to apply the on/off rule again. This closes the feedback loop.

Suppose we want a steadier temperature.

Bringing the thresholds closer together can reduce the temperature variation, while making the unit switch more frequently. If the equipment allows adjustable cooling, we can try a different rule: cool harder when the room is too warm and reduce the cooling near 23 °C.

The heat outside does not disappear when we reach the target. To hold the room at 23 °C, the air conditioner may need to keep running at just enough intensity to remove the heat that is entering.

The temperature stays constant because those effects balance. That is an equilibrium of the model: the room's temperature has stopped changing, even though heat is still moving.

So far, this sounds reasonable.

Now suppose someone opens the door. Warm air enters and the temperature rises from 23 °C to 24 °C. Then the door closes and the usual heat load returns.

Will our controller bring the temperature back? Will a small change remain small, or could the response make it worse?

Three panels show a room at 23 degrees, a door opening and the temperature rising to 24 degrees, then the closed door and a researcher asking whether the room will settle again.
A temporary disturbance creates the next question: what happens after the door closes?

We can run a simulation and inspect a graph. Then try another starting temperature. Then another. But I would also like an argument explaining which conditions make the behavior reliable.

To build that argument, we need a mathematical model. For our room, it would describe how entering heat and cooling change the temperature. Combining those relationships with the controller's rule tells us how the controlled room evolves.

We now have a more precise question. If the room starts sufficiently close to the equilibrium temperature, does it remain close afterward? That is the stability question. Actually returning to the equilibrium is an additional goal, called convergence. [6]

This is the question that brings Lyapunov into the story.

Historical black-and-white portrait of Aleksandr Mikhailovich Lyapunov, with a full beard and a dark suit.
Aleksandr M. Lyapunov (1857–1918)Unknown photographer · Public domainWikimedia Commons [8]

Lyapunov is a person's surname. Aleksandr Mikhailovich Lyapunov, who lived from 1857 to 1918, was a Russian mathematician. His research included mechanics and the equilibrium of rotating liquids. In 1892, he defended a doctoral thesis titled The General Problem of the Stability of Motion. [7]

The question was much broader than our air conditioner: how can we reason about the effect of small changes on a system's motion?

His name became attached to mathematical ideas for studying stability. When engineers talk about Lyapunov stability or a Lyapunov function, that is the person they are referring to.

One useful idea is to construct a single quantity whose behavior tells us something about the whole system. A suitable function can let us establish stability without first calculating the system's entire motion through time. [6]

What could that quantity be for our room?

We want something that tells us how far the temperature is from 23 °C. At 25 °C, we are two degrees too warm. At 21 °C, we are two degrees too cold.

The direction matters when we choose the action. Above the target, we want the temperature to fall. Below it, we want it to rise. For a measure of how far away we are, we would like both situations to give a positive number, with zero exactly at the target.

One simple way to do that is to subtract 23 from the temperature and multiply the result by itself.

At 25 °C, the difference is 2, so the score is 2 × 2 = 4. At 24 °C, it is 1 × 1 = 1. At 23 °C, it is zero.

At 21 °C, the difference is -2. Multiplying -2 by itself also gives 4. Both rooms are two degrees away, so both get the same score.

Let's call that score V. The letter is just a conventional name.

In mathematical language, the rule that turns a temperature into a score is a function. Give it a temperature, and it gives us a number.

If we call the temperature T, the rule is V(T) = (T - 23)². The notation V(T) means "the value of the score when the temperature is T". Here, T is the numerical temperature in degrees Celsius, and the superscript 2 means to multiply the difference by itself.

A table explains the error score. Temperatures 21, 22, 23, 24 and 25 degrees have differences from the target of minus two, minus one, zero, one and two. Squaring them gives V scores four, one, zero, one and four.
V is the name of a score. In this example, it is zero at the target and positive above or below it.

We have a score. How does that help with the room?

Suppose we start at 24 °C. The score is 1. If the room's equations and our control rule let us prove that this score never increases, then it can never become larger than 1.

That immediately tells us something physical: the temperature must stay between 22 °C and 24 °C. Reaching 25 °C would give a score of 4, which would violate the bound.

A statement about a number has become a statement about the room.

For the squared error from 23 degrees, a score at most four permits temperatures from 21 to 25 degrees. A score at most one permits 22 through 24 degrees. A score of zero permits exactly 23 degrees.
This is why the score is useful. Bounding V bounds the room's temperature. The control rule and model must establish that the score stays within the chosen bound.

To establish stability, this reasoning must work for every sufficiently nearby starting temperature.

This is the connection I wanted to understand. If we can establish the right property of V, we get a restriction on what the system can do. The equations and the controller still have to establish the bound we just assumed.

Notice the two roles. The controller chooses the cooling action. V helps us analyze what that action does to the temperature.

For this one-temperature example, our squared-error function is a candidate for a Lyapunov function. To use it in that role, we must prove the required properties from the model. Writing down the formula is the start of the argument.

There is also a stronger question. Can we show that the score approaches zero? If it does, the temperature approaches 23 °C.

A decreasing score can level off above zero, so that conclusion needs more than the observation that the score went down.

In the illustrative adjustable-cooling model below, one room starts at 30 °C and another at 21 °C. Both approach 23 °C, and both scores decrease. The temperature moves in different directions in the two cases, while V gives us a common way to describe progress toward the target.

Two temperatures, initially 30 and 21 degrees, approach 23 under the adjustable cooling rule chosen for the model. The lower panel shows the squared error score V decreasing in both cases.
For this illustrative model with constant outdoor temperature and ideal actuator response, both temperatures approach 23 °C and both error scores decrease.

Our earlier on/off controller had accepted a different goal. At 23 °C, its score is zero. At 27 °C, its score is 16. As that controller produces a temperature cycle, the score cycles too. That follows from choosing a temperature band rather than convergence to a single temperature.

I can draw a convincing picture of a quantity going down. We still need to establish that the claimed behavior follows from the equations.

In the first panel, a researcher points to a marble in a bowl labeled V and says Works in the sketch. In the second, the researcher holds a large pile of papers and says Now for the proof.
The bowl suggests an intuition. A proof must establish the relevant properties from the model's equations.

And that brings me back to Lean.

Now I can describe a task I would like to try. Start with a model and a control rule. Look for a function that could help demonstrate stability. Work through the argument, then express it as a proof that Lean can check.

Agents could help explore candidate functions and intermediate arguments. We would still need to check that our model and formal statement describe the problem we intended to study. Lean would check the logical steps of the formal proof.

For a room described by one temperature, squared error is a natural place to start. A robot can have positions, velocities and other quantities interacting at once. Finding a suitable function for that system can be much harder.

That is what "Searching for Lyapunov" means here: looking for functions that can support a stability argument, and understanding how to construct and check that argument.

That feels like a problem I can start with. A room, a thermometer, a controller and a claim I want to be able to check.

We'll study these ideas together over the next parts, starting with small examples and making the mathematics explicit as we need it.

Next, we'll return to the room and write down its model. I want to understand what each quantity means, where the equations come from, and what changes when we choose a different controller.

References

  1. OpenAI. On the Navier–Stokes Millennium Prize Problem. September 8, 2026. The announced result addresses alternatives C and D in the official formulation, with smooth external forcing.
    https://openai.com/index/navier-stokes-solution/
  2. OpenAI. Sharing AI progress in mathematics. October 6, 2026.
    https://openai.com/index/sharing-ai-progress-in-mathematics/
  3. Lean. Programming language and proof assistant.
    https://lean-lang.org/
  4. Kevin Hartnett. The Proof in the Code. Macmillan.
    https://us.macmillan.com/books/9781250493941/theproofinthecode/
  5. MathWorks. Model House Heating System.
    https://www.mathworks.com/help/simulink/ug/model-a-house-heating-system.html
  6. Russ Tedrake. Underactuated Robotics. Lyapunov Analysis.
    https://underactuated.mit.edu/lyapunov.html
  7. J. J. O'Connor and E. F. Robertson. Aleksandr Mikhailovich Lyapunov. MacTutor History of Mathematics, University of St Andrews.
    https://mathshistory.st-andrews.ac.uk/Biographies/Lyapunov/
  8. Wikimedia Commons. Portrait of Aleksandr Lyapunov. Unknown photographer, first published in 1908 or earlier. Public domain.
    https://commons.wikimedia.org/wiki/File:Aleksandr_Lyapunov.jpg

Cite this post

Copy this entry into your .bib file.

@misc{dias2026-searching-for-lyapunov,
  author = {Dias, Felipe Meneguitti},
  title = {{Searching for Lyapunov: Part 1}},
  year = {2026},
  month = {11},
  howpublished = {Blog post},
  url = {https://fmenegui.com/blog/searching-for-lyapunov/},
  note = {Published on 2026-11-02}
}
Download .bib

In LaTeX, use \cite{dias2026-searching-for-lyapunov}.

Search