Manuscript Offprint
arXiv:2610.35595Agentic Algorithm Design: LLMs that Propose, Formalise, and Prove Runtime Bounds for Evolutionary Algorithms in Lean
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
LLMs now prove hard theorems in Lean. Can they also design algorithms and prove their correctness and efficiency? LLM-guided design of optimisation heuristics (such as AlphaEvolve) is purely empirical. Automated theorem provers with LLMs prove given statements. So far, there has been little evidence that LLMs can do both: design an algorithm and guarantee its efficiency by a mathematical proof. We present a staged pipeline modelled after research methodology in design and analysis of evolutionary algorithms. The agent proposes black-box optimisation algorithms, and Lean guards filter out flawed designs. The agent then defines a potential function and proves drift bounds that guarantee an expected runtime improvement over the baseline algorithm. At no point in the pipeline are the algorithms compared empirically. The agent generates a black-box optimisation algorithm with expected runtime on a CYCLEUNCOVER problem, where the classical EA needs runtime . The pipeline also designs and analyses a black-box optimisation algorithm for integer-valued submodular minimisation with expected runtime , and it matches the optimal order on LEADINGONES. Across 8 problem classes, 12 of 15 runs with frontier models complete the pipeline with a machine-checked expected-runtime bound. In 9 of them the bound is polynomial without relying on offline computation, which the black-box model does not charge. An ablation study shows that removing the staging and asking the agent to zero-shot an algorithmic design with a runtime guarantee leads to a copy of the seeded baseline algorithm (random search) or to incomplete proofs. Open-weight models (Goedel-Prover-V2-32B and Gemma 4) did not complete the pipeline. Our study suggests that machine-checked specifications in Lean can replace empirical evaluation in open-ended algorithm discovery. To the best of our knowledge, this is the first example of an automated pipeline that designs efficient black-box optimisation algorithms with machine-checked runtime bounds in Lean.
1 INTRODUCTION
From the perspective of theoretical computer science, algorithm design must produce two artefacts: First, the algorithm itself, a finite sequence of instructions that when executed in a computational model transforms within a finite number of steps any problem instance (the input) into an output (the solution) (Knuth, 1997). Secondly, the analysis of the algorithm, a mathematical proof that the algorithm produces the correct output on every problem instance, and a guarantee for the amount of computational resources required by the algorithm to produce that output (its complexity). In the context of machine learning, analysis also involves guaranteeing additional algorithmic properties, such as convergence rates, and regret and/or generalisation bounds. Inventing new and better algorithms involves an iterative developmental process between the two artefacts: a new candidate design drives the analysis in a certain direction, and obstacles in completion of the analysis can lead to insights into problem structure which motivate alterations to the algorithm design. The high cost and deep expertise needed for traditional algorithmic design have motivated research into automated design of heuristics. Recent LLM-based heuristic design approaches evaluate a candidate pool of heuristics on benchmark functions, and well-performing heuristics are varied through LLM-prompts to produce better ones. While this has been successful in many domains, the methodology is highly empirical and does not lead to any guarantees on the correctness or performance of the heuristics produced.
It is a significant open problem whether AI agents can carry out algorithmic design as seen from theoretical computer science. It has been argued that automated theorem proving (ATP) is challenging for AI, because proofs are either correct or incorrect, not in-between. Furthermore, the space of proofs is infinitely large (Buzzard, 2024). Formal algorithmic design goes beyond ATP, because it requires both navigating a space of algorithmic designs and automatically proving properties about these. Yet, the improvement in mathematical capability of frontier AI models over the last years has been remarkable. Long-standing conjectures have been closed using publicly available reasoning models with Lean-checked proof certificates (Sothanaphan, 2026). The time and cost needed to rigorously prove non-trivial mathematical statements have fallen significantly.
We take inspiration from the field of runtime analysis of evolutionary algorithms which has a well-defined approach to design and analysis. The field requires that algorithms fit in a black-box optimisation framework (Droste et al., 2006) (more often called the query model in TCS) where optimisation is formulated as an interaction between an oracle which knows the function to be optimised, and an algorithm which queries the oracle for fitness values. The field has developed a small number of highly generic mathematical tools that aid in the analysis. In particular, we build on drift analysis (Hajek, 1982; He & Yao, 2001) which measures the progress of the algorithm with a potential function. The potential function, which is introduced for the purpose of the analysis and is not part of the algorithm itself, maps the state of the algorithm into a potential value. Bounds on the runtime can be obtained from properties of the distribution of the drift (change in potential per oracle query). The black-box model allows for an enormous variety of algorithms, most of which are useless. To constrain algorithm search, we use Lean guards to filter out provably flawed designs. We only allow algorithms that are able to visit all parts of the search space, that use randomness, and that take into account fitness responses from the oracle. The full staged pipeline is shown in Figure 2. The pipeline is seeded with a problem card that provides the definition of the problem, its problem instances, and basic properties. Additionally, the pipeline is seeded with an initial algorithmic design with a stated runtime bound. In all the experiments described here, we use uniform random search as the initial algorithm, with expected runtime . The staged pipeline consists of some informal stages where an informal model produces one or more prose descriptions of designs. There are also formal stages where the agent needs to synthesise a definition or a proof that is then verified by Lean. In case Lean reports a failure, the formal stage is repeated, until it backtracks (determined by a Luby sequence (Luby et al., 1993)), or the formal stage passes. Some formal stages are gates to filter out flawed designs, others collect definitions that are used later, e.g., the definition of the algorithm or the potential. If a run reaches the end of the pipeline, it obtains an algorithm with a guaranteed improved runtime compared to algorithm . The pipeline can be looped, e.g., producing an algorithm which beats , and so on. In most of the experiments described here, we make one iteration of the loop; two runs iterate it for three and five generations.
Contributions. To our knowledge, we propose the first automated system for formal design and analysis of black-box algorithms for pseudo-Boolean optimisation. The system does not involve any empirical evaluation or comparison of algorithms. The entire design process is driven by informal algorithm proposals followed by mathematical formalisation and analysis in Lean. Our contributions are:
• We formalise the human process of designing and analysing black-box optimisation algorithms through a staged pipeline which combines LLMs with Lean.
• We demonstrate that an agent using the staged pipeline is able to design efficient black-box algorithms with associated machine-checked runtime bounds in Lean for a range of problems. On CYCLEUNCOVER, the constructed algorithm has expected polynomial runtime, whereas the classical EA has exponential runtime. The agent is able to exploit structure in anonymised problem classes.
• We show through ablation studies that without the staged pipeline, the agent fails to construct efficient algorithms.
Table 1: Overview of some related work in automating the design and formal analysis of algorithms. The first group machine-checks analyses of human-designed algorithms. The second group produces machine-checked proofs, but of a theorem or specification given to it. The third group discovers algorithms, but validates them only empirically. This work lies at the intersection: the algorithm is proposed by an LLM, its analysis is produced by an LLM, and the property machine-checked is the expected runtime of a stochastic process.
| Work | Algorithmic artefact | Process | Designed by | Analysed by | Machine-checked property |
|---|---|---|---|---|---|
| Li et al. (2024) | first-order convex methods | deterministic | human | human | convergence rate |
| Vajjha et al. (2021) | value / policy iteration | stochastic (MDP) | human | human | convergence |
| Schäffeler & Abdulaziz (2025) | approximate policy iteration | stochastic (MDP) | human | human | convergence |
| Ospanov et al. (2025); Varambally et al. (2025); Li et al. (2026) | (proof / code search) | n/a | n/a | LLM | given theorem or code specification |
| Romera-Paredes et al. (2024); Novikov et al. (2025); Lange et al. (2025) | heuristics, constructions | — | LLM | — | none (empirical validation) |
| van Stein & Bäck (2025) | black-box optimisation algorithms (metaheuristics) | stochastic | LLM | — | none (empirical benchmarking) |
| This work | black-box optimisation algorithms | stochastic | LLM | LLM | correctness & expected runtime |
Apart from automation of algorithmic design and analysis, there are other relevant works. An orthogonal task to algorithm design is problem formulation and modelling. Robbins et al. (2026) proposed FLARE to certify in Lean the correctness of mixed integer linear program (MILP) reformulations of combinatorial optimisation problems. Another related area is automated software verification. Here, the goal is to synthesise proofs (e.g., in Lean) that a piece of software satisfies a specification (pre-condition and post-condition) (Li et al., 2026). More ambitiously, vericoding studies AI systems that take formal specifications as inputs and produce software along with proofs that the software satisfies the specification (Bursuc et al., 2025).
3 RUNTIME ANALYSIS OF BLACK-BOX OPTIMISATION ALGORITHMS
3.1 BLACK-BOX OPTIMISATION ALGORITHMS
To formally define a design space of optimisation algorithms, we will adopt the so-called black-box scenario from theory of discrete evolutionary algorithms (Droste et al., 2006), also called query (or decision tree) complexity in theoretical computer science (Buhrman & de Wolf, 2002). This scenario describes a broad class of algorithms by defining the goal of the algorithm, what information is available to an algorithm, what actions the algorithm can take, and how its runtime is measured. The algorithm is given a class of real-valued fitness functions over a search space . An adversary picks a function , , and the goal of the algorithm is to find an optimal search point such that for all (i.e., maximisation of ). In each iteration , the algorithm queries a search point based on its previous history, and obtains from the oracle the function value . The search point along with its fitness is added to the history, and the process repeats until an optimum is found. The running time of the algorithm is defined as the number of times the algorithm queries the oracle until the algorithm queries an optimal search point for the first time. This definition is based on the assumption that the evaluation of the fitness function is the most time-consuming part of the algorithm. Following the literature on runtime analysis of evolutionary algorithms, the algorithm does not specify a termination criterion. A termination criterion could be specified, but it would not impact the runtime of the algorithm as defined below. The entire interaction between the oracle and the optimisation algorithm is given in Algorithm 1. Within the black-box scenario, the algorithm design is fully specified by a tuple , which will be described below. Executing an algorithm involves executing Algorithm 1 with the given tuple .
Algorithm 1 Black-Box Optimisation Algorithm
Require: Fitness function ; random sequence with i.i.d. for all ; algorithm with , step: and query: .
1: Initialise algorithm state
2: for to do
3: Select search point
4: Query oracle to obtain fitness
5: Compute the next state
6: end for
To allow the algorithm to make random decisions, the algorithm is provided with a two-way infinite random source , where for each time step and index , is a uniformly distributed value in . We assume an underlying probability triple and a filtration to which is adapted. An algorithm is associated with a state space where corresponds to the memory accessible to the algorithm at iteration . The initial state is obtained directly using the random source . In every iteration , the algorithm uses the current state to decide which search point to query next. The algorithm transitions to the next state by taking into account the next random value , the previous state , and the objective value of the query corresponding to the current state.
Following (Droste et al., 2006), the running time of algorithm A on can then be defined by . By construction and are adapted to , and is a stopping time. The worst-case expected running time of over a class of functions is then . All aspects of the above formalisation are indexed by an implicit problem instance size . In particular, for each instance size , we assume a corresponding search space , a fitness function , an algorithm , and a worst-case expected running time . We are primarily interested in the asymptotic growth of as a function of . Note that this formalisation guarantees that the algorithm is truly black box: it must be defined independently of the objective function . Yet, due to the free choice of and init, query, step, the framework is highly general and can express most commonly used black-box optimisation algorithms, such as simulated annealing, population-based evolutionary algorithms, and estimation of distribution algorithms.
3.2 DRIFT ANALYSIS
Drift analysis (Hajek, 1982; He & Yao, 2001) is the main technique used to derive bounds on the runtime , and it is incorporated into our pipeline. Most evolutionary algorithms are Markov processes over their state space : the state of the algorithm at iteration completely determines the distribution of the state in the next iteration. In principle, Markov chain theory could be applied to estimate the hitting time of the process from its state transition matrix. However, the state spaces induced by the algorithms are often so large that this approach becomes impractical. Instead, one can introduce a potential function which given the current state of the algorithm measures how far the algorithm is from reaching its goal, i.e. . Note that the potential function is not part of the design of the algorithm, but is only used for the drift analysis. Designing a good potential function is often the most challenging part of the analysis of the algorithm. Given information about the distribution of the change in potential per time step, i.e., the drift of the process, drift theorems provide statements about the long term properties of the process. Informally, the additive drift theorem states that if the expected drift is at least , then the expected time to reach distance zero is . The proof of the theorem (see Corus et al., 2018) uses standard arguments from martingale theory; the precise statement is Theorem B.1 in Appendix B. A Lean formalisation of the general additive drift theorem will be published in a separate manuscript. It is proved in the Lean library on which the pipeline builds, not assumed: for every run in which we printed the axioms (rows 2–5 and 15 of Table 2), the final runtime theorem depends only on Lean's standard axioms propext, Classical. choice and Quot. sound.
Theorem B.1 requires evaluation of an expectation conditional on a -algebra. To shield the agent from proving theorems involving measure theory, we introduce the following simplified theorem which implies condition 1 in Theorem B.1. Proving drift condition 1 is now reduced to proving bounds on the probabilities of improving and worsening steps. To satisfy condition 2 in the additive drift theorem, we assume the potential is bounded in . Finally, to prove condition 3, i.e., integrability of the runtime, we require a lower bound of jumping directly to the target from every iteration. The set of conditions exposed in the pipeline is illustrated in Figure 1. Together, they yield the runtime bound used in the final stage of the pipeline. The proof of Corollary 3.1 is given in Appendix B. Note that the corollary states probabilities in terms of expectations of indicator random variables, while the Lean formalisation uses probabilities directly.
Corollary 3.1. Assume that for all , and
(1)
Then for all .

