When a function is defined over pattern matching its argument, I often have to apply cases in a proof.
But when the definition additionally does pattern matching over the components, can I just apply cases over both patterns at once?
For example:
fun my_fun where "my_fun (a, MyType x y) = ..."
To prove a property of my_fun c
I often do
apply (cases c)
subgoal for _ b
apply (cases b)
by simp
Can I just simplify this into one line?
Like this? by (cases rule: my_fun.cases[of c]) simp
Yes exactly like that, thanks!
Last updated: Feb 01 2025 at 20:19 UTC