I'm trying to prove the following, and I think I have the right approach to solving by enumerating all the cases for b
and all the single argument boolean functions f
(should be 4 functions over 2 boolean values), proving the point by exhaustively destructing everything.
Theorem example :
forall (f : bool -> bool) (b : bool),
f (f b) = b.
Proof.
intros.
destruct (f (f b)).
- destruct b.
+ reflexivity.
+ Fail discriminate. admit.
- destruct b eqn:Hqebb.
+ Fail discriminate. admit.
+ reflexivity.
Qed.
However, when I try to discriminate on the 2nd and 3rd steps, on false = true
I get the following error:
Ltac call to "discriminate" failed.
No primitive equality found.
I've used discriminate before with inductive types and it worked as expected, so I was surprised it didn't work here with boolean types. Any ideas why?