Compiled ray-machine programs for hyperplane vertex-facet incidence testing and subset-inclusion table emission
ProvedGrunbaum2003.rayMachine_hyperplane_incidence_and_inclusion_table_programscombinatoricsconvex-geometryconvex-polytopes
This theorem compiles the two output-synthesis components of the Gritzmann–Klee–Westwater ray-oracle reconstruction algorithm into verified List RayInstruction programs with zero oracle queries:
- Hyperplane Incidence Indicator (
hyperplaneIncidenceProgram): Given a -dimensional functional atlBaseand a point atxBase, evaluates the affine slack and applies a 2-step 3-way.branchzero-indicator to write1if and0otherwise intooutBase ≥ minBase, preserving all cells< outBase. - Unary Header and Subset-Inclusion Table Emitter (
headerAndInclusionTableProgram): Given an matrix of face-vertex incidence bits stored atfvBase + i * V + k, evaluates the division-free boolean implication product to emit the unary header1, ..., 1, 0of length followed by the subset-inclusion table intooutBase ..and shifts the head tooutBase.
Preamble
import Definitions.Def_Grunbaum2003_RayInstruction import Definitions.Def_Grunbaum2003_RayConfiguration import Definitions.Def_Grunbaum2003_rayMachineStep import Definitions.Def_Grunbaum2003_rayMachineRun import Mathlib.Algebra.BigOperators.Fin set_option autoImplicit false open scoped BigOperators Classical
Formal statement
namespace Grunbaum2003
theorem rayMachine_hyperplane_incidence_and_inclusion_table_programs :
∃ (hyperplaneIncidenceProgram : ℕ → ℤ → ℤ → ℤ → List RayInstruction)
(hyperplaneIncidenceDest : ℕ → ℤ → ℤ → ℤ → ℤ)
(hyperplaneIncidenceSteps : ℕ → ℤ → ℤ → ℕ)
(headerAndInclusionTableProgram : ℕ → ℕ → ℤ → ℤ → List RayInstruction)
(headerAndInclusionTableDest : ℕ → ℕ → ℤ → ℤ → ℤ)
(headerAndInclusionTableSteps : ℕ → ℕ → ℤ → ℕ),
(∀ {d : ℕ} (oracle : (Fin d → ℝ) → Fin d → ℝ) (source : ℤ → ℝ)
(lBase xBase minBase : ℤ) (q : ℕ),
let prog := hyperplaneIncidenceProgram d lBase xBase minBase
let outBase := hyperplaneIncidenceDest d lBase xBase minBase
let steps := hyperplaneIncidenceSteps d lBase xBase
minBase ≤ outBase ∧
∃ c' : RayConfiguration,
rayMachineRun prog oracle steps ⟨0, 0, source, q⟩ = some c' ∧
c'.pc = steps + 1 ∧ prog[c'.pc]? = some .halt ∧
c'.head = 0 ∧ c'.queries = q ∧
c'.tape outBase =
(if (∑ i : Fin d, source (lBase + (i.val : ℤ)) * source (xBase + (i.val : ℤ))) = 1
then (1 : ℝ) else 0) ∧
(∀ z : ℤ, z < outBase → c'.tape z = source z)) ∧
(∀ {d n V : ℕ} (oracle : (Fin d → ℝ) → Fin d → ℝ) (source : ℤ → ℝ)
(fvBase minBase : ℤ) (q : ℕ) (inc : Fin n → Fin V → Prop),
(∀ (a : Fin n) (k : Fin V),
source (fvBase + (a.val : ℤ) * (V : ℤ) + (k.val : ℤ)) =
if inc a k then (1 : ℝ) else 0) →
let prog := headerAndInclusionTableProgram n V fvBase minBase
let outBase := headerAndInclusionTableDest n V fvBase minBase
let steps := headerAndInclusionTableSteps n V fvBase
minBase ≤ outBase ∧
∃ c' : RayConfiguration,
rayMachineRun prog oracle steps ⟨0, 0, source, q⟩ = some c' ∧
c'.pc = steps ∧ prog[c'.pc]? = some .halt ∧
c'.head = outBase ∧ c'.queries = q ∧
(∀ i : Fin n, c'.tape (c'.head + (i.val : ℤ)) = 1) ∧
c'.tape (c'.head + (n : ℤ)) = 0 ∧
(∀ i j : Fin n,
c'.tape (c'.head + ((n + 1 + i.val * n + j.val : ℕ) : ℤ)) =
if (∀ k : Fin V, inc i k → inc j k) then (1 : ℝ) else 0) ∧
(∀ z : ℤ, z < c'.head → c'.tape z = source z)) := 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)