Approach I: queries settle at least of hyperplanes in
ProvedMegiddoLP.FixedDim.approachI_fractionLet , and let , , be hyperplanes with . Then there is a query strategy such that for every unknown point :
- makes at most queries;
- every position that reports is correct;
- reports the position of for at least of the hyperplanes, where :
The constants solve the paper's recursion , with , . Repeating such a round and discarding the settled hyperplanes is what yields the query bound and, in linear programming, the linear-time pruning.
Formalization Note The page's "at least hyperplanes" is read as (natural-number division). The page does not say how the non-integer count is rounded. The floor is exactly what the paper's pairing recursion yields: pairs, and . It coincides with the page whenever divides .
import Mathlib import Definitions.Def_MegiddoLP_FixedDim_QueryTree
/-!
Megiddo, J. ACM 31 (1984), §3.2 pp. 118 and 121 (Approach I): `A(d) = 2^{d-1}` queries
suffice to determine the position of `x*` relative to at least `B(d)·n` of `n` given
hyperplanes in `ℝ^d`, where `B(d) = 2^{1-2^d}`. The count `B(d)·n` is read as
`⌊n / 2^{2^d - 1}⌋`.
-/
namespace MegiddoLP.FixedDim
/-- **Approach I: `A(d) = 2^{d-1}`, `B(d) = 2^{1-2^d}`.** For `d ≥ 1` and `n` hyperplanes
`{aᵢ ⬝ᵥ x = bᵢ}` in `ℝ^d` with `aᵢ ≠ 0`, there is a strategy which, for every unknown point `x`,
makes at most `2^{d-1}` queries and reports correct positions for at least
`⌊n / 2^{2^d - 1}⌋` of the hyperplanes. -/
theorem approachI_fraction (d n : ℕ) (hd : 1 ≤ d) (a : Fin n → Fin d → ℝ) (b : Fin n → ℝ)
(ha : ∀ i, a i ≠ 0) :
∃ T : QTree d (Fin n → Option Ordering), ∀ x : Fin d → ℝ,
T.numQueries x ≤ 2 ^ (d - 1) ∧
(∀ i o, T.eval x i = some o → compare (a i ⬝ᵥ x) (b i) = o) ∧
n / 2 ^ (2 ^ d - 1) ≤ (Finset.univ.filter fun i => (T.eval x i).isSome).card := by sorry
end MegiddoLP.FixedDim
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let with . For each let and . The hypothesis is that every .
Claim. There exists a query tree in , as in the QueryTree definition. Its leaves carry functions assigning to each index either no report or a report in . For every :
- Query bound: the number of queries on the path of is at most .
- Correctness: whenever reports for index , stands in relation to .
- Coverage: the number of indices receiving a report is at least
using natural-number division, which rounds down.
The tree depends only on , , and .
Degenerate cases.
- The exponents and involve no truncated subtraction, because .
- . The bounds are query and reports.
- , including . The coverage bound is . The claim is then met by a single leaf that reports nothing.
- . Excluded by hypothesis.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.