lean2/tests/lean/run/724.lean
2015-07-06 15:19:19 -07:00

18 lines
539 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.

import data.list
open list bool nat
definition filter {A} : list A → (A → bool) → list A
| filter [] p := []
| filter (a :: l) p :=
match p a with
| tt := a :: filter l p
| ff := filter l p
end
example : list := filter [0, 3, 7, 2, 4, 6, 3, 4]
(λ(n : ), begin induction n, exact tt, induction v_0, exact tt, exact ff end)
definition foo : list := filter [0, 3, 7, 2, 4, 6, 3, 4]
(λ(n : ), begin induction n, exact tt, induction v_0, exact tt, exact ff end)
example : foo = [0, 2, 4, 6, 4] := rfl