]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma
some restyling ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_aaa.ma
index e5b5d6f7a8696ddaadcb56aeca60ec408f2a4f08..aa0c10865bfebc3f49e13d937606b7cab1028093 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "basic_2/rt_transition/cpm_aaa.ma".
+include "ground_2/lib/arith_2b.ma".
 include "basic_2/rt_computation/cpms_aaa.ma".
+include "basic_2/rt_computation/lprs_cpms.ma".
 include "basic_2/dynamic/cnv.ma".
 
-(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
+(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
 
 (* Forward lemmas on atomic arity assignment for terms **********************)
 
 (* Basic_2A1: uses: snv_fwd_aaa *)
-lemma cnv_fwd_aaa (a) (h): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A.
+lemma cnv_fwd_aaa (a) (h): ∀G,L,T. ⦃G,L⦄ ⊢ T ![a,h] → ∃A. ⦃G,L⦄ ⊢ T ⁝ A.
 #a #h #G #L #T #H elim H -G -L -T
 [ /2 width=2 by aaa_sort, ex_intro/
 | #I #G #L #V #_ * /3 width=2 by aaa_zero, ex_intro/
@@ -45,8 +46,36 @@ qed-.
 (* Forward lemmas with t_bound rt_transition for terms **********************)
 
 lemma cnv_fwd_cpm_SO (a) (h) (G) (L):
-      ∀T. ⦃G, L⦄ ⊢ T ![a, h] → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U.
+      ∀T. ⦃G,L⦄ ⊢ T ![a,h] → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U.
 #a #h #G #L #T #H
 elim (cnv_fwd_aaa … H) -H #A #HA
 /2 width=2 by aaa_cpm_SO/
 qed-.
+
+(* Forward lemmas with t_bound rt_computation for terms *********************)
+
+lemma cnv_fwd_cpms_total (a) (h) (n) (G) (L):
+      ∀T. ⦃G,L⦄ ⊢ T ![a,h] → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U.
+#a #h #n #G #L #T #H
+elim (cnv_fwd_aaa … H) -H #A #HA
+/2 width=2 by cpms_total_aaa/
+qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma cnv_inv_appl_pred (a) (h) (G) (L):
+      ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T ![yinj a,h] →
+      ∃∃p,W0,U0. ⦃G,L⦄ ⊢ V ![a,h] & ⦃G,L⦄ ⊢ T ![a,h] &
+                   ⦃G,L⦄ ⊢ V ➡*[1,h] W0 & ⦃G,L⦄ ⊢ T ➡*[↓a,h] ⓛ{p}W0.U0.
+#a #h #G #L #V #T #H
+elim (cnv_inv_appl … H) -H #n #p #W #U #Ha #HV #HT #HVW #HTU
+lapply (ylt_inv_inj … Ha) -Ha #Ha
+elim (cnv_fwd_aaa … HT) #A #HA
+elim (cpms_total_aaa h … (a-↑n) … (ⓛ{p}W.U))
+[|*: /2 width=8 by cpms_aaa_conf/ ] -HA #X #HU0
+elim (cpms_inv_abst_sn … HU0) #W0 #U0 #HW0 #_ #H destruct
+lapply (cpms_trans … HVW … HW0) -HVW -HW0 #HVW0
+lapply (cpms_trans … HTU … HU0) -HTU -HU0
+>(arith_m2 … Ha) -Ha #HTU0
+/2 width=5 by ex4_3_intro/
+qed-.