]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/static_2/relocation/sex.ma
milestone update in basic_2, update in ground and static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / sex.ma
index 6eb1629fd8609d3416f2aa0f272d6a3b8048ed8b..3fba7476ad0d087ac365539b8668024fc793e1ee 100644 (file)
@@ -12,8 +12,8 @@
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground_2/relocation/rtmap_sle.ma".
-include "ground_2/relocation/rtmap_sdj.ma".
+include "ground/relocation/rtmap_sle.ma".
+include "ground/relocation/rtmap_sdj.ma".
 include "static_2/notation/relations/relation_5.ma".
 include "static_2/syntax/lenv.ma".
 
@@ -23,15 +23,23 @@ inductive sex (RN,RP:relation3 lenv bind bind): rtmap → relation lenv ≝
 | sex_atom: ∀f. sex RN RP f (⋆) (⋆)
 | sex_next: ∀f,I1,I2,L1,L2.
             sex RN RP f L1 L2 → RN L1 I1 I2 →
-            sex RN RP (↑f) (L1.ⓘ{I1}) (L2.ⓘ{I2})
+            sex RN RP (↑f) (L1.ⓘ[I1]) (L2.ⓘ[I2])
 | sex_push: ∀f,I1,I2,L1,L2.
             sex RN RP f L1 L2 → RP L1 I1 I2 →
-            sex RN RP (⫯f) (L1.ⓘ{I1}) (L2.ⓘ{I2})
+            sex RN RP (⫯f) (L1.ⓘ[I1]) (L2.ⓘ[I2])
 .
 
 interpretation "generic entrywise extension (local environment)"
    'Relation RN RP f L1 L2 = (sex RN RP f L1 L2).
 
+definition sex_transitive: relation3 lenv bind bind → relation3 lenv bind bind →
+                           relation3 lenv bind bind →
+                           relation3 lenv bind bind → relation3 lenv bind bind →
+                           relation3 rtmap lenv bind ≝
+                           λR1,R2,R3,RN,RP,f,L1,I1.
+                           ∀I. R1 L1 I1 I → ∀L2. L1 ⪤[RN,RP,f] L2 →
+                           ∀I2. R2 L2 I I2 → R3 L1 I1 I2.
+
 definition R_pw_confluent2_sex: relation3 lenv bind bind → relation3 lenv bind bind →
                                 relation3 lenv bind bind → relation3 lenv bind bind →
                                 relation3 lenv bind bind → relation3 lenv bind bind →
@@ -41,13 +49,14 @@ definition R_pw_confluent2_sex: relation3 lenv bind bind → relation3 lenv bind
                                 ∀L1. L0 ⪤[RN1,RP1,f] L1 → ∀L2. L0 ⪤[RN2,RP2,f] L2 →
                                 ∃∃I. R2 L1 I1 I & R1 L2 I2 I.
 
-definition sex_transitive: relation3 lenv bind bind → relation3 lenv bind bind →
-                           relation3 lenv bind bind →
-                           relation3 lenv bind bind → relation3 lenv bind bind →
-                           relation3 rtmap lenv bind ≝
-                           λR1,R2,R3,RN,RP,f,L1,I1.
-                           ∀I. R1 L1 I1 I → ∀L2. L1 ⪤[RN,RP,f] L2 →
-                           ∀I2. R2 L2 I I2 → R3 L1 I1 I2.
+definition R_pw_replace3_sex: relation3 lenv bind bind → relation3 lenv bind bind →
+                              relation3 lenv bind bind → relation3 lenv bind bind →
+                              relation3 lenv bind bind → relation3 lenv bind bind →
+                              relation3 rtmap lenv bind ≝
+                              λR1,R2,RN1,RP1,RN2,RP2,f,L0,I0.
+                              ∀I1. R1 L0 I0 I1 → ∀I2. R2 L0 I0 I2 →
+                              ∀L1. L0 ⪤[RN1,RP1,f] L1 → ∀L2. L0 ⪤[RN2,RP2,f] L2 →
+                              ∀I. R2 L1 I1 I → R1 L2 I2 I.
 
 (* Basic inversion lemmas ***************************************************)
 
