non associative with precedence 45
for @{ 'RDrop $d $e $L1 $L2 }.
-notation "hvbox( ⦃ L1, break T1 ⦄ > break ⦃ L2 , break T2 ⦄ )"
+notation "hvbox( ⦃ L1, break T1 ⦄ ⧁ break ⦃ L2 , break T2 ⦄ )"
non associative with precedence 45
- for @{ 'SupTerm $L1 $T1 $L2 $T2 }.
+ for @{ 'RestSupTerm $L1 $T1 $L2 $T2 }.
notation "hvbox( L ⊢ break ⌘ ⦃ T ⦄ ≡ break term 46 k )"
non associative with precedence 45
non associative with precedence 45
for @{ 'RDropStar $e $L1 $L2 }.
-notation "hvbox( ⦃ L1, break T1 ⦄ > * break ⦃ L2 , break T2 ⦄ )"
+notation "hvbox( ⦃ L1, break T1 ⦄ ⧁ + break ⦃ L2 , break T2 ⦄ )"
non associative with precedence 45
- for @{ 'SupTermStar $L1 $T1 $L2 $T2 }.
+ for @{ 'RestSupTermPlus $L1 $T1 $L2 $T2 }.
+
+notation "hvbox( ⦃ L1, break T1 ⦄ ⧁ * break ⦃ L2 , break T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'RestSupTermStar $L1 $T1 $L2 $T2 }.
notation "hvbox( T1 break ▶ * [ d , break e ] break term 46 T2 )"
non associative with precedence 45
non associative with precedence 45
for @{ 'XPRed $h $g $L $T1 $T2 }.
-notation "hvbox( h ⊢ break ⦃ L1, break T1 ⦄ • ⥸ break [ g ] break ⦃ L2 , break T2 ⦄ )"
- non associative with precedence 45
- for @{ 'YPRed $h $g $L1 $T1 $L2 $T2 }.
-
(* Computation **************************************************************)
notation "hvbox( T1 ➡ * break term 46 T2 )"
non associative with precedence 45
for @{ 'XSN $h $g $L $T }.
-notation "hvbox( h ⊢ break ⦃ L1, break T1 ⦄ • ⥸ * break [ g ] break ⦃ L2 , break T2 ⦄ )"
- non associative with precedence 45
- for @{ 'YPRedStar $h $g $L1 $T1 $L2 $T2 }.
-
-notation "hvbox( h ⊢ break ⦃ L1, break T1 ⦄ • ⭃ * break [ g ] break ⦃ L2 , break T2 ⦄ )"
- non associative with precedence 45
- for @{ 'YPRedStepStar $h $g $L1 $T1 $L2 $T2 }.
-
(* Conversion ***************************************************************)
notation "hvbox( L ⊢ break term 46 T1 ⬌ break term 46 T2 )"
(**************************************************************************)
include "basic_2/substitution/ldrop.ma".
+include "basic_2/unfold/frsups.ma".
include "basic_2/static/sd.ma".
(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
ssta h g l L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
| ssta_appl: ∀L,V,T,U,l. ssta h g l L T U →
ssta h g l L (ⓐV.T) (ⓐV.U)
-| ssta_cast: ∀L,V,W,T,U,l. ssta h g (l - 1) L V W → ssta h g l L T U →
- ssta h g l L (ⓝV. T) (ⓝW. U)
+| ssta_cast: ∀L,W,T,U,l. ssta h g l L T U → ssta h g l L (ⓝW. T) U
.
interpretation "stratified static type assignment (term)"
| #L #K #W #V #U #i #l #_ #_ #_ #k0 #H destruct
| #a #I #L #V #T #U #l #_ #k0 #H destruct
| #L #V #T #U #l #_ #k0 #H destruct
-| #L #V #W #T #U #l #_ #_ #k0 #H destruct
+| #L #W #T #U #l #_ #k0 #H destruct
qed.
(* Basic_1: was just: sty0_gen_sort *)
| #L #K #W #V #U #i #l #HLK #HWV #HWU #j #H destruct /3 width=8/
| #a #I #L #V #T #U #l #_ #j #H destruct
| #L #V #T #U #l #_ #j #H destruct
-| #L #V #W #T #U #l #_ #_ #j #H destruct
+| #L #W #T #U #l #_ #j #H destruct
]
qed.
| #L #K #W #V #U #i #l #_ #_ #_ #a #I #X #Y #H destruct
| #b #J #L #V #T #U #l #HTU #a #I #X #Y #H destruct /2 width=3/
| #L #V #T #U #l #_ #a #I #X #Y #H destruct
-| #L #V #W #T #U #l #_ #_ #a #I #X #Y #H destruct
+| #L #W #T #U #l #_ #a #I #X #Y #H destruct
]
qed.
| #L #K #W #V #U #i #l #_ #_ #_ #X #Y #H destruct
| #a #I #L #V #T #U #l #_ #X #Y #H destruct
| #L #V #T #U #l #HTU #X #Y #H destruct /2 width=3/
-| #L #V #W #T #U #l #_ #_ #X #Y #H destruct
+| #L #W #T #U #l #_ #X #Y #H destruct
]
qed.
∃∃Z. ⦃h, L⦄ ⊢ X •[g, l] Z & U = ⓐY.Z.
/2 width=3/ qed-.
-fact ssta_inv_cast1_aux: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g, l] U → ∀X,Y. T = ⓝY.X →
- ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y •[g, l-1] Z1 & ⦃h, L⦄ ⊢ X •[g, l] Z2 &
- U = ⓝZ1.Z2.
+fact ssta_inv_cast1_aux: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g, l] U →
+ ∀X,Y. T = ⓝY.X → ⦃h, L⦄ ⊢ X •[g, l] U.
#h #g #L #T #U #l * -L -T -U -l
[ #L #k #l #_ #X #Y #H destruct
| #L #K #V #W #U #l #i #_ #_ #_ #X #Y #H destruct
| #L #K #W #V #U #l #i #_ #_ #_ #X #Y #H destruct
| #a #I #L #V #T #U #l #_ #X #Y #H destruct
| #L #V #T #U #l #_ #X #Y #H destruct
-| #L #V #W #T #U #l #HVW #HTU #X #Y #H destruct /2 width=5/
+| #L #W #T #U #l #HTU #X #Y #H destruct //
]
qed.
(* Basic_1: was just: sty0_gen_cast *)
lemma ssta_inv_cast1: ∀h,g,L,X,Y,U,l. ⦃h, L⦄ ⊢ ⓝY.X •[g, l] U →
- ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y •[g, l-1] Z1 & ⦃h, L⦄ ⊢ X •[g, l] Z2 &
- U = ⓝZ1.Z2.
+ ⦃h, L⦄ ⊢ X •[g, l] U.
/2 width=4/ qed-.
(* Advanced inversion lemmas ************************************************)
+lemma ssta_inv_frsupp: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g, l] U → ⦃L, U⦄ ⧁+ ⦃L, T⦄ → ⊥.
+#h #g #L #T #U #l #H elim H -L -T -U -l
+[ #L #k #l #_ #H
+ elim (frsupp_inv_atom1_frsups … H)
+| #L #K #V #W #U #i #l #_ #_ #HWU #_ #H
+ elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H
+ elim (lift_inv_lref2_be … H ? ?) -H //
+| #L #K #W #V #U #i #l #_ #_ #HWU #_ #H
+ elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H
+ elim (lift_inv_lref2_be … H ? ?) -H //
+| #a #I #L #V #T #U #l #_ #IHTU #H
+ elim (frsupp_inv_bind1_frsups … H) -H #H [2: /4 width=4/ ] -IHTU
+ lapply (frsups_fwd_fw … H) -H normalize
+ <associative_plus <associative_plus #H
+ elim (le_plus_xySz_x_false … H)
+| #L #V #T #U #l #_ #IHTU #H
+ elim (frsupp_inv_flat1_frsups … H) -H #H [2: /4 width=4/ ] -IHTU
+ lapply (frsups_fwd_fw … H) -H normalize
+ <associative_plus <associative_plus #H
+ elim (le_plus_xySz_x_false … H)
+| /3 width=4/
+]
+qed-.
+
fact ssta_inv_refl_aux: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g, l] U → T = U → ⊥.
#h #g #L #T #U #l #H elim H -L -T -U -l
[ #L #k #l #_ #H
- lapply (next_lt h k) destruct -H -e0 (**) (* these premises are not erased *)
+ lapply (next_lt h k) destruct -H -e0 (**) (* destruct: these premises are not erased *)
<e1 -e1 #H elim (lt_refl_false … H)
| #L #K #V #W #U #i #l #_ #_ #HWU #_ #H destruct
elim (lift_inv_lref2_be … HWU ? ?) -HWU //
elim (lift_inv_lref2_be … HWU ? ?) -HWU //
| #a #I #L #V #T #U #l #_ #IHTU #H destruct /2 width=1/
| #L #V #T #U #l #_ #IHTU #H destruct /2 width=1/
-| #L #V #W #T #U #l #_ #_ #_ #IHTU #H destruct /2 width=1/
+| #L #W #T #U #l #HTU #_ #H destruct
+ elim (ssta_inv_frsupp … HTU ?) -HTU /2 width=1/
]
-qed.
+qed-.
+
+lemma ssta_inv_refl: ∀h,g,T,L,l. ⦃h, L⦄ ⊢ T •[g, l] T → ⊥.
+/2 width=8 by ssta_inv_refl_aux/ qed-.
-lemma ssta_inv_refl: ∀h,g,L,T,l. ⦃h, L⦄ ⊢ T •[g, l] T → ⊥.
-/2 width=8/ qed-.
+lemma ssta_inv_frsups: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g, l] U → ⦃L, U⦄ ⧁* ⦃L, T⦄ → ⊥.
+#h #g #L #T #U #L #HTU #H elim (frsups_inv_all … H) -H
+[ * #_ #H destruct /2 width=6 by ssta_inv_refl/
+| /2 width=8 by ssta_inv_frsupp/
+]
+qed-.
elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
-| #L1 #V1 #W1 #T1 #U1 #l #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_flat1 … H1) -H1 #V2 #W2 #HV12 #HW12 #H destruct
- elim (lift_inv_flat1 … H2) -H2 #T2 #U2 #HT12 #HU12 #H destruct /3 width=5/
+| #L1 #W1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct /3 width=5/
]
qed.
elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
[ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
- | <le_plus_minus_comm // /2 width=1/
+ | <le_plus_minus_comm //
]
]
| #L2 #K2 #W2 #V2 #W #i #l #HLK2 #HWV2 #HW2 #IHWV2 #L1 #d #e #HL21 #X #H
elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
[ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
- | <le_plus_minus_comm // /2 width=1/
+ | <le_plus_minus_comm //
]
]
| #a #I #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
| #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5/
-| #L2 #V2 #W2 #T2 #U2 #l #_ #_ #IHVW2 #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHVW2 … HL21 … HV12) -IHVW2
- elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5/
+| #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #HW12 #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3/
]
qed.
elim (lift_total V 0 (i+1)) /3 width=10/
| #a #I #L #V #T #U #l #_ * /3 width=2/
| #L #V #T #U #l #_ * #T0 #HUT0 /3 width=2/
-| #L #V #W #T #U #l #_ #_ * #W0 #HW0 * /3 width=2/
+| #L #W #T #U #l #_ * /2 width=2/
]
qed-.