-
Notifications
You must be signed in to change notification settings - Fork 3
/
AnnotatedSubtypeArrow.v
54 lines (49 loc) · 1.45 KB
/
AnnotatedSubtypeArrow.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Require Export SystemFR.Judgments.
Require Export SystemFR.AnnotatedTactics.
Require Export SystemFR.ErasedSubtype.
Opaque reducible_values.
Lemma annotated_subtype_arrow:
forall Θ Γ A1 A2 B1 B2 x,
~(x ∈ fv_context Γ) ->
~(x ∈ fv A2) ->
~(x ∈ fv B2) ->
~(x ∈ fv B1) ->
~(x ∈ Θ) ->
is_annotated_type A2 ->
is_annotated_type B2 ->
[[ Θ; Γ ⊨ B1 <: A1 ]] ->
[[ Θ; (x,B1) :: Γ ⊨ open 0 A2 (fvar x term_var) <: open 0 B2 (fvar x term_var) ]] ->
[[ Θ; Γ ⊨ T_arrow A1 A2 <: T_arrow B1 B2 ]].
Proof.
unfold open_subtype;
repeat step.
apply reducible_arrow_subtype_subst with (erase_type A1) (erase_type A2) (erase_context Γ) x;
repeat step;
side_conditions.
unshelve epose proof (H7 ρ l0 _ _ _ v0 _);
repeat step || erase_open.
Qed.
Lemma annotated_subtype_arrow2:
forall Θ Γ T A B x f,
~(x ∈ fv_context Γ) ->
~(f ∈ fv_context Γ) ->
~(x = f) ->
~(x ∈ fv B) ->
~(f ∈ fv B) ->
~(x ∈ fv A) ->
~(f ∈ fv A) ->
~(x ∈ fv T) ->
~(f ∈ fv T) ->
~(x ∈ Θ) ->
~(f ∈ Θ) ->
is_annotated_type B ->
[[ Θ; (x,A) :: (f,T) :: Γ ⊨
app (fvar f term_var) (fvar x term_var) : open 0 B (fvar x term_var) ]] ->
[[ Θ; Γ ⊨ T <: T_arrow A B ]].
Proof.
unfold open_subtype;
repeat step.
apply subtype_arrow2 with (support ρ) x f (erase_context Γ) (erase_type T);
repeat step || erase_open;
side_conditions.
Qed.