]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma
- former llpx_sn an lleq reactivated as lfxs and lfeq
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / lexs.ma
index 0bed76cfd05d77e09c8ce748845b841719212e04..e1fdd74f402c8cbd78f74beae500e67a017f23bb 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground_2/relocation/nstream_sle.ma".
+include "ground_2/relocation/rtmap_sle.ma".
 include "basic_2/notation/relations/relationstar_5.ma".
 include "basic_2/grammar/lenv.ma".
 
-(* GENERAL ENTRYWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****)
+(* GENERIC ENTRYWISE EXTENSION OF CONTEXT-SENSITIVE REALTIONS FOR TERMS *****)
 
 (* Basic_2A1: includes: lpx_sn_atom lpx_sn_pair *)
 inductive lexs (RN,RP:relation3 lenv term term): rtmap → relation lenv ≝
@@ -29,9 +29,22 @@ inductive lexs (RN,RP:relation3 lenv term term): rtmap → relation lenv ≝
              lexs RN RP (↑f) (L1.ⓑ{I}V1) (L2.ⓑ{I}V2)
 .
 
-interpretation "general entrywise extension (local environment)"
+interpretation "generic entrywise extension (local environment)"
    'RelationStar RN RP f L1 L2 = (lexs RN RP f L1 L2).
 
+definition lexs_confluent: relation6 (relation3 lenv term term)
+                                     (relation3 lenv term term) … ≝
+                           λR1,R2,RN1,RP1,RN2,RP2.
+                           ∀f,L0,T0,T1. R1 L0 T0 T1 → ∀T2. R2 L0 T0 T2 →
+                           ∀L1. L0 ⦻*[RN1, RP1, f] L1 → ∀L2. L0 ⦻*[RN2, RP2, f] L2 →
+                           ∃∃T. R2 L1 T1 T & R1 L2 T2 T.
+
+definition lexs_transitive: relation5 (relation3 lenv term term)
+                                      (relation3 lenv term term) … ≝
+                            λR1,R2,R3,RN,RP.
+                            ∀f,L1,T1,T. R1 L1 T1 T → ∀L2. L1 ⦻*[RN, RP, f] L2 →
+                            ∀T2. R2 L2 T T2 → R3 L1 T1 T2.
+
 (* Basic inversion lemmas ***************************************************)
 
 fact lexs_inv_atom1_aux: ∀RN,RP,X,Y,f. X ⦻*[RN, RP, f] Y → X = ⋆ → Y = ⋆.
@@ -126,18 +139,36 @@ lemma lexs_inv_push: ∀RN,RP,I1,I2,L1,L2,V1,V2,f.
 #L0 #V0 #HL10 #HV10 #H destruct /2 width=1 by and3_intro/
 qed-.
 
+lemma lexs_inv_tl: ∀RN,RP,I,L1,L2,V1,V2,f. L1 ⦻*[RN, RP, ⫱f] L2 →
+                   RN L1 V1 V2 → RP L1 V1 V2 → 
+                   L1.ⓑ{I}V1 ⦻*[RN, RP, f] L2.ⓑ{I}V2.
+#RN #RP #I #L2 #L2 #V1 #V2 #f elim (pn_split f) *
+/2 width=1 by lexs_next, lexs_push/
+qed-.
+
+(* Basic forward lemmas *****************************************************)
+
+lemma lexs_fwd_pair: ∀RN,RP,I1,I2,L1,L2,V1,V2,f. 
+                     L1.ⓑ{I1}V1 ⦻*[RN, RP, f] L2.ⓑ{I2}V2 →
+                     L1 ⦻*[RN, RP, ⫱f] L2 ∧ I1 = I2.
+#RN #RP #I1 #I2 #L2 #L2 #V1 #V2 #f #Hf
+elim (pn_split f) * #g #H destruct
+[ elim (lexs_inv_push … Hf) | elim (lexs_inv_next … Hf) ] -Hf
+/2 width=1 by conj/
+qed-.
+
 (* Basic properties *********************************************************)
 
-lemma lexs_eq_repl_back: ∀RN,RP,L1,L2. eq_stream_repl_back … (λf. L1 ⦻*[RN, RP, f] L2).
+lemma lexs_eq_repl_back: ∀RN,RP,L1,L2. eq_repl_back … (λf. L1 ⦻*[RN, RP, f] L2).
 #RN #RP #L1 #L2 #f1 #H elim H -L1 -L2 -f1 //
 #I #L1 #L2 #V1 #v2 #f1 #_ #HV #IH #f2 #H
