File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ def vector_sum {w n : Nat} (v : Vector (BitVec w) n) : BitVec w :=
9898theorem extract_drop {w n x : Nat} (v : Vector (BitVec w) (n)) (h : x < n) :
9999 (v.extract x)[0 ] = v[x] := by simp
100100
101- -- Main correctness theorem for N:2 compressor chain.
101+ /-- Main correctness theorem for N:2 compressor chain.
102+ For a vector of BitVectors, the compressor chain reduces it to a pair (s,t)
103+ such that the sum of all elements in the vector equals s + t <<< 1. -/
102104theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
103105 let ⟨s, t⟩ := chain v
104106 vector_sum v = s + t <<< 1 := by
@@ -117,7 +119,7 @@ theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
117119 simp
118120 | 2 =>
119121 simp [chain, vector_sum, carrySave]
120- erw [extract_drop (h := by omega), extract_drop (h := by omega)]
122+ repeat erw [extract_drop (h := by omega)]
121123 rw [carrySaveAdder]
122124 grind
123125 | n + 3 =>
You can’t perform that action at this time.
0 commit comments