]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/lib/formal_topology/cprop_connectives.ma
- lambda_delta: "conversion" and "equivalence" components started
[helm.git] / matita / matita / lib / formal_topology / 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 include "basics/pts.ma".
16
17 inductive False: CProp[0] ≝.
18
19 inductive Or (A,B:CProp[0]) : CProp[0] ≝
20  | Left : A → Or A B
21  | Right : B → Or A B.
22
23 interpretation "constructive or" 'or x y = (Or x y).
24
25 inductive Or3 (A,B,C:CProp[0]) : CProp[0] ≝
26  | Left3 : A → Or3 A B C
27  | Middle3 : B → Or3 A B C
28  | Right3 : C → Or3 A B C.
29
30 interpretation "constructive ternary or" 'or3 x y z= (Or3 x y z).
31
32 notation < "hvbox(a break ∨ b break ∨ c)" with precedence 35 for @{'or3 $a $b $c}.
33
34 inductive Or4 (A,B,C,D:CProp[0]) : CProp[0] ≝
35  | Left3 : A → Or4 A B C D
36  | Middle3 : B → Or4 A B C D
37  | Right3 : C → Or4 A B C D
38  | Extra3: D → Or4 A B C D.
39
40 interpretation "constructive ternary or" 'or4 x y z t = (Or4 x y z t).
41
42 notation < "hvbox(a break ∨ b break ∨ c break ∨ d)" with precedence 35 for @{'or4 $a $b $c $d}.
43
44 inductive And (A,B:CProp[0]) : CProp[0] ≝
45  | Conj : A → B → And A B.
46  
47 interpretation "constructive and" 'and x y = (And x y).
48
49 inductive And3 (A,B,C:CProp[0]) : CProp[0] ≝
50  | Conj3 : A → B → C → And3 A B C.
51
52 notation < "hvbox(a break ∧ b break ∧ c)" with precedence 35 for @{'and3 $a $b $c}.
53  
54 interpretation "constructive ternary and" 'and3 x y z = (And3 x y z).
55
56 inductive And42 (A,B,C,D:CProp[2]) : CProp[2] ≝
57  | Conj42 : A → B → C → D → And42 A B C D.
58
59 notation < "hvbox(a break ∧ b break ∧ c break ∧ d)" with precedence 35 for @{'and4 $a $b $c $d}.
60  
61 interpretation "constructive quaternary and2" 'and4 x y z t = (And42 x y z t).
62
63 record Iff (A,B:CProp[0]) : CProp[0] ≝
64  { if: A → B;
65    fi: B → A
66  }.
67  
68 record Iff1 (A,B:CProp[1]) : CProp[1] ≝
69  { if1: A → B;
70    fi1: B → A
71  }.
72  
73 notation "hvbox(a break ⇔ b)" right associative with precedence 25 for @{'iff1 $a $b}.
74 interpretation "logical iff" 'iff x y = (Iff x y).
75 interpretation "logical iff type1" 'iff1 x y = (Iff1 x y).
76
77 inductive exT22 (A:Type[2]) (P:A→CProp[2]) : CProp[2] ≝
78   ex_introT22: ∀w:A. P w → exT22 A P.
79   
80 interpretation "CProp[2] exists" 'exists \eta.x = (exT22 ? x).
81 (*
82 definition pi1exT22 ≝ λA,P.λx:exT22 A P.match x with [ex_introT22 x _ ⇒ x].
83 definition pi2exT22 ≝ 
84   λA,P.λx:exT22 A P.match x return λx.P (pi1exT22 ?? x) with [ex_introT22 _ p ⇒ p].
85   
86 interpretation "exT22 \fst" 'pi1 = (pi1exT22 ? ?).
87 interpretation "exT22 \snd" 'pi2 = (pi2exT22 ? ?).
88 interpretation "exT22 \fst a" 'pi1a x = (pi1exT22 ? ? x).
89 interpretation "exT22 \snd a" 'pi2a x = (pi2exT22 ? ? x).
90 interpretation "exT22 \fst b" 'pi1b x y = (pi1exT22 ? ? x y).
91 interpretation "exT22 \snd b" 'pi2b x y = (pi2exT22 ? ? x y).
92 *)
93 inductive exT (A:Type[0]) (P:A→CProp[0]) : CProp[0] ≝
94   ex_introT: ∀w:A. P w → exT A P.
95
96 interpretation "CProp exists" 'exists \eta.x = (exT ? x).
97
98 notation "\ll term 19 a, break term 19 b \gg" 
99 with precedence 90 for @{'dependent_pair $a $b}.
100 interpretation "dependent pair" 'dependent_pair a b = 
101   (ex_introT ? ? a b).
102
103 (*
104 definition pi1exT ≝ λA,P.λx:exT A P.match x with [ex_introT x _ ⇒ x].
105 definition pi2exT ≝ 
106   λA,P.λx:exT A P.match x return λx.P (pi1exT ?? x) with [ex_introT _ p ⇒ p].
107
108 interpretation "exT \fst" 'pi1 = (pi1exT ? ?).
109 interpretation "exT \fst a" 'pi1a x = (pi1exT ? ? x).
110 interpretation "exT \fst b" 'pi1b x y = (pi1exT ? ? x y).
111 interpretation "exT \snd" 'pi2 = (pi2exT ? ?).
112 interpretation "exT \snd a" 'pi2a x = (pi2exT ? ? x).
113 interpretation "exT \snd b" 'pi2b x y = (pi2exT ? ? x y).
114 *)
115 inductive exT23 (A:Type[0]) (P:A→CProp[0]) (Q:A→CProp[0]) (R:A→A→CProp[0]) : CProp[0] ≝
116   ex_introT23: ∀w,p:A. P w → Q p → R w p → exT23 A P Q R.
117 (*
118 definition pi1exT23 ≝
119   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 x _ _ _ _ ⇒ x].
120 definition pi2exT23 ≝
121   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 _ x _ _ _ ⇒ x].
122
123 interpretation "exT2 \fst" 'pi1 = (pi1exT23 ? ? ? ?).
124 interpretation "exT2 \snd" 'pi2 = (pi2exT23 ? ? ? ?).   
125 interpretation "exT2 \fst a" 'pi1a x = (pi1exT23 ? ? ? ? x).
126 interpretation "exT2 \snd a" 'pi2a x = (pi2exT23 ? ? ? ? x).
127 interpretation "exT2 \fst b" 'pi1b x y = (pi1exT23 ? ? ? ? x y).
128 interpretation "exT2 \snd b" 'pi2b x y = (pi2exT23 ? ? ? ? x y).
129 *)
130 inductive exT2 (A:Type[0]) (P,Q:A→CProp[0]) : CProp[0] ≝
131   ex_introT2: ∀w:A. P w → Q w → exT2 A P Q.
132
133
134 definition Not : CProp[0] → CProp[0] ≝ λx:CProp[0].x → False.
135
136 interpretation "constructive not" 'not x = (Not x).
137   
138 definition cotransitive: ∀C:Type[0]. ∀lt:C→C→CProp[0].CProp[0] ≝
139  λC:Type[0].λlt:C→C→CProp[0].∀x,y,z:C. lt x y → lt x z ∨ lt z y. 
140
141 definition coreflexive: ∀C:Type[0]. ∀lt:C→C→CProp[0].CProp[0] ≝
142  λC:Type[0].λlt:C→C→CProp[0]. ∀x:C. ¬ (lt x x).
143
144 definition symmetric: ∀C:Type[0]. ∀lt:C→C→CProp[0].CProp[0] ≝
145  λC:Type[0].λlt:C→C→CProp[0]. ∀x,y:C.lt x y → lt y x.
146
147 definition antisymmetric: ∀A:Type[0]. ∀R:A→A→CProp[0]. ∀eq:A→A→Prop.CProp[0] ≝
148  λA:Type[0].λR:A→A→CProp[0].λeq:A→A→Prop.∀x:A.∀y:A.R x y→R y x→eq x y.
149
150 definition reflexive: ∀C:Type[0]. ∀lt:C→C→CProp[0].CProp[0] ≝ λA:Type[0].λR:A→A→CProp[0].∀x:A.R x x.
151
152 definition transitive: ∀C:Type[0]. ∀lt:C→C→CProp[0].CProp[0] ≝ λA:Type[0].λR:A→A→CProp[0].∀x,y,z:A.R x y → R y z → R x z.
153
154 definition reflexive1: ∀A:Type[1].∀R:A→A→CProp[1].CProp[1] ≝ λA:Type[1].λR:A→A→CProp[1].∀x:A.R x x.
155 definition symmetric1: ∀A:Type[1].∀R:A→A→CProp[1].CProp[1] ≝ λC:Type[1].λlt:C→C→CProp[1]. ∀x,y:C.lt x y → lt y x.
156 definition transitive1: ∀A:Type[1].∀R:A→A→CProp[1].CProp[1] ≝ λA:Type[1].λR:A→A→CProp[1].∀x,y,z:A.R x y → R y z → R x z.
157
158 definition reflexive2: ∀A:Type[2].∀R:A→A→CProp[2].CProp[2] ≝ λA:Type[2].λR:A→A→CProp[2].∀x:A.R x x.
159 definition symmetric2: ∀A:Type[2].∀R:A→A→CProp[2].CProp[2] ≝ λC:Type[2].λlt:C→C→CProp[2]. ∀x,y:C.lt x y → lt y x.
160 definition transitive2: ∀A:Type[2].∀R:A→A→CProp[2].CProp[2] ≝ λA:Type[2].λR:A→A→CProp[2].∀x,y,z:A.R x y → R y z → R x z.
161
162 definition reflexive3: ∀A:Type[3].∀R:A→A→CProp[3].CProp[3] ≝ λA:Type[3].λR:A→A→CProp[3].∀x:A.R x x.
163 definition symmetric3: ∀A:Type[3].∀R:A→A→CProp[3].CProp[3] ≝ λC:Type[3].λlt:C→C→CProp[3]. ∀x,y:C.lt x y → lt y x.
164 definition transitive3: ∀A:Type[3].∀R:A→A→CProp[3].CProp[3] ≝ λA:Type[3].λR:A→A→CProp[3].∀x,y,z:A.R x y → R y z → R x z.