]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reduction/llpr_ldrop.ma
commit of the "computation" component with lazy pointwise extensions
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reduction / llpr_ldrop.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/relocation/fquq_alt.ma".
16 include "basic_2/reduction/cpr_lift.ma".
17 include "basic_2/reduction/cpr_llpx_sn.ma".
18 include "basic_2/reduction/llpr.ma".
19
20 (* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************)
21
22 (* Advanced inversion lemmas ************************************************)
23
24 lemma llpr_inv_lref_ge_dx: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
25                            ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 →
26                            ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 &
27                                     ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
28 /2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-.
29
30 lemma llpr_inv_lref_ge_sn: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
31                            ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 →
32                            ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 &
33                                     ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
34 /2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-.
35
36 lemma llpr_inv_lref_ge_bi: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i →
37                            ∀I1,I2,K1,K2,V1,V2.
38                            ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 →
39                            ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2.
40 /2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-.
41
42 lemma llpr_inv_bind_O: ∀a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [ⓑ{a,I}V.T, 0] L2 →
43                        ⦃G, L1⦄ ⊢ ➡[V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V.
44 /2 width=2 by llpx_sn_inv_bind_O/ qed-.
45
46 lemma llpr_bind_repl_O: ∀I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V2 →
47                         ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡ W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[T, 0] L2.ⓑ{J}W2.
48 /2 width=4 by llpx_sn_bind_repl_O/ qed-.
49
50 (* Advanced properties ******************************************************)
51
52 lemma llpr_cpr_conf: ∀G. s_r_confluent1 … (cpr G) (llpr G 0).
53 /3 width=10 by llpx_sn_cpr_conf, cpr_inv_lift1, cpr_lift/ qed-.
54
55 (* Properties on context-sensitive parallel reduction for terms *************)
56
57 lemma fqu_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
58                         ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
59                         ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄.
60 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
61 /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/
62 #G #L #K #U #T #e #HLK #HUT #U2 #HU2
63 elim (lift_total U2 0 (e+1)) #T2 #HUT2
64 lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/
65 qed-.
66
67 lemma fquq_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
68                          ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
69                          ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
70 #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
71 [ #HT12 elim (fqu_cpr_trans_dx … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
72 | * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
73 ]
74 qed-.
75
76 lemma fqu_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
77                         ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
78                         ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄.
79 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
80 /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/
81 #G #L #K #U #T #e #HLK #HUT #U2 #HU2
82 elim (lift_total U2 0 (e+1)) #T2 #HUT2
83 lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/
84 qed-.
85
86 lemma fquq_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
87                          ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
88                          ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
89 #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
90 [ #HT12 elim (fqu_cpr_trans_sn … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
91 | * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
92 ]
93 qed-.