@[simp]theoremblockIndex_val {vertices : Nat} (d n : Nat) (v : Fin vertices)
(j : Fin (blockSize d n)) :
(blockIndex d n v j).val = blockSize d n * v.val + j.val :=by
proof · 2
lines
change j.val + blockSize d n * v.val = blockSize d n * v.val + j.val
exact Nat.add_comm _ _
theoremblockIndex_eq_encodeDart {vertices : Nat} (d n : Nat) (v : Fin vertices)
(p : Fin (n + 1) →Fin d) (direction : Bool) :
blockIndex d n v (dartBlockEquiv d n (p, direction)) =
encodeDart vertices d n (direction, (v, p)) :=by
proof · 6
lines
apply Fin.ext
change (dartBlockEquiv d n (p, direction)).val + blockSize d n * v.val =
(dartEquiv vertices d n (direction, (v, p))).val
rw [dartEquiv_val, dartBlockEquiv_val]
unfold blockSize
omega
defvertexRows {vertices d : Nat} (input : PortTables.Table vertices d) (n : Nat)
(v : Fin vertices) :
List (GenericGraphTables.DartRow (labelCount d n) vertices (dartCount vertices d n)) :=
body · 1
line
List.ofFn (funj : Fin (blockSize d n) => (table input n).rows[blockIndex d n v j])
@[simp]theoremvertexRows_length {vertices d : Nat}
(input : PortTables.Table vertices d) (n : Nat) (v : Fin vertices) :
(vertexRows input n v).length = blockSize d n :=by
theoremvertexRowWords_length {vertices d : Nat} (input : PortTables.Table vertices d)
(n : Nat) (v : Fin vertices) :
(vertexRowWords input n v).length =
(labelCount d n * labelCount d n + 2) * blockSize d n :=by
theoremvertexRowBits_length_ge {vertices d : Nat} (input : PortTables.Table vertices d)
(n : Nat) (v : Fin vertices) :
(labelCount d n * labelCount d n + 2) * blockSize d n ≤
(vertexRowBits input n v).length :=by
theoremvertexRowBits_length_le {vertices d : Nat} (input : PortTables.Table vertices d)
(n : Nat) (v : Fin vertices) :
(vertexRowBits input n v).length ≤
blockSize d n *
(vertices + dartCount vertices d n + 2 * (labelCount d n * labelCount d n)) :=by
proof · 3
lines
have h :=GenericGraphTables.rowsBits_length_le (vertexRows input n v)
rw [vertexRows_length] at h
exact h