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/dynamic/cnv_cpce.ma".
17 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
19 definition IH (h) (a): relation3 genv lenv term ≝
20 λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] →
21 ∀n,T1. ⦃G,L0⦄ ⊢ T0 ➡[n,h] T1 → ∀T2. ⦃G,L0⦄ ⊢ T0 ⬌η[h] T2 →
22 ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 →
23 ∃∃T. ⦃G,L1⦄ ⊢ T1 ⬌η[h] T & ⦃G,L0⦄ ⊢ T2 ➡[n,h] T.
25 lemma pippo_aux (h) (a) (G0) (L0) (T0):
26 (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH h a G L T) →
29 [ #s #_ #_ #n #X1 #HX1 #X2 #HX2 #L1 #HL01
30 elim (cpm_inv_sort1 … HX1) -HX1 #H #Hn destruct
31 lapply (cpce_inv_sort_sn … HX2) -HX2 #H destruct
32 /3 width=3 by cpce_sort, cpm_sort, ex2_intro/
33 | #i #IH #Hi #n #X1 #HX1 #X2 #HX2 #L1 #HL01
34 elim (cnv_inv_lref_drops … Hi) -Hi #I #K0 #W0 #HLK0 #HW0
35 elim (lpr_drops_conf … HLK0 … HL01) [| // ] #Y1 #H1 #HLK1
36 elim (lex_inv_pair_sn … H1) -H1 #K1 #W1 #HK01 #HW01 #H destruct
37 elim (cpce_inv_lref_sn_drops_bind … HX2 … HLK0) -HX2 *
39 elim (cpm_inv_lref1_drops … HX1) -HX1 *
40 [ #H1 #H2 destruct -HW0 -HLK0 -IH
41 @(ex2_intro … (#i)) [| // ]
42 @cpce_zero_drops #n #p #Y1 #X1 #V1 #U1 #HLY1 #HWU1
43 lapply (drops_mono … HLY1 … HLK1) -L1 #H2 destruct
44 /4 width=12 by lpr_cpms_trans, cpms_step_sn/
45 | #Y0 #W0 #W1 #HLY0 #HW01 #HWX1 -HI -HW0 -IH
46 lapply (drops_mono … HLY0 … HLK0) -HLY0 #H destruct
47 @(ex2_intro … X1) [| /2 width=6 by cpm_delta_drops/ ]
50 lemma cpce_inv_eta_drops (h) (n) (G) (L) (i):
51 ∀X. ⦃G,L⦄ ⊢ #i ⬌η[h] X →
52 ∀K,W. ⇩*[i] L ≘ K.ⓛW →
53 ∀p,V1,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U →
54 ∀V2. ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 →
55 ∀W2. ⇧*[↑i] V2 ≘ W2 → X = +ⓛW2.ⓐ#0.#↑i.
57 theorem cpce_mono_cnv (h) (a) (G) (L):
58 ∀T. ⦃G,L⦄ ⊢ T ![h,a] →
59 ∀T1. ⦃G,L⦄ ⊢ T ⬌η[h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ⬌η[h] T2 → T1 = T2.