Skip to content
Snippets Groups Projects
Commit c06dbdc1 authored by Jonas Kastberg's avatar Jonas Kastberg
Browse files

Updated/Omitted Lam and proved Let

parent 4f2b5309
No related branches found
No related tags found
1 merge request!8Algorithmic Typing Judgement
...@@ -190,31 +190,28 @@ Section properties. ...@@ -190,31 +190,28 @@ Section properties.
iApply wp_frame_r. iFrame "HΓ". iApply ("Hf" $! v with "HA1"). iApply wp_frame_r. iFrame "HΓ". iApply ("Hf" $! v with "HA1").
Qed. Qed.
Lemma ltyped_lam Γ Γ1 Γ2 Γ3 x e A1 A2 : Lemma ltyped_lam Γ Γ1 Γ2 x e A1 A2 :
env_split Γ Γ1 Γ2 -∗ (<[ x := A1 ]>Γ e : A2 Γ2) -∗
(<[ x := A1 ]>Γ2 e : A2 Γ3) -∗ Γ (λ: x, e) : A1 A2 Γ2.
Γ (λ: x, e) : A1 A2 Γ1. Proof.
Proof. iIntros "#He" (vs) "!> HΓ /=".
iIntros "#Hsplit #He" (vs) "!> HΓ /=". wp_pures.
iDestruct ("Hsplit" with "HΓ") as "[HΓ1 HΓ2]". iSplitL; last by admit.
iFrame "HΓ1". wp_pures.
iIntros (v) "HA1". wp_pures. iIntros (v) "HA1". wp_pures.
iDestruct ("He" $!((binder_insert x v vs)) with "[HA1 HΓ2]") as "He'". iDestruct ("He" $!((binder_insert x v vs)) with "[HA1 HΓ]") as "He'".
{ iApply (env_ltyped_insert with "[HA1 //] HΓ2"). } { iApply (env_ltyped_insert with "[HA1 //] HΓ"). }
rewrite -subst_map_binder_insert. rewrite -subst_map_binder_insert.
iApply (wp_wand with "He'"). iApply (wp_wand with "He'").
iIntros (w) "[$ _]". iIntros (w) "[$ _]".
Qed. Admitted.
Lemma ltyped_let Γ Γ1 Γ2 (x : binder) e1 e2 A1 A2 : Lemma ltyped_let Γ1 Γ2 Γ3 (x : binder) e1 e2 A1 A2 :
env_split Γ Γ1 Γ2 -∗ (Γ1 e1 : A1 Γ2) -∗ (<[x:=A1]>Γ2 e2 : A2 Γ3) -∗
(Γ1 e1 : A1) -∗ (<[x:=A1]>Γ2 e2 : A2) -∗ Γ1 (let: x:=e1 in e2) : A2 Γ3.
Γ (let: x:=e1 in e2) : A2.
Proof. Proof.
iIntros "#Hsplit #HA1 #HA2". iIntros "#He1 #He2".
iApply (ltyped_app Γ Γ2 Γ1 _ _ A1 A2)=> //. iApply ltyped_app=> //.
- by iApply env_split_comm. iApply (ltyped_lam)=> //.
- by iApply ltyped_lam=> //=.
Qed. Qed.
Lemma ltyped_rec Γ Γ' f x e A1 A2 : Lemma ltyped_rec Γ Γ' f x e A1 A2 :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment