DEFINITION sty0_gen_cast()
TYPE =
∀g:G
.∀c:C
.∀v1:T
.∀t1:T
.∀x:T
.sty0 g c (THead (Flat Cast) v1 t1) x
→ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2)
BODY =
assume g: G
assume c: C
assume v1: T
assume t1: T
assume x: T
suppose H: sty0 g c (THead (Flat Cast) v1 t1) x
assume y: T
suppose H0: sty0 g c y x
we proceed by induction on H0 to prove
eq T y (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2)
case sty0_sort : c0:C n:nat ⇒
the thesis becomes
∀H1:eq T (TSort n) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (TSort (next g n)) (THead (Flat Cast) v2 t2)
suppose H1: eq T (TSort n) (THead (Flat Cast) v1 t1)
(H2)
we proceed by induction on H1 to prove
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒True
| TLRef ⇒False
| THead ⇒False
case refl_equal : ⇒
the thesis becomes
<λ:T.Prop>
CASE TSort n OF
TSort ⇒True
| TLRef ⇒False
| THead ⇒False
consider I
we proved True
<λ:T.Prop>
CASE TSort n OF
TSort ⇒True
| TLRef ⇒False
| THead ⇒False
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒True
| TLRef ⇒False
| THead ⇒False
end of H2
consider H2
we proved
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒True
| TLRef ⇒False
| THead ⇒False
that is equivalent to False
we proceed by induction on the previous result to prove
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (TSort (next g n)) (THead (Flat Cast) v2 t2)
we proved
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (TSort (next g n)) (THead (Flat Cast) v2 t2)
∀H1:eq T (TSort n) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (TSort (next g n)) (THead (Flat Cast) v2 t2)
case sty0_abbr : c0:C d:C v:T i:nat :getl i c0 (CHead d (Bind Abbr) v) w:T :sty0 g d v w ⇒
the thesis becomes
∀H4:eq T (TLRef i) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O w) (THead (Flat Cast) v2 t2)
() by induction hypothesis we know
eq T v (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g d v1 v2 λ:T.λt2:T.sty0 g d t1 t2 λv2:T.λt2:T.eq T w (THead (Flat Cast) v2 t2)
suppose H4: eq T (TLRef i) (THead (Flat Cast) v1 t1)
(H5)
we proceed by induction on H4 to prove
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
case refl_equal : ⇒
the thesis becomes
<λ:T.Prop>
CASE TLRef i OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
consider I
we proved True
<λ:T.Prop>
CASE TLRef i OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
end of H5
consider H5
we proved
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
that is equivalent to False
we proceed by induction on the previous result to prove
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O w) (THead (Flat Cast) v2 t2)
we proved
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O w) (THead (Flat Cast) v2 t2)
∀H4:eq T (TLRef i) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O w) (THead (Flat Cast) v2 t2)
case sty0_abst : c0:C d:C v:T i:nat :getl i c0 (CHead d (Bind Abst) v) w:T :sty0 g d v w ⇒
the thesis becomes
∀H4:eq T (TLRef i) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O v) (THead (Flat Cast) v2 t2)
() by induction hypothesis we know
eq T v (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g d v1 v2 λ:T.λt2:T.sty0 g d t1 t2 λv2:T.λt2:T.eq T w (THead (Flat Cast) v2 t2)
suppose H4: eq T (TLRef i) (THead (Flat Cast) v1 t1)
(H5)
we proceed by induction on H4 to prove
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
case refl_equal : ⇒
the thesis becomes
<λ:T.Prop>
CASE TLRef i OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
consider I
we proved True
<λ:T.Prop>
CASE TLRef i OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
end of H5
consider H5
we proved
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒True
| THead ⇒False
that is equivalent to False
we proceed by induction on the previous result to prove
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O v) (THead (Flat Cast) v2 t2)
we proved
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O v) (THead (Flat Cast) v2 t2)
∀H4:eq T (TLRef i) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt2:T.sty0 g c0 t1 t2
λv2:T.λt2:T.eq T (lift (S i) O v) (THead (Flat Cast) v2 t2)
case sty0_bind : b:B c0:C v:T t0:T t2:T :sty0 g (CHead c0 (Bind b) v) t0 t2 ⇒
the thesis becomes
∀H3:eq T (THead (Bind b) v t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Bind b) v t2) (THead (Flat Cast) v2 t3)
() by induction hypothesis we know
eq T t0 (THead (Flat Cast) v1 t1)
→(ex3_2
T
T
λv2:T.λ:T.sty0 g (CHead c0 (Bind b) v) v1 v2
λ:T.λt3:T.sty0 g (CHead c0 (Bind b) v) t1 t3
λv2:T.λt3:T.eq T t2 (THead (Flat Cast) v2 t3))
suppose H3: eq T (THead (Bind b) v t0) (THead (Flat Cast) v1 t1)
(H4)
we proceed by induction on H3 to prove
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒<λ:K.Prop> CASE k OF Bind ⇒True | Flat ⇒False
case refl_equal : ⇒
the thesis becomes
<λ:T.Prop>
CASE THead (Bind b) v t0 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒<λ:K.Prop> CASE k OF Bind ⇒True | Flat ⇒False
consider I
we proved True
<λ:T.Prop>
CASE THead (Bind b) v t0 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒<λ:K.Prop> CASE k OF Bind ⇒True | Flat ⇒False
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒<λ:K.Prop> CASE k OF Bind ⇒True | Flat ⇒False
end of H4
consider H4
we proved
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒<λ:K.Prop> CASE k OF Bind ⇒True | Flat ⇒False
that is equivalent to False
we proceed by induction on the previous result to prove
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Bind b) v t2) (THead (Flat Cast) v2 t3)
we proved
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Bind b) v t2) (THead (Flat Cast) v2 t3)
∀H3:eq T (THead (Bind b) v t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Bind b) v t2) (THead (Flat Cast) v2 t3)
case sty0_appl : c0:C v:T t0:T t2:T :sty0 g c0 t0 t2 ⇒
the thesis becomes
∀H3:eq T (THead (Flat Appl) v t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Flat Appl) v t2) (THead (Flat Cast) v2 t3)
() by induction hypothesis we know
eq T t0 (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g c0 v1 v2 λ:T.λt3:T.sty0 g c0 t1 t3 λv2:T.λt3:T.eq T t2 (THead (Flat Cast) v2 t3)
suppose H3: eq T (THead (Flat Appl) v t0) (THead (Flat Cast) v1 t1)
(H4)
we proceed by induction on H3 to prove
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒
<λ:K.Prop>
CASE k OF
Bind ⇒False
| Flat f⇒<λ:F.Prop> CASE f OF Appl⇒True | Cast⇒False
case refl_equal : ⇒
the thesis becomes
<λ:T.Prop>
CASE THead (Flat Appl) v t0 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒
<λ:K.Prop>
CASE k OF
Bind ⇒False
| Flat f⇒<λ:F.Prop> CASE f OF Appl⇒True | Cast⇒False
consider I
we proved True
<λ:T.Prop>
CASE THead (Flat Appl) v t0 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒
<λ:K.Prop>
CASE k OF
Bind ⇒False
| Flat f⇒<λ:F.Prop> CASE f OF Appl⇒True | Cast⇒False
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒
<λ:K.Prop>
CASE k OF
Bind ⇒False
| Flat f⇒<λ:F.Prop> CASE f OF Appl⇒True | Cast⇒False
end of H4
consider H4
we proved
<λ:T.Prop>
CASE THead (Flat Cast) v1 t1 OF
TSort ⇒False
| TLRef ⇒False
| THead k ⇒
<λ:K.Prop>
CASE k OF
Bind ⇒False
| Flat f⇒<λ:F.Prop> CASE f OF Appl⇒True | Cast⇒False
that is equivalent to False
we proceed by induction on the previous result to prove
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Flat Appl) v t2) (THead (Flat Cast) v2 t3)
we proved
ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Flat Appl) v t2) (THead (Flat Cast) v2 t3)
∀H3:eq T (THead (Flat Appl) v t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv2:T.λ:T.sty0 g c0 v1 v2
λ:T.λt3:T.sty0 g c0 t1 t3
λv2:T.λt3:T.eq T (THead (Flat Appl) v t2) (THead (Flat Cast) v2 t3)
case sty0_cast : c0:C v0:T v2:T H1:sty0 g c0 v0 v2 t0:T t2:T H3:sty0 g c0 t0 t2 ⇒
the thesis becomes
∀H5:eq T (THead (Flat Cast) v0 t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv3:T.λ:T.sty0 g c0 v1 v3
λ:T.λt3:T.sty0 g c0 t1 t3
λv3:T.λt3:T.eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v3 t3)
(H2) by induction hypothesis we know
eq T v0 (THead (Flat Cast) v1 t1)
→ex3_2 T T λv3:T.λ:T.sty0 g c0 v1 v3 λ:T.λt2:T.sty0 g c0 t1 t2 λv3:T.λt2:T.eq T v2 (THead (Flat Cast) v3 t2)
(H4) by induction hypothesis we know
eq T t0 (THead (Flat Cast) v1 t1)
→ex3_2 T T λv3:T.λ:T.sty0 g c0 v1 v3 λ:T.λt3:T.sty0 g c0 t1 t3 λv3:T.λt3:T.eq T t2 (THead (Flat Cast) v3 t3)
suppose H5: eq T (THead (Flat Cast) v0 t0) (THead (Flat Cast) v1 t1)
(H6)
by (f_equal . . . . . H5)
we proved
eq
T
<λ:T.T> CASE THead (Flat Cast) v0 t0 OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
<λ:T.T> CASE THead (Flat Cast) v1 t1 OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
eq
T
λe:T.<λ:T.T> CASE e OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
THead (Flat Cast) v0 t0
λe:T.<λ:T.T> CASE e OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
THead (Flat Cast) v1 t1
end of H6
(h1)
(H7)
by (f_equal . . . . . H5)
we proved
eq
T
<λ:T.T> CASE THead (Flat Cast) v0 t0 OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
<λ:T.T> CASE THead (Flat Cast) v1 t1 OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
eq
T
λe:T.<λ:T.T> CASE e OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
THead (Flat Cast) v0 t0
λe:T.<λ:T.T> CASE e OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
THead (Flat Cast) v1 t1
end of H7
suppose H8: eq T v0 v1
(H10)
consider H7
we proved
eq
T
<λ:T.T> CASE THead (Flat Cast) v0 t0 OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
<λ:T.T> CASE THead (Flat Cast) v1 t1 OF TSort ⇒t0 | TLRef ⇒t0 | THead t⇒t
that is equivalent to eq T t0 t1
we proceed by induction on the previous result to prove sty0 g c0 t1 t2
case refl_equal : ⇒
the thesis becomes the hypothesis H3
sty0 g c0 t1 t2
end of H10
(H12)
we proceed by induction on H8 to prove sty0 g c0 v1 v2
case refl_equal : ⇒
the thesis becomes the hypothesis H1
sty0 g c0 v1 v2
end of H12
by (refl_equal . .)
we proved eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v2 t2)
by (ex3_2_intro . . . . . . . H12 H10 previous)
we proved
ex3_2
T
T
λv3:T.λ:T.sty0 g c0 v1 v3
λ:T.λt3:T.sty0 g c0 t1 t3
λv3:T.λt3:T.eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v3 t3)
eq T v0 v1
→(ex3_2
T
T
λv3:T.λ:T.sty0 g c0 v1 v3
λ:T.λt3:T.sty0 g c0 t1 t3
λv3:T.λt3:T.eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v3 t3))
end of h1
(h2)
consider H6
we proved
eq
T
<λ:T.T> CASE THead (Flat Cast) v0 t0 OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
<λ:T.T> CASE THead (Flat Cast) v1 t1 OF TSort ⇒v0 | TLRef ⇒v0 | THead t ⇒t
eq T v0 v1
end of h2
by (h1 h2)
we proved
ex3_2
T
T
λv3:T.λ:T.sty0 g c0 v1 v3
λ:T.λt3:T.sty0 g c0 t1 t3
λv3:T.λt3:T.eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v3 t3)
∀H5:eq T (THead (Flat Cast) v0 t0) (THead (Flat Cast) v1 t1)
.ex3_2
T
T
λv3:T.λ:T.sty0 g c0 v1 v3
λ:T.λt3:T.sty0 g c0 t1 t3
λv3:T.λt3:T.eq T (THead (Flat Cast) v2 t2) (THead (Flat Cast) v3 t3)
we proved
eq T y (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2)
we proved
∀y:T
.sty0 g c y x
→(eq T y (THead (Flat Cast) v1 t1)
→ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2))
by (insert_eq . . . . previous H)
we proved ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2)
we proved
∀g:G
.∀c:C
.∀v1:T
.∀t1:T
.∀x:T
.sty0 g c (THead (Flat Cast) v1 t1) x
→ex3_2 T T λv2:T.λ:T.sty0 g c v1 v2 λ:T.λt2:T.sty0 g c t1 t2 λv2:T.λt2:T.eq T x (THead (Flat Cast) v2 t2)