@@ -1589,7 +1589,8 @@ Proof.
15891589 edestruct s1 as (? & ? & ?); eauto.
15901590 invs Hv1. eexists; split; eauto. econstructor; eauto.
15911591 - invs Hrep.
1592- + invs H3.
1592+ + let H3 := match goal with H : ⊩ _ ~ tApp _ _ |- _ => H end in
1593+ invs H3.
15931594 + cbn in Hsunny. rtoProp.
15941595 edestruct s0 as (v1 & Hv1 & Hv2). 3: eauto. eauto. eauto.
15951596 invs Hv1.
@@ -1613,6 +1614,7 @@ Proof.
16131614 - assert (pars = 0) as ->. {
16141615 unfold constructor_isprop_pars_decl in *.
16151616 destruct lookup_constructor as [[[[] [? ?]] ?] | ] eqn:EE; cbn in *; try congruence.
1617+ let H0 := match goal with H : Some _ = Some _ |- _ => H end in
16161618 invs H0.
16171619 destruct lookup_env eqn:EEE; try congruence.
16181620 eapply lookup_env_wellformed in EEE; eauto.
@@ -1631,7 +1633,8 @@ Proof.
16311633 eapply All2_Set_All2 in H14. eapply All2_nth_error_Some_right in H14 as He2. 2: eauto.
16321634 destruct He2 as (br' & Hnth & nms & Hbrs & Hbr & Hnodup). invs Hv1.
16331635 edestruct s1 as (v2 & Hv1_ & Hv2_).
1634- 1: { eapply forallb_nth_error in H6. setoid_rewrite Hnth in H6. cbn in H6. rtoProp.
1636+ 1: { let H6 := match goal with H : is_true (forallb _ _) |- _ => H end in
1637+ eapply forallb_nth_error in H6; setoid_rewrite Hnth in H6; cbn in H6. rtoProp.
16351638 assert (nms = flat_map (λ x : name, match x with
16361639 | nAnon => []
16371640 | nNamed na => [na]
@@ -1640,6 +1643,9 @@ Proof.
16401643 { rewrite Heqnms flat_map_concat_map.
16411644 intros ? (? & ([] & <- & ?) % in_map_iff & Hd) % in_concat; cbn in *; eauto.
16421645 destruct Hd; subst; eauto.
1646+ let H6' := match goal with H : is_true (forallb _ _) |- _ => H end in
1647+ rename H6 into H6_old;
1648+ rename H6' into H6.
16431649 eapply forallb_forall in H6; eauto.
16441650 cbn in H6. unfold fresh in H6. destruct in_dec; cbn in *; congruence. }
16451651 { subst. unfold dupfree in H9. destruct dupfree_dec_ident; cbn in *; congruence. }
@@ -1657,7 +1663,10 @@ Proof.
16571663 eapply All2_Set_All2, All2_length in H10; eauto.
16581664 eapply All2_Set_All2, All2_length in Hbrs; eauto.
16591665 rewrite -> !skipn_length in *. lia.
1660- -- eapply forallb_nth_error in H6. setoid_rewrite Hnth in H6. cbn in H6. rtoProp.
1666+ -- let H6' := match goal with H : is_true (forallb _ _) |- _ => H end in
1667+ rename H6 into H6_old;
1668+ rename H6' into H6.
1669+ eapply forallb_nth_error in H6. setoid_rewrite Hnth in H6. cbn in H6. rtoProp.
16611670 enough (nms = flat_map (λ x : name, match x with
16621671 | nAnon => []
16631672 | nNamed na => [na]
@@ -1679,9 +1688,9 @@ Proof.
16791688 rewrite -> !skipn_length in *. lia.
16801689 * solve_all.
16811690 * now rewrite rev_involutive in Hv2_.
1682- - eapply X; eauto. (* artifact of the induction being weird and having a trivial assumption to not mess up proof script. FIXME! *)
1691+ - eauto. (* artifact of the induction being weird and having a trivial assumption to not mess up proof script. FIXME! *)
16831692 - invs Hrep.
1684- + invs H5. invs H6.
1693+ + invs H5.
16851694 + cbn -[substl] in *. rtoProp.
16861695 edestruct s0 as (v & IH1 & IH2). 3, 1, 2: eauto.
16871696 invs IH1.
@@ -1697,6 +1706,10 @@ Proof.
16971706 eapply eval_wf in IH2 as Hwf; eauto.
16981707 invs Hwf.
16991708
1709+ let H12 := match goal with H : NoDup (map fst vfix) |- _ => H end in
1710+ let H16 := match goal with H : forall nm, In nm (map fst vfix) -> ~In nm _ |- _ => H end in
1711+ let X := match goal with H : All (fun t => is_true (sunny _ _)) vfix |- _ => H end in
1712+ let X0 := match goal with H : All (fun v => wf _) _ |- _ => H end in
17001713 rename H12 into dupfree_vfix, H16 into distinct_vfix_E0, X into sunny_in_vfix, X0 into wf_E0.
17011714
17021715 edestruct s2 as (v'' & IH1'' & IH2'').
@@ -1716,7 +1729,7 @@ Proof.
17161729 }
17171730 { intros ? [-> | ?].
17181731 - eapply All_nth_error in sunny_in_vfix; eauto .
1719- cbn in sunny_in_vfix. rtoProp. unfold fresh in H2 .
1732+ cbn in sunny_in_vfix. rtoProp. unfold fresh in * .
17201733 destruct in_dec; cbn in *; eauto .
17211734 rewrite in_app_iff in n. eauto .
17221735 - eapply distinct_vfix_E0; eauto .
@@ -1786,7 +1799,8 @@ Proof.
17861799 edestruct s0 as (v & Hv1 & Hv2). 1: eauto. eauto . econstructor.
17871800 eexists. split. eauto . econstructor; eauto .
17881801 - invs Hrep.
1789- + invs H2.
1802+ + let H2 := multimatch goal with H : _ |- _ => H end in
1803+ now invs H2.
17901804 + cbn in Hsunny. rtoProp.
17911805 eapply eval_to_value in ev as Hval. invs Hval.
17921806 * destruct f'; cbn in *; try congruence.
@@ -1796,19 +1810,30 @@ Proof.
17961810 invs Hv1; destruct args using rev_ind; cbn in *; try congruence.
17971811 all: match goal with [H : _ = mkApps _ _ |- _ ] => now rewrite mkApps_app in H end.
17981812 - invs Hrep.
1799- + invs H2. eexists. split. econstructor. instantiate (1 := vs).
1800- * eapply All2_All2_Set. eapply All2_Set_All2 in H5.
1801- eapply All2_All2_mix in X. 2: eapply X0.
1802- solve_all. eapply All2_trans'. 2: eauto. 2: exact X.
1803- intros. destruct X1, p, a. eapply eval_represents_value; eauto .
1813+ + let H2 := match goal with H : ⊩ _ ~ tConstruct _ _ _ |- _ => H end in
1814+ invs H2. eexists. split. econstructor. instantiate (1 := vs).
1815+ * eapply All2_All2_Set.
1816+ let H5 := multimatch goal with H : _ |- _ => H end in
1817+ eapply All2_Set_All2 in H5.
1818+ let X := match goal with H : All2 (EWcbvEval.eval _) _ _ |- _ => H end in
1819+ eapply All2_All2_mix in X. 2: let X0 := match goal with H : All2 (fun _ _ => MCProd.and3 _ _ _) _ _ |- _ => H end in exact X0.
1820+ solve_all. eapply All2_trans'. 2: eauto. 2: let X := match goal with H : All2 (fun _ _ => _ * EWcbvEval.eval _ _ _) _ _ |- _ => H end in exact X.
1821+ intros x y z [? [? ?]]. eapply eval_represents_value; eauto .
18041822 * econstructor. eauto .
18051823 + cbn in Hsunny.
18061824 solve_all.
1825+ let H5' := multimatch goal with H : _ |- _ => H end in
1826+ rename H5' into H5.
18071827 eapply All2_Set_All2 in H5.
18081828 eapply All2_All_mix_left in H5. 2: eauto.
1829+ let X' := match goal with H : All2 (EWcbvEval.eval _) _ _ |- _ => H end in
1830+ rename X into X_old;
1831+ rename X' into X.
1832+ let X0' := match goal with H : All2 (fun _ _ => MCProd.and3 _ _ _) _ _ |- _ => H end in
1833+ rename X0' into X0.
18091834 eapply All2_All2_mix in X. 2: eapply X0.
18101835 cbn in X. eapply All2_trans' in X. 3: eapply H5.
1811- 2:{ intros. destruct X1, p, p0, a .
1836+ 2:{ intros x y z [[? r] [[s0] ?]] .
18121837 eapply s0 in r; eauto . exact r. }
18131838 assert ({ vs & All3 (fun v x z => ⊩ v ~ z × eval Σ' E x v) vs args0 args'}) as [vs Hvs]. {
18141839 clear - X. induction X. eexists; econstructor. destruct IHX as [vs Hvs].
0 commit comments