]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma
renaming in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / syntax / lenv.ma
index 7b6bc80eb76ef3c88841c21ba46e1884e450e672..2822b5d4b2fc828a03802cf64d4eca4592b2edf9 100644 (file)
@@ -25,44 +25,44 @@ include "basic_2/syntax/bind.ma".
 
 (* local environments *)
 inductive lenv: Type[0] ≝
-| LAtom: lenv                       (* empty *)
-| LPair: lenv → bind2 → term → lenv (* binary binding construction *)
+| LAtom: lenv               (* empty *)
+| LBind: lenv → bind → lenv (* binding construction *)
 .
 
 interpretation "sort (local environment)"
    'Star = LAtom.
-(*
+
+interpretation "local environment binding construction (generic)"
+   'DxItem L I = (LBind L I).
+
 interpretation "local environment binding construction (unary)"
-   'DxBind1 L I = (LUnit L I).
-*)
+   'DxBind1 L I = (LBind L (BUnit I)).
+
 interpretation "local environment binding construction (binary)"
-   'DxBind2 L I T = (LPair L I T).
-(*
+   'DxBind2 L I T = (LBind L (BPair I T)).
+
 interpretation "void (local environment)"
-   'DxVoid L = (LPair L Void).
-*)
+   'DxVoid L = (LBind L (BUnit Void)).
+
 interpretation "abbreviation (local environment)"
-   'DxAbbr L T = (LPair L Abbr T).
+   'DxAbbr L T = (LBind L (BPair Abbr T)).
 
 interpretation "abstraction (local environment)"
-   'DxAbst L T = (LPair L Abst T).
+   'DxAbst L T = (LBind L (BPair Abst T)).
 
-definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2.
+definition cfull: relation3 lenv bind bind ≝ λL,I1,I2. ⊤.
 
-definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤.
+definition ceq: relation3 lenv term term ≝ λL. eq ….
 
 (* Basic properties *********************************************************)
 
 lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
-#L1 elim L1 -L1 [| #L1 #I1 #V1 #IHL1 ] * [2,4: #L2 #I2 #V2 ]
-[1,4: @or_intror #H destruct
-| elim (eq_bind2_dec I1 I2) #HI
-  [ elim (eq_term_dec V1 V2) #HV
-    [ elim (IHL1 L2) -IHL1 /2 width=1 by or_introl/ #HL ]
-  ]
-  @or_intror #H destruct /2 width=1 by/
-| /2 width=1 by or_introl/
+#L1 elim L1 -L1 [| #L1 #I1 #IHL1 ] * [2,4: #L2 #I2 ]
+[3: /2 width=1 by or_introl/
+|2: elim (eq_bind_dec I1 I2) #HI
+    [ elim (IHL1 L2) -IHL1 #HL /2 width=1 by or_introl/ ]
 ]
+@or_intror #H destruct /2 width=1 by/
 qed-.
 
 lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
@@ -70,18 +70,20 @@ lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
 
 (* Basic inversion lemmas ***************************************************)
 
-fact destruct_lpair_lpair_aux: ∀I1,I2,L1,L2,V1,V2. L1.ⓑ{I1}V1 = L2.ⓑ{I2}V2 →
-                               ∧∧L1 = L2 & I1 = I2 & V1 = V2.
-#I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1 by and3_intro/
+fact destruct_lbind_lbind_aux: ∀I1,I2,L1,L2. L1.ⓘ{I1} = L2.ⓘ{I2} →
+                               L1 = L2 ∧ I1 = I2.
+#I1 #I2 #L1 #L2 #H destruct /2 width=1 by conj/
 qed-.
 
-lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥.
-#I #V #L elim L -L
+(* Basic_2A1: uses: discr_lpair_x_xy *)
+lemma discr_lbind_x_xy: ∀I,L. L = L.ⓘ{I} → ⊥.
+#I #L elim L -L
 [ #H destruct
-| #L #J #W #IHL #H
-  elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *)
+| #L #J #IHL #H elim (destruct_lbind_lbind_aux … H) -H  (**) (* destruct lemma needed *)
+  #H1 #H2 destruct /2 width=1 by/
 ]
 qed-.
 
-lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L → ⊥.
-/2 width=4 by discr_lpair_x_xy/ qed-.
+(* Basic_2A1: uses: discr_lpair_xy_x *)
+lemma discr_lbind_xy_x: ∀I,L. L.ⓘ{I} = L → ⊥.
+/2 width=4 by discr_lbind_x_xy/ qed-.