A Hamiltonian cycle is a directed cycle that visits every vertex of a graph exactly once. It describes a round trip that respects every arc's direction and uses each location once. Exact algorithms for this problem are a central example in the study of exponential running time: a polynomial improvement and an improvement in the exponential base have very different effects as the number of vertices grows. The classical dynamic programs of Bellman (1962) and Held and Karp (1962) use time O(2^n n²).
Koana and Kumabe state a randomized O(1.9133^n) algorithm for unrestricted directed graphs in Theorem 1, PDF p.2 / printed p.1. This mission targets that theorem and its numbered supporting results. The source is the October 2026 STOC 2027 submission #811; this citation does not assert conference acceptance. The mathematical claims are known results in that submission. The requested work is their Lean formalization, including the computational meaning of the runtime statements.
The cycle input consists of an integer n≥0 and an n×n Boolean adjacency matrix: entry (u,v) records whether the directed arc u→v is present. No symmetry or degree condition is imposed. Vertices are labelled 0,…,n−1. A cycle is a cyclic ordering of these vertices with every consecutive arc, including the closing arc, present. The empty graph has no cycle; on one vertex the answer is its self-loop bit; on two vertices a directed 2-cycle is allowed.
A directed multigraph has a finite vertex set V and a finite set E of individually labelled arcs, with a tail and head for each arc. Parallel arcs remain distinct. A Hamiltonian s–t path is a sequence of |V|−1 arcs visiting every vertex once, starting at s and ending at t. Its total weight is the sum of its arc weights. The parity c_B is zero or one according to whether the number of such paths of integer total weight B is even or odd.
For the random construction, G is simple and loopless, s≠t, and no arc enters s or leaves t. An integer d≥2 specifies d incoming groups at each non-source vertex. Independently for each original arc uv, draw a subset S_uv of {1,…,d}. The empty subset has probability δ=1/(1+(2^d−1)²), and every nonempty subset has probability (1−δ)/(2^d−1). For each ℓ in S_uv, create a labelled copy in group (v,ℓ). A group selection chooses one group at each non-source vertex; empty groups and equal weights of different groups are allowed. These are the objects of §2, PDF p.4 / printed p.3.
The path polynomial f is the sum over Hamiltonian paths P in G of ∏{uv∈P}(∑{ℓ∈S_uv} z_{vℓ}), over the two-element field F₂ with independent commuting variables z_{vℓ}. Nonzero means a nonzero formal polynomial. For polynomial labels p on a multigraph, h is the path sum ∑P∏{e∈P}p(e). The incoming Laplacian L has diagonal entry at u equal to the sum of labels of arcs entering u; off-diagonal entry (u,v) is minus the sum of labels of arcs u→v. L_s removes row and column s. An out-arborescence rooted at s is a spanning tree directed away from s.
The goal is one finite executable randomized program A and an absolute constant C>0, chosen before n and the input graph G, satisfying
The decimal base is exact. The bound is stated at every size, with the finitely many small sizes absorbed into C. The small-size answers are deterministic.
The supporting targets retain the paper's numbering. Lemma 6 bounds the cancellation space W={c:∑{i,ℓ}c{iℓ}z_{iℓ}f_i=0} for arbitrary fields and nonzero polynomials:
Lemma 5 states Pr[f≠0]≥(1−δ)^{n−1}; Proposition 3 gives the same lower bound for existence of a group selection with odd path count. Lemma 2 is the published isolation result for any nonempty finite set family and independent uniform weights in {1,…,2N}, with success ≥1/2. Lemma 7 and the corrected Lemma 8 state
Here H_X deletes arcs leaving I\X, and A consists of additional loopless arcs leaving t. For each internal i, let W_i be its incoming weight set and d_i=|W_i|. Independently uniform subsets R_i⊆W_i specify added arcs t→i of those weights. The family 𝒳(R) consists of X for which L_s(H_X(R),p) has no zero row at i∈I\X. Write x_i=1[i∈X] and let s_i be the vector of coefficients of the diagonal polynomial at i. For a_i=(α_i,β_i)≠0, 𝒳_a(R) imposes α_i x_i+β_iᵀs_i=1 at every i. Lemmas 9 and 10 assert
The first fixes R and a surviving X; the second fixes arbitrary nonzero a. Proposition 4 requires parity success ≥5/6 for every integer B, d≥1 and weights 0,…,W, in total time C(2−2^{−d})^n(n+m+W+1)^k with absolute C,k and m labelled arcs. Polynomial m recovers the source bound. These targets are Lemmas 5–10 and Proposition 4, PDF pp.5–11 / printed pp.4–10.
The headline result gives a decision algorithm with a base strictly below two for general directed inputs. Its acceptance guarantee supplies a certificate of actual Hamiltonicity: no negative instance can be accepted. The weighted parity result separately quantifies how the number of distinct incoming weights affects exponential running time, while allowing zero weights, parallel arcs and arbitrary target weights.
A completed formalization would connect finite graph and polynomial identities to operational program execution and bit costs. The isolation theorem already has a published machine-checked proof; the other results here are open formalization targets. Compiling their statements does not establish their proofs. The reusable outputs include labelled path families, weighted outward tree sums and random affine subset systems.
A fast unweighted parity computation cannot distinguish zero cycles from a positive even number of cycles. Arbitrary independent arc weights can make the number of distinct incoming weights large, removing the advantage in Proposition 4. The algebraic target therefore cannot be replaced by ordinary unweighted parity. On the computational side, a small expected number of nonzero determinants does not establish a worst-case algorithm: locating the relevant subsets and handling every random branch must also fit the time budget. These distinctions are explicit in §§2 and 4.
Lean uses finite labelled arc types, natural arc weights, integer B, MvPolynomial over arbitrary fields, Polynomial over ZMod 2 and finite counting laws. The public parity input is unrestricted by preprocessing; only the determinant lemmas use normalized graphs. Arbitrary polynomial labels are retained in Lemma 7. Empty incoming weight sets and d_i=0 are included. The cycle input extends §2's loopless convention to loops and the specified zero/singleton cases.
The program representation reuses a finite-instruction log-cost RAM with no witness and a constant-zero oracle. Independent fair bits are represented by uniform finite tapes. Finite uniform sampling must be implemented with a bounded rejection budget and sufficient amplification to retain the stated success constants. Every memory address, accessed value and arithmetic operation incurs its specified bit cost; exponential space is allowed. Correctness and speed are conclusions about executed instructions, never assumptions on an oracle or an answer law. Contributions are needed for all research proofs and the executable programs that witness the algorithmic theorems, including subroutine costs and the final acceptance check.
Lemma 8 excludes added loops t→t. With H={s→t} and one added loop labelled 1, its printed right side is det[1+1]=0 although h=1. This minimal correction leaves the algorithm's augmentations unchanged. Each formal item records its encodings and generalizations separately.
namespace DirectedHamiltonicity.Main
open Multidigraph
/-- Theorem 1, PDF p.2 / printed p.1 (proof PDF p.5 / printed p.4): Directed Hamiltonian Cycle has a
one-sided randomized algorithm with running time `O(1.9133^n)`. There is one fixed randomized
program `P` of the log-cost RAM and a constant `C > 0` such that for every `n` and every Boolean
adjacency matrix `adj` on `Fin n` (arbitrary directed graph; loops allowed), on the encoded input:
1. every run, for every coin string, halts with a one-bit output after a total cost of at most
`C · 1.9133^n`;
2. if the graph has no Hamiltonian cycle, no run outputs `true` (no false positives);
3. if it has one, with uniformly random coins of any length `L ≥ C · 1.9133^n` the output is `true`
with probability at least `2/3`. -/
theorem theorem1 :
∃ (P : TargetedSamplers.Program) (C : ℝ), 0 < C ∧
∀ (n : ℕ) (adj : Fin n → Fin n → Bool),
(∀ coins : List Bool, ∃ (cost : ℕ) (b : Bool),
P.RunsIn (runTapes (encodeDigraph n adj) coins) cost (some [b]) ∧
(cost : ℝ) ≤ C * (19133 / 10000 : ℝ) ^ n) ∧
(n ≤ 1 → ∀ coins : List Bool,
P.Outputs (runTapes (encodeDigraph n adj) coins) (some [smallCycleAnswer n adj])) ∧
(¬ HasHamCycle n adj →
∀ coins : List Bool, ¬ P.Outputs (runTapes (encodeDigraph n adj) coins) (some [true])) ∧
(HasHamCycle n adj → ∀ L : ℕ, C * (19133 / 10000 : ℝ) ^ n ≤ L →
(2 / 3 : ℝ) ≤ outputProb P (encodeDigraph n adj) L [true]) := by sorry
end DirectedHamiltonicity.Main
Directed Hamiltonian Cycle on an -vertex directed graph has a one-sided randomized algorithm with running time . Precisely: there is one fixed program of the log-cost RAM with fair coins and a constant such that for every and every directed graph on , given by its Boolean adjacency matrix (no symmetry, degree or looplessness assumption):
At sizes the output equals the direct small-size answer on every coin string. Here exactly. For there is no Hamiltonian cycle; for the answer is the single diagonal entry; a directed 2-cycle is a Hamiltonian cycle for . The target is the full one-sided decision result, with no degree or parity promise.
Differences from the source:
No open leaves. Every sub-goal is proved or awaiting decomposition.