Download data/lean/OAI/Combinatorics/BinaryEdit/CodeExistence.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/BinaryEdit/CodeExistence.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/BinaryEdit/CodeExistence.lean
-
curl -L -o CodeExistence.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/BinaryEdit/CodeExistence.lean
1.98 kB
| import OAI.Combinatorics.BinaryEdit.CodeNumerics | |
| import OAI.Combinatorics.BinaryEdit.SegmentCodeLCS | |
| namespace OAI | |
| /-! Closing the probabilistic segment-code construction at the exact source | |
| parameters: block width MΒ² and cutoff ceil(120 logβ M). -/ | |
| namespace TreeEdit.BinaryLower.Code | |
| universe u | |
| /-- A single binary codebook separates all long segments of unequal labels. | |
| The alphabet can be arbitrary finite; its size is only bounded by M. -/ | |
| theorem exists_fixed_width_separated_code {M : β} (hM : 2 β€ M) | |
| (Ξ : Type u) [Fintype Ξ] (hΞ : Fintype.card Ξ β€ M) : | |
| β c : Ξ β Word Bool (M ^ 2), | |
| β (k l : Ξ), k β l β β (a i j : β), segmentThreshold M β€ a β | |
| i + a β€ M ^ 2 β j + a β€ M ^ 2 β | |
| 100 * lcs (((c k).val.drop i).take a) | |
| (((c l).val.drop j).take a) β€ 99 * a := by | |
| apply SegmentCode.exists_lcs_separated_code Ξ (M ^ 2) (segmentThreshold M) | |
| simpa only [Nat.cast_add, Nat.cast_pow, Nat.cast_one] using | |
| code_union_bound_for_alphabet hΞ hM | |
| /-- There is an absolute threshold at which the actual codebook and the | |
| short-pair error budget needed by the deterministic proof coexist. -/ | |
| theorem exists_binary_code_with_error_budget : | |
| β Mβ : β, β M : β, Mβ β€ M β | |
| 2 β€ M β§ | |
| 2 * (M : β) * segmentThreshold M β€ (M : β) ^ 2 / 2 β§ | |
| β (Ξ : Type u) [Fintype Ξ], Fintype.card Ξ β€ M β | |
| β c : Ξ β Word Bool (M ^ 2), | |
| β (k l : Ξ), k β l β β (a i j : β), segmentThreshold M β€ a β | |
| i + a β€ M ^ 2 β j + a β€ M ^ 2 β | |
| 100 * lcs (((c k).val.drop i).take a) | |
| (((c l).val.drop j).take a) β€ 99 * a := by | |
| obtain β¨Mβ, hMββ© := exists_code_numerical_threshold | |
| refine β¨Mβ, fun M hM => ?_β© | |
| obtain β¨hM2, herr, _β© := hMβ M hM | |
| exact β¨hM2, herr, fun Ξ _ hΞ => exists_fixed_width_separated_code hM2 Ξ hΞβ© | |
| end TreeEdit.BinaryLower.Code | |
| end OAI | |