]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/relocation/fsupq.ma
Still a problem to be fixed: after reaching the border we must always add
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / fsupq.ma
index cd33d8e99050e12286294e25a9bcee5f564e1bb8..0a48ca02aaeef7a011475b4fbdad10b8d464bd20 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
+include "basic_2/notation/relations/suptermopt_6.ma".
 include "basic_2/relocation/fsup.ma".
 
 (* OPTIONAL SUPCLOSURE ******************************************************)
 
-inductive fsupq: bi_relation lenv term ≝
-| fsupq_refl   : ∀L,T. fsupq L T L T
-| fsupq_lref_O : ∀I,L,V. fsupq (L.ⓑ{I}V) (#0) L V
-| fsupq_pair_sn: ∀I,L,V,T. fsupq L (②{I}V.T) L V
-| fsupq_bind_dx: ∀a,I,L,V,T. fsupq L (ⓑ{a,I}V.T) (L.ⓑ{I}V) T
-| fsupq_flat_dx: ∀I,L,V,T.   fsupq L (ⓕ{I}V.T) L T
-| fsupq_ldrop  : ∀L1,K1,K2,T1,T2,U1,d,e.
-                ⇩[d, e] L1 ≡ K1 → ⇧[d, e] T1 ≡ U1 →
-                fsupq K1 T1 K2 T2 → fsupq L1 U1 K2 T2
+(* activate genv *)
+inductive fsupq: tri_relation genv lenv term ≝
+| fsupq_lref_O : ∀I,G,L,V. fsupq G (L.ⓑ{I}V) (#0) G L V
+| fsupq_pair_sn: ∀I,G,L,V,T. fsupq G L (②{I}V.T) G L V
+| fsupq_bind_dx: ∀a,I,G,L,V,T. fsupq G L (ⓑ{a,I}V.T) G (L.ⓑ{I}V) T
+| fsupq_flat_dx: ∀I,G, L,V,T. fsupq G L (ⓕ{I}V.T) G L T
+| fsupq_drop   : ∀G,L,K,T,U,e.
+                 ⇩[0, e] L ≡ K → ⇧[0, e] T ≡ U → fsupq G L U G K T
 .
 
 interpretation
    "optional structural successor (closure)"
-   'SupTermOpt L1 T1 L2 T2 = (fsupq L1 T1 L2 T2).
+   'SupTermOpt G1 L1 T1 G2 L2 T2 = (fsupq G1 L1 T1 G2 L2 T2).
 
 (* Basic properties *********************************************************)
 
-lemma fsup_fsupq: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄.
-#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // /2 width=7/ qed.
+lemma fsupq_refl: tri_reflexive … fsupq.
+/2 width=3 by fsupq_drop/ qed.
 
-(* Basic properties *********************************************************)
-
-lemma fsupq_lref_S_lt: ∀I,L,K,V,T,i. 0 < i → ⦃L, #(i-1)⦄ ⊃⸮ ⦃K, T⦄ → ⦃L.ⓑ{I}V, #i⦄ ⊃⸮ ⦃K, T⦄.
-/3 width=7/ qed.
-
-lemma fsupq_lref: ∀I,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃L, #i⦄ ⊃⸮ ⦃K, V⦄.
-/3 width=2/ qed.
+lemma fsup_fsupq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄.
+#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // /2 width=3 by fsupq_drop/
+qed.
 
 (* Basic forward lemmas *****************************************************)
 
-lemma fsupq_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ → ♯{L2, T2} ≤ ♯{L1, T1}.
-#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // [1,2,3: /2 width=1/ ]
-#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12
-lapply (ldrop_fwd_lw … HLK1) -HLK1 #HLK1
-lapply (lift_fwd_tw … HTU1) -HTU1 #HTU1
-@(transitive_le … IHT12) -IHT12 /2 width=1/
+lemma fsupq_fwd_fw: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → ♯{G2, L2, T2} ≤ ♯{G1, L1, T1}.
+#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 /2 width=1 by lt_to_le/
+#G1 #L1 #K1 #T1 #U1 #e #HLK1 #HTU1
+lapply (ldrop_fwd_lw … HLK1) -HLK1
+lapply (lift_fwd_tw … HTU1) -HTU1
+/2 width=1 by le_plus, le_n/
 qed-.
 
-fact fsupq_fwd_length_lref1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ →
+fact fsupq_fwd_length_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
                                  ∀i. T1 = #i → |L2| ≤ |L1|.
-#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 //
-[ #a #I #L #V #T #j #H destruct
-| #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #i #H destruct
-  lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 #HLK1
-  elim (lift_inv_lref2 … HTU1) -HTU1 * #Hdei #H destruct
-  @(transitive_le … HLK1) /2 width=2/
+#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 //
+[ #a #I #G #L #V #T #j #H destruct
+| #G1 #L1 #K1 #T1 #U1 #e #HLK1 #HTU1 #i #H destruct
+  /2 width=3 by ldrop_fwd_length_le4/
 ]
 qed-.
 
-lemma fsupq_fwd_length_lref1: ∀L1,L2,T2,i. ⦃L1, #i⦄ ⊃⸮ ⦃L2, T2⦄ → |L2| ≤ |L1|.
-/2 width=5 by fsupq_fwd_length_lref1_aux/
+lemma fsupq_fwd_length_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊃⸮ ⦃G2, L2, T2⦄ → |L2| ≤ |L1|.
+/2 width=7 by fsupq_fwd_length_lref1_aux/
 qed-.