]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/static_2/syntax/theq.ma
milestone in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / theq.ma
index 37c4af70ac3d9a46c56371229c9e001e21e6f800..052f9f775b900e254251d21c98d4e96e0c7208a6 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "static_2/notation/relations/topiso_4.ma".
-include "static_2/syntax/item_sd.ma".
+include "static_2/notation/relations/topiso_2.ma".
 include "static_2/syntax/term.ma".
 
 (* HEAD EQUIVALENCE FOR TERMS ***********************************************)
 
 (* Basic_2A1: includes: tsts_atom tsts_pair *)
-inductive theq (h) (o): relation term ≝
-| theq_sort: ∀s1,s2,d. deg h o s1 d → deg h o s2 d → theq h o (⋆s1) (⋆s2)
-| theq_lref: ∀i. theq h o (#i) (#i)
-| theq_gref: ∀l. theq h o (§l) (§l)
-| theq_pair: ∀I,V1,V2,T1,T2. theq h o (②{I}V1.T1) (②{I}V2.T2)
+inductive theq: relation term ≝
+| theq_sort: ∀s1,s2. theq (⋆s1) (⋆s2)
+| theq_lref: ∀i. theq (#i) (#i)
+| theq_gref: ∀l. theq (§l) (§l)
+| theq_pair: ∀I,V1,V2,T1,T2. theq (②{I}V1.T1) (②{I}V2.T2)
 .
 
-interpretation "head equivalence (term)" 'TopIso h o T1 T2 = (theq h o T1 T2).
+interpretation "head equivalence (term)" 'TopIso T1 T2 = (theq T1 T2).
 
 (* Basic inversion lemmas ***************************************************)
 
-fact theq_inv_sort1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀s1. X = ⋆s1 →
-                         ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2.
-#h #o #X #Y * -X -Y
-[ #s1 #s2 #d #Hs1 #Hs2 #s #H destruct /2 width=5 by ex3_2_intro/
+fact theq_inv_sort1_aux: ∀X,Y. X ⩳ Y → ∀s1. X = ⋆s1 →
+                         ∃s2. Y = ⋆s2.
+#X #Y * -X -Y
+[ #s1 #s2 #s #H destruct /2 width=2 by ex_intro/
 | #i #s #H destruct
 | #l #s #H destruct
 | #I #V1 #V2 #T1 #T2 #s #H destruct
@@ -41,36 +40,36 @@ fact theq_inv_sort1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀s1. X = ⋆s1 →
 qed-.
 
 (* Basic_1: was just: iso_gen_sort *)
-lemma theq_inv_sort1: ∀h,o,Y,s1. ⋆s1 ⩳[h, o] Y →
-                      ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2.
-/2 width=3 by theq_inv_sort1_aux/ qed-.
+lemma theq_inv_sort1: ∀Y,s1. ⋆s1 ⩳ Y →
+                      ∃s2. Y = ⋆s2.
+/2 width=4 by theq_inv_sort1_aux/ qed-.
 
-fact theq_inv_lref1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀i. X = #i → Y = #i.
-#h #o #X #Y * -X -Y //
-[ #s1 #s2 #d #_ #_ #j #H destruct
+fact theq_inv_lref1_aux: ∀X,Y. X ⩳ Y → ∀i. X = #i → Y = #i.
+#X #Y * -X -Y //
+[ #s1 #s2 #j #H destruct
 | #I #V1 #V2 #T1 #T2 #j #H destruct
 ]
 qed-.
 
 (* Basic_1: was: iso_gen_lref *)
-lemma theq_inv_lref1: ∀h,o,Y,i. #i ⩳[h, o] Y → Y = #i.
+lemma theq_inv_lref1: ∀Y,i. #i ⩳ Y → Y = #i.
 /2 width=5 by theq_inv_lref1_aux/ qed-.
 
-fact theq_inv_gref1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀l. X = §l → Y = §l.
-#h #o #X #Y * -X -Y //
-[ #s1 #s2 #d #_ #_ #k #H destruct
+fact theq_inv_gref1_aux: ∀X,Y. X ⩳ Y → ∀l. X = §l → Y = §l.
+#X #Y * -X -Y //
+[ #s1 #s2 #k #H destruct
 | #I #V1 #V2 #T1 #T2 #k #H destruct
 ]
 qed-.
 
-lemma theq_inv_gref1: ∀h,o,Y,l. §l ⩳[h, o] Y → Y = §l.
+lemma theq_inv_gref1: ∀Y,l. §l ⩳ Y → Y = §l.
 /2 width=5 by theq_inv_gref1_aux/ qed-.
 
-fact theq_inv_pair1_aux: ∀h,o,T1,T2. T1 ⩳[h, o] T2 →
+fact theq_inv_pair1_aux: ∀T1,T2. T1 ⩳ T2 →
                          ∀J,W1,U1. T1 = ②{J}W1.U1 →
                          ∃∃W2,U2. T2 = ②{J}W2.U2.
-#h #o #T1 #T2 * -T1 -T2
-[ #s1 #s2 #d #_ #_ #J #W1 #U1 #H destruct
+#T1 #T2 * -T1 -T2
+[ #s1 #s2 #J #W1 #U1 #H destruct
 | #i #J #W1 #U1 #H destruct
 | #l #J #W1 #U1 #H destruct
 | #I #V1 #V2 #T1 #T2 #J #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/
@@ -79,15 +78,15 @@ qed-.
 
 (* Basic_1: was: iso_gen_head *)
 (* Basic_2A1: was: tsts_inv_pair1 *)
-lemma theq_inv_pair1: ∀h,o,J,W1,U1,T2. ②{J}W1.U1 ⩳[h, o] T2 →
+lemma theq_inv_pair1: ∀J,W1,U1,T2. ②{J}W1.U1 ⩳ T2 →
                       ∃∃W2,U2. T2 = ②{J}W2. U2.
 /2 width=7 by theq_inv_pair1_aux/ qed-.
 
-fact theq_inv_pair2_aux: ∀h,o,T1,T2. T1 ⩳[h, o] T2 →
+fact theq_inv_pair2_aux: ∀T1,T2. T1 ⩳ T2 →
                          ∀J,W2,U2. T2 = ②{J}W2.U2 →
                          ∃∃W1,U1. T1 = ②{J}W1.U1.
-#h #o #T1 #T2 * -T1 -T2
-[ #s1 #s2 #d #_ #_ #J #W2 #U2 #H destruct
+#T1 #T2 * -T1 -T2
+[ #s1 #s2 #J #W2 #U2 #H destruct
 | #i #J #W2 #U2 #H destruct
 | #l #J #W2 #U2 #H destruct
 | #I #V1 #V2 #T1 #T2 #J #W2 #U2 #H destruct /2 width=3 by ex1_2_intro/
@@ -95,29 +94,15 @@ fact theq_inv_pair2_aux: ∀h,o,T1,T2. T1 ⩳[h, o] T2 →
 qed-.
 
 (* Basic_2A1: was: tsts_inv_pair2 *)
-lemma theq_inv_pair2: ∀h,o,J,T1,W2,U2. T1 ⩳[h, o] ②{J}W2.U2 →
+lemma theq_inv_pair2: ∀J,T1,W2,U2. T1 ⩳ ②{J}W2.U2 →
                       ∃∃W1,U1. T1 = ②{J}W1.U1.
 /2 width=7 by theq_inv_pair2_aux/ qed-.
 
 (* Advanced inversion lemmas ************************************************)
 
-lemma theq_inv_sort1_deg: ∀h,o,Y,s1. ⋆s1 ⩳[h, o] Y → ∀d. deg h o s1 d →
-                          ∃∃s2. deg h o s2 d & Y = ⋆s2.
-#h #o #Y #s1 #H #d #Hs1 elim (theq_inv_sort1 … H) -H
-#s2 #x #Hx <(deg_mono h o … Hx … Hs1) -s1 -d /2 width=3 by ex2_intro/
-qed-.
-
-lemma theq_inv_sort_deg: ∀h,o,s1,s2. ⋆s1 ⩳[h, o] ⋆s2 →
-                         ∀d1,d2. deg h o s1 d1 → deg h o s2 d2 →
-                         d1 = d2.
-#h #o #s1 #y #H #d1 #d2 #Hs1 #Hy
-elim (theq_inv_sort1_deg … H … Hs1) -s1 #s2 #Hs2 #H destruct
-<(deg_mono h o … Hy … Hs2) -s2 -d1 //
-qed-.
-
-lemma theq_inv_pair: ∀h,o,I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ⩳[h, o] ②{I2}V2.T2 →
+lemma theq_inv_pair: ∀I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ⩳ ②{I2}V2.T2 →
                      I1 = I2.
-#h #o #I1 #I2 #V1 #V2 #T1 #T2 #H elim (theq_inv_pair1 … H) -H
+#I1 #I2 #V1 #V2 #T1 #T2 #H elim (theq_inv_pair1 … H) -H
 #V0 #T0 #H destruct //
 qed-.
 
@@ -125,28 +110,23 @@ qed-.
 
 (* Basic_1: was: iso_refl *)
 (* Basic_2A1: was: tsts_refl *)
-lemma theq_refl: ∀h,o. reflexive … (theq h o).
-#h #o * //
+lemma theq_refl: reflexive … theq.
+* //
 * /2 width=1 by theq_lref, theq_gref/
-#s elim (deg_total h o s) /2 width=3 by theq_sort/
 qed.
 
 (* Basic_2A1: was: tsts_sym *)
-lemma theq_sym: ∀h,o. symmetric … (theq h o).
-#h #o #T1 #T2 * -T1 -T2 /2 width=3 by theq_sort/
+lemma theq_sym: symmetric … theq.
+#T1 #T2 * -T1 -T2 /2 width=3 by theq_sort/
 qed-.
 
 (* Basic_2A1: was: tsts_dec *)
-lemma theq_dec: ∀h,o,T1,T2. Decidable (T1 ⩳[h, o] T2).
-#h #o * [ * #s1 | #I1 #V1 #T1 ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ]
-[ elim (deg_total h o s1) #d1 #H1
-  elim (deg_total h o s2) #d2 #H2
-  elim (eq_nat_dec d1 d2) #Hd12 destruct /3 width=3 by theq_sort, or_introl/
-  @or_intror #H
-  lapply (theq_inv_sort_deg … H … H1 H2) -H -H1 -H2 /2 width=1 by/
+lemma theq_dec: ∀T1,T2. Decidable (T1 ⩳ T2).
+* [ * #s1 | #I1 #V1 #T1 ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ]
+[ /3 width=1 by theq_sort, or_introl/
 |2,3,13:
   @or_intror #H
-  elim (theq_inv_sort1 … H) -H #x1 #x2 #_ #_ #H destruct
+  elim (theq_inv_sort1 … H) -H #x #H destruct
 |4,6,14:
   @or_intror #H
   lapply (theq_inv_lref1 … H) -H #H destruct