]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/dama/dama/cprop_connectives.ma
notation factored, coercion commant taking terms and not only URI
[helm.git] / helm / software / matita / contribs / dama / dama / cprop_connectives.ma
index a0a701694ccc9ba1c7bac93758cfb3b0527ef261..b8b33f8e6425bdf8c5aec7f525cdd5ee0f53b906 100644 (file)
@@ -13,6 +13,7 @@
 (**************************************************************************)
 
 include "logic/equality.ma".
+include "datatypes/constructors.ma".
 
 inductive Or (A,B:CProp) : CProp ≝
  | Left : A → Or A B
@@ -39,48 +40,22 @@ notation < "a ∧ b ∧ c ∧ d" with precedence 35 for @{'and4 $a $b $c $d}.
  
 interpretation "constructive quaternary and" 'and4 x y z t = (Conj4 x y z t).
 
-coinductive product (A,B:Type) : Type ≝ pair : ∀a:A.∀b:B.product A B.
-
-notation "a \times b" left associative with precedence 70 for @{'product $a $b}.
-interpretation "prod" 'product a b = (product a b).
-definition first : ∀A.∀P.A × P → A ≝ λA,P,s.match s with [pair x _ ⇒ x].
-definition second : ∀A.∀P.A × P → P ≝ λA,P,s.match s with [pair _ y ⇒ y].
-
-interpretation "pair pi1" 'pi1 = (first _ _).
-interpretation "pair pi2" 'pi2 = (second _ _).
-interpretation "pair pi1" 'pi1a x = (first _ _ x).
-interpretation "pair pi2" 'pi2a x = (second _ _ x).
-interpretation "pair pi1" 'pi1b x y = (first _ _ x y).
-interpretation "pair pi2" 'pi2b x y = (second _ _ x y).
-
-notation "hvbox(\langle term 19 a, break term 19 b\rangle)" 
-with precedence 90 for @{ 'pair $a $b}.
-interpretation "pair" 'pair a b = (pair _ _ a b).
-
 inductive exT (A:Type) (P:A→CProp) : CProp ≝
   ex_introT: ∀w:A. P w → exT A P.
 
 interpretation "CProp exists" 'exists \eta.x = (exT _ x).
 interpretation "dependent pair" 'pair a b = (ex_introT _ _ a b).
 
-notation < "'fst' \nbsp x" non associative with precedence 90 for @{'pi1a $x}.
-notation < "'snd' \nbsp x" non associative with precedence 90 for @{'pi2a $x}.
-notation < "'fst' \nbsp x \nbsp y" non associative with precedence 90 for @{'pi1b $x $y}.
-notation < "'snd' \nbsp x \nbsp y" non associative with precedence 90 for @{'pi2b $x $y}.
-notation > "'fst'" non associative with precedence 90 for @{'pi1}.
-notation > "'snd'" non associative with precedence 90 for @{'pi2}.
-
 definition pi1exT ≝ λA,P.λx:exT A P.match x with [ex_introT x _ ⇒ x].
 definition pi2exT ≝ 
   λA,P.λx:exT A P.match x return λx.P (pi1exT ?? x) with [ex_introT _ p ⇒ p].
 
-interpretation "exT fst" 'pi1 = (pi1exT _ _).
-interpretation "exT fst" 'pi1a x = (pi1exT _ _ x).
-interpretation "exT fst" 'pi1b x y = (pi1exT _ _ x y).
-interpretation "exT snd" 'pi2 = (pi2exT _ _).
-interpretation "exT snd" 'pi2a x = (pi2exT _ _ x).
-interpretation "exT snd" 'pi2b x y = (pi2exT _ _ x y).
+interpretation "exT \fst" 'pi1 = (pi1exT _ _).
+interpretation "exT \fst" 'pi1a x = (pi1exT _ _ x).
+interpretation "exT \fst" 'pi1b x y = (pi1exT _ _ x y).
+interpretation "exT \snd" 'pi2 = (pi2exT _ _).
+interpretation "exT \snd" 'pi2a x = (pi2exT _ _ x).
+interpretation "exT \snd" 'pi2b x y = (pi2exT _ _ x y).
 
 inductive exT23 (A:Type) (P:A→CProp) (Q:A→CProp) (R:A→A→CProp) : CProp ≝
   ex_introT23: ∀w,p:A. P w → Q p → R w p → exT23 A P Q R.
@@ -90,12 +65,12 @@ definition pi1exT23 ≝
 definition pi2exT23 ≝
   λA,P,Q,R.λx:exT23 A P Q R.match x with [ex_introT23 _ x _ _ _ ⇒ x].
 
-interpretation "exT2 fst" 'pi1 = (pi1exT23 _ _ _ _).
-interpretation "exT2 snd" 'pi2 = (pi2exT23 _ _ _ _).   
-interpretation "exT2 fst" 'pi1a x = (pi1exT23 _ _ _ _ x).
-interpretation "exT2 snd" 'pi2a x = (pi2exT23 _ _ _ _ x).
-interpretation "exT2 fst" 'pi1b x y = (pi1exT23 _ _ _ _ x y).
-interpretation "exT2 snd" 'pi2b x y = (pi2exT23 _ _ _ _ x y).
+interpretation "exT2 \fst" 'pi1 = (pi1exT23 _ _ _ _).
+interpretation "exT2 \snd" 'pi2 = (pi2exT23 _ _ _ _).   
+interpretation "exT2 \fst" 'pi1a x = (pi1exT23 _ _ _ _ x).
+interpretation "exT2 \snd" 'pi2a x = (pi2exT23 _ _ _ _ x).
+interpretation "exT2 \fst" 'pi1b x y = (pi1exT23 _ _ _ _ x y).
+interpretation "exT2 \snd" 'pi2b x y = (pi2exT23 _ _ _ _ x y).
 
 definition Not : CProp → Prop ≝ λx:CProp.x → False.