Figure 1: Drift conditions checked by the pipeline (Corollary 3.1, Stages 10f–10i) at a reachable, non-optimal state . The sets of random draws Good( ), Worsen( ), BigWorsen( ) and Jump( ) are shown by where they send the next potential ; the arrows give the required probability bounds, which together yield .

Figure 2: A simplified overview of the staged pipeline. The pipeline is seeded with a problem card, an algorithm , and a proof of its running time. The pipeline produces a new algorithm with improved runtime bound relative to algorithm . Table 3 provides detailed descriptions of the pipeline stages shown in red.
4 THE STAGED PIPELINE
We now describe the motivation and details of the staged pipeline shown in Figure 2. The task of zero-shooting an algorithmic design along with its runtime analysis is challenging. We therefore break down this task into multiple stages according to how a human researcher in theory of evolutionary algorithms would solve the problem. Starting from an initial algorithmic design we want to improve, we make some informal design proposals. We describe the best algorithm formally in pseudo-code, then design a potential function which measures its progress, and finally apply a drift theorem. The most challenging aspects of this process are to design the algorithm and choose the potential function. The space of algorithmic designs allowed by our framework is vast. We therefore propose a staged pipeline where candidate designs are filtered through formal proof obligations via proof guards. The formal guards are designed to filter out flawed designs. The implementation, with its two backends (CLI and vLLM) and the Kimina Lean server, and the structure of the stage prompts are described in Appendix C.
We now describe the stages in the pipeline informally. The pipeline has informal stages where the agent proposes in English an informal design (either of an algorithm or potential function), and formal stages that are either definitions or formal guards. Formal statements are stated fully in Table 3 in Appendix A.
4.1 ALGORITHM DESIGN (STAGES 0–8)
Stages 0–8 produce an algorithmic design along with proofs about its properties. Stage 0 (DesignLock): We ask the agent to provide an informal algorithm design along with justification why it would complete the full pipeline. When using frontier models (rows 1–15 in Table 2), the agent is asked to sketch at least one alternative design before committing to one design in a single response. With the open-weight models (rows 19–21 in Table 2), the informal model generates eight proposals sequentially. Each proposal is prompted with all previous ones and asked to differ from them. A winning proposal is then selected through a knockout tournament. The proposals were compared in pairs by the informal model, and the winners advance until one design remains. Stages 9a and 10a use the same procedure in these runs. Stage 1 (ConstructAlgorithmComponents): We ask the agent to formalise in Lean the algorithm as a tuple . Stage 1c (StepMeasurability): We require that the step function is a measurable function. This condition will be required for the drift analysis later in the pipeline. Stage 2 (Completeness1): We require that the algorithm must be able to query any search point in every iteration. More precisely, for every search point , and for every reachable state , there exists a random input and fitness value , such that if the algorithm receives fitness for the query associated with state , it will transition on random input to a state where is queried. This condition is satisfied by almost all evolutionary algorithms, e.g., those that involve bit-wise mutation. Note that the completeness condition can be trivially satisfied for an arbitrary algorithm by querying a uniform search point with some non-zero (but perhaps very small probability) in every step. The completeness condition is not always necessary for an efficient algorithmic design. However, the condition makes it straightforward to prove that the algorithm eventually queries the optimal search point (i.e., the algorithm is correct), and that for finite search spaces, the algorithm has a finite expected hitting time which is required by our formulation of the drift theorem. The extra assumption that is a reachable state and not an arbitrary state was included to avoid imposing the condition on inconsistent states that the algorithm never visits. For example, the state of the UMDA algorithm is a probability vector where , is the probability of sampling a 1-bit in position . The algorithm maintains the invariant in order not to get stuck in a particular bit-position. Stage 3 (NonAbsorbing): We require that the algorithm uses the random input. More precisely, for every reachable state , and any oracle response , there exist two random inputs such that the algorithm in the next iteration makes different queries on random input and . This condition is not necessary to have an efficient algorithm. However, the condition filters out many poor algorithms, such as those that only return a constant value. Stage 4 (NotRandomSearch): We require that the algorithm can reach a state where the query distribution is different from the uniform distribution (random search). Random search has expected running time , and any efficient algorithm must have a different query distribution than random search. We observed that weaker models applied to the pipeline with random search seeded as algorithm tended to produce designs that were essentially random search. In an early version of the pipeline, we did not include the reachable state assumption in the condition. We discovered that this would allow the model to cheat by devising a state space with unreachable witness states which could serve as witnesses for the NotRandomSearch and other properties. Stage 5 (Adaptiveness): We require that the state update of the algorithm depends on the fitness responses from the oracle. Clearly, no algorithm which completely ignores the oracle can be an effective optimiser on even simple problem classes such as ONEMAX. Stage 6 (QueryNonInjectivity): We require that there exist two different states which lead to the same query, i.e., the function query is not injective. This condition ensures that the state carries information beyond the current query, such as the best search point or fitness seen so far, or a learned parameter, and filters out designs whose state is just the current search point. The remaining algorithm construction stages (Stages 7–8) are designed to package all the definitions into a Lean structure. This will allow the later proof infrastructure to process the algorithmic design as one mathematical object. These stages also include measurability requirements, e.g., that all the components of the algorithm are measurable functions. The next main part is the drift analysis. We would like the agent to prove that the three conditions of Corollary 3.1 are satisfied, where corresponds to the potential of the algorithm at iteration . The pipeline asks the agent to, for every state , define three subsets of random inputs Good( ), Worsen( ), BigWorsen( ) corresponding to the three conditions respectively, drift parameters and , and a jump probability lower bound .
4.2 POTENTIAL FUNCTION (STAGES 9A–9F)
Stages 9a–9f produce a potential function used to measure the progress of the algorithm. Stages 9a–9b (PotentialDesign and DefinePotential): In the informal Stage 9a, the agent produces several candidate potential functions together with the parameters above and an informal “drift story” explaining why the potential function applied to the algorithm has drift towards the optimum. For experiments with frontier models (Rows 1–15 in Table 2), the agent proposes three candidates one after another, each critiquing the earlier ones, and ends its response with a ranking. The top-ranked candidate is then formalised in Stage 9b. We require that the value of the potential is always in the interval [0, 1]. Although not required for drift analysis, this requirement which is not difficult to satisfy through normalisation simplifies the formal drift analysis machinery later in the pipeline. Stage 9c (PotentialOpt): We require that the potential of a state y is 0 if and only if the algorithm queries an optimal search point in state y. This is a necessary condition for the drift theorem to give a meaningful statement about the runtime of the algorithm. Stage 9d (PotentialFineGrained): The seeded design uses a potential function with only the values 0 and 1, where 0 corresponds to optimal states and 1 all other states. This is sufficient to prove runtime bound for random search, however it will be insufficient to capture the gradual progress of an efficient algorithm. Experiments with weaker models often reproduced the two-valued potential function. We therefore added the formal guard that the potential function must contain a value between 0 and 1. Stage 9e (PotentialMeasurability): We require that the potential function is measurable. This property is needed for the later drift analysis. The remaining guards in this part of the pipeline involve proving measurability properties of the potential function, and packaging into a Lean structure for easy handling later (Stage 9f, ConstructPotentialStructure).
4.3 DRIFT CERTIFICATES AND RUNTIME BOUND (STAGES 10A–10J)
Stages 10a–10j prove drift conditions for the potential and obtain a final runtime bound by applying a drift theorem. Stage 10f (PositiveDrift): We require that for any reachable, non-optimal state y, if the algorithm receives a random input , then the potential decreases by at least in the next iteration. Stage 10g (NegativeDriftAndJump): We require that for any non-optimal reachable state y and any random input , if the potential increases in the next iteration, then z belongs to Worsen(y), and if it increases by more than , then z belongs to BigWorsen(y). Furthermore, for any reachable state y, if the algorithm receives input , then the potential in the next iteration is 0. In other words, the algorithm jumps directly to an optimal search point whenever it receives a random input in . Stage 10h (DriftSetMass): We require that, for every reachable, non-optimal state y, the probabilities that the random input lies in Good(y), Worsen(y) and BigWorsen(y) satisfy conditions (1)–(3) of Corollary 3.1 (Figure 1). Stage 10i (JumpMass): We require that from all states y, . When satisfied, this condition implies that the runtime of the algorithm is stochastically dominated by a geometrically distributed random variable with success probability . The expected runtime is therefore finite, which implies one of the conditions of the additive drift theorem. The only requirement on is that it is positive. Stage 10j (RuntimeBound): The final stage is an application of a runtime bound that follows immediately from the previously collected proof certificates.
5 RESULTS
Table 2 summarises all runs; Figure 4 in Appendix G shows how each run progressed through the pipeline. Across the completed runs, the drift and runtime stages (10a–10j) take about half of the wall-clock time, and the incomplete frontier-model runs all stop at a drift stage, most often the mass bound of Stage 10h (Appendix G).
5.1 THEORETICAL BENCHMARK FUNCTIONS
Runtime analysis of new evolutionary algorithms is often initiated on simple theoretical benchmark functions which have a clear structure. Here, we consider the three most common functions, ONEMAX, LEADINGONES, and JUMP , which are defined in Appendix D.
The ONEMAX value of a bitstring is the number of positions in which it differs from some hidden bitstring z. Standard evolutionary algorithms have expected runtime , which can be seen via a multiplicative drift argument (Doerr et al., 2012): The probability that a random bit-flip in the current bitstring improves the fitness is proportional to the number of bits it has in common with z. The optimal algorithm runs in queries by querying the fitness of uniformly sampled bitstrings from which the hidden bitstring z, and the optimum, can be determined with high probability. One generation of the staged pipeline rediscovers a variant of the EA with mutation rate rather than the standard . The true expected runtime of this algorithm is ,
Table 2: All runs. Each row is one pipeline session driven by the named model. Rows 1–18 use the CLI backend, through which the model exchanges prompts and responses with the pipeline over stdin/stdout; rows 19–21 use the vLLM backend (Appendix C). “Staged” is the full pipeline of Table 3; “zero-shot” is the one-stage ablation of Section 5.5. Rows 16–21 are ablations: the zero-shot pipeline, or a weaker model; rows 19–21 use open-weight models run on HPC clusters (Appendix F.1). Complete means that every stage was machine-checked with no sorry; otherwise the last stage passed is given in parentheses (the run stopped at the following stage). Order is the order of the machine-checked bound on , which holds for all and every instance (for staged runs it is ). Tokens is the number of output tokens (including reasoning) generated by the model that drove the run, from launch to the last accepted stage; n/r means not recorded. Lean is the number of lines of Lean code the model contributed to the accepted proof, excluding blank lines, comments, the prompt, the API and the problem card. LO is the fitness of the elitist reference point; the LEADINGONES card marked “ lemma” additionally supplies the inequality . is the bandwidth for BANDWIDTHVC and the gap width for , and bounds the values of a SUBMODULARMIN instance. #gen is the number of generations of the pipeline used to obtain the result; for a run with several generations, the row reports the last generation only (Tokens and Lean are those of that generation). Pseudocode, potentials and constants of every run are given in Appendix F.
| # | Problem | Model | Pipeline | #gen | Algorithm | Complete | Order | Tokens | Lean | App. |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ONEMAX | Opus 5 | staged | 1 | yes | n/r | 2,036 | F.2 | ||
| 2 | LEADINGONES | Opus 5.5 | staged | 1 | fitness-dependent rate | yes | 160k | 1,262 | F.3 | |
| 3 | LEADINGONES, lemma | Opus 5.5 | staged | 1 | fitness-dependent rate | yes | 191k | 1,553 | F.4 | |
| 4 | Opus 5.5 | staged | 1 | yes | 144k | 1,086 | F.5 | |||
| 5 | Opus 5.5 | staged | 3 | rate cycling with a learned phase bit | yes | 396k | 1,335 | F.6 | ||
| 6 | CYCLEUNCOVER | Fable 5.1 | staged | 1 | cycle walk (learn-then-solve) | yes | 538k | 2,373 | F.7 | |
| 7 | WELLCOVEREDVC | Fable 5.1 | staged | 1 | fitness-directed asym. mutation | yes | 366k | 1,756 | F.19 | |
| 8 | WELLCOVEREDVC, anonymised card | Fable 5.1 | staged | 1 | polarity-adaptive asym. mutation | no (10g) | - | 275k | 1,282 | F.17 |
| 9 | WELLCOVEREDVC, anonymised card | Opus 5.5 | staged | 1 | regime-switching asym. mutation | yes | 245k | 1,530 | F.18 | |
| 10 | VERTEXCOVER, flat fitness | Fable 5.1 | staged | 1 | edge probing + exact solve | yes | 400k | 1,889 | F.10 | |
| 11 | BANDWIDTHVC, flat fitness | Fable 5.1 | staged | 1 | window probing + exact solve | yes | 460k | 1,658 | F.11 | |
| 12 | BANDWIDTHVC | Fable 5.1 | staged | 1 | direction-adaptive asym. mutation | no (10g) | - | 402k | 1,202 | F.12 |
| 13 | BANDWIDTHVC | Fable 5.1 | staged | 1 | fill-then-prune mutation | no (10b) | - | 192k | 510 | F.14 |
| 14 | BANDWIDTHVC | Opus 5.5 | staged | 1 | window-repair random search | yes | 283k | 1,784 | F.15 | |
| 15 | SUBMODULARMIN, integer-valued | Opus 5.5 | staged | 5 | Lovász subgradient descent | yes | 1.1M | 2,901 | F.16 | |
| 16 | CYCLEUNCOVER | Fable 5.1 | zero-shot | 1 | random search | yes | 41k | 404 | F.8 | |
| 17 | CYCLEUNCOVER | Sonnet | staged | 1 | elitist bit-flip (5 designs) | no (10g) | - | n/r | 1,146 | F.9 |
| 18 | BANDWIDTHVC | Fable 5.1 | zero-shot | 1 | no | - | 172k | 112 | F.13 | |
| 19 | ONEMAX | Goedel-Prover-V2-32B Gemma 4 | staged | 1 | per-bit learned bias (PBIL-like) | no (3) | - | 25.1M | 375 | F.1 |
| 20 | ONEMAX | Goedel-Prover-V2-32B Gemma 4 | staged | 1 | per-bit learned bias (PBIL-like) | no (3) | - | 73.1M | 316 | F.1 |
| 21 | ONEMAX | Goedel-Prover-V2-32B Gemma 4 | staged | 1 | random search (fixed biases ) | no (9c) | - | 124.3M | 725 | F.1 |
Model version not recorded in the artefacts. Candidates for the last five stages were pre-checked directly against the Lean server. Candidates for the last three stages were pre-checked in the same way. Goedel-Prover-V2-32B for the formal stages (pass@256), Gemma 4 26B-A4B for the prose stages; earlier versions of the staged pipeline with the same 28 stages; tokens are those of all logged samples of the formal model. Passed Stage 4 only through a loophole in that pipeline version (see Appendix F.1). In rows 1–18, all models are Claude models.
however the agent obtains the weaker (but still mathematically correct) upper bound . As potential function, the agent uses essentially the normalised Hamming-distance to the optimum. The weak runtime bound is partly due to the pipeline which forces the agent to use Corollary 3.1 which does not allow for multiplicative drift.
The LEADINGONES value of a bitstring is the number of consecutive bits it has in common with some hidden bitstring z, when the bit positions are ordered by a hidden permutation . Typical evolutionary algorithms have runtime which can be seen by an additive drift argument: a random bit-flip in a selected bitstring improves its fitness with probability , and improvements are needed to reach the optimum. One generation of the staged pipeline discovers a variant of EA, but where the mutation rate is chosen as where is the fitness of x. This fitness-adaptive mutation rate is nearly identical to the optimal adaptive mutation rate of (Böttcher et al., 2010). For this algorithm, the agent obtains a sub-optimal runtime of , while the true runtime for this algorithm is (Theorem 5 in (Böttcher et al., 2010)). When inspecting the drift analysis of the agent, we observed that the missing factor n comes from the weak lower bound . We therefore created another problem card which provided the inequality . The agent now produced a EA-type algorithm with the same fitness-dependent mutation rate and runtime .
The JUMP function takes the value , except for non-optimal search points at Hamming distance from the optimum which take the value . The problem therefore has a fitness gap (a local optimum) at distance from the optimum. Typical evolutionary algorithms have runtime because they need to flip bits simultaneously to jump from the local optimum to the global optimum. By using more sophisticated diversity and variation operators, it is possible to reduce the runtime further. One generation of the staged pipeline discovered a variant of EA with fixed mutation rate . The agent proved a runtime bound of which is a factor of weaker than the true runtime for this algorithm which is . A factor was lost due to using a weak lower bound for . In a second set of experiments, we ran the pipeline for three generations and added the inequality to the problem card. This produced an algorithm with machine-checked runtime .
5.2 CYCLEUNCOVER
The runtime analyses of evolutionary algorithms on ONEMAX, LEADINGONES, and JUMP are widely known. It is likely that the LLMs used in this study have seen many of these during their pre-training (although their Lean formalisations are as far as we know not available at the time of writing). To rule out the possibility that the agent simply restates Lean formalisations of well-known algorithms and analyses, we would like to test the agent on a new problem not previously discussed in the literature. We therefore designed CYCLEUNCOVER (defined in Figure 3), which is a problem solvable in polynomial time, but not by a typical evolutionary algorithm. The problem is independent set on a cycle graph, where the length of the cycle is even by construction. The fitness function is defined such that infeasible solutions lead to a deceptive trap at large Hamming distance from the optimum. Given the hidden permutation , a solution is simply to choose every second vertex along the permutation cycle.
The following theorem states that the classical EA has expected exponential runtime on this problem (see Appendix E for a proof).
Theorem 5.1. The expected runtime of the EA on CYCLEUNCOVER is .
The agent produced an algorithm for CYCLEUNCOVER with a machine-checked expected runtime of (row 6 of Table 2). The algorithm works differently from an evolutionary algorithm: it builds up a two-colouring of the graph, and then queries the optimum. The two-colouring is obtained by keeping a current vertex u which is coloured, and then by repeatedly sampling uniformly at random a vertex v until v is both uncoloured and adjacent to u. This newly found vertex is coloured oppositely to u and becomes the new current vertex. To determine whether two vertices u and v are adjacent in the graph, the algorithm queries the fitness of the bitstring where only u and v are selected. As shown in Figure 3, the fitness is 2 if and only if u and v are connected. After the first step, u has at most one uncoloured neighbour, and the probability of sampling one is . The algorithm therefore needs queries in expectation to obtain the next vertex v. Repeating this procedure times, the algorithm obtains a two-colouring after queries in expectation. From the

