← All papers
First page of OEIS-Equiv: Evaluating Code Reasoning in Large Language Models via Equivalence Proofs

OEIS-Equiv: Evaluating Code Reasoning in Large Language Models via Equivalence Proofs

Yehua Lin, Yin Chen

cs.CL Nov 29, 2026 · v1
Builds a benchmark of 200 Lean 4 program-equivalence tasks with Lean-verified reference proofs and evaluates LLMs and Lean provers on them.
Large language models (LLMs) are increasingly used to turn natural language into code. But does this mean LLMs can reason about code? Existing evaluations can hardly tell, because most use familiar code and check only answers. We therefore turn to code that is valid but unfamiliar. We pair a program found by automated search, written in a Lean 4 domain-specific language, with one that an LLM generated for the same integer sequence. We then ask models to prove the two equivalent. Accordingly, we introduce OEIS-Equiv: 200 such tasks, each with a Lean-verified reference proof. DeepSeek-V4-Pro, which wrote all the LLM-generated programs, proves no pair equivalent, even after reasoning for tens of thousands of tokens per task. No other model proves more than a few. Even on tasks that a single line of automated tactics can prove, most are proved by no model. Thus, for LLMs, writing correct code and reasoning about code are not the same thing.

Existing code-reasoning evaluations for LLMs mostly use familiar code and check only final answers, so they cannot tell genuine reasoning apart from pattern recognition or lucky guesses.

OEIS-Equiv pairs search-found DSL programs for OEIS integer sequences, represented in Lean 4 via Sequencelib, with programs written by DeepSeek-V4-Pro for the same sequences. Models must prove the two programs extensionally equivalent in Lean. All 200 tasks are checked numerically and come with a Lean-verified reference proof. Three general-purpose reasoning models and three formal provers are evaluated without tool feedback, and one-line automated tactic scripts are studied as a baseline.

Figure 1: Overview of OEIS-Equiv.

No model proves more than 3 of the 200 tasks, and DeepSeek-V4-Pro proves none. One-line tactic scripts using grind, omega, nlinarith and aesop prove 21 tasks. Of the 15 tasks provable with pre-2025 tactics, 7 are proved by no model.

MethodTasks solved
DeepSeek-V4-Pro0/200 (0.0%)
GLM-5.22/200 (1.0%)
MiniMax-M33/200 (1.5%)
DeepSeek-Prover-V2-7B2/200 (1.0%)
Goedel-Prover-V2-32B1/200 (0.5%)
Automated proof tactics21/200 (10.5%)
Tasks solved on OEIS-Equiv