Axiom HleafNodeConst: forall x p leafIdx lvl dt,
              isLeafNode x (writeToNode p leafIdx lvl dt) ->
              isLeafNode x p.

Lemma writeBacks_invariant_holds: forall leafIdx lvl memSz lIDs s, init_invariant s memSz -> forall u strm stsh ttr, (u, (strm, (stsh, ttr))) = runState (writeBacks leafIdx lIDs lvl) s -> init_invariant (strm, (stsh, ttr)) memSz.