@@ -429,14 +429,7 @@ Qed.
429429
430430(** ** The correctness proof *)
431431
432- Record extraction_pre (Σ : global_env_ext) : Type
433- := Build_extraction_pre
434- { extr_env_axiom_free' : axiom_free (fst Σ);
435- extr_env_wf' : wf_ext Σ }.
436-
437432Hint Constructors PCUICWcbvEval.eval erases : core.
438- Arguments extr_env_wf' {Σ}.
439- Arguments extr_env_axiom_free' {Σ}.
440433
441434Definition EisConstruct_app :=
442435 fun t => match (EAstUtils.decompose_app t).1 with
@@ -682,16 +675,16 @@ Proof.
682675Qed .
683676
684677Lemma erases_correct (wfl := default_wcbv_flags) Σ t T t' v Σ' :
685- extraction_pre Σ ->
678+ wf_ext Σ ->
686679 Σ;;; [] |- t : T ->
687680 Σ;;; [] |- t ⇝ℇ t' ->
688681 erases_deps Σ Σ' t' ->
689682 Σ |-p t ▷ v ->
690683 exists v', Σ;;; [] |- v ⇝ℇ v' /\ ∥ Σ' ⊢ t' ▷ v' ∥.
691684Proof .
692- intros pre Hty He Hed H.
685+ intros wfΣ Hty He Hed H.
693686 revert T Hty t' He Hed.
694- induction H; intros T Hty t' He Hed; destruct pre as [axfree wfΣ] .
687+ induction H; intros T Hty t' He Hed.
695688 - assert (Hty' := Hty).
696689 assert (eval Σ (PCUICAst.tApp f a) res) by eauto.
697690 eapply inversion_App in Hty as (? & ? & ? & ? & ? & ?).
@@ -805,10 +798,6 @@ Proof.
805798 + exists EAst.tBox. split. econstructor.
806799 eapply Is_type_eval. 3: eassumption. eauto. eauto. eauto. constructor. econstructor. eauto.
807800
808- - destruct Σ as (Σ, univs).
809- cbn in *.
810- eapply axfree in isdecl. congruence.
811-
812801 - assert (Hty' := Hty).
813802 assert (Σ |-p tCase (ind, pars) p discr brs ▷ res) by eauto.
814803 eapply inversion_Case in Hty' as [u' [args' [mdecl [idecl [ps [pty [btys
@@ -906,7 +895,7 @@ Proof.
906895 eapply subject_reduction. eauto. exact Hty.
907896 etransitivity.
908897 eapply PCUICReduction.red_case_c. eapply wcbeval_red. eauto.
909- now eapply PCUICClosed.subject_closed in t0. eauto. eauto.
898+ eauto. eauto.
910899
911900 etransitivity. constructor. constructor.
912901 unfold iota_red. rewrite <- nth_default_eq. unfold nth_default.
@@ -949,7 +938,7 @@ Proof.
949938 eapply subject_reduction. eauto. exact Hty.
950939 etransitivity.
951940 eapply PCUICReduction.red_case_c. eapply wcbeval_red. eauto.
952- now eapply PCUICClosed.subject_closed in t0; eauto. eauto. eauto.
941+ eauto. eauto.
953942 etransitivity. constructor. constructor.
954943 unfold iota_red. rewrite <- nth_default_eq. reflexivity.
955944
@@ -1062,7 +1051,7 @@ Proof.
10621051 eapply erases_deps_mkApps_inv in Hty_vc' as (? & ?).
10631052 now eapply nth_error_forall in H1; eauto.
10641053 + exists EAst.tBox. split. econstructor.
1065- eapply Is_type_eval. 4 : eassumption. all:eauto. constructor. econstructor. eauto.
1054+ eapply Is_type_eval. 3 : eassumption. all:eauto. constructor. econstructor. eauto.
10661055
10671056 - assert (Hty' := Hty).
10681057 assert (Hunf := H).
@@ -1080,7 +1069,7 @@ Proof.
10801069
10811070 + exists EAst.tBox. split; [|now constructor; constructor].
10821071 econstructor.
1083- eapply Is_type_eval. 4 :eapply X. eauto . eauto.
1072+ eapply Is_type_eval. 3 :eapply X. eauto.
10841073 eapply eval_fix; eauto.
10851074 rewrite /cunfold_fix e0 //. congruence.
10861075 + depelim Hed.
@@ -1151,10 +1140,11 @@ Proof.
11511140 assert(Σ ;;; [] |- mkApps (tFix mfix idx) (argsv ++ [av]) : PCUICLiftSubst.subst [av] 0 x1).
11521141 { rewrite -mkApps_nested. eapply PCUICValidity.type_App'; eauto.
11531142 eapply subject_reduction_eval; eauto. }
1154- epose proof (fix_app_is_constructor Σ (args:=argsv ++ [av]) axfree X).
1143+ epose proof (fix_app_is_constructor Σ (args:=argsv ++ [av]) X).
11551144 rewrite /unfold_fix e0 in X0.
11561145 specialize (X0 eq_refl). simpl in X0.
11571146 rewrite nth_error_snoc in X0. auto. apply X0.
1147+ eapply value_axiom_free, eval_to_value; eauto.
11581148 eapply value_whnf; eauto.
11591149 eapply eval_closed; eauto. now eapply PCUICClosed.subject_closed in t0.
11601150 eapply eval_to_value; eauto. }
@@ -1214,7 +1204,7 @@ Proof.
12141204 -- exists EAst.tBox.
12151205 split.
12161206 ++ econstructor.
1217- eapply Is_type_eval. 4 :eauto. all:eauto.
1207+ eapply Is_type_eval. 3 :eauto. all:eauto.
12181208 rewrite -mkApps_nested.
12191209 eapply eval_fix; eauto.
12201210 1-2:eapply value_final, eval_to_value; eauto.
@@ -1232,7 +1222,7 @@ Proof.
12321222 destruct Hty' as (? & ? & ? & ? & ? & ?).
12331223
12341224 eapply subject_reduction in t as typ_stuck_fix; [|eauto|]; first last.
1235- { eapply wcbeval_red. 4 :eauto. all:eauto. }
1225+ { eapply wcbeval_red. 3 :eauto. all:eauto. }
12361226
12371227 eapply erases_App in He as He'; [|eauto].
12381228 destruct He' as [(-> & [])|(? & ? & -> & ? & ?)].
@@ -1242,12 +1232,12 @@ Proof.
12421232 eapply Is_type_red.
12431233 * eauto.
12441234 * eapply PCUICReduction.red_app.
1245- -- eapply wcbeval_red; [eauto|eauto| |eauto]. eauto.
1246- -- eapply wcbeval_red; [eauto|eauto| |eauto]. eauto.
1235+ -- eapply wcbeval_red; [eauto| |eauto]. eauto.
1236+ -- eapply wcbeval_red; [eauto| |eauto]. eauto.
12471237 * eauto.
12481238 + depelim Hed.
12491239 eapply subject_reduction in t0 as typ_arg; [|eauto|]; first last.
1250- { eapply wcbeval_red; [eauto|eauto| |eauto]. eauto. }
1240+ { eapply wcbeval_red; [eauto| |eauto]. eauto. }
12511241
12521242 eapply IHeval1 in H1 as (? & ? & [?]); [|now eauto|now eauto].
12531243 eapply IHeval2 in H2 as (? & ? & [?]); [|now eauto|now eauto].
0 commit comments