]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/Plogic/connectives.ma
d840143e3835ca29080b6b51eb0542690a84762f
[helm.git] / helm / software / 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 ninductive True: Prop ≝  
18 I : True.
19
20 default "true" cic:/matita/basics/connectives/True.ind.
21
22 ninductive False: Prop ≝ .
23
24 default "false" cic:/matita/basics/connectives/False.ind.
25
26 ndefinition Not: Prop → Prop ≝
27 λA. A → False.
28
29 interpretation "logical not" 'not x = (Not x).
30
31 ntheorem absurd : ∀ A,C:Prop. A → ¬A → C.
32 #A; #C; #H; #Hn; nelim (Hn H).
33 nqed.
34
35 ntheorem not_to_not : ∀A,B:Prop. (A → B) → ¬B →¬A.
36 /3/.
37 nqed.
38
39 ninductive And (A,B:Prop) : Prop ≝
40     conj : A → B → And A B.
41
42 interpretation "logical and" 'and x y = (And x y).
43
44 ntheorem proj1: ∀A,B:Prop. A ∧ B → A.
45 #A; #B; #AB; nelim AB; //.
46 nqed.
47
48 ntheorem proj2: ∀ A,B:Prop. A ∧ B → B.
49 #A; #B; #AB; nelim AB; //.
50 nqed.
51
52 ninductive Or (A,B:Prop) : Prop ≝
53      or_introl : A → (Or A B)
54    | or_intror : B → (Or A B).
55
56 interpretation "logical or" 'or x y = (Or x y).
57
58 ndefinition decidable : Prop → Prop ≝ 
59 λ A:Prop. A ∨ ¬ A.
60
61 ninductive ex (A:Type[0]) (P:A → Prop) : Prop ≝
62     ex_intro: ∀ x:A. P x →  ex A P.
63     
64 interpretation "exists" 'exists x = (ex ? x).
65
66 ninductive ex2 (A:Type[0]) (P,Q:A \to Prop) : Prop ≝
67     ex_intro2: ∀ x:A. P x → Q x → ex2 A P Q.
68
69 ndefinition iff :=
70  λ A,B. (A → B) ∧ (B → A).