This feature is needed when we declare an inductive predicate/type which is indexed by a mutual and/or nested inductive datatype. See tests/lean/run/term_pred.lean for an example. @Armael: this commit should fix the issue with the `cases` tactic that you reported today.
25 lines
599 B
Text
25 lines
599 B
Text
inductive term
|
|
| app : string → list term → term
|
|
| var : string → term
|
|
|
|
inductive bin_only : term → Prop
|
|
| leaf : ∀ x, bin_only (term.var x)
|
|
| bin_app : ∀ op a b, bin_only a → bin_only b → bin_only (term.app op [a, b])
|
|
|
|
example (op : string) (a : term) : ¬ bin_only (term.app op [a]) :=
|
|
begin
|
|
intro h,
|
|
cases h
|
|
end
|
|
|
|
example (op : string) (a b : term) (H : bin_only (term.app op [a, b])) : bin_only a :=
|
|
begin
|
|
cases H,
|
|
assumption
|
|
end
|
|
|
|
example (op : string) (a b : term) (H : bin_only (term.app op [a, b])) : bin_only b :=
|
|
begin
|
|
cases H with _ _ _ _ H1 H2,
|
|
exact H2
|
|
end
|