math / data /lean /ComparatorChallenges /BinaryEditLower.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.29 kB
import Mathlib
namespace OAI
namespace TreeEdit
universe u
/-- A single unit-cost insertion, deletion, or substitution at any position. -/
inductive EditStep {Ξ± : Type u} : List Ξ± β†’ List Ξ± β†’ Prop
| insert (p q : List Ξ±) (a : Ξ±) : EditStep (p ++ q) (p ++ a :: q)
| delete (p q : List Ξ±) (a : Ξ±) : EditStep (p ++ a :: q) (p ++ q)
| substitute (p q : List Ξ±) (a b : Ξ±) : EditStep (p ++ a :: q) (p ++ b :: q)
/-- An edit script with no restriction on intermediate word lengths. -/
inductive EditScript {Ξ± : Type u} : List Ξ± β†’ List Ξ± β†’ β„• β†’ Prop
| nil (x : List Ξ±) : EditScript x x 0
| cons {x y z : List Ξ±} {n : β„•} :
EditStep x y β†’ EditScript y z n β†’ EditScript x z (n + 1)
noncomputable def ed {Ξ± : Type u} (x y : List Ξ±) : β„• :=
sInf {n | EditScript x y n}
abbrev RealL1 := lp (fun _ : β„• => ℝ) 1
abbrev Word (Ξ± : Type u) (n : β„•) := {x : List Ξ± // x.length = n}
namespace BinaryLower
/-- The product of the two maximal pairwise distance ratios. -/
noncomputable def distortion {X : Type u} (ρ : X β†’ X β†’ ℝ) (f : X β†’ RealL1) : ℝ :=
sSup {r : ℝ | βˆƒ x y : X, x β‰  y ∧ r = β€–f x - f yβ€– / ρ x y} *
sSup {r : ℝ | βˆƒ x y : X, x β‰  y ∧ r = ρ x y / β€–f x - f yβ€–}
/-- The infimum over every injective map into the full real sequence space ℓ₁. -/
noncomputable def c1 (X : Type u) (ρ : X β†’ X β†’ ℝ) : ℝ :=
sInf {D : ℝ | βˆƒ f : X β†’ RealL1, Function.Injective f ∧ D = distortion ρ f}
noncomputable def binarySetDistortion {n : β„•} (W : Finset (Word Bool n)) : ℝ :=
c1 {x : Word Bool n // x ∈ W}
(fun x y => (ed x.val.val y.val.val : ℝ))
noncomputable def growth (c : ℝ) (d : β„•) : ℝ :=
Real.exp (c * Real.sqrt (Real.log (d : ℝ) * Real.log (Real.log (d : ℝ))))
end BinaryLower
open BinaryLower
/-- The binary lower-bound theorem of OpenAI's September 27, 2026 tree-constructions
manuscript: finite equal-length witnesses for every sufficiently large length cap. -/
theorem binary_lower_bound :
βˆƒ c : ℝ, 0 < c ∧ βˆƒ dβ‚€ : β„•, βˆ€ d : β„•, dβ‚€ ≀ d β†’
βˆƒ n : β„•, 1 ≀ n ∧ n ≀ d ∧
βˆƒ W : Finset (Word Bool n), 2 ≀ W.card ∧
growth c d ≀ binarySetDistortion W := by
sorry
end TreeEdit
end OAI