(* Copyright (c) 2008-2012, Adam Chlipala
*
* This work is licensed under a
* Creative Commons Attribution-Noncommercial-No Derivative Works 3.0
* Unported License.
* The license text is available at:
* http://creativecommons.org/licenses/by-nc-nd/3.0/
*)
(*
The plan:
* show why Prop is a good name
* show how to prove things about propositions -- introduce
the constructor, split, destruct, tauto, intuition, exists, firstorder,
inversion tactics
* propositions about equality!
* propositions that hide equality... + gotchas
* recursive Props
*)
Require Import CpdtTactics.
Set Implicit Arguments.
(** * Propositional Logic *)
(* Terms of propositional logic:
P, Q, R := True | False
| P /\ Q
| P \/ Q
| P -> Q
| ~P
| x
| forall x. P
| exists x. P
Let's show that Prop is a good name by showing how these terms appear there.
*)
Inductive True : Prop := I.
Inductive False : Prop :=.
Inductive and (P Q : Prop) : Prop :=
conj : P -> Q -> and P Q.
Inductive or (P Q : Prop) : Prop :=
| or_introl : P -> or P Q
| or_intror : Q -> or P Q.
Definition not (P : Prop) := P -> False.
(* forall is built-in *)
Inductive ex (A : Type) (P : A -> Prop) : Prop :=
ex_intro : forall x : A, P x -> ex P.
Notation "P /\ Q" := (and P Q).
Notation "P \/ Q" := (or P Q).
(* approximately: Notation "P -> Q" := forall x : P, Q. *)
Notation "~ P" := (not P).
Notation "'exists' x , p" := (ex (fun x => p)) (at level 200, x ident, right associativity) : type_scope.
Notation "'exists' x : t , p" := (ex (fun x:t => p)) (at level 200, x ident, right associativity) : type_scope.