(* Blocks that are not mapped by f are set to empty permission. This makes the invariant preservation easier. *)
Definition projectMap (f : memren) (pmap : access_map) : access_map :=
(pmap#1, Maps.PTree.fold (fun acc b bperm =>
match f b with
| Some b' =>
Maps.PTree.set b' bperm acc
| None =>
acc end)
pmap.2 (Maps.PTree.empty _)).

Lemma stepType_inj:
forall tpc tpf i (pffi:containsThread tpf i) (pfci: containsThread tpc i) m m' f fg st
(Hfg:forall b1 b2 : block, fg b1 = Some b2 -> b1 = b2)
(Hincr: ren_incr fg f)
(Hge_wd: ge_wd fg the_ge)
(Hvalid_mem: valid_mem m)
(Hmem_obs_eq: mem_obs_eq f m m'),
ctl_inj f (getThreadC pfci) (getThreadC pffi) ->
getStepType pfci m st <-> getStepType pffi m' st.