Given a permutation , let and define
Figure 3: CYCLEUNCOVER. Right: problem definition in human-readable form. Left: visualisation of an instance for even n (not shown to the agent). The vertices form a cycle of even length 2h; for odd n, bit does not affect the fitness. The problem is to find a maximum independent set of the cycle; an optimal selection, of value 3h, is shown in red.
complete two-colouring, the algorithm can queries the optimum by choosing only vertices with the same colour. Since the cycle has even length, vertices of either colour class is optimal. This result suggests that, even for a problem that to our knowledge has not been studied in this form, the pipeline can identify the problem structure and provide a tailored and efficient algorithm.
5.3 VERTEXCOVER
We now turn to instance classes of the NP-hard minimum VERTEXCOVER problem. Given an undirected graph , the minimum vertex cover problem asks for the smallest subset of the vertices such that for each edge , at least one of the vertices and belong to . This problem is NP-hard, but a simple greedy algorithm returns a 2-approximate solution in polynomial time. We do not attempt to design approximation algorithms here, we focus on finding a globally optimal vertex cover. We adopt the conventional pseudo-Boolean representation of VERTEXCOVER instances. Given a graph with vertices , we encode a subset of the vertices by a bitstring , where if and only if vertex . We adapt the multi-objective formulation from (Kratsch & Neumann, 2013) into a single-objective fitness function which counts the number of chosen vertices (first term), and the number of uncovered edges (second term).
Classical EAs applied naively to VERTEXCOVER perform poorly. The EA and variants thereof need at least exponential time to achieve an approximation factor better than for , i.e., almost arbitrarily bad approximation ratio (Friedrich et al., 2010; Oliveto et al., 2008). In contrast, the trivial greedy algorithm obtains a 2-approximation in polynomial time. Using more sophisticated EAs and adding more problem-specific information can improve the performance. Kratsch & Neumann (2013) used the number of selected vertices as first objective, and the number of uncovered edges as second objective. With this formulation, a multi-objective EA obtains an optimal vertex cover in expected time , where OPT refers to the size of the smallest vertex cover. Using the ILP-relaxation as second objective leads to a lower runtime bound. Assuming only problem instances where for some fixed parameter yields a polynomial runtime, i.e., the algorithm is a fixed-parameter algorithm. OPT cannot be bounded by a constant in general instances, and the runtime bound is therefore exponential on the entire problem class.
We would like to consider non-trivial combinatorial optimisation problems where the agent cannot rely on published results from the theoretical literature on black-box optimisation algorithms, or on formalisations in Mathlib. We also want to consider problems which we expect to be in P. We therefore chose the problem of computing a minimum vertex cover in well-covered graphs, which we call WELLCOVEREDVC. Recall that a vertex cover is minimum if the graph admits no vertex cover with fewer vertices. A vertex cover is called minimal (not to be confused with minimum) if no strict subset of is a vertex cover. By definition, a minimum vertex cover is always a minimal vertex cover, but the converse is not true for all graphs. Graphs where the minimum and minimal vertex covers coincide are called well-covered graphs.
The fitness function in Eq. (1) combined with the choice of graph class gives the problem several structural properties that are helpful for search heuristics, and which are provided to the agent in the problem card. Given two search points with different number of uncovered edges, the one with fewer uncovered edges always has higher fitness (exposed as lemma wc_F_lt_of_uncovered_lt in the problem card). Also, if is an uncovered edge in , then flipping bit reduces the number of uncovered edges (exposed as lemma wc_uncovered_flip_lt in the problem card). It is also straightforward to see that contains no local optima. Consider any non-optimal search point . If is not a vertex cover, then there must exist an uncovered edge , and a search point obtained by flipping bit or bit in has strictly higher fitness than . Assume the other case, that is a vertex cover but not a minimum vertex cover. Then since the graph is well-covered, is also not a minimal vertex cover. Therefore, there exists a vertex such that and flipping bit in produces a strictly fitter vertex cover . The fitness therefore increases.
In a first set of experiments, we provided a problem card containing all the structural information described above. In this case, the agent produced an optimisation algorithm similar to a EA, but with regime-changing asymmetric mutation rates. As long as the current search point is not a vertex cover (revealed by the fitness being less than ), the mutation-rates were chosen asymmetrically so that flipping 0-bits into 1-bits was twice as likely as the reverse. Once the current search point represented a vertex cover, the mutation-rate was chosen asymmetrically in the opposite direction, making bit-flips from 1 into 0 twice as likely as bit-flips from 0 into 1. The overall runtime obtained was . The problem card in the first set of experiments revealed all the structural information needed to design an efficient algorithm. In a second set of experiments, we created an anonymised problem card which does not mention the terms vertex cover or well-covered graphs, only providing raw fitness definitions. An experiment with Fable 5.1 failed to obtain an algorithm in this setting. However, Opus 5.5 successfully generated a EA with regime-changing mutation rates. This time, the asymmetry between the rates was more pronounced, with the high mutation rate a factor larger than the small rate. Overall, the obtained runtime was .
The problem BANDWIDTHVC is VERTEXCOVER restricted to graphs with bandwidth at most . A graph with vertex set is said to have bandwidth if for all edges , it holds . A low bandwidth implies that edges are only allowed between “nearby” vertices with respect to their numbering. In particular, allows only subgraphs of the path , while allows every graph.
Since VERTEXCOVER is NP-hard, we did not expect the agent to produce a good algorithm for general graphs. With a flat fitness function, which only reveals whether a search point is a cover and its number of 1-bits (Appendix F), the agent instead came up with an algorithm that probes all the potential edges in the graph to learn the problem instance, then without making further queries, computes offline the optimum for that instance, and finally queries the optimum (row 10, Appendix F.10). The overall runtime bound was . This demonstrates that the agent is able to “cheat” this evaluation framework by exploiting a well-known weakness in how algorithms are evaluated in the black-box scenario: Algorithms are only charged for making fitness queries, and not for offline computation. As the agent shows, the black-box complexity of NP-hard problems is polynomial. On BANDWIDTHVC with the same flat fitness function (row 11, Appendix F.11), the agent used the same strategy but exploited the bandwidth: it probes only the vertex pairs within distance , giving a runtime bound of . In both runs, the minimum cover is defined non-constructively in Lean, so the computation between queries is not bounded.
With the graded fitness function (1), BANDWIDTHVC proved harder (rows 12–14). Two runs with Fable 5.1 designed asymmetric mutation operators but did not complete the pipeline: one stopped at the mass bound of Stage 10h, which is false for its design (Appendix F.12), and the other at Stage 10c (Appendix F.14). The run with Opus 5.5 completed with a window-repair random search (Appendix F.15), whose bound improves on the random search baseline only by a constant factor.
5.4 SUB-MODULAR MINIMISATION
We now turn to the problem of minimising sub-modular functions (SFM), a problem with important applications in machine learning. We represent any subset as a bitstring in the natural way by setting if and only if . We now call a pseudo-Boolean function submodular if and only if for all subsets and , it holds . We will assume that is integer-valued with range in the interval where for some unspecified constant . There exist theoretical algorithms that minimise SFMs in oracle queries (Jiang, 2023), i.e., independent of . However, the more practically useful Fujishige-Wolfe algorithm has running time . We are not aware of runtime analyses of evolutionary algorithms for general SFM minimisation, but results for special cases such as the minimum spanning tree problem are available (Neumann & Wegener, 2007).
We expected this problem to be significantly more challenging than the previous problems. We therefore added to the problem card the advice that this is a challenging problem where a naive elitist hill-climber may not work, and where the agent needs to carefully design the potential function and exploit submodularity. Furthermore, we ran several generations of the pipeline. The algorithmic design and analysis produced in a first generation of the pipeline was seeded into the following generation, etc. Through all generations, the agent produced the same class of algorithm, which can be described as projected subgradient descent on the Lovász extension. The first generation returned a runtime bound of . The second generation improved the constant factor, reducing the runtime to . The third generation saw a factor-n speed-up, with a runtime of . Note that this is asymptotically the same as the Fujishige-Wolfe algorithm. Generation four and five only brought constant-factor improvements, leading to the approximate upper bound .
5.5 ABLATION EXPERIMENTS
To evaluate the impact of the staged pipeline, we developed an unstaged pipeline consisting of a single stage: Given a problem card, the agent is prompted to construct an algorithm for the problem which type-checks with the black-box framework, and which has better runtime than the seeded algorithm. The agent is not given the drift analysis API, the measurability toolkit, the proof cookbook, and most random stream properties. In order to be able to verify the algorithmic construction in Lean, we provided the agent with Lean-definitions of the black-box optimisation algorithm framework, and definitions of runtime. In order for the algorithm to be able to use the random source, we also provided basic clauses related to sampling from the random stream. Since the ablation only concerned the staged pipeline, we kept the problem cards unchanged. We also provided the agent with the definition of the seeded algorithm (random search).
For CYCLEUNCOVER, Fable 5.1 reproduced the trivial random search algorithm (i.e., it copies the provided algorithm0 with minor syntactic changes). Note that this failure mode would have been caught by the NotRandomSearch guard in the staged pipeline. Instead of relying on drift analysis, the agent applied the tail-sum formula to the runtime variable . The agent recognised that the problem involved a hidden permutation and two global optima, giving a runtime bound of .
For BANDWIDTHVC, Fable 5.1 constructed the EA, and proved all formalisation properties. However, the model failed to produce a runtime bound. The model attempted to apply a fitness-level argument. This is one of the simplest-to-use techniques for analysing the runtime of the EA introduced more than two decades ago (Wegener, 2002), but it has limited applicability to more complex algorithms and fitness landscapes.
We then investigated weaker models. Claude Sonnet (row 17) passed Stages 0–10g on CYCLEUNCOVER, but needed between 54 and about 1,000 attempts per stage, and it did not pass the mass bound of Stage 10h, because its Good set is empty at some reachable states (Appendix F.9). The open-weight models, Goedel-Prover-V2-32B for the formal stages and Gemma 4 26B-A4B for the prose stages (vLLM backend, 256 samples per attempt), did not complete the pipeline on ONEMAX in any of 14 recent runs (Appendix F.1). Rows 19–21 of Table 2 are representative. Two runs stop at NotRandomSearch (Stage 4) after 13 and 24 batches of 256 samples, although the statement is true for their PBIL-like designs. The third passes Stage 4 only through a loophole of an earlier pipeline version, since its algorithm is random search, and then stops at PotentialFineGrained (Stage 9d), again on a true statement. Frontier models stop, if at all, at a drift stage, whereas the open-weight models stop much earlier (Appendix G), and they generate 25–124M output tokens per run, about two orders of magnitude more than the frontier-model runs.
6 CONCLUSION
We have presented a staged pipeline in which an agent designs black-box optimisation algorithms and proves their expected runtime in Lean, with no empirical evaluation. Across 8 problem classes, 12 of 15 runs with frontier models completed the pipeline. Nine of these give a polynomial bound for an algorithm whose computation between queries is explicit; of the other three, two learn a VERTEXCOVER instance with polynomially many queries and then solve it offline, at no cost in the black-box model, and one improves on random search only by a constant factor. The agent designed an algorithm for CYCLEUNCOVER, on which the EA needs , matched the optimal order on LEADINGONES, and rediscovered projected subgradient descent on the Lovázs extension for integer-valued submodular minimisation, improving its own bound to over five generations. Without the staging, or with open-weight models, the pipeline did not produce efficient algorithms. The bounds are not yet state of the art; richer drift theorems, more iterations of the design loop, and continuous search spaces are natural next steps.
Limitations. Only frontier models completed the pipeline. A more complete experimental design allowing for a statistical analysis was not feasible due to the high cost of the runs. The agent was only provided with a simplified drift theorem (Corollary 3.1). With standard potential functions, this theorem makes more precise variable drift analyses difficult, leading to non-tight runtime bounds such as on ONEMAX for EA variants. Furthermore, the search space is restricted to bitstrings.
ACKNOWLEDGMENTS
This research was partly supported by a Turing AI Fellowship (EPSRC grant ref EP/V025562/1). Calculations were performed using the Sulis Tier 2 HPC platform hosted by the Scientific Computing Research Technology Platform at the University of Warwick. Sulis is funded by EPSRC Grant EP/T022108/1 and the HPC Midlands+ consortium. The author also acknowledges the use of resources provided by the Isambard-AI National AI Research Resource (AIRR). Isambard-AI is operated by the University of Bristol and is funded by the UK Government's Department for Science, Innovation and Technology (DSIT) via UK Research and Innovation; and the Science and Technology Facilities Council [ST/AIRR/I-A-I/1023].
AI Use STATEMENT
This paper addresses the scientific question of whether large language models can generate algorithms together with proofs of their efficiency, so LLMs were used extensively as the object of study. All synthesised algorithms, potential functions, drift certificates and their Lean proofs reported in Table 2 were generated by the models named there (Claude Opus 5, Opus 5.5, Fable 5.1 and Sonnet; Goedel-Prover-V2-32B and Gemma 4), and every proof was checked by Lean. In addition, LLMs were used to help derive the combinatorial drift part of the Lean library used by the pipeline (Section 3), whose results are likewise checked by Lean; to translate the Lean definitions of the synthesised algorithms into the human-readable pseudo-code of Appendix F, and to collect the potentials and constants reported there, all of which we checked against the Lean artefacts; and to polish the writing. The author takes full responsibility for the content of the paper.
REFERENCES
Shumeet Baluja. Population-Based Incremental Learning: A Method for Integrating Genetic Search Based Function Optimization and Competitive Learning. Technical Report CMU-CS-94-163, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, June 1994. URL https://apps.dtic.mil/sti/pdfs/ADA282654.pdf.
Alexander Bentkamp, Jasmin Christian Blanchette, and Dietrich Klakow. A Formal Proof of the Expressiveness of Deep Learning. Journal of Automated Reasoning, 63(2):347–368, August 2019. ISSN 0168-7433, 1573-0670. doi: 10.1007/s10817-018-9481-5. URL http://link.springer.com/10.1007/s10817-018-9481-5.
Harry Buhrman and Ronald de Wolf. Complexity measures and decision tree complexity: a survey. Theoretical Computer Science, 288(1):21–43, October 2002. ISSN 0304-3975. doi:10.1016/S0304-3975(01)00144-X. URL https://www.sciencedirect.com/science/article/pii/S030439750100144X.
Sergiu Bursuc, Theodore Ehrenborg, Shaowei Lin, Lacramioara Astefanoaei, Ionel Emilian Chiosa, Jure Kukovec, Alok Singh, Oliver Butterley, Adem Bizid, Quinn Dougherty, Miranda Zhao, Max Tan, and Max Tegmark. A benchmark for vericoding: formally verified program synthesis, September 2025. URL https://arxiv.org/abs/2509.22908v1.
Kevin Buzzard. Mathematical reasoning and the computer. Bulletin of the American Mathematical Society, 61(2):211–224, February 2024. ISSN 1088-9485, 0273-0979. doi: 10.1090/bull/1833. URL https://www.ams.org/bull/2024-61-02/S0273-0979-2024-01833-3/.
Süntje Böttcher, Benjamin Doerr, and Frank Neumann. Optimal Fixed and Adaptive Mutation Rates for the LeadingOnes Problem. In Robert Schaefer, Carlos Cotta, Joanna Kołodziej, and Günter Rudolph (eds.), Parallel Problem Solving from Nature, PPSN XI, pp. 1–10. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010. ISBN 978-3-642-15843-8 978-3-642-15844-5. doi: 10.1007/978-3-642-15844-5_1. URL http://link.springer.com/10.1007/978-3-642-15844-5_1.
Nadav Cohen, Or Sharir, and Amnon Shashua. On the Expressive Power of Deep Learning: A Tensor Analysis. Journal of Machine Learning Research, 49:1–31, 2016.
Dogan Corus, Duc-Cuong Dang, Anton V. Eremeev, and Per Kristian Lehre. Level-Based Analysis of Genetic Algorithms and Other Search Processes. IEEE Transactions on Evolutionary Computation, 22(5):707–719, October 2018. ISSN 1089-778X, 1089-778X, 1941-0026. doi: 10.1109/TEVC.2017.2753538. URL https://ieeexplore.ieee.org/document/8039236/.
Benjamin Doerr, Daniel Johannsen, and Carola Winzen. Multiplicative Drift Analysis. Algorithmica, 64(4):673–697, December 2012. ISSN 1432-0541. doi: 10.1007/s00453-012-9622-x. URL https://doi.org/10.1007/s00453-012-9622-x.
Marco Dos Santos, Hugues de Saxcé, Haiming Wang, Ran Wang, Mantas Baksys, Mert Unsal, Junqi Liu, Zhengying Liu, and Jia Li. Kimina Lean Server: A high-performance Lean server for large-scale verification. arXiv:2504.21230, 2025.
Stefan Droste, Thomas Jansen, and Ingo Wegener. On the analysis of the evolutionary algorithm. Theoretical Computer Science, 276(1–2):51–81, 2002.
Stefan Droste, Thomas Jansen, and Ingo Wegener. Upper and Lower Bounds for Randomized Search Heuristics in Black-Box Optimization. Theory of Computing Systems, 39(4):525–544, July 2006. ISSN 1433-0490. doi: 10.1007/s00224-004-1177-z. URL https://doi.org/10.1007/s00224-004-1177-z.
Manuel Eberl, Max W. Haslbeck, and Tobias Nipkow. Verified Analysis of Random Binary Tree Structures. Journal of Automated Reasoning, 64(5):879–910, June 2020. ISSN 1573-0670. doi: 10.1007/s10817-020-09545-0. URL https://doi.org/10.1007/s10817-020-09545-0.
Alhussein Fawzi, Matej Balog, Aja Huang, Thomas Hubert, Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Francisco J. R. Ruiz, Julian Schrittwieser, Grzegorz Swirszcz, David Silver, Demis Hassabis, and Pushmeet Kohli. Discovering faster matrix multiplication algorithms with reinforcement learning. Nature, 610(7930):47–53, October 2022. ISSN 1476-4687. doi: 10.1038/s41586-022-05172-4. URL https://www.nature.com/articles/s41586-022-05172-4.
Tobias Friedrich, Jun He, Nils Hebbinghaus, Frank Neumann, and Carsten Witt. Approximating Covering Problems by Randomized Search Heuristics Using Multi-Objective Models. Evolutionary Computation, 18(4):617–633, December 2010. ISSN 1063-6560. doi: 10.1162/EVCO_a_00003. URL https://doi.org/10.1162/EVCO_a_00003.
Gemma Team. Gemma 4 Technical Report, July 2026. URL http://arxiv.org/abs/2607.02770. arXiv:2607.02770 [cs.CL].
Bruce Hajek. Hitting-Time and Occupation-Time Bounds Implied by Drift Analysis with Applications. Advances in Applied Probability, 14(3):502–525, 1982. ISSN 0001-8678. doi: 10.2307/1426671. URL https://www.jstor.org/stable/1426671. Publisher: Applied Probability Trust.
Jun He and Xin Yao. Drift analysis and average time complexity of evolutionary algorithms. Artificial Intelligence, 127(1):57–85, March 2001. ISSN 00043702. doi: 10.1016/S0004-3702(01)00058-3. URL http://linkinghub.elsevier.com/retrieve/pii/S0004370201000583.
Haotian Jiang. Minimizing Convex Functions with Rational Minimizers. Journal of the ACM, 70(1):1–27, February 2023. ISSN 0004-5411, 1557-735X. doi: 10.1145/3566050. URL https://dl.acm.org/doi/10.1145/3566050.
Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs, November 2017. URL http://arxiv.org/abs/1601.01001. arXiv:1601.01001 [cs.LO].
Donald E. Knuth. The art of computer programming, volume 1 (3rd ed.): fundamental algorithms. Addison Wesley Longman Publishing Co., Inc., USA, 1997. ISBN 0201896834.
Stefan Kratsch and Frank Neumann. Fixed-Parameter Evolutionary Algorithms and the Vertex Cover Problem. Algorithmica, 65(4):754–771, April 2013. ISSN 1432-0541. doi: 10.1007/s00453-012-9660-4. URL https://doi.org/10.1007/s00453-012-9660-4.
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles (SOSP), pp. 611–626, 2023.
Robert Tjarko Lange, Yuki Imajuku, and Edoardo Cetin. ShinkaEvolve: Towards Open-Ended And Sample-Efficient Program Evolution, September 2025. URL http://arxiv.org/abs/2509.19349. arXiv:2509.19349 [cs].
Chenyi Li, Ziyu Wang, Wanyi He, Yuxuan Wu, Shengyang Xu, and Zaiwen Wen. Formalization of Complexity Analysis of the First-order Algorithms for Convex Optimization, July 2024. URL http://arxiv.org/abs/2403.11437. arXiv:2403.11437 [math].
Zenan Li, Ziran Yang, Deyuan He, Haoyu Zhao, Andrew Zhao, Shange Tang, Kaiyu Yang, Aarti Gupta, Zhendong Su, and Chi Jin. Goedel-Code-Prover: Hierarchical Proof Search for Open State-of-the-Art Code Verification, March 2026. URL http://arxiv.org/abs/2603.19329. arXiv:2603.19329 [cs.SE].
Yong Lin, Shange Tang, Bohan Lyu, Ziran Yang, Jui-Hui Chung, Haoyu Zhao, Lai Jiang, Yihan Geng, Jiawei Ge, Jingruo Sun, Jiayun Wu, Jiri Gesi, Ximing Lu, David Acuna, Kaiyu Yang, Hongzhou Lin, Yejin Choi, Danqi Chen, Sanjeev Arora, and Chi Jin. Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction, August 2025. URL http://arxiv.org/abs/2508.03613. arXiv:2508.03613 [cs.CL].
Fei Liu, Xialiang Tong, Mingxuan Yuan, Xi Lin, Fu Luo, Zhenkun Wang, Zhichao Lu, and Qingfu Zhang. Evolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language Model. In Proceedings of the 41st International Conference on Machine Learning, pp. 32201–32223. PMLR, July 2024. URL https://proceedings.mlr.press/v235/liu24bs.html.
Fei Liu, Yiming Yao, Ping Guo, Zhiyuan Yang, Xi Lin, Zhe Zhao, Xialiang Tong, Kun Mao, Zhichao Lu, Zhenkun Wang, Mingxuan Yuan, and Qingfu Zhang. A Systematic Survey on Large Language Models for Algorithm Design. ACM Computing Surveys, 58(8):1–32, June 2026. ISSN 0360-0300, 1557-7341. doi: 10.1145/3787585. URL https://dl.acm.org/doi/10.1145/3787585.
Michael Luby, Alistair Sinclair, and David Zuckerman. Optimal speedup of Las Vegas algorithms. Information Processing Letters, 47(4):173–180, 1993. ISSN 0020-0190. doi: https://doi.org/10.1016/0020-0190(93)90029-9. URL https://www.sciencedirect.com/science/article/pii/0020019093900299.
Rajeev Motwani and Prabhakar Raghavan. Randomized Algorithms. Cambridge University Press, 1995.
Frank Neumann and Ingo Wegener. Randomized local search, evolutionary algorithms, and the minimum spanning tree problem. Theoretical Computer Science, 378(1):32–40, June 2007. ISSN 0304-3975. doi: 10.1016/j.tcs.2006.11.002. URL https://www.sciencedirect.com/science/article/pii/S0304397506008589.
Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco J. R. Ruiz, Abbas Mehrabian, M. Pawan Kumar, Abigail See, Swarat Chaudhuri, George Holland, Alex Davies, Sebastian Nowozin, Pushmeet Kohli, and Matej Balog. AlphaEvolve: A coding agent for scientific and algorithmic discovery, June 2025. URL http://arxiv.org/abs/2506.13131. arXiv:2506.13131 [cs].
Pietro S. Oliveto, Jun He, and Xin Yao. Analysis of population-based evolutionary algorithms for the vertex cover problem. In 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), pp. 1563–1570, June 2008. doi: 10.1109/CEC.2008.4631000. URL https://ieeexplore.ieee.org/abstract/document/4631000.
Azim Ospanov, Farzan Farnia, and Roozbeh Yousefzadeh. APOLLO: Automated LLM and Lean Collaboration for Advanced Formal Reasoning, May 2025. URL https://arxiv.org/abs/2505.05758v5.
Henry Robbins, Connor Lawless, Madeleine Udell, and Ellen Vitercik. FLARE: Verifying MILP Reformulations with LLM-Based Theorem Proving, August 2026. URL http://arxiv.org/abs/2608.25220. arXiv:2608.25220 [cs.AI].
Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan S. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi. Mathematical discoveries from program search with large language models. Nature, 625(7995):468–475, January 2024. doi:10.1038/s41586-023-06924-6.
Maximilian Schäffeler and Mohammad Abdulaziz. Formally Verified Approximate Policy Iteration. Proceedings of the AAAI Conference on Artificial Intelligence, 39(25):26659–26667, April 2025. ISSN 2374-3468. doi: 10.1609/aaai.v39i25.34868. URL https://ojs.aaai.org/index.php/AAAI/article/view/34868. Number: 25.
Nat Sothanaphan. Resolution of Erdős Problem #728: a writeup of Aristotle’s Lean proof, January 2026. URL http://arxiv.org/abs/2601.07421. arXiv:2601.07421 [math.NT].
Koundinya Vajjha, Avraham Shinnar, Barry Trager, Vasily Pestun, and Nathan Fulton. CertRL: formalizing convergence proofs for value and policy iteration in Coq. In Proceedings of the 10th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2021, pp. 18–31, New York, NY, USA, January 2021. Association for Computing Machinery. ISBN 978-1-4503-8299-1. doi: 10.1145/3437992.3439927. URL https://dl.acm.org/doi/10.1145/3437992.3439927.
Niki van Stein and Thomas Bäck. LLaMEA: A Large Language Model Evolutionary Algorithm for Automatically Generating Metaheuristics. IEEE Transactions on Evolutionary Computation, 29(2):331–345, April 2025. ISSN 1941-0026. doi: 10.1109/TEVC.2024.3497793. URL https://ieeexplore.ieee.org/abstract/document/10752628.
Sumanth Varambally, Thomas Voice, Yanchao Sun, Zhifeng Chen, Rose Yu, and Ke Ye. Hilbert: Recursively Building Formal Proofs with Informal Reasoning, September 2025. URL https://arxiv.org/abs/2509.22819v2.
Ingo Wegener. Methods for the Analysis of Evolutionary Algorithms on Pseudo-Boolean Functions. In Ruhul Sarker, Masoud Mohammadian, and Xin Yao (eds.), Evolutionary Optimization, pp. 349–369. Springer US, Boston, MA, 2002. ISBN 978-0-306-48041-6. doi: 10.1007/0-306-48041-7_14. URL https://doi.org/10.1007/0-306-48041-7_14.
A FORMAL STATEMENT OF THE PIPELINE STAGES
Table 3 states every stage of the pipeline formally; the stages are described informally in Section 4.
Table 3: The stages of the pipeline that generates one algorithm and proves it faster than its predecessor, restated in the formalism of Algorithm 1. [I] is an informal stage producing prose (no Lean code) with candidate selection (see Section 4.1 and Section 4.2), [F*] is a formal stage that introduces new Lean definitions used by later stages, and [F-] a formal stage that only proves properties of definitions introduced earlier; in both, the Lean declarations produced are checked by Lean and carried forward. denotes a fixed fitness function (an element of the problem class, e.g. ONEMAX composed with an unknown target bitstring), so that reachableWith (as opposed to reachable) restricts to states reachable when the true fitness fed to step is always . denote random draws; unif is the bitstring obtained by sampling each coordinate of against threshold 1/2. is the bitstring length, and a ‘prev’ subscript refers to the previous algorithm/potential pair in the outer self-improvement loop.
| Stage | Name | Formalisation |
|---|---|---|
| Algorithm construction (Stages 0–8) | ||
| 0 | DesignLock[I] | Commit to , init, step, query and a qualitative account of which component of tracks ; no numeric constants yet. |
| 1 | Construct-AlgorithmComponents[F*] | Define , init : , step : , query : . |
| 1c | StepMeasurability[F-] | step is measurable. |
| 2 | Completeness1[F-] | |
| 3 | NonAbsorbing[F-] | |
| 4 | NotRandom-Search[F-] | |
| 5 | Adaptiveness[F-] | query(step(,step(), ))\nquery(step(,step(), ))\n(a two-step strengthening of the usual one-step adaptiveness property: the fitness fed at the first step must still move the query one step later). |
| 6 | QueryNon-Injectivity[F-] | |
| 7 | AlgorithmInfrastructure[F*] | Equip with the five instances (measurable space, topology, pseudometrizability, Borel -algebra, second-countability) the framework requires. |
| 7a | InitMeasurability[F-] | init is measurable. |
| 7b | QueryMeasurability[F-] | query is measurable. |
| 8 | Construct-AlgorithmStructure[F*] | Package , together with the Stage 1c/7/7a/7b witnesses, into a single algorithm record. |
| Potential design (Stages 9a–9f) | ||
| 9a | Potential-Design[I] | Rank candidate potentials by whether step can be shown, even informally, to decrease faster than unif. |
| 9b | Define-Potential[F*] | Define with . |
| 9c | PotentialOpt[F-] | — vanishes exactly at states whose query is -optimal. |
| 9d | PotentialFine-Grained[F-] | — rules out a -valued (indicator) potential. |
| 9e | PotentialMeasurability[F-] | is measurable. |
(Table 3 continued)
| Stage | Name | Formalisation |
|---|---|---|
| 9f | ConstructPotentialStructure | Package , together with the Stage 9b–9e witnesses, into a single potential record. |
| Drift design and runtime bound (Stages 10a–10j) | ||
| 10a | DriftDesign | Work out closed forms, against the now-fixed and , for : and for the four draw sets Good, Worsen, BigWorsen, Jump: below. |
| 10b | DefineDrift-Constants | Define as closed-form expressions in . |
| 10c | DriftConstant-Properties | , and (the speed-up certificate) |
| 10d | DefineDrift-Sets | Define Good, Worsen, BigWorsen, Jump: as explicit sets of draws. |
| 10e | DriftSetMeas-urability | For each : is measurable. |
| 10f | PositiveDrift | |
| 10g | NegativeDrift-AndJump | For with reachableWith, and every : ; and, for every with reachableWith: |
| 10h | DriftSetMass | For reachableWith with : |
| 10i | JumpMass | — holds at every , unlike Stage 10h, since it underwrites integrability of the hitting time. |
| 10j | RuntimeBound | |
B PROOFS OF THE DRIFT CONDITION
The additive drift theorem used in Section 3 is the following; a proof is given by Corus et al. (2018). Theorem B.1 (Additive drift theorem). Let be a discrete-time stochastic process in adapted to any filtration . For any , define . If for some and all : (1) \mathbb{E}\left[Z_{t+1} - Z_t + \varepsilon\right] < T_a\mid \mathcal{G}_t\right] \leq 0, (2) , and (3) , then .
We present the proof of Corollary 3.1. The Lean formalisation of this proof, which was developed as part of the staged pipeline, follows almost exactly this proof.
Proof of Corollary 3.1. Define
Note that these definitions immediately imply
where the last inequality follows because for all . We now have
by assumptions 1-3
since
by Eqs. (2), (4), and (5)
by Eq. (3) and
The result now follows by rearranging the inequality above.
C IMPLEMENTATION AND PROMPT
Implementation. The pipeline Python code was initially based on the Goedel-Prover-V2 codebase (Lin et al., 2025). Every candidate declaration is checked by Lean 4 on a Kimina Lean server (Dos Santos et al., 2025), and the Lean errors are returned to the model in the next attempt. The number of attempts allowed before backtracking to a previous stage is determined by a Luby sequence (Luby et al., 1993) . In particular, each stage has its own copy of the sequence with unit 3, so it is allowed 3, 3, 6, 3, 3, 6, 12, ... attempts on successive visits. When a stage exhausts its allowance, the pipeline backtracks by one stage on the first failure of that stage, and by more stages one each further failure. In addition, the whole pipelinen is restarted from Stage 0 when 200, attempts have been used in the k-th run of the pipeline, or earlier when 100 consecutive attempts make no progress beyond the furthest stage reached. All runs in Table 2 use these parameters.
The responses to the prompts of each stage come from a backend. With the CLI backend, the pipeline writes each prompt to standard output and reads the response from standard input, so that the pipeline can be driven by an external agent; rows 1–18 of Table 2 use this backend with Claude models. With the vLLM backend, the pipeline serves open-weight models itself with vLLM (Kwon et al., 2023), sampling many candidates per attempt; rows 19–21 use this backend with Goedel-Prover-V2-32B (Lin et al., 2025) for the formal stages and Gemma 4 26B-A4B (Gemma Team, 2026) for the prose stages. The stages, their Lean statements, and the checks are the same for both backends.
The prompt. Every stage prompt starts with the same global block, followed by the accepted declarations so far and the task of the stage. The global block describes the framework: the black-box algorithm structure of Algorithm 1, the problem-class interface and the baseline algorithm, whose definitions the agent can use as a template. It then lists an API of library results, whose signatures are checked against the Lean build. These include samplers that turn the random source into bitstrings, with a fixed or a state-dependent per-bit bias, together with inverse lemmas that construct a random input producing any given bitstring. They also include lemmas about bitstrings, how to access elements of a bitstrings, etc. Furthermore, a measurability toolkit provides two tactics that decompose tuple-, if- and arithmetic-structured step and potential functions into leaves, and gives the idioms that close each kind of leaf. For the drift stages, the block describes the random source, the reachability predicates and an assembly theorem of Stage 10j, and it explains which properties of that theorem constrain the design, e.g. that a single and p must serve every reachable non-optimal state. The problem card (Appendices D and F) is spliced in as the only problem-specific part. Finally, a proof cookbook collects recurring Lean pitfalls and their fixes, such as if b then is preferred over if , never to call decide on goals involving a symbolic n, how to show that two state tuples differ, and to prove measurability with the toolkit rather than with aesop, whose fixed search budget times out on nested ifs. After a failed attempt the agent sees the failing declaration, the Lean error, its earlier attempts at the stage and a list of facts verified in earlier stages.
D THEORETICAL BENCHMARK FUNCTIONS
For write for the number of ones. The three benchmark functions are
so ONEMAX counts the ones, LEADINGONES counts the ones before the first zero, and JUMP behaves like ONEMAX except for a gap of width below the optimum , in which the fitness points away from the optimum. For the EA with mutation rate the expected optimisation times are on ONEMAX, on LEADINGONES and on JUMP for constant (Droste et al., 2002).
A black-box algorithm must not depend on the instance, so each function is turned into a class of instances by hiding its optimum. Write for the bitwise exclusive or and for the complement of . Each permutation of induces a permutation of , which we also denote by , defined by for all . The problem cards used in our experiments define
Each instance has the unique optimum . For the gap width is a constant of the class that the agent does not know, so every proof must be uniform in . Algorithms whose mutation treats all bits alike, such as the EA, have the same expected optimisation time on every instance of a class as on the underlying function.
E CYCLEUNCOVER: DEFINITION AND RUNTIME OF THE EA
Algorithm 2 (1+1) EA
1:
2: Choose an initial bit string uniformly at random
3: while forever do
4: Create by flipping each bit in independently with probability (mutation)
5: if , and otherwise (selection)
6:
7: end while
This section proves Theorem 5.1. The objective eval, the count count and the feasibility condition guard are those of Figure 3: guard(x) holds exactly when the chosen vertices form an independent set of the hidden cycle, and eval(x) = 2h + count(x) if guard(x) and eval(x) = count(x) otherwise.
Proof of Theorem 5.1. Without loss of generality, we assume that is the identity-permutation.
We condition on the event that both endpoints and of the first edge are 1-bits in the initial search point, and that it contains at least 1-bits. By a union bound and a Chernoff bound (Motwani & Raghavan, 1995), the probability of this event is at least . If this event does not happen, we lower bound the runtime by 0.
We consider two phases, the first phase consisting of the first iterations, and the second phase consisting of the following iterations. We consider phase 1 a failure (from the perspective of the analysis) if bit or is flipped during this phase. The probability of this failure event is upper bounded by . If phase 1 is not a failure, then guard() is never satisfied, and the fitness is count(), i.e., the number of 1-bits is non-decreasing.
We call an iteration in the first phase successful if either the current search point has at least 1-bits, or if mutation increases the number of 1-bits. The probability of a successful iteration is at least
The number of successful iterations in phase 1 dominates stochastically a binomially distributed random variable with parameters t and p. By a Chernoff bound, the probability that there are less than
successes is , and otherwise we call phase 1 a failure.
Assuming no failure in phase 1, the current search point at the start of phase 2 contains 1-bits. We now prove inductively that in each of the following iterations, the number of 1-bits in the current search point is at least . If the current point is infeasible with at least 1-bits, an offspring is accepted only if it is feasible or has at least as many 1-bits. In order to satisfy guard( ) i.e., the solution is feasible, it is necessary to have at most 1-bits (at most on the cycle, plus bit if is odd). Therefore, to satisfy guard( ), at least bits must be flipped simultaneously. By a union bound, this type of failure has probability at most .
Conditioned on the good starting event and no failures, the running time of the algorithm is at least . By a union bound, the probability of a failure in phase 1 or 2 is at most for some constant . The unconditional expected runtime is therefore at least .
F ALGORITHMS, POTENTIALS AND RUNTIME BOUNDS OF ALL RUNS
This appendix collects, for every run summarised in Table 2, the synthesised algorithm, the potential function and the runtime bound. The pseudocode is a human-readable transcription of the frozen Lean definitions of init and step; in every run query returns the first component of the state. We write for the per-bit sampler that sets bit iff (so ; a scalar means for all ), for the coordinates of the same draw from index on, for bitwise XOR, for the number of ones, for the -th unit vector, for the complement, for the indicator of , and for clamping to (coordinatewise for vectors). Unless stated otherwise, is the fitness of the pending query passed to step, and a potential is 0 if and only if the query of is fitness-maximal. For staged runs the runtime theorem is for all and every instance , with the drift constants and (the Good-set mass) given; “machine-checked” means the file compiles with no sorry.
Problem cards. ONEMAX: , unique optimum . LEADINGONES (card 1o): an instance is a pair of a string and a permutation of the positions, and with and LEADINGONES as in Appendix D; the unique optimum is . The second version of the card also supplies the inequality for . (card ): with as in Appendix D; the unique optimum is . The gap width is an opaque constant, so every proof must be uniform in . SUBMODULARMIN, integer-valued (card submodular minimisation integer valued additional advice): an instance is a submodular function with for an opaque class constant and , and . Besides the definitions, the card supplies only facts about the integer range (every non-optimal point has , and distinct values differ by at least 1) and the advice quoted in Appendix F.16; it supplies no lemmas about submodular functions. CYCLEUNCOVER (card laminate): the objective
Table 4: Open-weight runs on ONEMAX with the most recent pipeline versions. “Last passed” is the last stage that was machine-checked.
| Run | Cluster | Started | Pipeline version | Hours | Last passed |
|---|---|---|---|---|---|
| generous-dragon-779 | Sulis | 2026-09-21 | optimisation | 23.8 | 3 |
| driven-blaze-773 | Sulis | 2026-09-18 | optimisation | 23.8 | 1 |
| denim-paper-771 | Sulis | 2026-09-17 | split.v9 | 21.6 | 3 |
| super-moon-761 | Sulis | 2026-09-15 | split.v9 | 23.3 | 3 |
| bumbling-plant-742 | Sulis | 2026-09-13 | split.v9 | 23.2 | 3 |
| avid-waterfall-734 | Isambard-AI | 2026-09-12 | split.v9 | 23.6 | 3 |
| mild-dream-724 | Sulis | 2026-09-08 | split.v9 | 23.6 | 3 |
| absurd-puddle-723 | Isambard-AI | 2026-09-08 | split.v9 | 23.6 | 3 |
| peach-armadillo-718 | Isambard-AI | 2026-09-06 | split.v9 | 23.7 | 3 |
| serene-voice-715 | Sulis | 2026-09-06 | split.v9 | 23.8 | 1c |
| visionary-snow-713 | Sulis | 2026-09-05 | split.v8 | 20.7 | 3 |
| pleasant-elevator-712 | Isambard-AI | 2026-09-04 | split.v8 | 23.7 | 1c |
| golden-yogurt-711 | Isambard-AI | 2026-09-02 | split.v8 | 36.8 | 9c |
| royal-snowflake-710 | Sulis | 2026-09-01 | split.v8 | 46.2 | 3 |
eval of Figure 3, with , optimum value . VERTEXCOVER, flat fitness (cards vertex_cover, early bandwidth_vertex_cover): if is a cover of and otherwise. VERTEXCOVER, graded fitness (later bandwidth_vertex_cover, wcvc, well_covered_vertex_cover): , where is the number of edges with no chosen endpoint; covers are exactly the points with . For the bandwidth cards every edge satisfies , and is known to the algorithm; the well-covered cards restrict to graphs whose minimal covers are all minimum. The wcvc card is an anonymised copy of the well-covered card with all names and derived facts removed.
F.1 ONEMAX, OPEN-WEIGHT MODELS (STAGED; INCOMPLETE)
These runs used the vLLM backend, which serves the models itself, instead of the CLI backend used for the other runs (Appendix C). The formal stages were generated by Goedel-Prover-V2-32B with 256 samples per attempt at temperature 1, and the informal stages (0, 9a, 10a) by Gemma 4 26B-A4B, both served with vLLM on 3 NVIDIA L40 GPUs (Sulis) or 4 NVIDIA GH200 GPUs (Isambard-AI). All runs are on ONEMAX with earlier versions of the staged pipeline that have the same 28 stages as Table 3. The token usage of the formal model is not logged by this backend, and the Lean code of these runs is not included.
Table 4 lists the 14 runs made with the three most recent of these pipeline versions (September 2026). No run completed: each ended after 21–46 hours of wall-clock time. Ten runs got stuck at Stage 4 (NotRandomSearch), three at Stage 1c or 2, and one reached Stage 9d (PotentialFineGrained). Rows 19–21 of Table 2 are, in order, the most recent run on each cluster with the most recent pipeline used there, and the run that got furthest.
All samples of the runs in rows 19–21 are logged, so the output tokens of Goedel-Prover-V2-32B can be counted with its own tokeniser over the logged responses; the informal stages add at most tokens per run. Lean lines are counted as in Table 2, at the last passed stage.
Row 19. The frozen design samples each bit with its own bias, initialised to ; after an improvement, every bias moves by 0.1 towards the corresponding bit of the query, clamped to the interval [0.1, 0.9]. This is a PBIL-like estimation-of-distribution algorithm (Baluja, 1994), but with too large margins. Stages 0–3 passed. Stage 4 is true for this design (the biases leave after one improving step), but all samples for it failed: contained no extractable Lean code, left unsolved goals, did not parse and used unknown identifiers. The pipeline backtracked to Stages 3, 2 and 1c, but never to the design stages. 5,896 samples, 25.1M output tokens, 23.8 h.
Row 20. Both designs, the first and the one proposed after a backtrack to Stage 0, are PBIL-like: per-bit biases, learning rate , clamped to [0.05, 0.95] and then [0.1, 0.9]. The update moves the biases towards the newly drawn query rather than the evaluated one, so the fitness only decides whether they move. Stage 4 is again true, and all samples for it failed: left unsolved goals, used unknown identifiers, did not parse and contained no extractable code. The run generated 10,776 samples and 73.1M output tokens, and lasted 23.6 hours.
Row 21. The algorithm is uniform random search with a stored current search point. Stage 4 passed (2 of 256 samples), because in this pipeline version the NotRandomSearch obligation did not require the witness state to be reachable: the accepted proof uses a state with all biases equal to 1, which the algorithm never reaches. The final version of the pipeline requires the state witness to be reachable. The run went on to define the potential and passed Stage 9c three times, but all samples for Stage 9d failed, although the statement is true for this potential: 31% omitted the required lemma, 25% left unsolved goals, 11% did not parse, 10% used unknown identifiers, and 16% recorded no Lean error. The run generated 22,584 samples and 124.3M output tokens, and lasted 36.8 hours.
F.2 ONEMAX, CLAUDE OPUS 5 (STAGED; COMPLETE)
Algorithm 3 (1+1)-style hill-climber with rate (ONEMAX, Claude Opus 5).
1: procedure init(u) 2: | return (bits (u), FALSE, , 0) 3: end procedure 4: procedure step(u, , f) 5: | if b and then 6: | 7: | else 8: | 9: | end if 10: if , else , for all i 11: | return (bits (u), TRUE, c, ) 12: end procedure
Potential. With if , else ,
Runtime. :
F.3 LEADINGONES, CLAUDE OPUS 5.5 (STAGED; COMPLETE)
Algorithm 4 Fitness-dependent mutation around an elitist reference point (LEADINGONES, Claude Opus 5.5).
1: procedure init(u) 2: | return (bits (u), FALSE, , 0) 3: end procedure 4: procedure step(u, , f) 5: | if b and then 6: | 7: | else 8: | 9: | end if 10: 11: | return 12: end procedure
Potential. With if , else ,
Runtime. :
F.4 LEADINGONES WITH THE LEMMA, CLAUDE OPUS 5.5 (STAGED; COMPLETE)
init, step and the potential are identical to Algorithm 4. The mask is drawn with the per-bit sampler, using the same fitness-dependent rate for every bit.
Runtime. : .
F.5 JUMP , CLAUDE OPUS 5.5 (STAGED; COMPLETE)
Algorithm 5 (1+1)-style hill-climber with rate (JUMP , Claude Opus 5.5).
1: procedure init(u) 2: | return (bits , FALSE, , 0) 3: end procedure 4: procedure step(u, , f) 5: | if b and then 6: | 7: | else 8: | 9: | end if 10: | return 11: end procedure
Potential. With and if , else ,
Runtime.
F.6 JUMP WITH THE LEMMA, CLAUDE OPUS 5.5 (STAGED, 3 GENERATIONS; COMPLETE)
We supplied the lemma and ran the pipeline for three generations. The runtimes are in all generations, but they differ in the leading constant. The agent used the same potential as in Appendix F.5. All three generations of the algorithm keep a strictly elitist search point (a new query is accepted only if , or at the first step) and differ only in the mask rate.
Generation 1. The mask rate is reset to on a strict improvement, multiplied by otherwise, and clamped to the interval .
Algorithm 6 Self-adjusting mask rate (JUMP with the lemma, generation 1).
1: procedure init(u) 2: | return (bits , FALSE, , , ) 3: end procedure 4: procedure step(u, , f) 5: | if b and then 6: | ; 7: | else 8: | ; 9: | end if 10: | 11: | return 12: end procedure
Runtime. : .
Generation 2. The mask rate is after a strict improvement and after a failure.
Algorithm 7 Failure-doubled mask rate (JUMP with the lemma, generation 2).
1: procedure init(u) 2: | return (bits, FALSE, , 0) 3: end procedure 4: procedure step(u, ), ) 5: | if and then 6: | ; 7: | else 8: | ; 9: | end if 10: | return , TRUE, , ) 11: end procedure
Runtime. : .
Generation 3. A phase bit is reset on a strict improvement and toggled on every failure; the mask rate is if the updated phase is set and otherwise.
Algorithm 8 Rate cycling with a learned phase bit (JUMP with the lemma, generation 3).
1: procedure init(u) 2: | return (bits, FALSE, , 0, FALSE) 3: end procedure 4: procedure step(u, , ) 5: | if and then 6: | ; 7: | else 8: | ; 9: | end if 10: | if , else 11: | return , TRUE, , , ) 12: end procedure
Runtime. : .
F.7 CYCLEUNCOVER, CLAUDE FABLE 5.1 (STAGED; COMPLETE)
Write and . The state holds the query, the indicator strings of the vertices labelled with the two colours so far, the frontier (last labelled vertex) , its colour , and the number of labelled vertices.
Algorithm 9 Cycle walk (CYCLEUNCOVER, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits, , , , FALSE, 0) 3: end procedure 4: procedure step(u, , ) 5: if , else ; 6: if and and and then 7: if then 8: 9: else 10: 11: end if 12: ; ; 13: else if and and then 14: ; ; ; 15: end if 16: if , else 17: return 18: end procedure
Potential. With the label count after one step from with the true fitness and truncated subtraction if , else . Runtime. , .
F.8 CYCLEUNCOVER, CLAUDE FABLE 5.1 (ZERO-SHOT ABLATION; COMPLETE)
This algorithm was obtained in an ablation run which did not include the staged pipeline. The algorithm samples a bitstring uniformly at random in each iteration, i.e., it is essentially identical to the baseline algorithm provided.
Algorithm 10 Random search with a recorded incumbent (CYCLEUNCOVER, zero-shot, Claude Fable 5.1).
1: procedure init(z) 2: | return (bits, FALSE, , 0) 3: end procedure 4: procedure step(z, , ) 5: if not or then 6: 7: end if 8: return (bits, TRUE, , ) 9: end procedure
▷ the query ignores the state
Potential. No potential is constructed because the agent does not use the staged pipeline. Runtime. .
F.9 CYCLEUNCOVER, CLAUDE SONNET (STAGED; INCOMPLETE)
Claude Sonnet did not complete the pipeline with problem card CYCLEUNCOVER. The following is a description of the algorithm constructed in generation 4 of 5. The algorithm is EA, except that the current search point is accepted only if the mutant is strictly better than the parent.
Algorithm 11 Design 4 (CYCLEUNCOVER, Claude Sonnet).
1: procedure init(z) 2: | return (bits, , ) ▷ has fitness 3: end procedure 4: procedure step(z, , ) 5: | if then 6: | 7: | end if 8: if , else , for all 9: | return (bits, , ) 10: end procedure
Potential. . Runtime. None proved (stopped at Stage 10h); , and .
F.10 VERTEXCOVER, CLAUDE FABLE 5.1 (STAGED; COMPLETE)
Let , , , and . Let probe be with bits cleared. Let opt(A) be a minimum-size string covering every edge recorded in the table , and target if , else opt(A).
Algorithm 12 Edge probing, then solve (VERTEXCOVER, Claude Fable 5.1).
1: procedure init(u) 2: | return (probe(0) ⊕ bits, , ) ▷ empty edge table 3: end procedure 4: procedure step(u, , ) 5: | if then 6: | 7: | if then 8: | 9: | end if 10: | end if 11: | return (target, , ) 12: end procedure
Potential. For non-optimal states, the potential is where . Runtime. : . The bound counts fitness evaluations only; opt(A) is defined non-constructively (as some minimum cover of the learned graph), so the computation between queries is not bounded.
F.11 BANDWIDTHVC, CLAUDE FABLE 5.1 (STAGED, FLAT FITNESS; COMPLETE)
Let , , , , let probe be with bits set to 0. Note that probe is a vertex cover if and only if is not an edge in the graph. Let opt(A) be as in Appendix F.10, plan if is even and , else opt(A), and if , else .
Algorithm 13 Interleaved window probing and solving (BANDWIDTHVC, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits)(u), 0, ) 3: end procedure 4: procedure step(u, (q, t, A), f) 5: | if and then 6: | if even then 7: | 8: | end if 9: | 10: | end if 11: | return (bits)(u), t, A) 12: end procedure
Potential. Off the optimum, . Runtime. , : . The bound counts fitness evaluations only; is defined non-constructively (as some minimum cover of the learned graph), so the computation between queries is not bounded.
F.12 BANDWIDTHVC, CLAUDE FABLE 5.1 (STAGED, GRADED FITNESS; INCOMPLETE)
Let .
Algorithm 14 Direction-adaptive asymmetric mutation (BANDWIDTHVC, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits, FALSE, , , , ) 3: end procedure 4: procedure step(u, (q, b, a, , , ), f) 5: | if not b then 6: | 7: | else if then 8: | if then 9: | ; 10: | else 11: | ; 12: | end if 13: | 14: | end if 15: | if , else , for all 16: | return , TRUE, , , , ) 17: end procedure
Potential. With if or , else : off the optimum if is a cover and otherwise. Runtime. None proved (stopped at Stage 10h); .
F.13 BANDWIDTHVC, CLAUDE FABLE 5.1 (ZERO-SHOT ABLATION; INCOMPLETE)
Algorithm 15 (1+1) EA with rate 1/n (BANDWIDTHVC, zero-shot, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits₁/₂(u), FALSE, 0^n, 0) 3: end procedure 4: procedure step(u, (q, b, x*, f*), f) 5: | if b and f < f* then 6: | (c, c_f) ← (x*, f*) 7: | else 8: | (c, c_f) ← (q, f) 9: | end if 10: | return (c ⊕ bits₁/n(u), TRUE, c, c_f) 11: end procedure
Potential. None. Runtime. The bound was left as sorry.
F.14 BANDWIDTHVC, CLAUDE FABLE 5.1, SECOND SESSION (STAGED; INCOMPLETE)
Algorithm 16 Fill-then-prune mutation (BANDWIDTHVC, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits₁/₂(u), FALSE, 0^n, 0) 3: end procedure 4: procedure step(u, (q, b, x*, f*), f) 5: | if b and f < f* then 6: | (c, c_f) ← (x*, f*) 7: | else 8: | (c, c_f) ← (q, f) 9: | end if 10: | if c_f < -n then 11: | p_i ← 1/(n + 1)^2 if c_i = 1, else 1/2, for all i 12: | else 13: | p_i ← 1/(n + 1) for all i 14: | end if 15: | return (c ⊕ bits_p(u), TRUE, c, c_f) 16: end procedure
Potential. Off the optimum, . Runtime. None proved (stopped at Stage 10c); , .
F.15 BANDWIDTHVC, CLAUDE OPUS 5.5 (STAGED; COMPLETE)
Let and .
Algorithm 17 Window-repair random search (BANDWIDTHVC, Claude Opus 5.5, attempt 2).
1: procedure init(u) 2: | return (bits₁/₂(u), FALSE, 0^n, 0) 3: end procedure 4: procedure step(u, (q, b, x*, f*), f) 5: | if b and f < f* then 6: | 7: | else 8: | 9: | end if 10: ; 11: | if for all then 12: | for all 13: | end if 14: | return (y, TRUE, c, c_f) 15: end procedure
Potential. With , if or , else , and : off the optimum .
Runtime. , : with .
The algorithm is close to random search with expected runtime bound . The algorithm maintains a currently best search point with corresponding fitness . In each iteration, the algorithm samples uniformly at random a new search point . If all the first bits of are 1-bits, then each of these bits is copied from the current search point , and then mutated with probability .
F.16 SUBMODULARMIN, INTEGER-VALUED, CLAUDE OPUS 5.5 (STAGED; COMPLETE)
The problem card contains the following advice (verbatim apart from a corrected typo): “Note that this is a challenging problem domain where naive algorithmic designs, such as elitist hill-climbing with a single individual, are unlikely to succeed. Current efforts in designing efficient evolutionary algorithms for this problem are ongoing, so your design must be innovative and well-justified. You need to carefully consider the properties of submodular functions and how to exploit them in your algorithm design. Note that the minimisation [of] sub-modular functions is a well-studied problem in combinatorial optimisation which allows for polynomial time algorithms.”
The state holds the query , the initialisation flag , a point , the position in the current chain, the accumulated subgradient , the previous chain value , the intended query and a flag recording that an optimum has been seen. is the set of the coordinates with the largest values of (ties broken by index), and .
Algorithm 18 Projected subgradient descent on the Lovázs extension (SUBMODULARMIN, Claude Opus 5.5).
1: procedure init(u) 2: | return 3: end procedure 4: procedure step(u, , ) 5: if not then 6: | 7: else if then 8: | no update 9: else if then 10: | 11: else if then 12: | for the coordinate added at position 13: | if then 14: | 15: | else 16: | 17: | end if 18: end if 19: return 20: end procedure
Potential. With a fixed minimiser of , and : if ; otherwise if , and if not replaces the second term before initialisation). Runtime. Generation 1: : . Generations 2–5 give and .
F.17 WELLCOVEREDVC, ANONYMISED CARD, CLAUDE FABLE 5.1 (STAGED; INCOMPLETE)
Let (applied only when sampling).
Algorithm 19 Polarity-adaptive asymmetric mutation (wcvc, Claude Fable 5.1).
1: procedure init(u) 2: | return (bits(u), FALSE, , , , ) 3: end procedure 4: procedure step(u, , ) 5: if not then 6: | 7: else if then 8: | if then 9: | 10: | else if then 11: | 12: | end if 13: | 14: else 15: | 16: end if 17: if , else , for all 18: return 19: end procedure
Potential. With if , else , and : off the optimum . Runtime. None proved (stopped at Stage 10h); , .
F.18 WELLCOVEREDVC, ANONYMISED CARD, CLAUDE OPUS 5.5 (STAGED; COMPLETE)
Algorithm 20 Regime-switching asymmetric mutation (wCVC, Claude Opus 5.5).
1: procedure init(u) 2: | return (bits(u), FALSE, , 0) 3: end procedure 4: procedure step(u, , ) 5: | if and then 6: | 7: | else 8: | 9: | end if 10: | if then 11: | if , else , for all 12: | else 13: | if , else , for all 14: | end if 15: | return 16: end procedure
Potential. With if or , else , and : off the optimum . Runtime. , : .
F.19 WELLCOVEREDVC, NAMED CARD, CLAUDE FABLE 5.1 (STAGED; COMPLETE)
Algorithm 21 Fitness-directed asymmetric mutation (WELLCOVEREDVC, Claude Fable 5.1).
1: procedure init(u) 2: | ; return 3: end procedure 4: procedure step(u, , ) 5: | if and then 6: | 7: | else 8: | 9: | end if 10: | 11: | if then 12: | if , else , for all 13: | else 14: | if , else , for all 15: | end if 16: | return 17: end procedure
Potential. Off the optimum, , where for a cover and otherwise, with the minimum cover size. Runtime. , : .
G PIPELINE PROGRESS AND PER-STAGE STATISTICS
Figure 4 shows how each run of Table 2 progressed through the stages of the pipeline, and Figure 5 where the runs spend their effort.
(a) completed runs

