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 "static_2/relocation/drops.ma".
16 include "static_2/relocation/lifts_lifts.ma".
17 include "basic_2/rt_conversion/cpce.ma".
19 (* CONTEXT-SENSITIVE PARALLEL ETA-CONVERSION FOR TERMS **********************)
21 (* Properties with uniform slicing for local environments *******************)
23 lemma cpce_eta_drops (h) (n) (G) (K):
24 ∀p,W,V1,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U →
25 ∀V2. ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 →
26 ∀i,L. ⇩*[i] L ≘ K.ⓛW →
27 ∀W2. ⇧*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ⬌η[h] +ⓛW2.ⓐ#0.#↑i.
28 #h #n #G #K #p #W #V1 #U #HWU #V2 #HV12 #i elim i -i
30 >(drops_fwd_isid … HLK) -L [| // ] /2 width=8 by cpce_eta/
31 | #i #IH #L #HLK #W2 #HVW2
32 elim (drops_inv_succ … HLK) -HLK #I #Y #HYK #H destruct
33 elim (lifts_split_trans … HVW2 (𝐔❴↑i❵) (𝐔❴1❵)) [| // ] #X2 #HVX2 #HXW2
34 /5 width=7 by cpce_lref, lifts_push_lref, lifts_bind, lifts_flat/
38 lemma cpce_zero_drops (h) (G):
39 ∀i,L. (∀n,p,K,W,V,U. ⇩*[i] L ≘ K.ⓛW → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥) →
42 [ * [ #_ // ] #L #I #Hi
43 /4 width=8 by cpce_zero, drops_refl/
44 | #i #IH * [ -IH #_ // ] #L #I #Hi
45 /5 width=8 by cpce_lref, drops_drop/
49 (* Inversion lemmas with uniform slicing for local environments *************)
51 lemma cpce_inv_lref_sn_drops (h) (G) (i) (L):
52 ∀X2. ⦃G,L⦄ ⊢ #i ⬌η[h] X2 →
53 ∀I,K. ⇩*[i] L ≘ K.ⓘ{I} →
54 ∨∨ ∧∧ ∀n,p,W,V,U. I = BPair Abst W → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥ & #i = X2
55 | ∃∃n,p,W,V1,V2,W2,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U & ⦃G,K⦄ ⊢ V1 ⬌η[h] V2
56 & ⇧*[↑i] V2 ≘ W2 & I = BPair Abst W & +ⓛW2.ⓐ#0.#(↑i) = X2.
58 [ #L #X2 #HX2 #I #K #HLK
59 lapply (drops_fwd_isid … HLK ?) -HLK [ // ] #H destruct
60 /2 width=1 by cpce_inv_zero_sn/
61 | #i #IH #L0 #X0 #HX0 #J #K #H0
62 elim (drops_inv_succ … H0) -H0 #I #L #HLK #H destruct
63 elim (cpce_inv_lref_sn … HX0) -HX0 #X2 #HX2 #HX20
64 elim (IH … HX2 … HLK) -IH -I -L *
66 lapply (lifts_inv_lref1_uni … HX20) -HX20 #H destruct
67 /4 width=7 by or_introl, conj/
68 | #n #p #W #V1 #V2 #W2 #U #HWU #HV12 #HVW2 #H1 #H2 destruct
69 elim (lifts_inv_bind1 … HX20) -HX20 #X2 #X #HWX2 #HX #H destruct
70 elim (lifts_inv_flat1 … HX) -HX #X0 #X1 #H0 #H1 #H destruct
71 lapply (lifts_inv_push_zero_sn … H0) -H0 #H destruct
72 elim (lifts_inv_push_succ_sn … H1) -H1 #j #Hj #H destruct
73 lapply (lifts_inv_lref1_uni … Hj) -Hj #H destruct
74 /4 width=12 by lifts_trans_uni, ex5_7_intro, or_intror/
79 lemma cpce_inv_zero_sn_drops (h) (G) (i) (L):
80 ∀X2. ⦃G,L⦄ ⊢ #i ⬌η[h] X2 →
81 ∀I,K. ⇩*[i] L ≘ K.ⓘ{I} →
82 (∀n,p,W,V,U. I = BPair Abst W → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥) →
84 #h #G #i #L #X2 #HX2 #I #K #HLK #HI
85 elim (cpce_inv_lref_sn_drops … HX2 … HLK) -L *
87 | #n #p #W #V1 #V2 #W2 #U #HWU #_ #_ #H destruct
88 elim (HI … HWU) -n -p -K -X2 -V1 -V2 -W2 -U -i //