Download data/lean/OAI/Combinatorics/EditApproximation/AlmostLinear.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.42 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/AlmostLinear.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/AlmostLinear.lean
-
curl -L -o AlmostLinear.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/AlmostLinear.lean
2.42 kB
| import OAI.Combinatorics.EditApproximation.AlmostLinearConditional | |
| import OAI.Combinatorics.EditApproximation.Probability.BernsteinFinite | |
| namespace OAI | |
| /-! A uniform binary approximation scheme for edit distance. | |
| The finite Bernstein inequality supplies the concentration bounds for the | |
| initial estimator and the refinement samples. -/ | |
| namespace EditApproximation | |
| open MeasureTheory Filter | |
| /-- Finite product-measure concentration for the initial estimator and refinement. -/ | |
| theorem computedBernsteinInputs (N : β) : ComputedBernsteinInputs N := by | |
| constructor | |
| Β· exact finiteBernsteinInput _ | |
| Β· intro b h | |
| exact finiteBernsteinInput _ | |
| /-- A uniform almost-linear approximation scheme. The same binary algorithm | |
| satisfies the approximation, equality, expected-work and space bounds. -/ | |
| theorem almostLinearEditDistance (epsilon : BinaryFraction) | |
| (hepsilon : 0 < epsilon.value) (_hepsilonOne : epsilon.value < 1) | |
| : | |
| (β (source target : List β€) (N : β), source.length + target.length β€ N β | |
| (2 / 3 : β) β€ (computedFullLaw (source.map integerSymbolCode) (target.map integerSymbolCode) N epsilon).real | |
| {outcome | EditDistortion.edit source target β€ integerBinaryAnswer source target N epsilon outcome β§ | |
| (integerBinaryAnswer source target N epsilon outcome : β) β€ | |
| (1 + (epsilon.value : β)) * EditDistortion.edit source target}) β§ | |
| (β (source target : List β€) (N : β), source = target β β outcome, | |
| integerBinaryAnswer source target N epsilon outcome = 0) β§ | |
| (β (C : β) (eta : β), 0 < eta β βαΆ N : β in atTop, | |
| β source target : List β€, source.length + target.length β€ N β | |
| (β z β source ++ target, z.natAbs β€ (N + 2) ^ C) β | |
| (β« outcome, integerBinaryWork source target N epsilon outcome | |
| βcomputedFullLaw (source.map integerSymbolCode) (target.map integerSymbolCode) N epsilon) β€ | |
| (N + 2 : β) ^ (1 + eta)) β§ | |
| (β C : β, βαΆ N : β in atTop, β source target : List β€, | |
| source.length + target.length β€ N β | |
| (β z β source ++ target, z.natAbs β€ (N + 2) ^ C) β | |
| β outcome, integerBinarySpace source target N epsilon outcome β€ (N + 2) ^ (C + 65564)) := by | |
| exact almostLinearEditDistance_conditional epsilon hepsilon _hepsilonOne computedBernsteinInputs | |
| end EditApproximation | |
| end OAI | |