How can I in coq, prove that a function f that accepts a bool true|false and returns a bool true|false (shown below), when applied twi
A tad shorter proof:
Require Import Sumbool.
Goal forall (f : bool -> bool) (b:bool), f (f (f b)) = f b.
Proof.
destruct b; (* case analysis on [b] *)
destruct (sumbool_of_bool (f true)); (* case analysis on [f true] *)
destruct (sumbool_of_bool (f false)); (* case analysis on [f false] *)
congruence. (* equational reasoning *)
Qed.