import OAI.Computability.SpaceSimulation.Epoch.Core import OAI.Computability.SpaceSimulation.Evaluation.Circuit namespace OAI /-! Lay out the implicit word graph in flat (epoch,column) order. -/ namespace Fifths namespace Tour open Radix Bin Circuit variable (D : Tour) /-- First N array columns, then start and k round history columns. -/ def stride := D.N+D.k+1 def total := D.E*D.stride abbrev Vertex := Fin D.total theorem stride_pos : 0 < D.stride := Nat.zero_lt_succ _ theorem total_pos : 0 < D.total := Nat.mul_pos (Nat.zero_lt_succ _) D.stride_pos def epoch (v : D.Vertex) := v.val / D.stride def col (v : D.Vertex) := v.val % D.stride def mkV (e j : ℕ) : D.Vertex := ⟨(e*D.stride + j) % D.total,Nat.mod_lt _ D.total_pos⟩ def hV (e j : ℕ) := D.mkV e (D.N+j) theorem epoch_lt (v : D.Vertex) : D.epoch v < D.E := (Nat.div_lt_iff_lt_mul D.stride_pos).mpr v.isLt theorem col_lt (v : D.Vertex) : D.col v < D.stride := Nat.mod_lt _ D.stride_pos theorem re_V (v : D.Vertex) : D.mkV (D.epoch v) (D.col v) = v := by apply Fin.ext have e := Nat.mod_add_div v.val D.stride unfold mkV epoch col dsimp rw [mul_comm,add_comm,e,Nat.mod_eq_of_lt v.isLt] theorem mkV_val {e j : ℕ} (p : e