Download data/lean/ComparatorChallenges/TreeEdit.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.06 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TreeEdit.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/ComparatorChallenges/TreeEdit.lean
-
curl -L -o TreeEdit.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TreeEdit.lean
2.06 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) | |
| /-- A script of precisely `n` edits. There is no restriction on its intermediate 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) | |
| /-- Ordinary unit-cost edit distance. The set is nonempty (delete then insert). -/ | |
| noncomputable def ed {Ξ± : Type u} (x y : List Ξ±) : β := | |
| sInf {n | EditScript x y n} | |
| /-- The full infinite-dimensional real ββ space. -/ | |
| abbrev RealL1 := lp (fun _ : β => β) 1 | |
| /-- Product of the two maximal pairwise distance ratios. -/ | |
| noncomputable def distortion (W : Finset (List Bool)) (f : W β RealL1) : β := | |
| sSup {r : β | β x y : W, x β y β§ | |
| r = dist (f x) (f y) / (ed x.val y.val : β)} * | |
| sSup {r : β | β x y : W, x β y β§ | |
| r = (ed x.val y.val : β) / dist (f x) (f y)} | |
| /-- Infimum over all injective ββ maps, used on finite sets with at least two points. -/ | |
| noncomputable def c1 (W : Finset (List Bool)) : β := | |
| sInf {D : β | β f : W β RealL1, Function.Injective f β§ distortion W f = D} | |
| /-- The binary main endpoint, for every sufficiently large cap (natural logarithms). -/ | |
| def BinaryLowerBound : Prop := | |
| β c : β, 0 < c β§ β dβ : β, β d : β, dβ β€ d β | |
| β n : β, n β€ d β§ β W : Finset (List Bool), | |
| 2 β€ W.card β§ (β w β W, w.length = n) β§ | |
| Real.exp (c * Real.sqrt (Real.log (d : β) * Real.log (Real.log (d : β)))) β€ c1 W | |
| theorem binary_torus : BinaryLowerBound := by | |
| sorry | |
| end TreeEdit | |
| end OAI | |