]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce_drops.ma
some added lemmas removed from auto
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_conversion / cpce_drops.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 "static_2/relocation/drops.ma".
16 include "static_2/relocation/lifts_lifts.ma".
17 include "basic_2/rt_conversion/cpce.ma".
18
19 (* CONTEXT-SENSITIVE PARALLEL ETA-CONVERSION FOR TERMS **********************)
20
21 (* Properties with uniform slicing for local environments *******************)
22
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
29 [ #L #HLK #W2 #HVW2
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/
35 ]
36 qed.
37
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 → ⊥) →
40       ⦃G,L⦄ ⊢ #i ⬌η[h] #i.
41 #h #G #i elim i -i
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/
46 ]
47 qed.
48
49 (* Inversion lemmas with uniform slicing for local environments *************)
50
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.
57 #h #G #i elim i -i
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 *
65   [ #HJ #H destruct
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/
75   ]
76 ]
77 qed-.
78
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 → ⊥) →
83       #i = X2.
84 #h #G #i #L #X2 #HX2 #I #K #HLK #HI
85 elim (cpce_inv_lref_sn_drops … HX2 … HLK) -L *
86 [ #_ #H //
87 | #n #p #W #V1 #V2 #W2 #U #HWU #_ #_ #H destruct
88   elim (HI … HWU) -n -p -K -X2 -V1 -V2 -W2 -U -i //
89 ]
90 qed-.