Proof using nisi rlmli rri.
intros.
find_copy_apply_lem_hyp entries_contiguous_invariant.
find_copy_apply_lem_hyp lift_nextIndex_safety.
assert (pred (getNextIndex (snd (nwState net h)) h') > 0) by omega.
unfold nextIndex_safety in *.
match goal with
| H : forall _ _, type _ = _ -> _ |- _ => specialize (H h h')
end.
intuition.
unfold entries_contiguous in *. specialize (H2 h).
unfold contiguous_range_exact_lo in *. intuition.
match goal with
| H : forall _, _ < _ <= _ -> _ |- _ =>
specialize (H (pred (getNextIndex (snd (nwState net h)) h')))
end.
unfold raft_refined_base_params in *.
repeat find_rewrite_lem deghost_spec. intuition.
break_exists_exists. intuition.
find_apply_lem_hyp entries_sorted_invariant.
apply findAtIndex_intro; eauto using sorted_uniqueIndices.
Qed.

(* Specifications: *)
Lemma prefix_within_term_subset :
forall l1 l1' l2,
prefix_within_term l1' l2 ->
(forall e, In e l1 -> In e l1') ->
prefix_within_term l1 l2.