-
Notifications
You must be signed in to change notification settings - Fork 3
/
SubtypeMisc.v
68 lines (58 loc) · 1.35 KB
/
SubtypeMisc.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Require Export SystemFR.ReducibilitySubtype.
Require Export SystemFR.ScalaDepSugar.
Opaque reducible_values.
Lemma subtype_top:
forall ρ T,
valid_interpretation ρ ->
[ ρ ⊨ T <: T_top ].
Proof.
repeat step || simp_red;
eauto using reducible_values_closed.
Qed.
Lemma open_subtop_helper:
forall Θ Γ T,
[ Θ; Γ ⊨ T <: T_top ].
Proof.
unfold open_subtype; intros; eauto using subtype_top.
Qed.
Lemma open_subtop:
forall Γ T,
[ Γ ⊫ T <: T_top ].
Proof.
eauto using open_subtop_helper.
Qed.
Lemma open_subrefl:
forall Γ T,
[ Γ ⊫ T <: T ].
Proof.
eauto using open_subtype_refl.
Qed.
Lemma subsing1:
forall ρ T t,
[ ρ ⊨ T_singleton T t <: T ].
Proof.
unfold T_singleton; repeat step || simp_red.
Qed.
Opaque T_singleton. (* for open_subsing1 *)
Lemma open_subsing1:
forall Θ Γ T t,
[ Θ; Γ ⊨ T_singleton T t <: T ].
Proof.
unfold open_subtype; intros; eapply subsing1;
repeat step || rewrite substitute_singleton in * by eauto with wf;
eauto.
Qed.
Lemma open_subsing_helper:
forall Θ Γ T1 T2 t,
[ Θ; Γ ⊨ T1 <: T2 ] ->
[ Θ; Γ ⊨ T_singleton T1 t <: T2 ].
Proof.
eauto using open_subsing1, open_subtype_trans.
Qed.
Lemma open_subsing:
forall Γ T1 T2 t,
[ Γ ⊫ T1 <: T2 ] ->
[ Γ ⊫ T_singleton T1 t <: T2 ].
Proof.
eauto using open_subsing_helper.
Qed.