]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_ssta.ma
partial commit: just the components before "static" ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_ssta.ma
index d96994e6cf0a6198f83d3c2487aa1e3ab5ce4bf2..3ba30937eea5dd6e445ce526430ed2c7d740f0c8 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "basic_2/dynamic/snv.ma".
+include "basic_2/dynamic/snv_lift.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
 
 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
 
 (* Properties on stratified static type assignment for terms ****************)
 
-lemma snv_ssta: ∀h,g,L,T. ⦃h, L⦄ ⊩ T :[g] → ∃∃U,l. ⦃h, L⦄ ⊢ T •[g, l] U.
-#h #g #L #T #H elim H -L -T
-[ #L #k elim (deg_total h g k) /3 width=3/
-| * #L #K #V #i #HLK #_ * #W #l0 #HVW
-  [ elim (lift_total W 0 (i+1)) /3 width=8/
-  | elim (lift_total V 0 (i+1)) /3 width=8/
-  ]
-| #a #I #L #V #T #_ #_ #_ * /3 width=3/
-| #a #L #V #W #W1 #T0 #T1 #l #_ #_ #_ #_ #_ #_ * /3 width=3/
-| #L #W #T #U #l #_ #_ #HTU #_ #_ #_ /3 width=3/ (**) (* auto fails without the last #_ *) 
+fact snv_ssta_aux: ∀h,g,L0,T0.
+                   (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[h, g] ⦃L1, T1⦄ → IH_snv_cpr_lpr h g L1 T1) →
+                   (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[h, g] ⦃L1, T1⦄ → IH_ssta_cpr_lpr h g L1 T1) →
+                   (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[h, g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
+                   ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ssta h g L1 T1.
+#h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [||||*]
+[ #k #HL0 #HT0 #_ #X #l #H2 destruct -IH3 -IH2 -IH1
+  elim (ssta_inv_sort1 … H2) -H2 #_ #H destruct //
+| #i #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
+  elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
+  elim (ssta_inv_lref1 … H2) -H2 * #K0 #V0 #W1 [| #l ] #H #HVW1 #HX [| #_ ]
+  lapply (ldrop_mono … H … HLK1) -H #H destruct
+  lapply (fsupp_lref … HLK1) #H
+  lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 /4 width=7/
+| #p #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2 -IH1
+  elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
+  elim (snv_inv_bind … H1) -H1 #HV1 #HT1
+  elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=5/
+| #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct
+  elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #HVW1 #HW10 #HT10
+  elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+  lapply (IH1 … HT1 … HTU1) -IH1 /2 width=1/ #HU1
+  elim (ssta_cpds_aux … IH3 IH2 … HTU1 … HT10) -IH3 -IH2 // /2 width=2/ -T1 #U #X #HU1U #H #HU0
+  elim (sstas_inv_bind1 … H) -H #U0 #HTU0 #H destruct
+  elim (cpcs_inv_abst2 … HU0) -HU0 #W2 #U2 #HU2 #HU02
+  elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
+  lapply (cprs_trans … HW10 … HW02) -W0 /3 width=10 by snv_appl, ex2_intro/ (**) (* auto is too slow without trace *)
+| #W1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
+  elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #HTU1 #HUW1
+  lapply (ssta_inv_cast1 … H2) -H2 /3 width=5/
 ]
 qed-.
-
-fact snv_ssta_conf_aux: ∀h,g,L,T. (
-                           ∀L0,T0. ⦃h, L0⦄ ⊩ T0 :[g] →
-                           ∀U0,l. ⦃h, L0⦄ ⊢ T0 •[g, l + 1] U0 →
-                           #{L0, T0} < #{L, T} → ⦃h, L0⦄ ⊩ U0 :[g]
-                        ) →
-                        ∀L0,T0. ⦃h, L0⦄ ⊩ T0 :[g] →
-                        ∀U0,l. ⦃h, L0⦄ ⊢ T0 •[g, l + 1] U0 →
-                        L0 = L → T0 = T → ⦃h, L0⦄ ⊩ U0 :[g].
-#h #g #L #T #IH1 #L0 #T0 * -L0 -T0
-[
-|
-|
-| #a #L0 #V #W #W0 #T0 #V0 #l0 #HV #HT0 #HVW #HW0 #HTV0 #X #l #H #H1 #H2 destruct
-  elim (ssta_inv_appl1 … H) -H #U0 #HTU0 #H destruct
-  lapply (IH1 … HT0 … HTU0 ?) // #HU0
-  @(snv_appl … HV HU0 HVW HW0) -HV -HU0 -HVW -HW0
-| #L0 #W #T0 #W0 #l0 #_ #HT0 #_ #_ #U0 #l #H #H1 #H2 destruct -W0
-  lapply (ssta_inv_cast1 … H) -H /2 width=5/