intros.
unfold CoreInitial; simpl.
unfold init_machine, JuicyMachineModule.THE_JUICY_MACHINE.JSEM.init_mach.
unfold semantics.initial_core.
unfold ErasureSafety.ErasureProof.JMS.the_sem.
unfold JuicyMachineModule.THE_JUICY_MACHINE.JSEM.ThreadPool.SEM.Sem.
rewrite JuicyMachineModule.THE_JUICY_MACHINE.SEM.CLN_msem.
simpl.
rewrite <- initial_equivalence_trivial.
subst r; simpl.
unfold initial_corestate.
unfold prog in *.
destruct spr as (b' & c' & e & SPR); simpl in *.
change semax_to_juicy_machine.prog with CSL_prog in *.
subst b'.
specialize (SPR n). destruct SPR as [jm [? [? [? _]]]].
unfold juicy_extspec.j_initial_core in H2.
unfold semantics.initial_core in H2. simpl in H2.
rewrite <- H in *.
destruct (Genv.find_funct_ptr g b) eqn:?H; [ | congruence].
inversion H3; clear H3; subst.
f_equal. f_equal. f_equal. f_equal. congruence.
Qed.

Lemma CoreInitial_juicy_safety:
forall (U : semax_invariant.schedule) (n : nat),
exists init_st,
(semantics.initial_core (MachineSemantics U (init_rmap n)))
0 init_genv (proj1_sig (init_mem CPROOF)) init_point nil =
Some ((U, nil, init_st), None) /\
forall U',
csafe (globalenv prog) (U', nil, init_st)
(proj1_sig (init_mem CPROOF)) n.