-[ elim (next_inv_sn … H) -H /3 width=1 by lexs_next/
-| elim (push_inv_sn … H) -H /3 width=1 by lexs_push/
+[ elim (eq_inv_nx … H) -H /3 width=3 by lexs_next/
+| elim (eq_inv_px … H) -H /3 width=3 by lexs_push/
 ]
 qed-.
 
-lemma lexs_eq_repl_fwd: ∀RN,RP,L1,L2. eq_stream_repl_fwd … (λf. L1 ⦻*[RN, RP, f] L2).
-#RN #RP #L1 #L2 @eq_stream_repl_sym /2 width=3 by lexs_eq_repl_back/ (**) (* full auto fails *)
+lemma lexs_eq_repl_fwd: ∀RN,RP,L1,L2. eq_repl_fwd … (λf. L1 ⦻*[RN, RP, f] L2).
+#RN #RP #L1 #L2 @eq_repl_sym /2 width=3 by lexs_eq_repl_back/ (**) (* full auto fails *)
 qed-.
 
 (* Note: fexs_sym and fexs_trans hold, but lexs_sym and lexs_trans do not  *)
@@ -156,9 +187,9 @@ lemma sle_lexs_trans: ∀RN,RP. (∀L,T1,T2. RN L T1 T2 → RP L T1 T2) →
 #RN #RP #HR #L1 #L2 #f2 #H elim H -L1 -L2 -f2 //
 #I #L1 #L2 #V1 #V2 #f2 #_ #HV12 #IH
 [ * * [2: #n1 ] ] #f1 #H
-[ /4 width=5 by lexs_next, sle_inv_SS_aux/
-| /4 width=5 by lexs_push, sle_inv_OS_aux/
-| elim (sle_inv_xO_aux … H) -H [3: // |2: skip ]
+[ /4 width=5 by lexs_next, sle_inv_nn/
+| /4 width=5 by lexs_push, sle_inv_pn/
+| elim (sle_inv_xp … H) -H [2,3: // ]
   #g1 #H #H1 destruct /3 width=5 by lexs_push/
 ]
 qed-.
@@ -169,9 +200,9 @@ lemma sle_lexs_conf: ∀RN,RP. (∀L,T1,T2. RP L T1 T2 → RN L T1 T2) →
 #RN #RP #HR #L1 #L2 #f2 #H elim H -L1 -L2 -f2 //
 #I #L1 #L2 #V1 #V2 #f1 #_ #HV12 #IH
 [2: * * [2: #n2 ] ] #f2 #H
-[ /4 width=5 by lexs_next, sle_inv_OS_aux/
-| /4 width=5 by lexs_push, sle_inv_OO_aux/
-| elim (sle_inv_Sx_aux … H) -H [3: // |2: skip ]
+[ /4 width=5 by lexs_next, sle_inv_pn/
+| /4 width=5 by lexs_push, sle_inv_pp/
+| elim (sle_inv_nx … H) -H [2,3: // ]
   #g2 #H #H2 destruct /3 width=5 by lexs_next/
 ]
 qed-.
@@ -183,11 +214,3 @@ lemma lexs_co: ∀RN1,RP1,RN2,RP2.
 #RN1 #RP1 #RN2 #RP2 #HRN #HRP #L1 #L2 #f #H elim H -L1 -L2 -f
 /3 width=1 by lexs_atom, lexs_next, lexs_push/
 qed-.
-
-(* Basic_2A1: removed theorems 17:
-              llpx_sn_inv_bind llpx_sn_inv_flat
-              llpx_sn_fwd_lref llpx_sn_fwd_pair_sn llpx_sn_fwd_length
-              llpx_sn_fwd_bind_sn llpx_sn_fwd_bind_dx llpx_sn_fwd_flat_sn llpx_sn_fwd_flat_dx
-              llpx_sn_refl llpx_sn_Y llpx_sn_bind_O llpx_sn_ge_up llpx_sn_ge llpx_sn_co
-              llpx_sn_fwd_drop_sn llpx_sn_fwd_drop_dx              
-*)