Certified upper bounds for the Chvátal–Sankoff constant
Abstract
The expected length of a longest common subsequence of two independent uniformly random binary strings of length n is γ2 n + o(n), where γ2 is the Chvátal–Sankoff constant. Simulations suggest γ2 ≈ 0.8122. In 2009 Lueker obtained the bound γ2 ≤ 0.826280 with a weighted finite automaton that remembers the last h = 8 symbols of each string. We prove γ2 ≤ 0.821963 by the same method with h = 13, where the automaton has about 1.66·1011 reachable states up to symmetry. The proof rests on an explicit vector v > 0 and a number λ < 1 with Av ≤ λv, where A is the weighted transition matrix; a program checks the inequality Av ≤ λv entry by entry, in exact arithmetic. The bound is also proved in the Lean 4 proof assistant.
In plain words
A longest common subsequence of two strings is a longest string that can be read in both by skipping some symbols. The file-comparison program diff is based on longest common subsequences, with lines as symbols. For two random strings of 0s and 1s, each of length n, Chvátal and Sankoff showed in 1975 that the average length of a longest common subsequence, divided by n, approaches a fixed number as n grows. Pushing Lueker’s 2009 method further, this paper proves that the number is at most 0.821963, below the bound 0.824120 obtained by L. Jack in October 2026. The proof assistant Lean has checked the result.
Formal statement and axioms
Each main result as stated in Lean, copied verbatim from the published package, with the axioms that the proof rests on. Lean v4.35.0-rc3, Mathlib c55e6e786f49. The package.
K13TopH13.gamma2_le
γ₂ ≤ 0.821963, kernel-only proof (history length 13)
theorem gamma2_le : gamma2 ≤ 0.821963Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nSource. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.
CS31aData.gamma2_le_n13
γ₂ ≤ 0.821963, proof with compiled code (history length 13)
theorem gamma2_le_n13 : gamma2 ≤ 0.821963Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nThe package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 56 more, for example CS31aData.N13.cert0._native.native_decide.ax_1_1, CS31aData.N13.cert1._native.native_decide.ax_1_1 and CS31aData.N13.cert2._native.native_decide.ax_1_1.
CS31aK.H12.gamma2_le
γ₂ ≤ 0.822579, kernel-only proof (history length 12)
theorem gamma2_le : gamma2 ≤ 0.822579Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nSource. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.
4 more formal statements
CS31aData.gamma2_le_h12
γ₂ ≤ 0.822579, proof with compiled code (history length 12)
theorem gamma2_le_h12 : gamma2 ≤ 0.822579Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nThe package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 7 more, for example CS31aData.H12.cert0._native.native_decide.ax_1_1, CS31aData.H12.cert1._native.native_decide.ax_1_1 and CS31aData.H12.cert2._native.native_decide.ax_1_1.
CS31aK.H11.gamma2_le
γ₂ ≤ 0.823290, kernel-only proof (history length 11)
theorem gamma2_le : gamma2 ≤ 0.823290Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nSource. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.
CS31aK.H10.gamma2_le
γ₂ ≤ 0.824120, kernel-only proof (history length 10)
theorem gamma2_le : gamma2 ≤ 0.824120Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nSource. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.
CS31aK.H9.gamma2_le
γ₂ ≤ 0.825101, kernel-only proof (history length 9)
theorem gamma2_le : gamma2 ≤ 0.825101Definitions used in the statement
noncomputable def lcsLen (A B : List Bool) : ℕ :=
sSup {k : ℕ | ∃ s : List Bool, List.Sublist s A ∧ List.Sublist s B ∧ s.length = k}noncomputable def expLCS (n : ℕ) : ℝ :=
(∑ A : Fin n → Bool, ∑ B : Fin n → Bool, (lcsLen (List.ofFn A) (List.ofFn B) : ℝ)) / 4 ^ nnoncomputable def gamma2 : ℝ :=
limUnder atTop fun n : ℕ => expLCS n / nSource. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.