]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/logic/cprop_connectives.ma
Dependencies removed.
[helm.git] / helm / software / matita / library / logic / cprop_connectives.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 inductive Or (A,B:CProp) : CProp ≝
16  | Left : A → Or A B
17  | Right : B → Or A B.
18
19 interpretation "constructive or" 'or x y = (Or x y).
20
21 inductive Or3 (A,B,C:CProp) : CProp ≝
22  | Left3 : A → Or3 A B C
23  | Middle3 : B → Or3 A B C
24  | Right3 : C → Or3 A B C.
25
26 interpretation "constructive ternary or" 'or3 x y z= (Or3 x y z).
27
28 notation < "hvbox(a break ∨ b break ∨ c)" with precedence 35 for @{'or3 $a $b $c}.
29
30 inductive Or4 (A,B,C,D:CProp) : CProp ≝
31  | Left3 : A → Or4 A B C D
32  | Middle3 : B → Or4 A B C D
33  | Right3 : C → Or4 A B C D
34  | Extra3: D → Or4 A B C D.
35
36 interpretation "constructive ternary or" 'or4 x y z t = (Or4 x y z t).
37
38 notation < "hvbox(a break ∨ b break ∨ c break ∨ d)" with precedence 35 for @{'or4 $a $b $c $d}.
39
40 inductive And (A,B:CProp) : CProp ≝
41  | Conj : A → B → And A B.
42  
43 interpretation "constructive and" 'and x y = (And x y).
44
45 inductive And3 (A,B,C:CProp) : CProp ≝
46  | Conj3 : A → B → C → And3 A B C.
47
48 notation < "hvbox(a break ∧ b break ∧ c)" with precedence 35 for @{'and3 $a $b $c}.
49  
50 interpretation "constructive ternary and" 'and3 x y z = (And3 x y z).
51
52 inductive And4 (A,B,C,D:CProp) : CProp ≝
53  | Conj4 : A → B → C → D → And4 A B C D.
54
55 notation < "hvbox(a break ∧ b break ∧ c break ∧ d)" with precedence 35 for @{'and4 $a $b $c $d}.
56  
57 interpretation "constructive quaternary and" 'and4 x y z t = (And4 x y z t).
58
59 inductive exT (A:Type) (P:A→CProp) : CProp ≝
60   ex_introT: ∀w:A. P w → exT A P.
61   
62 notation "\ll term 19 a, break term 19 b \gg" 
63 with precedence 90 for @{'dependent_pair $a $b}.
64 interpretation "dependent pair" 'dependent_pair a b = 
65   (ex_introT _ _ a b).
66
67 interpretation "CProp exists" 'exists \eta.x = (exT _ x).
68
69 notation "\ll term 19 a, break term 19 b \gg" 
70 with precedence 90 for @{'dependent_pair $a $b}.
71 interpretation "dependent pair" 'dependent_pair a b = 
72   (ex_introT _ _ a b).
73
74
75 definition pi1exT ≝ λA,P.λx:exT A P.match x with [ex_introT x _ ⇒ x].
76 definition pi2exT ≝ 
77   λA,P.λx:exT A P.match x return λx.P (pi1exT ?? x) with [ex_introT _ p ⇒ p].
78
79 interpretation "exT \fst" 'pi1 = (pi1exT _ _).
80 interpretation "exT \fst" 'pi1a x = (pi1exT _ _ x).
81 interpretation "exT \fst" 'pi1b x y = (pi1exT _ _ x y).
82 interpretation "exT \snd" 'pi2 = (pi2exT _ _).
83 interpretation "exT \snd" 'pi2a x = (pi2exT _ _ x).
84 interpretation "exT \snd" 'pi2b x y = (pi2exT _ _ x y).
85
86 inductive exT23 (A:Type) (P:A→CProp) (Q:A→CProp) (R:A→A→CProp) : CProp ≝
87   ex_introT23: ∀w,p:A. P w → Q p → R w p → exT23 A P Q R.
88
89 definition pi1exT23 ≝
90   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 x _ _ _ _ ⇒ x].
91 definition pi2exT23 ≝
92   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 _ x _ _ _ ⇒ x].
93
94 interpretation "exT2 \fst" 'pi1 = (pi1exT23 _ _ _ _).
95 interpretation "exT2 \snd" 'pi2 = (pi2exT23 _ _ _ _).   
96 interpretation "exT2 \fst" 'pi1a x = (pi1exT23 _ _ _ _ x).
97 interpretation "exT2 \snd" 'pi2a x = (pi2exT23 _ _ _ _ x).
98 interpretation "exT2 \fst" 'pi1b x y = (pi1exT23 _ _ _ _ x y).
99 interpretation "exT2 \snd" 'pi2b x y = (pi2exT23 _ _ _ _ x y).
100
101 inductive exT2 (A:Type) (P,Q:A→CProp) : CProp ≝
102   ex_introT2: ∀w:A. P w → Q w → exT2 A P Q.
103
104 alias id "False" = "cic:/Coq/Init/Logic/False.ind#xpointer(1/1)".
105 definition Not : CProp → Prop ≝ λx:CProp.x → False.
106
107 interpretation "constructive not" 'not x = (Not x).
108   
109 definition cotransitive ≝
110  λC:Type.λlt:C→C→CProp.∀x,y,z:C. lt x y → lt x z ∨ lt z y. 
111
112 definition coreflexive ≝ λC:Type.λlt:C→C→CProp. ∀x:C. ¬ (lt x x).
113
114 definition symmetric ≝ λC:Type.λlt:C→C→CProp. ∀x,y:C.lt x y → lt y x.
115
116 definition antisymmetric ≝ λA:Type.λR:A→A→CProp.λeq:A→A→Prop.∀x:A.∀y:A.R x y→R y x→eq x y.
117
118 definition reflexive ≝ λA:Type.λR:A→A→CProp.∀x:A.R x x.
119
120 definition transitive ≝ λA:Type.λR:A→A→CProp.∀x,y,z:A.R x y → R y z → R x z.
121