]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/grammar/lenv.ma
- some renaming according to the written version of basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / grammar / lenv.ma
index 95e155b74e52d06592f6e3553eddcf402562c519..ff183d177d77db041663f15645ee2cda1a8c61e4 100644 (file)
@@ -40,21 +40,29 @@ interpretation "abstraction (local environment)"
 
 (* Basic properties *********************************************************)
 
-axiom eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
+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/
+]
+qed-.
 
 (* Basic inversion lemmas ***************************************************)
 
-lemma destruct_lpair_lpair: ∀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/
+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/
 qed-.
 
 lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥.
 #I #V #L elim L -L
 [ #H destruct
 | #L #J #W #IHL #H
-  elim (destruct_lpair_lpair … H) -H #H1 #H2 #H3 destruct /2 width=1/ (**) (* destruct lemma needed *)
+  elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *)
 ]
 qed-.
-
-(* Basic_1: removed theorems 2: chead_ctail c_tail_ind *)