lean4-htt/tests/lean/nested_match.lean
Leonardo de Moura bb9e3ddae2 feat(library/init/meta/interactive): rw [-h] ==> rw [← h]
@Armael: this change may affect your project.

The file `doc/changes.md` explains the motivation for the change.
2017-07-05 11:42:55 -07:00

30 lines
415 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.

namespace ex1
def f :
| n :=
(match n with
| 0 := 0
| (m+1) := f m
end) + 1
def g :
| n :=
(match n, rfl : ∀ m, m = n → with
| 0, h := 0
| (m+1), h :=
have m < n, begin rw [←h], apply nat.lt_succ_self end,
g m
end) + 1
end ex1
namespace ex2
mutual def f, g
with f :
| n := g n + 1
with g :
| 0 := 0
| (n+1) := f n
end ex2