]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/logic/connectives.ma
ba229870fbca66c1a860268d30dc9e0e0301b137
[helm.git] / helm / software / matita / library / logic / 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 inductive True: Prop \def
16 I : True.
17
18 default "true" cic:/matita/logic/connectives/True.ind.
19
20 inductive False: Prop \def .
21
22 default "false" cic:/matita/logic/connectives/False.ind.
23
24 definition Not: Prop \to Prop \def
25 \lambda A. (A \to False).
26
27 (*CSC: the URI must disappear: there is a bug now *)
28 interpretation "logical not" 'not x = (cic:/matita/logic/connectives/Not.con x).
29
30 theorem absurd : \forall A,C:Prop. A \to \lnot A \to C.
31 intros. elim (H1 H).
32 qed.
33
34 default "absurd" cic:/matita/logic/connectives/absurd.con.
35
36 inductive And (A,B:Prop) : Prop \def
37     conj : A \to B \to (And A B).
38
39 (*CSC: the URI must disappear: there is a bug now *)
40 interpretation "logical and" 'and x y = (cic:/matita/logic/connectives/And.ind#xpointer(1/1) x y).
41
42 theorem proj1: \forall A,B:Prop. A \land B \to A.
43 intros. elim H. assumption.
44 qed.
45
46 theorem proj2: \forall A,B:Prop. A \land B \to B.
47 intros. elim H. assumption.
48 qed.
49
50 inductive Or (A,B:Prop) : Prop \def
51      or_introl : A \to (Or A B)
52    | or_intror : B \to (Or A B).
53
54 (*CSC: the URI must disappear: there is a bug now *)
55 interpretation "logical or" 'or x y =
56   (cic:/matita/logic/connectives/Or.ind#xpointer(1/1) x y).
57
58 theorem Or_ind':
59  \forall A,B:Prop.
60   \forall P: A \lor B \to Prop.
61    (\forall p:A. P (or_introl ? ? p)) \to
62    (\forall q:B. P (or_intror ? ? q)) \to
63     \forall p:A \lor B. P p.
64  intros.
65  apply
66   (match p return \lambda p.P p with
67     [(or_introl p) \Rightarrow H p
68     |(or_intror q) \Rightarrow H1 q]).
69 qed.
70
71 definition decidable : Prop \to Prop \def \lambda A:Prop. A \lor \lnot A.
72
73 inductive ex (A:Type) (P:A \to Prop) : Prop \def
74     ex_intro: \forall x:A. P x \to ex A P.
75
76 (*CSC: the URI must disappear: there is a bug now *)
77 interpretation "exists" 'exists \eta.x =
78   (cic:/matita/logic/connectives/ex.ind#xpointer(1/1) _ x).
79
80 inductive ex2 (A:Type) (P,Q:A \to Prop) : Prop \def
81     ex_intro2: \forall x:A. P x \to Q x \to ex2 A P Q.
82
83 definition iff :=
84  \lambda A,B. (A -> B) \land (B -> A).