lean4-htt/tests/lean/run/1663.lean
2017-06-12 19:45:01 -07:00

16 lines
616 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.

inductive statement : Type
| Sswitch : list (option × statement) → statement
open statement
mutual def find_label, find_label_ls
with find_label : statement → nat → option (statement × nat)
| (Sswitch sl) := λ k, find_label_ls sl k
with find_label_ls : list (option × statement) → nat → option (statement × nat)
| [] := λk, none
| ((_, s) :: sl') := λk, find_label s k <|> find_label_ls sl' k
example : find_label_ls [] = λ k, none :=
by simp [find_label_ls]
example (n s sl) : find_label_ls ((n, s)::sl) = λ k, find_label s k <|> find_label_ls sl k :=
by simp [find_label_ls]