]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/cprop_connectives.ma
models over N fixed
[helm.git] / helm / software / matita / contribs / dama / dama / 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/equality.ma".
16 include "datatypes/constructors.ma".
17
18 inductive Or (A,B:CProp) : CProp ≝
19  | Left : A → Or A B
20  | Right : B → Or A B.
21
22 interpretation "constructive or" 'or x y = (Or x y).
23
24 inductive Or3 (A,B,C:CProp) : CProp ≝
25  | Left3 : A → Or3 A B C
26  | Middle3 : B → Or3 A B C
27  | Right3 : C → Or3 A B C.
28
29 interpretation "constructive ternary or" 'or3 x y z= (Or3 x y z).
30
31 notation < "hvbox(a break ∨ b break ∨ c)" with precedence 35 for @{'or3 $a $b $c}.
32
33 inductive Or4 (A,B,C,D:CProp) : CProp ≝
34  | Left3 : A → Or4 A B C D
35  | Middle3 : B → Or4 A B C D
36  | Right3 : C → Or4 A B C D
37  | Extra3: D → Or4 A B C D.
38
39 interpretation "constructive ternary or" 'or4 x y z t = (Or4 x y z t).
40
41 notation < "hvbox(a break ∨ b break ∨ c break ∨ d)" with precedence 35 for @{'or4 $a $b $c $d}.
42
43 inductive And (A,B:CProp) : CProp ≝
44  | Conj : A → B → And A B.
45  
46 interpretation "constructive and" 'and x y = (And x y).
47
48 inductive And3 (A,B,C:CProp) : CProp ≝
49  | Conj3 : A → B → C → And3 A B C.
50
51 notation < "hvbox(a break ∧ b break ∧ c)" with precedence 35 for @{'and3 $a $b $c}.
52  
53 interpretation "constructive ternary and" 'and3 x y z = (And3 x y z).
54
55 inductive And4 (A,B,C,D:CProp) : CProp ≝
56  | Conj4 : A → B → C → D → And4 A B C D.
57
58 notation < "hvbox(a break ∧ b break ∧ c break ∧ d)" with precedence 35 for @{'and4 $a $b $c $d}.
59  
60 interpretation "constructive quaternary and" 'and4 x y z t = (And4 x y z t).
61
62 inductive exT (A:Type) (P:A→CProp) : CProp ≝
63   ex_introT: ∀w:A. P w → exT A P.
64
65 record sigT (A:Type) (P:A→Prop) : Type ≝ {
66   fstT:A;
67   sndT:P fstT
68 }.
69   
70 interpretation "sigT \fst" 'pi1 = (fstT _ _).
71 interpretation "sigT \fst" 'pi1a x = (fstT _ _ x).
72 interpretation "sigT \fst" 'pi1b x y = (fstT _ _ x y).
73 interpretation "sigT \snd" 'pi2 = (sndT _ _).
74 interpretation "sigT \snd" 'pi2a x = (sndT _ _ x).
75 interpretation "sigT \snd" 'pi2b x y = (sndT _ _ x y).
76
77 notation "\ll term 19 a, break term 19 b \gg" 
78 with precedence 90 for @{'dependent_pair $a $b}.
79 interpretation "dependent pair" 'dependent_pair a b = 
80   (ex_introT _ _ a b).
81
82 interpretation "dependent set" 'dependent_pair a b = 
83   (mk_sigT _ _ a b).
84
85 interpretation "CProp exists" 'exists \eta.x = (exT _ x).
86
87 notation "\ll term 19 a, break term 19 b \gg" 
88 with precedence 90 for @{'dependent_pair $a $b}.
89 interpretation "dependent pair" 'dependent_pair a b = 
90   (ex_introT _ _ a b).
91
92
93 definition pi1exT ≝ λA,P.λx:exT A P.match x with [ex_introT x _ ⇒ x].
94 definition pi2exT ≝ 
95   λA,P.λx:exT A P.match x return λx.P (pi1exT ?? x) with [ex_introT _ p ⇒ p].
96
97 interpretation "exT \fst" 'pi1 = (pi1exT _ _).
98 interpretation "exT \fst" 'pi1a x = (pi1exT _ _ x).
99 interpretation "exT \fst" 'pi1b x y = (pi1exT _ _ x y).
100 interpretation "exT \snd" 'pi2 = (pi2exT _ _).
101 interpretation "exT \snd" 'pi2a x = (pi2exT _ _ x).
102 interpretation "exT \snd" 'pi2b x y = (pi2exT _ _ x y).
103
104 inductive exT23 (A:Type) (P:A→CProp) (Q:A→CProp) (R:A→A→CProp) : CProp ≝
105   ex_introT23: ∀w,p:A. P w → Q p → R w p → exT23 A P Q R.
106
107 definition pi1exT23 ≝
108   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 x _ _ _ _ ⇒ x].
109 definition pi2exT23 ≝
110   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 _ x _ _ _ ⇒ x].
111
112 interpretation "exT2 \fst" 'pi1 = (pi1exT23 _ _ _ _).
113 interpretation "exT2 \snd" 'pi2 = (pi2exT23 _ _ _ _).   
114 interpretation "exT2 \fst" 'pi1a x = (pi1exT23 _ _ _ _ x).
115 interpretation "exT2 \snd" 'pi2a x = (pi2exT23 _ _ _ _ x).
116 interpretation "exT2 \fst" 'pi1b x y = (pi1exT23 _ _ _ _ x y).
117 interpretation "exT2 \snd" 'pi2b x y = (pi2exT23 _ _ _ _ x y).
118
119 definition Not : CProp → Prop ≝ λx:CProp.x → False.
120
121 interpretation "constructive not" 'not x = (Not x).
122   
123 definition cotransitive ≝
124  λC:Type.λlt:C→C→CProp.∀x,y,z:C. lt x y → lt x z ∨ lt z y. 
125
126 definition coreflexive ≝ λC:Type.λlt:C→C→CProp. ∀x:C. ¬ (lt x x).
127
128 definition symmetric ≝ λC:Type.λlt:C→C→CProp. ∀x,y:C.lt x y → lt y x.
129
130 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.
131
132 definition reflexive ≝ λA:Type.λR:A→A→CProp.∀x:A.R x x.
133
134 definition transitive ≝ λA:Type.λR:A→A→CProp.∀x,y,z:A.R x y → R y z → R x z.
135