Last active
September 21, 2016 07:42
-
-
Save fluiddynamics/60a4d4683dadef090a3a0685cfaa9a76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Print list. | |
Fixpoint In {A} (a:A) (l:list A) : Prop := | |
match l with | |
| nil => False | |
| cons b m => b = a \/ In a m | |
end. | |
Print nil. | |
Print or. | |
Print eq. | |
Inductive prop1 {atom} : Type : Type := | |
| atom_prop1 : atom -> prop1. | |
Print prop1. | |
Inductive SC_proves1 {atom} : list (@prop1 atom) -> @prop1 atom -> Prop := | |
| SC_init1 Γ P : In P Γ -> SC_proves1 Γ P. | |
Print False. | |
Inductive prop {atom} : Type := | |
| atom_prop : atom -> prop | |
| bot_prop : prop | |
| top_prop : prop | |
| and_prop : prop -> prop -> prop | |
| or_prop : prop -> prop -> prop | |
| impl_prop : prop -> prop -> prop. | |
Definition not_prop {atom} (P : @prop atom) := | |
impl_prop P (bot_prop). | |
Inductive SC_proves {atom} : list (@prop atom) -> @prop atom -> Prop := | |
| SC_init P Γ : In P Γ -> SC_proves Γ P | |
| SC_bot_elim P Γ : In bot_prop Γ -> SC_proves Γ P | |
| SC_top_intro Γ : SC_proves Γ top_prop | |
| SC_and_intro Γ P Q : SC_proves Γ P -> SC_proves Γ Q -> SC_proves Γ (and_prop P Q) | |
| SC_and_elim Γ P Q R : In (and_prop P Q) Γ -> | |
SC_proves (cons P (cons Q Γ)) R -> SC_proves Γ R | |
| SC_or_introl Γ P Q : SC_proves Γ P -> SC_proves Γ (or_prop P Q) | |
| SC_or_intror Γ P Q : SC_proves Γ Q -> SC_proves Γ (or_prop P Q) | |
| SC_or_elim Γ P Q R : In (or_prop P Q) Γ -> SC_proves (cons P Γ) R -> | |
SC_proves (cons Q Γ) R -> SC_proves Γ R | |
| SC_impl_intro Γ P Q : SC_proves (cons P Γ) Q -> SC_proves Γ (impl_prop P Q) | |
| SC_impl_elim Γ P Q R : In (impl_prop P Q) Γ -> SC_proves Γ P -> | |
SC_proves (cons Q Γ) R -> SC_proves Γ R. | |
Theorem PP : forall atom P, @SC_proves atom nil (impl_prop P P). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply SC_init. | |
simpl. apply or_introl. reflexivity. Qed. | |
Theorem and_comm : forall atom P Q, @SC_proves atom nil | |
(impl_prop (and_prop P Q) (and_prop Q P)). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply SC_and_intro. | |
+ apply (SC_and_elim _ P Q _). | |
- simpl. apply or_introl. reflexivity. | |
- apply SC_init. simpl. apply or_intror. apply or_introl. reflexivity. | |
+ apply (SC_and_elim _ P Q _). | |
- simpl. apply or_introl. reflexivity. | |
- apply SC_init. simpl. apply or_introl. reflexivity. | |
Qed. | |
Theorem or_comm : forall atom P Q, @SC_proves atom nil | |
(impl_prop (or_prop P Q) (or_prop Q P)). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply (SC_or_elim (cons (or_prop P Q) nil) P Q (or_prop Q P)). | |
+ simpl. apply or_introl. reflexivity. | |
+ apply SC_or_intror. apply SC_init. simpl. apply or_introl. reflexivity. | |
+ apply SC_or_introl. apply SC_init. simpl. apply or_introl. reflexivity. | |
Qed. | |
Theorem PQP : forall atom P Q, @SC_proves atom nil | |
(impl_prop P (impl_prop Q P)). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply SC_impl_intro. | |
apply SC_init. | |
simpl. apply or_intror. apply or_introl. reflexivity. | |
Qed. | |
Theorem syllogism : forall atom P Q R, @SC_proves atom | |
(cons (impl_prop P Q) (cons (impl_prop Q R) nil)) (impl_prop P R). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply (SC_impl_elim _ P Q R). | |
+ simpl. apply or_intror. apply or_introl. reflexivity. | |
+ apply SC_init. simpl. apply or_introl. reflexivity. | |
+ apply (SC_impl_elim _ Q R R). | |
- simpl. apply or_intror. apply or_intror. apply or_intror. apply or_introl. reflexivity. | |
- apply SC_init. simpl. apply or_introl. reflexivity. | |
- apply SC_init. simpl. apply or_introl. reflexivity. | |
Qed. | |
Theorem exp : forall atom P, @SC_proves atom nil | |
(impl_prop (bot_prop) P). | |
Proof. | |
intros. | |
apply SC_impl_intro. | |
apply SC_bot_elim. | |
simpl. apply or_introl. reflexivity. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment