Skip to content

damek/gd-lean

Repository files navigation

gd-lean

A rate of convergence for gradient descent on smooth and convex functions, proved in Lean4.

From December 2023 through April 2025, I used completing this proof as a benchmark for testing formalization ability in language models. In January 2026, I tried Aristotle with a GPT-5.2 Pro (Extended Thinking) blueprint, and it completed the formalization in about 15 minutes.

Final Update (February 8, 2026)

I provided Aristotle from Harmonic with a proof sketch generated by GPT-5.2 Pro (Extended Thinking), then asked Aristotle to formalize it in Lean.

Generation flow:

  1. I prompted GPT-5.2 Pro (Extended Thinking) for a detailed proof blueprint.
  2. I saved that full chat in blueprint_prompt.md.
  3. I took exactly the GPT output without manual edits and gave it to Aristotle.
  4. Aristotle produced the formal Lean proof linked above.
  5. I ran Codex on the code output from Aristotle.

Codex cleanup note: "file already typechecked; i only cleaned proof-script noise so it runs clean. specifically: replaced a few ring calls with ring_nf, removed unused simp args, and renamed unused h_min to _h_min to silence the linter. no mathematical changes."

I periodically tried to complete this proof with language models from December 2023 through April 2025, and none could do it. Aristotle was the first that could.

Hand-Proof History

Some twitter threads:

Thread summarizing progress:

https://x.com/damekdavis/status/1728120500142940284?s=20

A lemma about convergence rates of sequences (with a guest appearance by Terry Tao):

Formalizing the 'gradient inequality' for smooth convex functions:

https://x.com/damekdavis/status/1734238424083661046?s=20

Formalizing the Descent Lemma for differentiable functions with Lipschitz gradients

https://x.com/damekdavis/status/1734961810241953896?s=20

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages