]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/logic/connectives.ma
Preparing for 0.5.9 release.
[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 interpretation "logical not" 'not x = (Not x).
28
29 theorem absurd : \forall A,C:Prop. A \to \lnot A \to C.
30 intros. elim (H1 H).
31 qed.
32
33 default "absurd" cic:/matita/logic/connectives/absurd.con.
34
35 theorem not_to_not : \forall A,B:Prop. (A → B) \to ¬B →¬A.
36 intros.unfold.intro.apply H1.apply (H H2).
37 qed.
38
39 default "absurd" cic:/matita/logic/connectives/absurd.con.
40
41 inductive And (A,B:Prop) : Prop \def
42     conj : A \to B \to (And A B).
43
44 interpretation "logical and" 'and x y = (And x y).
45
46 theorem proj1: \forall A,B:Prop. A \land B \to A.
47 intros. elim H. assumption.
48 qed.
49
50 theorem proj2: \forall A,B:Prop. A \land B \to B.
51 intros. elim H. assumption.
52 qed.
53
54 inductive Or (A,B:Prop) : Prop \def
55      or_introl : A \to (Or A B)
56    | or_intror : B \to (Or A B).
57
58 interpretation "logical or" 'or x y = (Or x y).
59
60 theorem Or_ind':
61  \forall A,B:Prop.
62   \forall P: A \lor B \to Prop.
63    (\forall p:A. P (or_introl ? ? p)) \to
64    (\forall q:B. P (or_intror ? ? q)) \to
65     \forall p:A \lor B. P p.
66  intros.
67  apply
68   (match p return \lambda p.P p with
69     [(or_introl p) \Rightarrow H p
70     |(or_intror q) \Rightarrow H1 q]).
71 qed.
72
73 definition decidable : Prop \to Prop \def \lambda A:Prop. A \lor \lnot A.
74
75 inductive ex (A:Type) (P:A \to Prop) : Prop \def
76     ex_intro: \forall x:A. P x \to ex A P.
77
78 interpretation "exists" 'exists x = (ex ? 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).