(b) incomplete runs

| 1: ONEMAX (Opus 5) | 2: LEADINGONES (Opus 5.5) |
|---|---|
| 3: LEADINGONES, (Opus 5.5) | 4: JUMPk (Opus 5.5) |
| 5: JUMPk, (Opus 5.5) | 9: WELLCOVEREDVC, anon. (Opus 5.5) |
| 14: BANDWIDTHVC (Opus 5.5) | 15: SUBMODULARMIN (Opus 5.5) |
| 6: CYCLEUNCOVER (Fable 5.1) | 7: WELLCOVEREDVC (Fable 5.1) |
| 10: VERTEXCOVER (Fable 5.1) | 11: BANDWIDTHVC (Fable 5.1) |
| 8: WELLCOVEREDVC, anon. (Fable 5.1) |
|---|
| 12: BANDWIDTHVC (Fable 5.1) |
| 13: BANDWIDTHVC (Fable 5.1) |
| 17: CYCLEUNCOVER (Sonnet) |
| 19: ONEMAX (open-weight) |
| 20: ONEMAX (open-weight) |
| 21: ONEMAX (open-weight) |
Figure 4: Progress through the 28 pipeline stages for the runs of Table 2, numbered as in the table, one point per round. (a) Runs that completed the pipeline: the number of stages passed, including the drops caused by backtracking; the final point at 28 marks completion. Row 14 includes a first attempt that stalled at Stage 10c before the pipeline restarted.x1 (b) Runs that did not complete: the highest stage reached so far, on a logarithmic round axis (rows 12 and 17 continue for thousands of automatic rounds after their best level). The zero-shot runs (rows 16 and 18) have a single stage and are omitted.

