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/extpsubstsnstar_3.ma".
16 include "basic_2/grammar/lpx_sn.ma".
17 include "basic_2/substitution/cpys.ma".
19 (* SN EXTENDED MULTIPLE SUBSTITUTION FOR LOCAL ENVIRONMENTS *****************)
21 definition lpys: relation3 genv lenv lenv ≝ λG. lpx_sn (cpys G).
24 "extended multiple substitution (local environment, sn variant)"
25 'ExtPSubstSnStar G L1 L2 = (lpys G L1 L2).
27 (* Basic inversion lemmas ***************************************************)
29 lemma lpys_inv_atom1: ∀G,L2. ⦃G, ⋆⦄ ⊢ ▶*× L2 → L2 = ⋆.
30 /2 width=4 by lpx_sn_inv_atom1_aux/ qed-.
32 lemma lpys_inv_pair1: ∀I,G,K1,V1,L2. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ▶*× L2 →
33 ∃∃K2,V2. ⦃G, K1⦄ ⊢ ▶*× K2 & ⦃G, K1⦄ ⊢ V1 ▶*× V2 &
35 /2 width=3 by lpx_sn_inv_pair1_aux/ qed-.
37 lemma lpys_inv_atom2: ∀G,L1. ⦃G, L1⦄ ⊢ ▶*× ⋆ → L1 = ⋆.
38 /2 width=4 by lpx_sn_inv_atom2_aux/ qed-.
40 lemma lpys_inv_pair2: ∀I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ▶*× K2.ⓑ{I}V2 →
41 ∃∃K1,V1. ⦃G, K1⦄ ⊢ ▶*× K2 & ⦃G, K1⦄ ⊢ V1 ▶*× V2 &
43 /2 width=3 by lpx_sn_inv_pair2_aux/ qed-.
45 lemma lpys_inv_pair: ∀I1,I2,G,L1,L2,V1,V2. ⦃G, L1.ⓑ{I1}V1⦄ ⊢ ▶*× L2.ⓑ{I2}V2 →
46 ∧∧ ⦃G, L1⦄ ⊢ ▶*× L2 & ⦃G, L1⦄ ⊢ V1 ▶*× V2 & I1 = I2.
47 /2 width=1 by lpx_sn_inv_pair/ qed-.
49 (* Basic properties *********************************************************)
51 lemma lpys_refl: ∀G,L. ⦃G, L⦄ ⊢ ▶*× L.
52 /2 width=1 by lpx_sn_refl/ qed.
54 lemma lpys_pair: ∀I,G,K1,K2,V1,V2. ⦃G, K1⦄ ⊢ ▶*× K2 → ⦃G, K1⦄ ⊢ V1 ▶*× V2 →
55 ⦃G, K1.ⓑ{I}V1⦄ ⊢ ▶*× K2.ⓑ{I}V2.
56 /2 width=1 by lpx_sn_pair/ qed.
58 lemma lpys_append: ∀G,K1,K2. ⦃G, K1⦄ ⊢ ▶*× K2 → ∀L1,L2. ⦃G, L1⦄ ⊢ ▶*× L2 →
59 ⦃G, L1 @@ K1⦄ ⊢ ▶*× L2 @@ K2.
60 /3 width=1 by lpx_sn_append, cpys_append/ qed.
62 (* Basic forward lemmas *****************************************************)
64 lemma lpys_fwd_length: ∀G,L1,L2. ⦃G, L1⦄ ⊢ ▶*× L2 → |L1| = |L2|.
65 /2 width=2 by lpx_sn_fwd_length/ qed-.
67 (* Advanced forward lemmas **************************************************)
69 lemma lpys_fwd_append1: ∀G,K1,L1,L. ⦃G, K1 @@ L1⦄ ⊢ ▶*× L →
70 ∃∃K2,L2. ⦃G, K1⦄ ⊢ ▶*× K2 & L = K2 @@ L2.
71 /2 width=2 by lpx_sn_fwd_append1/ qed-.
73 lemma lpys_fwd_append2: ∀G,L,K2,L2. ⦃G, L⦄ ⊢ ▶*× K2 @@ L2 →
74 ∃∃K1,L1. ⦃G, K1⦄ ⊢ ▶*× K2 & L = K1 @@ L1.
75 /2 width=2 by lpx_sn_fwd_append2/ qed-.