]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpes.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_cpes.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 "basic_2/rt_computation/cpms_cpms.ma".
16 include "basic_2/rt_equivalence/cpes.ma".
17 include "basic_2/dynamic/cnv.ma".
18
19 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
20
21 (* Properties with t-bound rt-equivalence for terms *************************)
22
23 lemma cnv_appl_cpes (h) (a) (G) (L):
24       ∀n. ad a n →
25       ∀V. ❪G,L❫ ⊢ V ![h,a] → ∀T. ❪G,L❫ ⊢ T ![h,a] →
26       ∀W. ❪G,L❫ ⊢ V ⬌*[h,1,0] W →
27       ∀p,U. ❪G,L❫ ⊢ T ➡*[n,h] ⓛ[p]W.U → ❪G,L❫ ⊢ ⓐV.T ![h,a].
28 #h #a #G #L #n #Hn #V #HV #T #HT #W *
29 /4 width=11 by cnv_appl, cpms_cprs_trans, cpms_bind/
30 qed.
31
32 lemma cnv_cast_cpes (h) (a) (G) (L):
33       ∀U. ❪G,L❫ ⊢ U ![h,a] →
34       ∀T. ❪G,L❫ ⊢ T ![h,a] → ❪G,L❫ ⊢ U ⬌*[h,0,1] T → ❪G,L❫ ⊢ ⓝU.T ![h,a].
35 #h #a #G #L #U #HU #T #HT * /2 width=3 by cnv_cast/
36 qed.
37
38 (* Inversion lemmas with t-bound rt-equivalence for terms *******************)
39
40 lemma cnv_inv_appl_cpes (h) (a) (G) (L):
41       ∀V,T. ❪G,L❫ ⊢ ⓐV.T ![h,a] →
42       ∃∃n,p,W,U. ad a n & ❪G,L❫ ⊢ V ![h,a] & ❪G,L❫ ⊢ T ![h,a] &
43                  ❪G,L❫ ⊢ V ⬌*[h,1,0] W & ❪G,L❫ ⊢ T ➡*[n,h] ⓛ[p]W.U.
44 #h #a #G #L #V #T #H
45 elim (cnv_inv_appl … H) -H #n #p #W #U #Hn #HV #HT #HVW #HTU
46 /3 width=7 by cpms_div, ex5_4_intro/
47 qed-.
48
49 lemma cnv_inv_cast_cpes (h) (a) (G) (L):
50       ∀U,T. ❪G,L❫ ⊢ ⓝU.T ![h,a] →
51       ∧∧ ❪G,L❫ ⊢ U ![h,a] & ❪G,L❫ ⊢ T ![h,a] & ❪G,L❫ ⊢ U ⬌*[h,0,1] T.
52 #h #a #G #L #U #T #H
53 elim (cnv_inv_cast … H) -H
54 /3 width=3 by cpms_div, and3_intro/
55 qed-.
56
57 (* Eliminators with t-bound rt-equivalence for terms ************************)
58
59 lemma cnv_ind_cpes (h) (a) (Q:relation3 genv lenv term):
60       (∀G,L,s. Q G L (⋆s)) →
61       (∀I,G,K,V. ❪G,K❫ ⊢ V![h,a] → Q G K V → Q G (K.ⓑ[I]V) (#O)) →
62       (∀I,G,K,i. ❪G,K❫ ⊢ #i![h,a] → Q G K (#i) → Q G (K.ⓘ[I]) (#(↑i))) →
63       (∀p,I,G,L,V,T. ❪G,L❫ ⊢ V![h,a] → ❪G,L.ⓑ[I]V❫⊢T![h,a] →
64                      Q G L V →Q G (L.ⓑ[I]V) T →Q G L (ⓑ[p,I]V.T)
65       ) →
66       (∀n,p,G,L,V,W,T,U. ad a n → ❪G,L❫ ⊢ V![h,a] → ❪G,L❫ ⊢ T![h,a] →
67                          ❪G,L❫ ⊢ V ⬌*[h,1,0]W → ❪G,L❫ ⊢ T ➡*[n,h] ⓛ[p]W.U →
68                          Q G L V → Q G L T → Q G L (ⓐV.T)
69       ) →
70       (∀G,L,U,T. ❪G,L❫⊢ U![h,a] → ❪G,L❫ ⊢ T![h,a] → ❪G,L❫ ⊢ U ⬌*[h,0,1] T →
71                  Q G L U → Q G L T → Q G L (ⓝU.T)
72       ) →
73       ∀G,L,T. ❪G,L❫⊢ T![h,a] → Q G L T.
74 #h #a #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #G #L #T #H
75 elim H -G -L -T [5,6: /3 width=7 by cpms_div/ |*: /2 width=1 by/ ]
76 qed-.