]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/nlibrary/Plogic/connectives.ma
Previous patch improved: we now use an ad-hoc wrapper for Grammar.parsable
[helm.git] / matita / matita / nlibrary / Plogic / connectives.ma
1 (**************************************************************************)
2 (*       ___                                                                *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||       A.Asperti, C.Sacerdoti Coen,                          *)
8 (*      ||A||       E.Tassi, S.Zacchiroli                                 *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU Lesser General Public License Version 2.1         *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "Plogic/equality.ma".
16
17 inductive True: Prop ≝  
18 I : True.
19
20 inductive False: Prop ≝ .
21
22 (*
23 ndefinition Not: Prop → Prop ≝
24 λA. A → False. *)
25
26 inductive Not (A:Prop): Prop ≝
27 nmk: (A → False) → Not A.
28
29 interpretation "logical not" 'not x = (Not x).
30
31 theorem absurd : ∀ A:Prop. A → ¬A → False.
32 #A  #H  #Hn  elim Hn /2/  qed.
33
34 (*
35 ntheorem absurd : ∀ A,C:Prop. A → ¬A → C.
36 #A  #C  #H  #Hn  nelim (Hn H).
37 nqed. *)
38
39 theorem not_to_not : ∀A,B:Prop. (A → B) → ¬B →¬A.
40 /4/  qed.
41
42 inductive And (A,B:Prop) : Prop ≝
43     conj : A → B → And A B.
44
45 interpretation "logical and" 'and x y = (And x y).
46
47 theorem proj1: ∀A,B:Prop. A ∧ B → A.
48 #A  #B  #AB  elim AB  //.
49 qed.
50
51 theorem proj2: ∀ A,B:Prop. A ∧ B → B.
52 #A  #B  #AB  elim AB  //.
53 qed.
54
55 inductive Or (A,B:Prop) : Prop ≝
56      or_introl : A → (Or A B)
57    | or_intror : B → (Or A B).
58
59 interpretation "logical or" 'or x y = (Or x y).
60
61 definition decidable : Prop → Prop ≝ 
62 λ A:Prop. A ∨ ¬ A.
63
64 inductive ex (A:Type[0]) (P:A → Prop) : Prop ≝
65     ex_intro: ∀ x:A. P x →  ex A P.
66     
67 interpretation "exists" 'exists x = (ex ? x).
68
69 inductive ex2 (A:Type[0]) (P,Q:A \to Prop) : Prop ≝
70     ex_intro2: ∀ x:A. P x → Q x → ex2 A P Q.
71
72 definition iff :=
73  λ A,B. (A → B) ∧ (B → A).
74
75 interpretation "iff" 'iff a b = (iff a b).