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/relocation/fquq_alt.ma".
16 include "basic_2/static/ssta_llpx_sn.ma".
17 include "basic_2/reduction/cpr_lift.ma".
18 include "basic_2/reduction/cpr_llpx_sn.ma".
19 include "basic_2/reduction/llpr.ma".
21 (* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************)
23 (* Advanced inversion lemmas ************************************************)
25 lemma llpr_inv_lref_ge_dx: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
26 ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 →
27 ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 &
28 ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
29 /2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-.
31 lemma llpr_inv_lref_ge_sn: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
32 ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 →
33 ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 &
34 ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
35 /2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-.
37 lemma llpr_inv_lref_ge_bi: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
39 ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 →
40 ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
41 /2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-.
43 lemma llpr_inv_bind_O: ∀a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [ⓑ{a,I}V.T, 0] L2 →
44 ⦃G, L1⦄ ⊢ ➡[V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V.
45 /2 width=2 by llpx_sn_inv_bind_O/ qed-.
47 lemma llpr_bind_repl_O: ∀I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V2 →
48 ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡ W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[T, 0] L2.ⓑ{J}W2.
49 /2 width=4 by llpx_sn_bind_repl_O/ qed-.
51 (* Advanced properties ******************************************************)
53 lemma llpr_ssta_conf: ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpr G 0).
54 /3 width=10 by ssta_llpx_sn_conf, cpr_lift/ qed-.
56 lemma llpr_cpr_conf: ∀G. s_r_confluent1 … (cpr G) (llpr G 0).
57 /3 width=10 by cpr_llpx_sn_conf, cpr_inv_lift1, cpr_lift/ qed-.
59 (* Properties on context-sensitive parallel reduction for terms *************)
61 lemma fqu_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
62 ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
63 ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄.
64 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
65 /3 width=10 by llpr_lref, cpr_pair_sn, cpr_atom, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/
66 #G #L #K #U #T #e #HLK #HUT #U2 #HU2
67 elim (lift_total U2 0 (e+1)) #T2 #HUT2
68 lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/
71 lemma fquq_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
72 ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
73 ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
74 #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
75 [ #HT12 elim (fqu_cpr_trans_dx … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
76 | * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
80 lemma fqu_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
81 ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
82 ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄.
83 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
84 /3 width=10 by llpr_lref, cpr_pair_sn, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/
85 #G #L #K #U #T #e #HLK #HUT #U2 #HU2
86 elim (lift_total U2 0 (e+1)) #T2 #HUT2
87 lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/
90 lemma fquq_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
91 ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
92 ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
93 #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
94 [ #HT12 elim (fqu_cpr_trans_sn … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
95 | * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/