]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/logic/connectives.ma
nasty change in the lexer/parser:
[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 inductive And (A,B:Prop) : Prop \def
36     conj : A \to B \to (And A B).
37
38 interpretation "logical and" 'and x y = (And x y).
39
40 theorem proj1: \forall A,B:Prop. A \land B \to A.
41 intros. elim H. assumption.
42 qed.
43
44 theorem proj2: \forall A,B:Prop. A \land B \to B.
45 intros. elim H. assumption.
46 qed.
47
48 inductive Or (A,B:Prop) : Prop \def
49      or_introl : A \to (Or A B)
50    | or_intror : B \to (Or A B).
51
52 interpretation "logical or" 'or x y = (Or x y).
53
54 theorem Or_ind':
55  \forall A,B:Prop.
56   \forall P: A \lor B \to Prop.
57    (\forall p:A. P (or_introl ? ? p)) \to
58    (\forall q:B. P (or_intror ? ? q)) \to
59     \forall p:A \lor B. P p.
60  intros.
61  apply
62   (match p return \lambda p.P p with
63     [(or_introl p) \Rightarrow H p
64     |(or_intror q) \Rightarrow H1 q]).
65 qed.
66
67 definition decidable : Prop \to Prop \def \lambda A:Prop. A \lor \lnot A.
68
69 inductive ex (A:Type) (P:A \to Prop) : Prop \def
70     ex_intro: \forall x:A. P x \to ex A P.
71
72 interpretation "exists" 'exists x = (ex ? x).
73
74 inductive ex2 (A:Type) (P,Q:A \to Prop) : Prop \def
75     ex_intro2: \forall x:A. P x \to Q x \to ex2 A P Q.
76
77 definition iff :=
78  \lambda A,B. (A -> B) \land (B -> A).