lean4-htt/tests/lean/run/simp7.lean
Leonardo de Moura 5e24da0c2e fix: simp argument issue
See new test.
2021-02-16 13:12:57 -08:00

33 lines
699 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.

def f (x : α) := x
theorem ex1 (a : α) (b : List α) : f (a::b = []) = False :=
by simp [f]
def length : List α → Nat
| [] => 0
| a::as => length as + 1
theorem ex2 (a b c : α) (as : List α) : length (a :: b :: as) > length as := by
simp [length]
apply Nat.lt.step
apply Nat.ltSuccSelf
def fact : Nat → Nat
| 0 => 1
| x+1 => (x+1) * fact x
theorem ex3 : fact x > 0 := by
induction x with
| zero => rfl
| succ x ih =>
simp [fact]
apply Nat.mulPos
apply Nat.zeroLtSucc
apply ih
def head [Inhabited α] : List αα
| [] => arbitrary
| a::_ => a
theorem ex [Inhabited α] (a : α) (as : List α) : head (a::as) = a :=
by simp [head]