Library Lambda.JRussell.Coercion
Require
Import
Lambda.Terms
.
Require
Import
Lambda.Reduction
.
Require
Import
Lambda.Conv
.
Require
Import
Lambda.LiftSubst
.
Require
Import
Lambda.Env
.
Require
Import
Lambda.JRussell.Types
.
Require
Import
Lambda.JRussell.Basic
.
Implicit
Types
i
k
m
n
p
: nat
.
Implicit
Type
s
: sort
.
Implicit
Types
A
B
M
N
T
t
u
v
: term
.
Implicit
Types
e
f
g
: env
.
Inductive
coerce_in_env
: env
→ env
→ Prop
:=
| coerce_env_hd
: ∀ e
t
u
s
, e
|-= t
>> u
: s
→ e
|-= u
: Srt
s
→
coerce_in_env
(t
:: e
) (u
:: e
)
| coerce_env_tl
:
∀ e
f
t
, coerce_in_env
e
f
→ coerce_in_env
(t
:: e
) (t
:: f
).
Hint
Resolve
coerce_env_hd
coerce_env_tl
: coc
.
Lemma
ind_coerce_env
:
(∀ e
t
T
, e
|-= t
: T
→
∀ f
, coerce_in_env
e
f
→ f
|-= t
: T
) ∧
(∀ e
T
U
s
, e
|-= T
>> U
: s
→
∀ f
, coerce_in_env
e
f
→ f
|-= T
>> U
: s
) ∧
(∀ e
U
V
T
, e
|-= U
= V
: T
→
∀ f
, coerce_in_env
e
f
→ f
|-= U
= V
: T
).
Lemma
typ_coerce_env
: ∀ e
t
T
, e
|-= t
: T
→ ∀ f
, coerce_in_env
e
f
→
f
|-= t
: T
.
Lemma
coerce_coerce_env
: ∀ e
T
U
s
, e
|-= T
>> U
: s
→
∀ f
, coerce_in_env
e
f
→
f
|-= T
>> U
: s
.
Lemma
jeq_coerce_env
: ∀ e
U
V
T
, e
|-= U
= V
: T
→
∀ f
, coerce_in_env
e
f
→
f
|-= U
= V
: T
.