Skip to content

About

Autoformalization of Baek's solution to the moving sofa problem: the Gerver sofa is optimal

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Repository files navigation

Optimality of Gerver's sofa

This repository contains a Lean 4 proof that Gerver's sofa has the largest area of any shape that can be moved around a right-angled corner in a hallway of width one. This is the moving sofa problem, solved by Jineon Baek in Optimality of Gerver's Sofa (2024).

theorem MovingSofa.sofaConstant_eq_volume_gerversSofa : sofaConstant = volume gerversSofa
  • The statement is copied from Google DeepMind's formal-conjectures and passes comparator.
  • The statement is formalized unconditionally: the Green-type curve area identity and the Minkowski-type mixed area facts that the paper quotes are proved here.
  • The proof is about 66,000 lines of Lean, not counting dependencies. It was written in about four days by AI coding agents (OpenAI Codex and Claude Code), directed by Dean Cureton.

Built on

What's proved

The hallway is $(-\infty,1] \times [0,1] \cup [0,1] \times (-\infty,1]$. A moving sofa is a nonempty closed connected set in the horizontal arm, plus a continuous family of rigid motions that starts at the identity, keeps the set inside the hallway, and ends with it in the vertical arm. sofaConstant is the supremum of the areas of moving sofas. The theorem above is Theorem 1.1 of the paper.

Comparator checks two more theorems:

  • MovingSofa.GerversSofa.ABφθSpec.existsUnique: the four equations for Gerver's constants $A, B, \varphi, \theta$ have exactly one solution; gerversSofa is defined from it
  • MovingSofa.isMovingSofa_gerversSofa: Gerver's sofa is itself a moving sofa, so it attains the supremum

Two caveats: the statement fixes $m_0 = \mathrm{id}$ where the paper allows a translate (proved equivalent), and the area of Gerver's sofa is only shown to be $\ge 11/5$; the actual value $2.2195\ldots$ isn't checked.

The proof

The proof follows the same route as the paper. Any sofa of area $\ge 11/5$ is dominated by a balanced maximum sofa with rotation angle $\pi/2$, a limit of area-maximizing polygons. Its cap satisfies an injectivity condition, which lands it in a convex space of caps where area is bounded by a functional $Q$. Mamikon's theorem makes $Q$ quadratic and concave, and the directional derivative of $Q$ at Gerver's cap is $\le 0$ in every direction, so Gerver's cap maximizes $Q$. There $Q$ is exactly the area of Gerver's sofa. The $11/5$ bound for Gerver's sofa is an interval-arithmetic certificate checked by decide +kernel.

Directory Contents
MovingSofa/Geometry, Motion, Sofa hallways, motions, rotation angle, monotone sofas
MovingSofa/Convex, Curve, Analysis convex bodies, surface area measures, Jordan curves and Green's theorem, Lebesgue–Stieltjes calculus
MovingSofa/Cap, Polygon, Bounds caps and niches, balanced polygons and their limits, the injectivity condition
MovingSofa/Area Mamikon's theorem, the functional $Q$, its concavity and variation
MovingSofa/Gerver Gerver's sofa: geometry, matching it with the paper's set, area certificate
MovingSofa/ForMathlib general lemmas, nothing sofa-specific

Formalizing the paper surfaced 11 small errors/gaps in the paper's proofs, and 33 misprints. These are all repaired here, and none of them break the main theorem. See NOTES.md for more details.

Build

lake exe cache get
lake build

Challenge.lean gives three expected sorry warnings. The build can be quite slow, in part due to the vendored certificate.

Comparator accepts the solution against comparator.json, including the nanoda kernel replay.

Licensed under Apache-2.0, vendor/gerver-sofa is MIT.

About

Autoformalization of Baek's solution to the moving sofa problem: the Gerver sofa is optimal

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages