lean4-htt/tests/lean/run/inj1.lean
Leonardo de Moura 36cc7c23b6 fix: fixes #1886
2022-11-28 06:50:44 -08:00

41 lines
978 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

theorem test1 {α} (a b : α) (as bs : List α) (h : a::as = b::bs) : a = b :=
by {
injection h
}
theorem test2 {α} (a b : α) (f : αα) (as bs : List α) (h : a::as = b::bs) : f a = f b :=
by {
injection h with h1 h2;
rw [h1]
}
theorem test3 {α} (a b : α) (f : List α → List α) (as bs : List α) (h : (x : List α) → (y : List α) → x = y) : f as = f bs :=
have : a::as = b::bs := h (a::as) (b::bs);
by {
injection this with h1 h2;
rw [h2]
}
theorem test4 {α} (a b : α) (f : List α → List α) (as bs : List α) (h : (x : List α) → (y : List α) → x = y) : f as = f bs :=
by {
injection h (a::as) (b::bs) with h1 h2;
rw [h2]
}
theorem test5 {α} (a : α) (as : List α) (h : a::as = []) : 0 > 1 :=
by {
injection h
}
theorem test6 (n : Nat) (h : n+1 = 0) : 0 > 1 :=
by {
injection h
}
theorem test7 (n m k : Nat) (h : n + 1 = m + 1) : m = k → n = k :=
by {
injection h with h₁;
subst h₁;
intro h₂;
exact h₂
}