@@ -60,8 +69,8 @@ qed-.
 lemma sex_inv_atom1: ∀RN,RP,f,Y. ⋆ ⪤[RN,RP,f] Y → Y = ⋆.
 /2 width=6 by sex_inv_atom1_aux/ qed-.
 
-fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ↑g →
-                        ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}.
+fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ[J1] → f = ↑g →
+                        ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ[J2].
 #RN #RP #f #X #Y * -f -X -Y
 [ #f #g #J1 #K1 #H destruct
 | #f #I1 #I2 #L1 #L2 #HL #HI #g #J1 #K1 #H1 #H2 <(injective_next … H2) -g destruct
@@ -71,12 +80,12 @@ fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.
 qed-.
 
 (* Basic_2A1: includes lpx_sn_inv_pair1 *)
-lemma sex_inv_next1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN,RP,↑g] Y →
-                     ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}.
+lemma sex_inv_next1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ[J1] ⪤[RN,RP,↑g] Y →
+                     ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ[J2].
 /2 width=7 by sex_inv_next1_aux/ qed-.
 
-fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ⫯g →
-                        ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}.
+fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ[J1] → f = ⫯g →
+                        ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ[J2].
 #RN #RP #f #X #Y * -f -X -Y
 [ #f #g #J1 #K1 #H destruct
 | #f #I1 #I2 #L1 #L2 #_ #_ #g #J1 #K1 #_ #H elim (discr_next_push … H)
@@ -85,8 +94,8 @@ fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.
 ]
 qed-.
 
-lemma sex_inv_push1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN,RP,⫯g] Y →
-                     ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}.
+lemma sex_inv_push1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ[J1] ⪤[RN,RP,⫯g] Y →
+                     ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ[J2].
 /2 width=7 by sex_inv_push1_aux/ qed-.
 
 fact sex_inv_atom2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → Y = ⋆ → X = ⋆.
@@ -98,8 +107,8 @@ qed-.
 lemma sex_inv_atom2: ∀RN,RP,f,X. X ⪤[RN,RP,f] ⋆ → X = ⋆.
 /2 width=6 by sex_inv_atom2_aux/ qed-.
 
-fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ↑g →
-                        ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}.
+fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ[J2] → f = ↑g →
+                        ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ[J1].
 #RN #RP #f #X #Y * -f -X -Y
 [ #f #g #J2 #K2 #H destruct
 | #f #I1 #I2 #L1 #L2 #HL #HI #g #J2 #K2 #H1 #H2 <(injective_next … H2) -g destruct
@@ -109,12 +118,12 @@ fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.
 qed-.
 
 (* Basic_2A1: includes lpx_sn_inv_pair2 *)
-lemma sex_inv_next2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,↑g] K2.ⓘ{J2} →
-                     ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}.
+lemma sex_inv_next2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,↑g] K2.ⓘ[J2] →
+                     ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ[J1].
 /2 width=7 by sex_inv_next2_aux/ qed-.
 
-fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ⫯g →
-                        ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}.
+fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ[J2] → f = ⫯g →
+                        ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ[J1].
 #RN #RP #f #X #Y * -f -X -Y
 [ #f #J2 #K2 #g #H destruct
 | #f #I1 #I2 #L1 #L2 #_ #_ #g #J2 #K2 #_ #H elim (discr_next_push … H)
@@ -123,20 +132,20 @@ fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.
 ]
 qed-.
 
-lemma sex_inv_push2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,⫯g] K2.ⓘ{J2} →
-                     ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}.
+lemma sex_inv_push2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,⫯g] K2.ⓘ[J2] →
+                     ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ[J1].
 /2 width=7 by sex_inv_push2_aux/ qed-.
 
 (* Basic_2A1: includes lpx_sn_inv_pair *)
 lemma sex_inv_next: ∀RN,RP,f,I1,I2,L1,L2.
