Require Import Arith. Inductive color : Type := | Red: color | Blue: color | Dark (c:color): color | Light (c:color): color. Fixpoint isred (c:color) : bool := match c with | Red => true | Blue => false | Dark x => isred x | Light x => isred x end. Fixpoint isblue (c:color) : bool := match c with | Red => false | Blue => true | Dark x => isblue x | Light x => isblue x end. Compute isred (Dark (Light (Dark (Dark Blue)))). Compute isblue (Dark (Light (Dark (Dark Blue)))). Compute 1 =? 1. Theorem redblue_dichotomy: forall c, isblue c = negb (isred c). Proof. intro. induction c. simpl. reflexivity. simpl. reflexivity. simpl. assumption. simpl. assumption. Qed. Print nat. Print "=?". Print "=". Print true. Check true. Check True. Print True. (* Compute if 1 = 1 then true else false. <-- ERROR *) Definition zilch (n:nat) := (n = 0). Check zilch. Compute zilch 0. Compute zilch 1. Theorem zilch_onlyzero: forall n, zilch n -> n=0. Proof. intros. destruct n. reflexivity. discriminate H. Qed. Theorem zilch_twice: forall x y, zilch (x+y) -> x+y = 0. Proof. intros. destruct (x+y). reflexivity. discriminate H. Qed.