Ray-machine code relocation and -step ambient planar-section query adapter
ProvedGrunbaum2003.rayMachine_relocate_and_section_query_adaptercombinatoricsconvex-geometryconvex-polytopes
This theorem establishes two foundational machine-level building blocks for executing higher-dimensional Gritzmann–Klee–Westwater ray-oracle protocols on rayMachineRun:
- Instruction relocation (
RayCode.relocated_run,RayCode.relocated_halt): Shifting every control-flow target in a programprogram : List RayInstructionbypre.length(relocateInstruction pre.length) commutes exactly withrayMachineStepandrayMachineRununderrelocateConfiguration pre.length(which shiftspcbypre.lengthwhile preservinghead,tape, andqueries), and preserves halting states. - Physical planar-section query adapter (
RaySectionProgram.sectionQueryProgram_correct): For any ambient dimension and distinct coordinate indices in , there exists an explicit instruction listprogof length that, starting atpc = 0, head = 0with step size , anchor point (), and nonzero planar ray direction :- halts in steps with
head = 0andqueries = q + 1; - queries the ambient ray oracle on the embedded direction and stores the full ambient reply in cells ();
- writes the exact left-inverse planar coordinates back into cells and ; and
- preserves all other tape cells outside , the query block , and the scratch cell .
- halts in steps with
Formalization Note Because the planar secant detector operates on cells , placing the anchor point at , the physical query block at , and the scratch cell at guarantees zero tape interference with the native 2D controller.
Preamble
import Definitions.Def_Grunbaum2003_RayInstruction import Definitions.Def_Grunbaum2003_RayConfiguration import Definitions.Def_Grunbaum2003_rayMachineStep import Definitions.Def_Grunbaum2003_rayMachineRun import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Data.List.OfFn import Mathlib.Tactic.FinCases set_option autoImplicit false
Formal statement
namespace Grunbaum2003
theorem rayMachine_relocate_and_section_query_adapter :
(∃ (relocateInst : ℕ → RayInstruction → RayInstruction)
(relocateCfg : ℕ → RayConfiguration → RayConfiguration),
∀ (d : ℕ) (pre program : List RayInstruction)
(oracle : (Fin d → ℝ) → (Fin d → ℝ)) (t : ℕ) (c : RayConfiguration),
(relocateCfg pre.length c).pc = pre.length + c.pc ∧
(relocateCfg pre.length c).head = c.head ∧
(relocateCfg pre.length c).tape = c.tape ∧
(relocateCfg pre.length c).queries = c.queries ∧
rayMachineRun (pre ++ program.map (relocateInst pre.length)) oracle t
(relocateCfg pre.length c) =
(rayMachineRun program oracle t c).map (relocateCfg pre.length) ∧
(program[c.pc]? = some .halt →
(pre ++ program.map (relocateInst pre.length))[
(relocateCfg pre.length c).pc]? = some .halt)) ∧
(∀ (d : ℕ) (i j : Fin d), i ≠ j →
∃ prog : List RayInstruction,
prog.length = d + 10 ∧
∀ (oracle : (Fin d → ℝ) → Fin d → ℝ) (tape : ℤ → ℝ) (q : ℕ),
tape 17 ≠ 0 →
tape (18 + (j.val : ℤ)) ≠ 0 →
(fun k : Fin 2 => if k = 0 then tape 0 else tape 1) ≠ 0 →
∃ c : RayConfiguration,
rayMachineRun prog oracle (d + 9)
{pc := 0, head := 0, tape := tape, queries := q} = some c ∧
prog[c.pc]? = some .halt ∧
c.head = 0 ∧ c.queries = q + 1 ∧
(∀ k : Fin 2, c.tape (k.val : ℤ) =
let p : Fin d → ℝ := fun m => tape (18 + (m.val : ℤ))
let y : Fin d → ℝ := oracle (fun m =>
(if m = i then tape 17 * tape 0 else 0) + tape 1 * p m)
if k = 0 then (y i - (y j / p j) * p i) / tape 17 else y j / p j) ∧
(∀ k : Fin d, c.tape (18 + (d : ℤ) + (k.val : ℤ)) =
oracle (fun m =>
(if m = i then tape 17 * tape 0 else 0) +
tape 1 * tape (18 + (m.val : ℤ))) k) ∧
(∀ z : ℤ, z ≠ 0 → z ≠ 1 →
(z < 18 + (d : ℤ) ∨ 18 + (d : ℤ) + (d : ℤ) ≤ z) →
z ≠ 18 + 2 * (d : ℤ) → c.tape z = tape 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)