-                    L1.ⓘ{I1} ⪤[RN,RP,↑f] L2.ⓘ{I2} →
+                    L1.ⓘ[I1] ⪤[RN,RP,↑f] L2.ⓘ[I2] →
                     L1 ⪤[RN,RP,f] L2 ∧ RN L1 I1 I2.
 #RN #RP #f #I1 #I2 #L1 #L2 #H elim (sex_inv_next1 … H) -H
 #I0 #L0 #HL10 #HI10 #H destruct /2 width=1 by conj/
 qed-.
 
 lemma sex_inv_push: ∀RN,RP,f,I1,I2,L1,L2.
-                    L1.ⓘ{I1} ⪤[RN,RP,⫯f] L2.ⓘ{I2} →
+                    L1.ⓘ[I1] ⪤[RN,RP,⫯f] L2.ⓘ[I2] →
                     L1 ⪤[RN,RP,f] L2 ∧ RP L1 I1 I2.
 #RN #RP #f #I1 #I2 #L1 #L2 #H elim (sex_inv_push1 … H) -H
 #I0 #L0 #HL10 #HI10 #H destruct /2 width=1 by conj/
@@ -144,7 +153,7 @@ qed-.
 
 lemma sex_inv_tl: ∀RN,RP,f,I1,I2,L1,L2. L1 ⪤[RN,RP,⫱f] L2 →
                   RN L1 I1 I2 → RP L1 I1 I2 →
-                  L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2}.
+                  L1.ⓘ[I1] ⪤[RN,RP,f] L2.ⓘ[I2].
 #RN #RP #f #I1 #I2 #L2 #L2 elim (pn_split f) *
 /2 width=1 by sex_next, sex_push/
 qed-.
@@ -152,7 +161,7 @@ qed-.
 (* Basic forward lemmas *****************************************************)
 
 lemma sex_fwd_bind: ∀RN,RP,f,I1,I2,L1,L2.
-                    L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2} →
+                    L1.ⓘ[I1] ⪤[RN,RP,f] L2.ⓘ[I2] →
                     L1 ⪤[RN,RP,⫱f] L2.
 #RN #RP #f #I1 #I2 #L1 #L2 #Hf
 elim (pn_split f) * #g #H destruct
@@ -189,9 +198,9 @@ lemma sex_sym: ∀RN,RP.
 qed-.
 
 lemma sex_pair_repl: ∀RN,RP,f,I1,I2,L1,L2.
-                     L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2} →
+                     L1.ⓘ[I1] ⪤[RN,RP,f] L2.ⓘ[I2] →
                      ∀J1,J2. RN L1 J1 J2 → RP L1 J1 J2 →
-                     L1.ⓘ{J1} ⪤[RN,RP,f] L2.ⓘ{J2}.
+                     L1.ⓘ[J1] ⪤[RN,RP,f] L2.ⓘ[J2].
 /3 width=3 by sex_inv_tl, sex_fwd_bind/ qed-.
 
 lemma sex_co: ∀RN1,RP1,RN2,RP2. RN1 ⊆ RN2 → RP1 ⊆ RP2 →
@@ -201,7 +210,7 @@ lemma sex_co: ∀RN1,RP1,RN2,RP2. RN1 ⊆ RN2 → RP1 ⊆ RP2 →
 qed-.
 
 lemma sex_co_isid: ∀RN1,RP1,RN2,RP2. RP1 ⊆ RP2 →
-                   â\88\80f,L1,L2. L1 âª¤[RN1,RP1,f] L2 â\86\92 ð\9d\90\88â¦\83fâ¦\84 →
+                   â\88\80f,L1,L2. L1 âª¤[RN1,RP1,f] L2 â\86\92 ð\9d\90\88â\9dªfâ\9d« →
                    L1 ⪤[RN2,RP2,f] L2.
 #RN1 #RP1 #RN2 #RP2 #HR #f #L1 #L2 #H elim H -f -L1 -L2 //
 #f #I1 #I2 #K1 #K2 #_ #HI12 #IH #H