Booleans


Inductive bool := true | false.

Definition neg b := match b with
  true => false
| false => true
end.

Example E1: neg(neg true)=neg false.

Proof. simpl. reflexivity. Qed.

Example E2: neg(neg true)=neg false.

Proof. trivial. Qed.

Example E3 : forall x, neg(neg x)=x.

Proof. induction x. trivial. trivial. Qed.

Example E4: forall x, neg x = neg(neg(neg x)).

Proof. intros x. rewrite E3. trivial. Qed.

Example E5: forall x y, neg(neg x)=y -> y=x.

Proof. intros x y. rewrite E3. intros H. rewrite H. trivial. Qed.

Example E6: false=true -> False.

Proof. intros H. inversion H. Qed.

Example E7: forall x, neg x=x -> False.

Proof. induction x.
simpl. intros H. inversion H.
simpl. intros H. inversion H.
Qed.


This page has been generated by coqdoc