Skip to content

bsubercaseaux/EmptyHexagonLean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmptyHexagonLean

A Lean verification of the Empty Hexagon Number, obtained by a recent breakthrough of Heule and Scheucher. The main theorem is that every finite set of 30 or more points must contain a convex and empty 6-gon. The proof is based on generating a CNF formula whose unsatisfiability is formally proved to imply the theorem. This repository contains the formalization code, and it allows the generation of the associated CNF.

Installing Lean

See the quickstart guide from the Lean manual, or the extended setup instructions.

Building the Lean formalization

The Lean code is in the Lean/ folder. In this folder run:

lake exe cache get   # Downloads pre-built .olean files for mathlib
lake build           # Builds this project's main theorems

The main results are in

  • Lean/Geo/Hexagon/TheMainTheorem.lean
  • Lean/Geo/Naive/TheMainTheorem.lean

Overall structure:

  • Lean/Geo/Definitions defines orientations and develops a theory of combinatorial geometry.
  • Lean/Geo/Canonicalization proves that a set of points can be mapped to a 'canonical' set of points with the same orientations.
  • Lean/Geo/KGon defines the 'base' encoding, which is a shared component of both the naive encoding and the specialized hexagon encoding.
  • Lean/Geo/Naive defines the naive encoding and proves the main results based on it.
  • Lean/Geo/Hexagon defines the specialized encoding and proves main results based on it.
  • Lean/Geo/RunEncoding.lean gives a CLI for running the various encodings and outputting the resulting CNFs.
  • Lean/Geo/SAT, Lean/Geo/ToMathlib both contain components that morally belong in libraries on which we depend.

Generating CNFs

The project includes scripts for generating the CNFs we formalized against.

Convex 6-gon

For n points:

lake exe encode gon 6 <n>

With n = 17 this CNF can be solved in under a minute on most machines.

Convex k-hole

For convex k-hole in n points:

lake exe encode hole <k> <n>

For k = 3, 4, 5 on n = 3, 5, 10 respectively, the CNFs produced can be shown UNSAT instantly.

For k = 6, n = 30, the CNF takes on the order of 17,000 CPU hours to show UNSAT when parallelized using cube&conquer.

The script in utils/6hole-cube.c outputs the list of cubes we used to solve k = 6, n = 30. We will add scripts soon for reproducing the entire parallel computation.

Authors

About

Code related to the Lean verification of the empty hexagon theorem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published