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/cpye_lift.ma".
16 include "basic_2/substitution/lleq_alt.ma".
18 (* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************)
20 (* Forward lemmas on evaluation for extended substitution *******************)
22 lemma lleq_fwd_cpye: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → ∀G,T1. ⦃G, L1⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T1⦄ →
23 ∀T2. ⦃G, L2⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T2⦄ → T1 = T2.
24 #L1 #L2 #T #d #H @(lleq_ind_alt … H) -L1 -L2 -T -d
25 [ #L1 #L2 #d #k #_ #G #T1 #H1 #T2 #H2
26 >(cpye_inv_sort1 … H1) -H1 >(cpye_inv_sort1 … H2) -H2 //
27 | #L1 #L2 #d #i #_ #Hid #G #T1 #H1 #T2 #H2
28 >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ]
29 /2 width=1 by or3_intro2/
30 | #I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #HLK2 #_ #IHV #G #T1 #H1 #T2 #H2
31 elim (cpye_inv_lref1_subst_ex … H1 … HLK1) -H1 -HLK1 //
32 elim (cpye_inv_lref1_subst_ex … H2 … HLK2) -H2 -HLK2 //
33 >yminus_Y_inj #V2 #HV2 #HVT2 #V1 #HV1 #HVT1
34 lapply (IHV … HV1 … HV2) -IHV -HV1 -HV2 #H destruct /2 width=5 by lift_mono/
35 | #L1 #L2 #d #i #_ #HL1 #HL2 #G #T1 #H1 #T2 #H2
36 >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ]
37 /2 width=1 by or3_intro0/
38 | #L1 #L2 #d #p #_ #G #T1 #H1 #T2 #H2
39 >(cpye_inv_gref1 … H1) -H1 >(cpye_inv_gref1 … H2) -H2 //
40 | #a #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2
41 elim (cpye_inv_bind1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct
42 elim (cpye_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct
44 | #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2
45 elim (cpye_inv_flat1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct
46 elim (cpye_inv_flat1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct