rel_tac is a tactic used for synthesizing a well founded relation. The default implementation just uses type class resolution. More sophisticated strategies may need to access the set of recursive equations. This commit addresses this need.
21 lines
487 B
Text
21 lines
487 B
Text
mutual def even, odd
|
|
with even : nat → bool
|
|
| 0 := tt
|
|
| (a+1) := odd a
|
|
with odd : nat → bool
|
|
| 0 := ff
|
|
| (a+1) := even a
|
|
using_well_founded {rel_tac := λ f eqns, tactic.trace f >> tactic.trace eqns >> tactic.apply_instance}
|
|
|
|
example (a : nat) : even (a + 1) = odd a :=
|
|
by simp [even]
|
|
|
|
example (a : nat) : odd (a + 1) = even a :=
|
|
by simp [odd]
|
|
|
|
lemma even_eq_not_odd : ∀ a, even a = bnot (odd a) :=
|
|
begin
|
|
intro a, induction a,
|
|
simp [even, odd],
|
|
simph [even, odd]
|
|
end
|