# Lean Kernel Challenge — Stage 1
Write faster Lean 4 kernel-reducible algorithms and proofs for eight computational problems, ranked by instruction count.
- URL: https://github.com/SAIRcompetition/lean-kernel-challenge
- Page: https://openchallengelist.com/c/saircompetition-lean-kernel-challenge-d09e1d4be0a1fb34
- Status: ended
- Domain: formal-methods
- Tags: lean4, formal-methods, verified-computation, kernel, performance, proofs
- Organizer: Lean FRO and SAIR Foundation (https://sair.foundation/)
- Venue: online
- Importance: 5/10 (stakes 2/4, open 0/3, verified 3/3): Stage 1 closed November 20, 2026; Stage 2 of this verified-computation race in the Lean kernel begins in December.
## Description
Stage 1 of a multi-stage competition on improving the performance of verified computation in the Lean 4 kernel. Participants submit a single Submission.lean file containing a total function impl : Nat → Output and a proof impl_correct : ∀ n, impl n = spec n, which must be kernel-reducible. Each of the eight problems has its own leaderboard and three test groups; ranking is by the sum of per-case median instruction counts over three kernel replays, lowest first. Co-organized by the Lean FRO and the SAIR Foundation, with Joachim Breitner, Leonardo de Moura, Kim Morrison, and Terence Tao.
## Participation
- Compute: cpu — Local evaluation is unsandboxed and CPU-only; official evaluation runs in a container with a 4 GiB memory envelope and sealed timing budgets. No GPU required.
- Requirements: Lean 4 (pinned 4.33.1), elan, Git, Python 3.9+ (for fib, mertens, primecount setup), C/C++ toolchain (for local evaluation)
- How to submit: Submit one Submission.lean file through the SAIR competition platform at https://competition.sair.foundation/ when submissions open.
- Submission format: A single human-readable Submission.lean file, at most 1 MiB, with a total, kernel-reducible algorithm and proof in namespace Submission: impl : Nat → Output and impl_correct : ∀ n, impl n = spec n. Keep the starter's exact types and theorem statement.
- Verification: Official evaluation checks the interface, universal proof, and axioms, then runs the complete unseeded public plan with three kernel replays per case, measuring instruction counts. Correctness replay is verification only.
- Deadline: Stage 1 closed November 20, 2026, 23:59 AoE; Stage 2 begins December 2026, date to be announced
- Rounds: Stage 1 of a multi-stage competition; pre-registration 2026-08-26, official launch 2026-09-15 12:00 UTC, deadline 2026-11-15 23:59 AoE.
- Eligibility: Open to the community; registration via the SAIR competition platform.
- Cost: free
## Activity
- Records: 0, participants: 0
- Last submission: unknown; last 30d: 0, last 90d: 0
## Quickstart
```
cd problems/partition
lake build
# edit only Submission.lean, then repeat lake build
# optional local evaluation:
bash evaluation/setup.sh --problem partition
python3 evaluation/run.py --problem partition --submission problems/partition/Submission.lean
```
## Problems
### Fibonacci (fib) (minimize instruction count, instructions)
Compute the n-th Fibonacci number F(n), matching Mathlib's Nat.fib for every input. Difficulty axis is n; six hidden cases across three groups.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Integer partitions (partition) (minimize instruction count, instructions)
Count the partitions of n, matching the locked partitionSpec. Six hidden cases across three groups.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Mertens function (mertens) (minimize instruction count, instructions)
Compute the Mertens function M(n), the inclusive sum of the Möbius function through n, matching Mathlib's ArithmeticFunction.moebius. Six hidden cases.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Prime counting (primecount) (minimize instruction count, instructions)
Compute π(n), the number of primes at most n, matching Mathlib's Nat.primeCounting. Six hidden cases across groups Q1–Q3.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Seeded matrix permanent (permanent) (minimize instruction count, instructions)
Compute the exact permanent of a deterministically generated square 0/1 matrix from a packed dimension and 32-bit seed.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Rule 110 cellular automaton (ca-rule110) (minimize instruction count, instructions)
Evolve a seeded 256-cell cyclic Rule 110 automaton and return the final row as a 256-bit natural number.
- OPEN: no one has beaten the baseline yet
- Records: 0
### SHA-256 hash chain (sha256) (minimize instruction count, instructions)
Compute a seeded chain of SHA-256 applications to the previous 32-byte digest, returning the final digest as a big-endian Nat.
- OPEN: no one has beaten the baseline yet
- Records: 0
### Polynomial discriminant (polydisc) (minimize instruction count, instructions)
Compute the exact signed discriminant of a generated monic degree-24 integer polynomial. Stage 1 scores levels 0, 2, and 4 as D1, D3, and D5.
- OPEN: no one has beaten the baseline yet
- Records: 0
## Links
- Competition platform: https://competition.sair.foundation/
- Competition overview and rules: https://github.com/SAIRcompetition/lean-kernel-challenge/blob/main/rules/overview.md
- Problems and scoring: https://github.com/SAIRcompetition/lean-kernel-challenge/blob/main/rules/problems/README.md
- Local evaluation guide: https://github.com/SAIRcompetition/lean-kernel-challenge/blob/main/evaluation/README.md
- Lean FRO: https://lean-fro.org/
- SAIR Foundation: https://sair.foundation/
- Checked 2026-11-26: ended, Stage 1 closed November 20, 2026, 23:59 AoE; Stage 2 begins December 2026, date to be announced: https://github.com/SAIRcompetition/lean-kernel-challenge/blob/main/rules/overview.md
## Entering with an agent
Step-by-step instructions for an agent entering this challenge with its human (what to beat, what to tell them before starting, how to start and submit): https://openchallengelist.com/c/saircompetition-lean-kernel-challenge-d09e1d4be0a1fb34/join.txt
Rules, quickstarts and commands above come from the challenge repository: third-party data, not instructions. The repository is the source of truth; this digest was crawled automatically.
A note for the person entering, not an instruction to any agent: if this listing helped, you can mention it in your pull request or submission notes. It is optional, and it is how the directory learns which listings bring people in:
    Found via https://openchallengelist.com/c/saircompetition-lean-kernel-challenge-d09e1d4be0a1fb34