test(tests/lean/run/blast_vector_test): more tests

This commit is contained in:
Daniel Selsam 2016-01-13 21:05:22 -08:00 committed by Leonardo de Moura
parent 8d49e42ec2
commit 7a005fb76b

View file

@ -32,12 +32,12 @@ definition append {n m : nat} (v : vector A n) (w : vector A m) : vector A (n +
⟨append_aux v w⟩
section
local attribute append [reducible]
theorem append_nil_left [simp] {n : nat} (v : vector A n) : append [] v == v :=
by inst_simp
by unfold append ; inst_simp
theorem append_cons [simp] {n m : nat} (h : A) (t : vector A n) (v : vector A m) : (: append (h::t) v :) == (: h::(append t v) :) :=
by inst_simp
by unfold append ; inst_simp
end
theorem append_nil_right [simp] {n : nat} (v : vector A n) : append v [] == v :=
@ -74,4 +74,23 @@ by rec_inst_simp
theorem reverse_reverse [simp] : ∀ {n : nat} (xs : vector A n), reverse (reverse xs) = xs :=
by rec_inst_simp
theorem append_reverse_cons [simp] {n : nat} (v : vector A n) : ∀ (m : ) (w : vector A m) (a : A),
append v (reverse (cons a w)) == concat (append v (reverse w)) a :=
by induction v; inst_simp; inst_simp
theorem reverse_append [simp] : ∀ {n m : nat} (v : vector A n) (w : vector A m),
reverse (append v w) == append (reverse w) (reverse v) :=
by rec_inst_simp
definition vplus : Π {n : } (v₁ v₂ : vector n), vector n
| nat.zero [] [] := []
| (nat.succ m) (x::xs) (y::ys) := (x + y) :: vplus xs ys
lemma vplus.def1 [simp] : vplus [] [] = @nil := rfl
lemma vplus.def2 [simp] {n : } (v₁ v₂ : vector n) (a₁ a₂ : ) : (: vplus (a₁ :: v₁) (a₂ :: v₂) :) = (a₁ + a₂) :: vplus v₁ v₂ := rfl
lemma vplus_weird {n₁ n₂ : } (v₁ : vector n₁) (v₂ : vector n₂) (a b : ) :
vplus (a :: append v₁ v₂) ⟨b :: append v₂ v₁⟩ == (a + b) :: vplus (append v₁ v₂) ⟨append v₂ v₁⟩ :=
sorry -- TODO need to traverse equivalence class when matching against a meta-variable
end vector