1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/notation/relations/predsn_5.ma".
16 include "basic_2/static/lfxs.ma".
17 include "basic_2/rt_transition/cpm.ma".
19 (* PARALLEL R-TRANSITION FOR LOCAL ENV.S ON REFERRED ENTRIES ****************)
21 definition lfpr: sh → genv → relation3 term lenv lenv ≝
22 λh,G. lfxs (cpm 0 h G).
25 "parallel r-transition on referred entries (local environment)"
26 'PRedSn h T G L1 L2 = (lfpr h G T L1 L2).
28 (* Basic properties ***********************************************************)
30 lemma lfpr_atom: ∀h,I,G. ⦃G, ⋆⦄ ⊢ ➡[h, ⓪{I}] ⋆.
31 /2 width=1 by lfxs_atom/ qed.
33 lemma lfpr_sort: ∀h,I,G,L1,L2,V1,V2,s.
34 ⦃G, L1⦄ ⊢ ➡[h, ⋆s] L2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, ⋆s] L2.ⓑ{I}V2.
35 /2 width=1 by lfxs_sort/ qed.
37 lemma lfpr_zero: ∀h,I,G,L1,L2,V.
38 ⦃G, L1⦄ ⊢ ➡[h, V] L2 → ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, #0] L2.ⓑ{I}V.
39 /2 width=1 by lfxs_zero/ qed.
41 lemma lfpr_lref: ∀h,I,G,L1,L2,V1,V2,i.
42 ⦃G, L1⦄ ⊢ ➡[h, #i] L2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, #⫯i] L2.ⓑ{I}V2.
43 /2 width=1 by lfxs_lref/ qed.
45 lemma lfpr_gref: ∀h,I,G,L1,L2,V1,V2,l.
46 ⦃G, L1⦄ ⊢ ➡[h, §l] L2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, §l] L2.ⓑ{I}V2.
47 /2 width=1 by lfxs_gref/ qed.
49 lemma lfpr_pair_repl_dx: ∀h,I,G,L1,L2,T,V,V1.
50 ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, T] L2.ⓑ{I}V1 →
51 ∀V2. ⦃G, L1⦄ ⊢ V ➡[h] V2 →
52 ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, T] L2.ⓑ{I}V2.
53 /2 width=2 by lfxs_pair_repl_dx/ qed-.
55 (* Basic inversion lemmas ***************************************************)
57 lemma lfpr_inv_atom_sn: ∀h,I,G,Y2. ⦃G, ⋆⦄ ⊢ ➡[h, ⓪{I}] Y2 → Y2 = ⋆.
58 /2 width=3 by lfxs_inv_atom_sn/ qed-.
60 lemma lfpr_inv_atom_dx: ∀h,I,G,Y1. ⦃G, Y1⦄ ⊢ ➡[h, ⓪{I}] ⋆ → Y1 = ⋆.
61 /2 width=3 by lfxs_inv_atom_dx/ qed-.
63 lemma lfpr_inv_zero: ∀h,G,Y1,Y2. ⦃G, Y1⦄ ⊢ ➡[h, #0] Y2 →
65 ∃∃I,L1,L2,V1,V2. ⦃G, L1⦄ ⊢ ➡[h, V1] L2 &
66 ⦃G, L1⦄ ⊢ V1 ➡[h] V2 &
67 Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2.
68 /2 width=1 by lfxs_inv_zero/ qed-.
70 lemma lfpr_inv_lref: ∀h,G,Y1,Y2,i. ⦃G, Y1⦄ ⊢ ➡[h, #⫯i] Y2 →
72 ∃∃I,L1,L2,V1,V2. ⦃G, L1⦄ ⊢ ➡[h, #i] L2 &
73 Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2.
74 /2 width=1 by lfxs_inv_lref/ qed-.
76 lemma lfpr_inv_bind: ∀h,p,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡[h, ⓑ{p,I}V.T] L2 →
77 ⦃G, L1⦄ ⊢ ➡[h, V] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, T] L2.ⓑ{I}V.
78 /2 width=2 by lfxs_inv_bind/ qed-.
80 lemma lfpr_inv_flat: ∀h,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡[h, ⓕ{I}V.T] L2 →
81 ⦃G, L1⦄ ⊢ ➡[h, V] L2 ∧ ⦃G, L1⦄ ⊢ ➡[h, T] L2.
82 /2 width=2 by lfxs_inv_flat/ qed-.
84 (* Advanced inversion lemmas ************************************************)
86 lemma lfpr_inv_zero_pair_sn: ∀h,I,G,Y2,L1,V1. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, #0] Y2 →
87 ∃∃L2,V2. ⦃G, L1⦄ ⊢ ➡[h, V1] L2 & ⦃G, L1⦄ ⊢ V1 ➡[h] V2 &
89 /2 width=1 by lfxs_inv_zero_pair_sn/ qed-.
91 lemma lfpr_inv_zero_pair_dx: ∀h,I,G,Y1,L2,V2. ⦃G, Y1⦄ ⊢ ➡[h, #0] L2.ⓑ{I}V2 →
92 ∃∃L1,V1. ⦃G, L1⦄ ⊢ ➡[h, V1] L2 & ⦃G, L1⦄ ⊢ V1 ➡[h] V2 &
94 /2 width=1 by lfxs_inv_zero_pair_dx/ qed-.
96 lemma lfpr_inv_lref_pair_sn: ∀h,I,G,Y2,L1,V1,i. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, #⫯i] Y2 →
97 ∃∃L2,V2. ⦃G, L1⦄ ⊢ ➡[h, #i] L2 & Y2 = L2.ⓑ{I}V2.
98 /2 width=2 by lfxs_inv_lref_pair_sn/ qed-.
100 lemma lfpr_inv_lref_pair_dx: ∀h,I,G,Y1,L2,V2,i. ⦃G, Y1⦄ ⊢ ➡[h, #⫯i] L2.ⓑ{I}V2 →
101 ∃∃L1,V1. ⦃G, L1⦄ ⊢ ➡[h, #i] L2 & Y1 = L1.ⓑ{I}V1.
102 /2 width=2 by lfxs_inv_lref_pair_dx/ qed-.
104 (* Basic forward lemmas *****************************************************)
106 lemma lfpr_fwd_bind_sn: ∀h,p,I,G,L1,L2,V,T.
107 ⦃G, L1⦄ ⊢ ➡[h, ⓑ{p,I}V.T] L2 → ⦃G, L1⦄ ⊢ ➡[h, V] L2.
108 /2 width=4 by lfxs_fwd_bind_sn/ qed-.
110 lemma lfpr_fwd_bind_dx: ∀h,p,I,G,L1,L2,V,T.
111 ⦃G, L1⦄ ⊢ ➡[h, ⓑ{p,I}V.T] L2 → ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, T] L2.ⓑ{I}V.
112 /2 width=2 by lfxs_fwd_bind_dx/ qed-.
114 lemma lfpr_fwd_flat_sn: ∀h,I,G,L1,L2,V,T.
115 ⦃G, L1⦄ ⊢ ➡[h, ⓕ{I}V.T] L2 → ⦃G, L1⦄ ⊢ ➡[h, V] L2.
116 /2 width=3 by lfxs_fwd_flat_sn/ qed-.
118 lemma lfpr_fwd_flat_dx: ∀h,I,G,L1,L2,V,T.
119 ⦃G, L1⦄ ⊢ ➡[h, ⓕ{I}V.T] L2 → ⦃G, L1⦄ ⊢ ➡[h, T] L2.
120 /2 width=3 by lfxs_fwd_flat_dx/ qed-.
122 lemma lfpr_fwd_pair_sn: ∀h,I,G,L1,L2,V,T.
123 ⦃G, L1⦄ ⊢ ➡[h, ②{I}V.T] L2 → ⦃G, L1⦄ ⊢ ➡[h, V] L2.
124 /2 width=3 by lfxs_fwd_pair_sn/ qed-.
126 (* Basic_2A1: removed theorems 14:
127 lpr_inv_atom1 lpr_inv_pair1 lpr_inv_atom2 lpr_inv_pair2
129 lpr_fwd_length lpr_lpx
130 lpr_drop_conf drop_lpr_trans lpr_drop_trans_O1
131 cpr_conf_lpr lpr_cpr_conf_dx lpr_cpr_conf_sn
133 (* Basic_1: removed theorems 7:
134 wcpr0_gen_sort wcpr0_gen_head
135 wcpr0_getl wcpr0_getl_back
137 wcpr0_drop wcpr0_drop_back