I have the following goals:
f : bool -> bool
b : bool
H1 : f true = true
H2 : f true = false
H3 : f false = false
============================
false = true
Now using H1 and H2, I want to prove the goal using contradiction. I know about inversion
tactic, but I don't think I can apply it here. Any idea on how to proceed from here ?
This is the fully reproducible code where you can get the above goals:
Theorem bool_fn_applied_thrice :
forall (f : bool -> bool) (b : bool),
f (f (f b)) = f b.
Proof.
intros f b.
destruct (f b) eqn:H1.
- destruct (f true) eqn:H2.
+ rewrite -> H2.
reflexivity.
+ destruct (f false) eqn:H3.
* reflexivity.
* destruct b in H1.
{
}
Also would be interested to know if there is an simpler way of solving the above theorem than the above approach (Just the hints. One another way of approaching is using destruct on b
initially which actually proves the theorem after 5 usage of destructs).