mk_iff_of_inductive_prop #
This file defines a tactic tactic.mk_iff_of_inductive_prop that generates iff rules for
inductive Props. For example, when applied to list.chain, it creates a declaration with
the following type:
∀{α : Type*} (R : α → α → Prop) (a : α) (l : list α),
chain R a l ↔ l = [] ∨ ∃{b : α} {l' : list α}, R a b ∧ chain R b l ∧ l = b :: l'
This tactic can be called using either the mk_iff_of_inductive_prop user command or
the mk_iff attribute.
Iterate over two lists, if the first element of the first list is none, insert none into the
result and continue with the tail of first list. Otherwise, wrap the first element of the second
list with some and continue with the tails of both lists. Return when either list is empty.
Example:
list_option_merge [none, some (), none, some ()] [0, 1, 2, 3, 4] = [none, (some 0), none, (some 1)]
Equations
- mk_iff.list_option_merge (some _x :: xs) (y :: ys) = some y :: mk_iff.list_option_merge xs ys
- mk_iff.list_option_merge (some _x :: xs) list.nil = list.nil
- mk_iff.list_option_merge (none :: xs) ys = none :: mk_iff.list_option_merge xs ys
- mk_iff.list_option_merge list.nil _x = list.nil