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/substitution/lleq_ext.ma".
16 include "basic_2/reduction/cpx.ma".
18 (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
20 (* Properties on lazy equivalence for local environments ********************)
22 lemma lleq_cpx_trans: ∀h,g,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡[h, g] T2 →
23 ∀L1. L1 ⋕[T1, 0] L2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2.
24 #h #g #G #L2 #T1 #T2 #H elim H -G -L2 -T1 -T2 /2 width=2 by cpx_sort/
25 [ #I #G #L2 #K2 #V1 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV12 #L1 #H elim (lleq_fwd_lref_dx … H … HLK2) -L2
26 [ #H elim (ylt_yle_false … H) //
27 | * /3 width=7 by cpx_delta/
29 | #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_bind_O … H) -H
30 /3 width=1 by cpx_bind/
31 | #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
32 /3 width=1 by cpx_flat/
33 | #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #H elim (lleq_inv_bind_O … H) -H
34 /3 width=3 by cpx_zeta/
35 | #G #L2 #W1 #T1 #T2 #_ #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
36 /3 width=1 by cpx_tau/
37 | #G #L2 #W1 #W2 #T1 #_ #IHW12 #L1 #H elim (lleq_inv_flat … H) -H
39 | #a #G #L1 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
40 #HV1 #H elim (lleq_inv_bind_O … H) -H /3 width=1 by cpx_beta/
41 | #a #G #L1 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
42 #HV1 #H elim (lleq_inv_bind_O … H) -H /3 width=3 by cpx_theta/
46 (* Note: lemma 1000 *)
47 lemma lleq_cpx_conf_dx: ∀h,g,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡[h, g] T2 →
48 ∀L1. L1 ⋕[T1, 0] L2 → L1 ⋕[T2, 0] L2.
49 #h #g #G #L2 #T1 #T2 #H elim H -G -L2 -T1 -T2
51 | /3 width=3 by lleq_fwd_length, lleq_sort/
52 | #I2 #G #L2 #K2 #V1 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV12 #L1 #H elim (lleq_inv_lref_ge_dx … H … HLK2) // -H
54 lapply (ldrop_fwd_drop2 … HLK1) -HLK1 #HLK1
55 lapply (ldrop_fwd_drop2 … HLK2) -HLK2 #HLK2
56 @(lleq_lift_le … HLK1 HLK2 … HVW2) -HLK1 -HLK2 -HVW2 /2 width=1 by/ (**) (* full auto too slow *)
57 | #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_bind_O … H) -H
58 /4 width=5 by lleq_bind_repl_SO, lleq_bind/
59 | #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
60 /3 width=1 by lleq_flat/
61 | #G #L2 #V #T1 #T2 #T #_ #HT2 #IHT12 #L1 #H elim (lleq_inv_bind_O … H) -H
62 /3 width=10 by lleq_inv_lift_le, ldrop_drop/
63 | #G #L2 #V #T1 #T2 #_ #IHT12 #L1 #H elim (lleq_inv_flat … H) -H /2 width=1 by/
64 | #G #L2 #V1 #V2 #T #_ #IHV12 #L1 #H elim (lleq_inv_flat … H) -H /2 width=1 by/
65 | #a #G #L2 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
66 #HV1 #H elim (lleq_inv_bind_O … H) -H
67 /4 width=5 by lleq_bind_repl_SO, lleq_flat, lleq_bind/
68 | #a #G #L2 #V1 #V2 #V #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H
69 #HV1 #H elim (lleq_inv_bind_O … H) -H
70 #HW1 #HT1 @lleq_bind_O /2 width=1 by/ @lleq_flat (**) (* full auto too slow *)
71 [ /3 width=10 by lleq_lift_le, ldrop_drop/
72 | /3 width=3 by lleq_bind_repl_O/
76 lemma lleq_cpx_conf_sn: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 →
77 ∀L2. L1 ⋕[T1, 0] L2 → L1 ⋕[T2, 0] L2.
78 /4 width=6 by lleq_cpx_conf_dx, lleq_sym/ qed-.