fix(tests/lean): adjusts tests
This commit is contained in:
parent
415ca2b93f
commit
efc33a2f1d
3 changed files with 13 additions and 5 deletions
|
@ -10,7 +10,7 @@ begin
|
||||||
cases h₁, apply rfl
|
cases h₁, apply rfl
|
||||||
end
|
end
|
||||||
|
|
||||||
theorem congr {A B : Type} (f : A → B) {a₁ a₂ : A} (h : a₁ = a₂) : f a₁ = f a₂ :=
|
theorem congr2 {A B : Type} (f : A → B) {a₁ a₂ : A} (h : a₁ = a₂) : f a₁ = f a₂ :=
|
||||||
begin
|
begin
|
||||||
cases h, apply rfl
|
cases h, apply rfl
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
import data.vector
|
open nat
|
||||||
open nat vector
|
|
||||||
|
inductive vector (A : Type) : nat → Type :=
|
||||||
|
| nil {} : vector A zero
|
||||||
|
| cons : Π {n}, A → vector A n → vector A (succ n)
|
||||||
|
|
||||||
|
open vector
|
||||||
|
notation a :: b := cons a b
|
||||||
|
notation `[` l:(foldr `,` (h t, cons h t) nil `]`) := l
|
||||||
|
|
||||||
|
|
||||||
example (a b : nat) : succ a = succ b → a + 2 = b + 2 :=
|
example (a b : nat) : succ a = succ b → a + 2 = b + 2 :=
|
||||||
begin
|
begin
|
||||||
|
@ -11,7 +19,7 @@ end
|
||||||
example (A : Type) (n : nat) (v w : vector A n) (a : A) (b : A) :
|
example (A : Type) (n : nat) (v w : vector A n) (a : A) (b : A) :
|
||||||
a :: v = b :: w → b = a :=
|
a :: v = b :: w → b = a :=
|
||||||
begin
|
begin
|
||||||
intro H, injection H with aeqb neqn beqw,
|
intro H, injection H with neqn aeqb beqw,
|
||||||
rewrite aeqb
|
rewrite aeqb
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ constant f : A → A → A
|
||||||
|
|
||||||
theorem tst {a b c : A} (H1 : a = b) (H2 : b = c) : f a b = f b c :=
|
theorem tst {a b c : A} (H1 : a = b) (H2 : b = c) : f a b = f b c :=
|
||||||
begin
|
begin
|
||||||
apply (@congr A A _ _ (f a) (f b)),
|
apply (@congr A A (f a) (f b)),
|
||||||
assumption,
|
assumption,
|
||||||
apply (congr_arg f),
|
apply (congr_arg f),
|
||||||
assumption
|
assumption
|
||||||
|
|
Loading…
Reference in a new issue