OAI/Combinatorics/EditApproximation/Geometry/Accuracy.lean
7 declarations, 0 contain sorry, 0 declared as axioms
Accuracy assembly for the edit-distance approximation scheme
The probability and integer-conversion bounds of Section 8 of An Almost-Linear Approximation Scheme for Edit Distance (OpenAI, September 24, 2026) follow from the refinement estimate and simultaneous seed guarantee using Markov's inequality.
- def
OAI.EditApproximation.integerAnswerline 19Source documentation
The implementation clamps to the input length and rounds down.
noncomputable def integerAnswer (N : ℕ) (value : ℝ) : ℕ := …
- theorem
OAI.EditApproximation.integerAnswer_specline 24Source documentation
Clamping and rounding down preserve a one-sided approximation of an integer distance. This does not assert that an estimator has that bound.
theorem integerAnswer_spec {N D : ℕ} {value ε : ℝ} (hDN : D ≤ N) (hε : 0 ≤ ε) (hlower : (D : ℝ) ≤ value) (hupper : value ≤ (1 + ε) * D) : D ≤ integerAnswer N value ∧ (integerAnswer N value : ℝ) ≤ (1 + ε) * D := by …Mentions: OAI.EditApproximation.integerAnswer
- theorem
OAI.EditApproximation.integerAnswer_zeroline 38 - def
OAI.EditApproximation.goodExcessline 42Source documentation
The positive excess on executions having a good seed.
noncomputable def goodExcess {Ω : Type*} (G : Set Ω) (value : Ω → ℝ) (D : ℕ) : Ω → ℝ := G.indicator (fun ω => max (value ω - D) 0) - theorem
OAI.EditApproximation.goodExcess_nonnegline 45 - theorem
OAI.EditApproximation.goodExcess_tailline 52Source documentation
Markov's inequality converts the positive-excess expectation bound of Section 8 into an approximation tail bound.
theorem goodExcess_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {G : Set Ω} {value : Ω → ℝ} {D : ℕ} {ℓ ε : ℝ} (hD : 0 < D) (hℓ : 0 < ℓ) (hε : 0 < ε) (hint : Integrable (goodExcess G value D) μ) (hmoment : (∫ ω, goodExcess G value D ω ∂μ) ≤ (D : ℝ) / ℓ) : μ.real {ω | ε * D ≤ goodExcess G value D ω} ≤ 1 / (ℓ * ε) := by …Mentions: OAI.EditApproximation.goodExcess
- theorem
OAI.EditApproximation.final_answer_accuracyline 73Source documentation
Final probability assembly, with the two genuinely unresolved algorithmic guarantees exposed: a good-seed event and its excess moment. The stronger success probability
4/5implies the paper's2/3.theorem final_answer_accuracy {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {G : Set Ω} {value : Ω → ℝ} {N D : ℕ} {ℓ ε : ℝ} (hvalue : Measurable value) (hDN : D ≤ N) (hD : 0 < D) (hℓ : 0 < ℓ) (hε : 0 < ε) (haccuracy : 10 ≤ ℓ * ε) (hseed : μ.real Gᶜ ≤ 1 / 10) (hlower : ∀ ω ∈ G, (D : ℝ) ≤ value ω) (hint : Integrable (goodExcess G value D) μ) (hmoment : (∫ ω, goodExcess G value D ω ∂μ) ≤ (D : ℝ) / ℓ) : (4 / 5 : ℝ) ≤ μ.real {ω | D ≤ integerAnswer N (value ω) ∧ (integerAnswer N (value ω) : ℝ) ≤ (1 + ε) * D} := by …Mentions: OAI.EditApproximation.goodExcess, OAI.EditApproximation.integerAnswer