]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/cprop_connectives.ma
21c10a4e12b96dee2d4a6c1e09a14a437cd4a297
[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
17 inductive Or (A,B:CProp) : CProp ≝
18    Left : A → Or A B
19  | Right : B → Or A B.
20
21 interpretation "constructive or" 'or x y = (Or x y).
22
23 inductive And (A,B:CProp) : CProp ≝
24  | Conj : A → B → And A B.
25  
26 interpretation "constructive and" 'and x y = (And x y).
27
28 inductive And3 (A,B,C:CProp) : CProp ≝
29  | Conj3 : A → B → C → And3 A B C.
30
31 notation < "a ∧ b ∧ c" left associative with precedence 60 for @{'and3 $a $b $c}.
32  
33 interpretation "constructive ternary and" 'and3 x y z = (Conj3 x y z).
34
35 inductive And4 (A,B,C:CProp) : CProp ≝
36  | Conj4 : A → B → C → And4 A B C.
37
38 notation < "a ∧ b ∧ c ∧ d" left associative with precedence 60 for @{'and3 $a $b $c $d}.
39  
40 interpretation "constructive quaternary and" 'and4 x y z t = (Conj4 x y z t).
41
42 inductive exT (A:Type) (P:A→CProp) : CProp ≝
43   ex_introT: ∀w:A. P w → exT A P.
44
45 interpretation "CProp exists" 'exists \eta.x = (exT _ x).
46
47 inductive exT23 (A:Type) (P:A→CProp) (Q:A→CProp) (R:A→A→CProp) : CProp ≝
48   ex_introT23: ∀w,p:A. P w → Q p → R w p → exT23 A P Q R.
49
50 notation < "'fst' \nbsp x" non associative with precedence 50 for @{'pi1 $x}.
51 notation < "'snd' \nbsp x" non associative with precedence 50 for @{'pi2 $x}.
52 notation > "'fst' x" non associative with precedence 50 for @{'pi1 $x}.
53 notation > "'snd' x" non associative with precedence 50 for @{'pi2 $x}.
54 notation < "'fst' \nbsp x \nbsp y" non associative with precedence 50 for @{'pi12 $x $y}.
55 notation < "'snd' \nbsp x \nbsp y" non associative with precedence 50 for @{'pi22 $x $y}.
56
57 definition pi1exT ≝ λA,P.λx:exT A P.match x with [ex_introT x _ ⇒ x].
58
59 interpretation "exT fst" 'pi1 x = (pi1exT _ _ x).
60 interpretation "exT fst 2" 'pi12 x y = (pi1exT _ _ x y).
61
62 definition pi1exT23 ≝
63   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 x _ _ _ _ ⇒ x].
64 definition pi2exT23 ≝
65   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 _ x _ _ _ ⇒ x].
66    
67 interpretation "exT2 fst" 'pi1 x = (pi1exT23 _ _ _ _ x).
68 interpretation "exT2 snd" 'pi2 x = (pi2exT23 _ _ _ _ x).
69 interpretation "exT2 fst 2" 'pi12 x y = (pi1exT23 _ _ _ _ x y).
70 interpretation "exT2 snd 2" 'pi22 x y = (pi2exT23 _ _ _ _ x y).
71
72
73 definition Not : CProp → Prop ≝ λx:CProp.x → False.
74
75 interpretation "constructive not" 'not x = (Not x).
76   
77 definition cotransitive ≝
78  λC:Type.λlt:C→C→CProp.∀x,y,z:C. lt x y → lt x z ∨ lt z y. 
79
80 definition coreflexive ≝ λC:Type.λlt:C→C→CProp. ∀x:C. ¬ (lt x x).
81
82 definition symmetric ≝ λC:Type.λlt:C→C→CProp. ∀x,y:C.lt x y → lt y x.
83
84 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.
85
86 definition reflexive ≝ λA:Type.λR:A→A→CProp.∀x:A.R x x.
87
88 definition transitive ≝ λA:Type.λR:A→A→CProp.∀x,y,z:A.R x y → R y z → R x z.
89