6 Section ty0_correct. (****************************************************)
8 (*#* #caption "correctness of types" *)
9 (*#* #cap #cap c, t1, t2 #alpha t in T3 *)
11 Theorem ty0_correct : (g:?; c:?; t1,t2:?)
12 (ty0 g c t1 t2) -> (EX t | (ty0 g c t2 t)).
16 Intros; XElim H; Intros.
17 (* case 1 : ty0_conv *)
19 (* case 2 : ty0_sort *)
21 (* case 3 : ty0_abbr *)
23 (* case 4 : ty0_abst *)
25 (* case 5 : ty0_bind *)
27 (* case 6 : ty0_appl *)
28 XElim H0; XElim H2; Intros.
30 (* case 7 : ty0_cast *)
36 Tactic Definition Ty0Correct :=
38 [ _: (ty0 ?1 ?2 ?3 ?4) |- ? ] ->
39 LApply (ty0_correct ?1 ?2 ?3 ?4); [ Intros H_x | XAuto ];
44 Section ty0_shift. (******************************************************)
46 (*#* #caption "shift lemma for types" *)
47 (*#* #cap #cap t1, t2 #alpha c in C1, e in C2 *)
49 Theorem ty0_shift : (h:?; c,e:?) (drop h (0) c e) ->
50 (g:?; t1,t2:?) (ty0 g c t1 t2) -> (wf0 g e) ->
51 (ty0 g e (app c h t1) (app c h t2)).
57 Intros; DropGenBase; Rewrite <- H.
58 Repeat Rewrite app_O; XAuto.
60 Intros h IHh; XElim c.
61 (* case 2.1 : CSort *)
62 Intros; DropGenBase; Rewrite H.
64 (* case 2.2 : CTail k *)
65 Intros c IHc; Clear IHc; XElim k; Intros; Wf0Ty0.
66 DropGenBase; Move H0 after H2; Ty0Correct.
67 Simpl; Apply IHh; [ Idtac | EApply ty0_bind | Idtac ]; XEAuto.
72 Hints Resolve ty0_shift : ltlc.
76 Section ty0_unique. (*****************************************************)
78 (*#* #caption "uniqueness of types" *)
79 (*#* #cap #cap c, t1, t2 #alpha u in T *)
81 Theorem ty0_unique : (g:?; c:?; u,t1:?) (ty0 g c u t1) ->
82 (t2:?) (ty0 g c u t2) -> (pc3 c t1 t2).
86 Intros until 1; XElim H; Intros.
87 (* case 1 : ty0_conv *)
89 (* case 2 : ty0_sort *)
91 (* case 3 : ty0_abbr *)
92 Ty0GenBase; DropDis; Inversion H4.
93 Rewrite H7 in H2; Rewrite H8 in H2; XEAuto.
94 (* case 4 : ty0_abst *)
95 Ty0GenBase; DropDis; Inversion H4.
96 Rewrite H7 in H2; Rewrite H8 in H2; XEAuto.
97 (* case 5 : ty0_bind *)
99 (* case 6 : ty0_appl *)
100 Ty0GenBase; EApply pc3_t; [ Idtac | EApply H3 ]; XEAuto.
101 (* case 7 : ty0_cast *)
107 Hints Resolve ty0_unique : ltlc.