Planar reference-walk machine blocks, exit-prefix execution, terminal shared-support certificate, and query budget
ProvedGrunbaum2003.rayMachine_planar_reference_walk_and_one_sided_budgetcombinatoricsconvex-geometryconvex-polytopes
This theorem formalizes the complete planar secant reference-walk engine of the Gritzmann–Klee–Westwater ray-oracle algorithm on rayMachineRun, including its initialization programs, exit-prefix execution semantics, terminal shared-support certificate, and one-sided unknown-facet query budget:
- Planar initialization programs and native chord data (
secondQueryProgram_correct,firstMidpointProgram_correct,native_first_reference_data): At the normalized boundary anchor , the first query along returns with . The 6-stepsecondQueryProgramqueries , and the 12-stepfirstMidpointProgramqueries . The chord vector satisfies , , , and the convex affine gap satisfies and for all . - Exit-prefix execution and terminal shared-support certificate (
referenceWalkProgram_exits_of_first_guard,rayOracle_one_side_terminal_common_active): Any program matchingreferenceWalkProgramon instructions executes the scalar secant recurrence on actual oracle replies. At the first index where either terminal guard fires ( or ), the machine reachespc = 27in or steps withqueries = q + n(making no query on the final iteration), and there exists an original defining row shared by and (). - One-sided unknown-facet query budget (
one_side_actual_prefix_query_budget): Whenever all oracle replies along have strict slack on a set of already known facet rowsknown : Finset (Fin m), each of the positive-gap samples activates an unknown row at most twice (third_secant_response_leaves_common_piece), yielding and total phase query count .
Preamble
import Definitions.Def_Grunbaum2003_IsPolytopeRayOracle import Definitions.Def_Grunbaum2003_IsDPolytope import Definitions.Def_Grunbaum2003_RayInstruction import Definitions.Def_Grunbaum2003_RayConfiguration import Definitions.Def_Grunbaum2003_rayMachineStep import Definitions.Def_Grunbaum2003_rayMachineRun import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.LocallyConvex.Separation import Mathlib.Data.Finset.Lattice.Fold import Mathlib.Data.Fintype.Card import Mathlib.Data.Fintype.EquivFin import Mathlib.Data.Nat.Find import Mathlib.Order.Fin.Basic import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.FinCases import Mathlib.Tactic.Linarith import Mathlib.Tactic.Positivity import Mathlib.Tactic.Ring import Lean.Elab.Tactic.Omega set_option autoImplicit false
Formal statement
namespace Grunbaum2003
theorem rayMachine_planar_reference_walk_and_one_sided_budget :
∃ (suppliedPoint : Fin 2 → ℝ)
(firstDirection : Fin 2 → ℝ)
(secondDirection : ℝ → Fin 2 → ℝ)
(firstMidpointDirection : ℝ → Fin 2 → ℝ)
(firstChordValue : ℝ → (Fin 2 → ℝ) → ℝ)
(nativeReferenceFunctional : ℝ → (Fin 2 → ℝ) →L[ℝ] ℝ)
(nativeGap : ∀ {m : ℕ}, 0 < m → (Fin m → (Fin 2 → ℝ) →L[ℝ] ℝ) → (Fin 2 → ℝ) → ℝ → ℝ)
(secondQueryProgram : List RayInstruction)
(firstMidpointProgram : List RayInstruction)
(referenceWalkProgram : List RayInstruction),
suppliedPoint = (fun i => if i = 0 then 0 else 1) ∧
firstDirection = (fun i => if i = 0 then -1 else 1) ∧
(∀ t : ℝ, secondDirection t = fun i => if i = 0 then t / (1 + t) else 2 / (1 + t)) ∧
(∀ t : ℝ, firstMidpointDirection t = (1 / 2 : ℝ) • (suppliedPoint + secondDirection t)) ∧
(∀ (t : ℝ) (x : Fin 2 → ℝ), firstChordValue t x = (t - 1) * x 0 + t * x 1) ∧
(∀ (oracle : (Fin 2 → ℝ) → Fin 2 → ℝ) (tape : ℤ → ℝ) (q : ℕ),
0 < tape 1 →
∃ c : RayConfiguration,
rayMachineRun secondQueryProgram oracle 6
{pc := 0, head := 0, tape := tape, queries := q} = some c ∧
secondQueryProgram[c.pc]? = some .halt ∧ c.head = 0 ∧ c.queries = q + 1 ∧
(∀ i : Fin 2, c.tape (i.val : ℤ) = oracle (secondDirection (tape 1)) i) ∧
c.tape 3 = tape 1 + 1) ∧
(∀ (oracle : (Fin 2 → ℝ) → Fin 2 → ℝ) (tape : ℤ → ℝ) (q : ℕ),
1 < tape 3 →
∃ c : RayConfiguration,
rayMachineRun firstMidpointProgram oracle 12
{pc := 0, head := 0, tape := tape, queries := q} = some c ∧
firstMidpointProgram[c.pc]? = some .halt ∧ c.head = 0 ∧ c.queries = q + 1 ∧
(∀ i : Fin 2, c.tape (i.val : ℤ) = oracle (firstMidpointDirection (tape 3 - 1)) i) ∧
c.tape 5 = tape 0 ∧ c.tape 6 = tape 1 ∧ c.tape 3 = tape 3) ∧
(∀ {m : ℕ} (hm : 0 < m) (L : Fin m → (Fin 2 → ℝ) →L[ℝ] ℝ)
{P : Set (Fin 2 → ℝ)}, P = {q | ∀ j, L j q ≤ 1} →
∀ {oracle : (Fin 2 → ℝ) → (Fin 2 → ℝ)}, IsPolytopeRayOracle P oracle →
suppliedPoint ∈ frontier P →
let τ := oracle firstDirection 1
let B := secondDirection τ - suppliedPoint
let H := nativeGap hm L B
0 < τ ∧ 0 < B 0 ∧ firstChordValue τ B = 0 ∧ H 0 = 0 ∧
(∀ z : ℝ, 0 ≤ z → 0 ≤ H z) ∧
oracle firstDirection = suppliedPoint - (1 + τ) • B ∧
suppliedPoint - (1 + τ) • B ∈ P ∧
suppliedPoint + (1 : ℝ) • B = secondDirection τ ∧
firstMidpointDirection τ = suppliedPoint + (1 / 2 : ℝ) • B ∧
(oracle (secondDirection τ) ≠ secondDirection τ → 0 < H 1)) ∧
(∀ (program : List RayInstruction),
(∀ k : ℕ, k < 27 → program[k]? = referenceWalkProgram[k]?) →
∀ {m : ℕ} (hm : 0 < m) (L : Fin m → (Fin 2 → ℝ) →L[ℝ] ℝ)
{P : Set (Fin 2 → ℝ)}, P = {v | ∀ j, L j v ≤ 1} →
∀ {oracle : (Fin 2 → ℝ) → (Fin 2 → ℝ)}, IsPolytopeRayOracle P oracle →
suppliedPoint ∈ frontier P →
∀ {t : ℝ}, 0 < t → ∀ (B : Fin 2 → ℝ),
firstChordValue t B = 0 → B 0 ≠ 0 →
∀ (xs : ℕ → ℝ),
(∀ i : ℕ, xs (i + 2) =
(xs (i + 1) * nativeGap hm L B (xs i) - xs i * nativeGap hm L B (xs (i + 1))) /
(nativeGap hm L B (xs i) - nativeGap hm L B (xs (i + 1)))) →
0 < xs 1 → xs 1 < xs 0 →
0 < nativeGap hm L B (xs 0) →
(∀ w : ℝ, 0 ≤ w → w ≤ xs 0 → 0 ≤ nativeGap hm L B w) →
∀ (tape : ℤ → ℝ) (q : ℕ), tape 3 = t + 1 →
tape 0 = oracle (suppliedPoint + xs 1 • B) 0 →
tape 1 = oracle (suppliedPoint + xs 1 • B) 1 →
tape 5 = oracle (suppliedPoint + xs 0 • B) 0 →
tape 6 = oracle (suppliedPoint + xs 0 • B) 1 →
∀ (n : ℕ),
(∀ i : ℕ, i < n → nativeGap hm L B (xs (i + 1)) ≠ 0 ∧ xs (i + 2) ≠ 0) →
((∀ (known : Finset (Fin m)),
(∀ z : ℝ, 0 ≤ z → z ≤ xs 0 → ∀ j ∈ known, L j (oracle (suppliedPoint + z • B)) < 1) →
n + 1 ≤ 2 * (m - known.card) ∧ 3 + n ≤ 2 * (m - known.card) + 2) ∧
((nativeGap hm L B (xs (n + 1)) = 0 ∨ xs (n + 2) = 0) →
(∀ {a : ℝ}, 0 < a → suppliedPoint - a • B ∈ P →
∃ j : Fin m, L j suppliedPoint = 1 ∧ L j (oracle (suppliedPoint + xs (n + 1) • B)) = 1) ∧
∃ c : RayConfiguration,
rayMachineRun program oracle
(27 * n + (if nativeGap hm L B (xs (n + 1)) = 0 then 23 else 24))
{pc := 0, head := 0, tape := tape, queries := q} = some c ∧
c.pc = 27 ∧ c.head = 0 ∧ c.queries = q + n ∧
c.tape 5 = oracle (suppliedPoint + xs n • B) 0 ∧
c.tape 6 = oracle (suppliedPoint + xs n • B) 1 ∧
c.tape 9 = oracle (suppliedPoint + xs (n + 1) • B) 0 ∧
c.tape 10 = oracle (suppliedPoint + xs (n + 1) • B) 1 ∧
c.tape 3 = t + 1 ∧
(c.tape 16 = 0 ↔ nativeGap hm L B (xs (n + 1)) = 0) ∧
(∀ i : Fin 2, c.tape (i.val : ℤ) = (suppliedPoint + xs (n + 2) • B) i) ∧
(∀ j : ℤ, j < 0 ∨ 16 < j → c.tape j = tape j)))) := by sorry
end Grunbaum2003Source
Grünbaum 2003, Convex Polytopes (2nd ed., Graduate Texts in Mathematics 221), §3.6, pp. 52b–52c (citing Gritzmann–Klee–Westwater 1995)