Definition same_except_cur (m m' : Mem.mem) :=
  Mem.mem_contents m = Mem.mem_contents m' /\
  max_access_at m = max_access_at m' /\
  Mem.nextblock m = Mem.nextblock m'.

Lemma PTree_xmap_ext (A B : Type) (f f' : positive -> A -> B) t : (forall a, f a = f' a) -> PTree.xmap f t = PTree.xmap f' t.