]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / lprs.ma
index 4bc12d246b22890658eaf8f5c571c122ba1f7279..880278d222f394b538eda0566f3a905ae18fa057 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "basic_2/notation/relations/predsnstar_3.ma".
-include "basic_2/substitution/lpx_sn_tc.ma".
-include "basic_2/reduction/lpr.ma".
+include "basic_2/notation/relations/predsnstar_4.ma".
+include "static_2/relocation/lex.ma".
+include "basic_2/rt_computation/cprs_ext.ma".
 
-(* SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ****************************)
+(* PARALLEL R-COMPUTATION FOR FULL LOCAL ENVIRONMENTS ***********************)
 
-definition lprs: relation3 genv lenv lenv ≝
-                 λG. TC … (lpr G).
+definition lprs (h) (G): relation lenv ≝
+                         lex (λL.cpms h G L 0).
 
-interpretation "parallel computation (local environment, sn variant)"
-   'PRedSnStar G L1 L2 = (lprs G L1 L2).
-
-(* Basic eliminators ********************************************************)
-
-lemma lprs_ind: ∀G,L1. ∀R:predicate lenv. R L1 →
-                (∀L,L2. ⦃G, L1⦄ ⊢ ➡* L → ⦃G, L⦄ ⊢ ➡ L2 → R L → R L2) →
-                ∀L2. ⦃G, L1⦄ ⊢ ➡* L2 → R L2.
-#G #L1 #R #HL1 #IHL1 #L2 #HL12
-@(TC_star_ind … HL1 IHL1 … HL12) //
-qed-.
-
-lemma lprs_ind_dx: ∀G,L2. ∀R:predicate lenv. R L2 →
-                   (∀L1,L. ⦃G, L1⦄ ⊢ ➡ L → ⦃G, L⦄ ⊢ ➡* L2 → R L → R L1) →
-                   ∀L1. ⦃G, L1⦄ ⊢ ➡* L2 → R L1.
-#G #L2 #R #HL2 #IHL2 #L1 #HL12
-@(TC_star_ind_dx … HL2 IHL2 … HL12) //
-qed-.
+interpretation
+   "parallel r-computation on all entries (local environment)"
+   'PRedSnStar h G L1 L2 = (lprs h G L1 L2).
 
 (* Basic properties *********************************************************)
 
-lemma lpr_lprs: ∀G,L1,L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡* L2.
-/2 width=1 by inj/ qed.
+(* Basic_2A1: uses: lprs_pair_refl *)
+lemma lprs_bind_refl_dx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 →
+                                 ∀I. ⦃G, L1.ⓘ{I}⦄ ⊢ ➡*[h] L2.ⓘ{I}.
+/2 width=1 by lex_bind_refl_dx/ qed.
 
-lemma lprs_refl: ∀G,L. ⦃G, L⦄ ⊢ ➡* L.
-/2 width=1 by lpr_lprs/ qed.
+lemma lprs_pair (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 →
+                         ∀V1,V2. ⦃G, L1⦄ ⊢ V1 ➡*[h] V2 →
+                         ∀I. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2.ⓑ{I}V2.
+/2 width=1 by lex_pair/ qed.
 
-lemma lprs_strap1: ∀G,L1,L,L2. ⦃G, L1⦄ ⊢ ➡* L → ⦃G, L⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡* L2.
-/2 width=3 by step/ qed-.
+lemma lprs_refl (h) (G): ∀L. ⦃G, L⦄ ⊢ ➡*[h] L.
+/2 width=1 by lex_refl/ qed.
 
-lemma lprs_strap2: ∀G,L1,L,L2. ⦃G, L1⦄ ⊢ ➡ L → ⦃G, L⦄ ⊢ ➡* L2 → ⦃G, L1⦄ ⊢ ➡* L2.
-/2 width=3 by TC_strap/ qed-.
+(* Basic inversion lemmas ***************************************************)
 
-lemma lprs_pair_refl: ∀G,L1,L2. ⦃G, L1⦄ ⊢ ➡* L2 → ∀I,V. ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡* L2.ⓑ{I}V.
-/2 width=1 by TC_lpx_sn_pair_refl/ qed.
+(* Basic_2A1: uses: lprs_inv_atom1 *)
+lemma lprs_inv_atom_sn (h) (G): ∀L2. ⦃G, ⋆⦄ ⊢ ➡*[h] L2 → L2 = ⋆.
+/2 width=2 by lex_inv_atom_sn/ qed-.
 
-(* Basic inversion lemmas ***************************************************)
+(* Basic_2A1: was: lprs_inv_pair1 *)
+lemma lprs_inv_pair_sn (h) (G):
+                       ∀I,K1,L2,V1. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2 →
+                       ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡*[h] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 & L2 = K2.ⓑ{I}V2.
+/2 width=1 by lex_inv_pair_sn/ qed-.
 
-lemma lprs_inv_atom1: ∀G,L2. ⦃G, ⋆⦄ ⊢ ➡* L2 → L2 = ⋆.
-/2 width=2 by TC_lpx_sn_inv_atom1/ qed-.
+(* Basic_2A1: uses: lprs_inv_atom2 *)
+lemma lprs_inv_atom_dx (h) (G): ∀L1. ⦃G, L1⦄ ⊢ ➡*[h] ⋆ → L1 = ⋆.
+/2 width=2 by lex_inv_atom_dx/ qed-.
 
-lemma lprs_inv_atom2: ∀G,L1. ⦃G, L1⦄ ⊢ ➡* ⋆ → L1 = ⋆.
-/2 width=2 by TC_lpx_sn_inv_atom2/ qed-.
+(* Basic_2A1: was: lprs_inv_pair2 *)
+lemma lprs_inv_pair_dx (h) (G):
+                       ∀I,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡*[h] K2.ⓑ{I}V2 →
+                       ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡*[h] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 & L1 = K1.ⓑ{I}V1.
+/2 width=1 by lex_inv_pair_dx/ qed-.
 
-(* Basic forward lemmas *****************************************************)
+(* Basic eliminators ********************************************************)
 
-lemma lprs_fwd_length: ∀G,L1,L2. ⦃G, L1⦄ ⊢ ➡* L2 → |L1| = |L2|.
-/2 width=2 by TC_lpx_sn_fwd_length/ qed-.
+(* Basic_2A1: was: lprs_ind_alt *)
+lemma lprs_ind (h) (G): ∀Q:relation lenv.
+                        Q (⋆) (⋆) → (
+                          ∀I,K1,K2.
+                          ⦃G, K1⦄ ⊢ ➡*[h] K2 →
+                          Q K1 K2 → Q (K1.ⓘ{I}) (K2.ⓘ{I})
+                        ) → (
+                          ∀I,K1,K2,V1,V2.
+                          ⦃G, K1⦄ ⊢ ➡*[h] K2 → ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 →
+                          Q K1 K2 → Q (K1.ⓑ{I}V1) (K2.ⓑ{I}V2)
+                        ) →
+                        ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → Q L1 L2.
+/3 width=4 by lex_ind/ qed-.