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