Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A linearly dependent pair of opposite slopes: ai1=ak1=0a_{i1}=a_{k1}=0ai1​=ak1​=0 and the middle hyperplane settles one of them

Proved
MegiddoLP.FixedDim.dependent_pair

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

computational-geometrymultidimensional-searchp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let d≥2d\ge2d≥2, let Hi={aiTx=bi}H_i=\{a_i^Tx=b_i\}Hi​={aiT​x=bi​} have nonnegative slope and Hk={akTx=bk}H_k=\{a_k^Tx=b_k\}Hk​={akT​x=bk​} nonpositive slope, and suppose the two are linearly dependent: ai=λaka_i=\lambda a_kai​=λak​ for a real λ≠0\lambda\neq0λ=0. Then:

  1. ai1=ak1=0a_{i1}=a_{k1}=0ai1​=ak1​=0;
  2. let Hik(1)H^{(1)}_{ik}Hik(1)​ be the hyperplane midway between them,
Hik(1): ∑jaijxj=12(bi+λbk).H^{(1)}_{ik}:\ \sum_j a_{ij}x_j=\tfrac12(b_i+\lambda b_k).Hik(1)​: j∑​aij​xj​=21​(bi​+λbk​).

There is a rule FFF, depending only on the data, that maps the oracle's answer for Hik(1)H^{(1)}_{ik}Hik(1)​ to one of HiH_iHi​, HkH_kHk​ and a position, such that for every x∈Rdx\in\mathbb{R}^dx∈Rd the position is the true position of xxx relative to that hyperplane.

Part 1 holds because a dependent pair has a common slope, which must be both nonnegative and nonpositive, hence 000. Part 2 shows that in the dependent case a single hyperplane with zero x1x_1x1​-coefficient replaces the pair Hik(1)H^{(1)}_{ik}Hik(1)​, Hik(2)H^{(2)}_{ik}Hik(2)​. So the recursion into dimension d−1d-1d−1 also covers this case.

Formalization Note The dimension is d+2d+2d+2 in Lean and x1x_1x1​ is index 0. λ\lambdaλ is written lam.

Preamble
import Mathlib
import Definitions.Def_MegiddoLP_FixedDim_Pairing
Formal statement
/-!
Megiddo, J. ACM 31 (1984), §3.2 p. 120 (Figure 2): a linearly dependent pair of hyperplanes of
opposite slopes has zero `x₁`-coefficients, and the hyperplane midway between them settles
the position of `x*` relative to one of the two. The paper's `x₁, x₂` are the indices `0, 1`
of `Fin (d + 2)`.
-/

namespace MegiddoLP.FixedDim

/-- **The linearly dependent pair.** Let `Hᵢ = {aᵢ ⬝ᵥ x = bᵢ}` have nonnegative slope and
`H_k = {a_k ⬝ᵥ x = b_k}` nonpositive slope, with `aᵢ = λ a_k` for a real `λ ≠ 0`. Then
`a_i1 = a_k1 = 0`, and there is a rule `F`, depending only on the data, mapping the oracle's
answer for the middle hyperplane `H⁽¹⁾_ik = {aᵢ ⬝ᵥ x = (bᵢ + λ b_k)/2}` to a choice of `Hᵢ`
(`true`) or `H_k` (`false`) and the correct position of `x` relative to it, for every `x`. -/
theorem dependent_pair {d : ℕ} (ai ak : Fin (d + 2) → ℝ) (bi bk lam : ℝ)
    (hlam : lam ≠ 0) (hdep : ai = lam • ak)
    (hi : HasNonnegSlope ai) (hk : HasNonposSlope ak) :
    (ai 0 = 0 ∧ ak 0 = 0) ∧
    ∃ F : Ordering → Bool × Ordering, ∀ x : Fin (d + 2) → ℝ,
      let r := F (compare (ai ⬝ᵥ x) ((bi + lam * bk) / 2))
      (r.1 = true → compare (ai ⬝ᵥ x) bi = r.2) ∧
      (r.1 = false → compare (ak ⬝ᵥ x) bk = r.2) := by sorry

end MegiddoLP.FixedDim
Source
Megiddo, Linear Programming in Linear Time When the Dimension Is Fixed, J. ACM 31(1) (1984) 114–127, §3.2, p. 120 and Figure 2 (the linearly dependent case)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let d∈Nd \in \mathbb{N}d∈N, let ai,ak∈Rd+2a^i, a^k \in \mathbb{R}^{d+2}ai,ak∈Rd+2, and let bi,bk,λ∈Rb_i, b_k, \lambda \in \mathbb{R}bi​,bk​,λ∈R. Write a1,a2a_1, a_2a1​,a2​ for the first two coordinates of a vector.

Hypotheses.

  • λ≠0\lambda \ne 0λ=0.
  • ai=λaka^i = \lambda a^kai=λak coordinatewise.
  • aia^iai has nonnegative slope: a2i=0a^i_2 = 0a2i​=0, or −a1i/a2i≥0-a^i_1/a^i_2 \ge 0−a1i​/a2i​≥0.
  • aka^kak has nonpositive slope: a2k≠0a^k_2 \ne 0a2k​=0 and −a1k/a2k≤0-a^k_1/a^k_2 \le 0−a1k​/a2k​≤0.

Claim, part 1. a1i=0a^i_1 = 0a1i​=0 and a1k=0a^k_1 = 0a1k​=0.

Claim, part 2. There exists a function FFF from {<,=,>}\{<,=,>\}{<,=,>} to pairs (β,o)(\beta,o)(β,o), where β\betaβ is true or false and o∈{<,=,>}o \in \{<,=,>\}o∈{<,=,>}. It is chosen depending only on the data. For every x∈Rd+2x \in \mathbb{R}^{d+2}x∈Rd+2, let σ\sigmaσ be the relation of ai⋅xa^i\cdot xai⋅x to

bi+λbk2,\frac{b_i + \lambda b_k}{2},2bi​+λbk​​,

and put (β,o)=F(σ)(\beta,o) = F(\sigma)(β,o)=F(σ). Then:

  • if β\betaβ is true, ai⋅xa^i\cdot xai⋅x stands in relation ooo to bib_ibi​;
  • if β\betaβ is false, ak⋅xa^k\cdot xak⋅x stands in relation ooo to bkb_kbk​.

The single query used is the hyperplane with normal aia^iai and right-hand side (bi+λbk)/2(b_i+\lambda b_k)/2(bi​+λbk​)/2.

Degenerate cases.

  • The hypotheses are satisfiable, for example with ai=ak=(0,1,0,…,0)a^i = a^k = (0,1,0,\dots,0)ai=ak=(0,1,0,…,0) and λ=1\lambda = 1λ=1.
  • They force a2k≠0a^k_2 \ne 0a2k​=0, and hence a2i=λa2k≠0a^i_2 = \lambda a^k_2 \ne 0a2i​=λa2k​=0. So no division by zero enters the slope conditions.
  • The division by 222 is ordinary real division.
  • d=0d = 0d=0. Everything is in R2\mathbb{R}^2R2.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me