Figure 5: Per-stage statistics of the runs of Table 2, numbered as in the table. Top: number of attempts per stage (colour on a logarithmic scale; the number is shown when a stage needed more than one attempt); a red frame marks the stage at which an incomplete run stopped. For rows 19–21 (vLLM backend) one attempt is a batch of 256 samples. Bottom: share of wall-clock time spent in each stage, averaged over the 12 completed frontier-model runs. Each run is counted up to its first completion or, if it did not complete, up to its last round at its highest stage. The zero-shot runs (rows 16 and 18) have a single stage and are omitted.
Figure 5 shows where the runs spend their effort. Over the 12 completed frontier-model runs, the drift and runtime stages (Stages 10a–10j) account for 53% of the wall-clock time, algorithm construction (Stages 0–8) for 34% and the potential (Stages 9a–9f) for 13%. The most expensive stages are the pointwise drift and mass proofs: PositiveDrift (10f, 13%), DriftSetMass (10h, 9%) and NegativeDriftAndJump (10g, 8%). Two stages fail at the first attempt in almost every run for technical rather than mathematical reasons: DriftConstantProperties (10c) failed first in all 12 completed runs (81 attempts and 13 backtracks in total), mostly on the normal form of the baseline constants, and StepMeasurability (1c) in 11 of them. The incomplete frontier-model runs stop at a drift stage: rows 8, 12 and 17 at the mass bound (10h), which is false for their designs, and row 13 at 10c. The open-weight models stop much earlier, at NotRandomSearch (Stage 4, rows 19 and 20) and PotentialFineGrained (Stage 9d, row 21), after 13–24 batches of 256 samples at that stage. The Sonnet run (row 17) needed between 54 and about 1,000 attempts at every stage it passed before Stage 10g.