Inductive color : Set := Red | Black | Green. Print color. Inductive rb : color -> Prop := | rbR : rb Red | rbB : rb Black. Definition rbf c : bool := match c with | Red => true | Black => true | _ => false end. Lemma rb_rbf_by_destruct_inv : forall c, rb c -> rbf c = true. Proof. intros c r. destruct c; simpl; try reflexivity. inversion r. Qed. Lemma rb_rbf_by_case : forall c, rb c -> rbf c = true. Proof. intros c r. revert r. case c; simpl; try reflexivity. intro r. inversion r. Qed. (* The right way! *) Lemma rb_rbf_by_clever_case : forall c, rb c -> rbf c = true. Proof. intros c r. case r; reflexivity. Qed. Print rb_rbf_by_clever_case. Print rb_rbf_by_case. Inductive isred : color -> Prop := | rr : isred Red. Lemma isred_rbf : forall c, isred c -> rbf c = true. Proof. intros c i. case i. reflexivity. Qed. Section to_be_some_color. Variable x: color. Inductive isx : color -> Prop := | ix : isx x. Variable P : color -> Prop. Hypothesis px : P x. Lemma isx_P : forall c, isx c -> P c. Proof. intros c i. case i. assumption. Qed. End to_be_some_color. Print isx_P. Print eq_ind. Print eq.