Proving f (f bool) = bool

前端 未结 4 1261
悲&欢浪女
悲&欢浪女 2020-12-30 07:01

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

4条回答
  •  误落风尘
    2020-12-30 07:22

    Goal forall (f:bool -> bool) (b:bool), f (f (f b)) = f b.
    Proof.
    intros.
    remember (f true) as ft.
    remember (f false) as ff.
    destruct ff ; destruct ft ; destruct b ; 
        try rewrite <- Heqft ; try rewrite <- Heqff ; 
        try rewrite <- Heqft ; try rewrite <- Heqff ; auto.
    Qed.
    

提交回复
热议问题