Fixpoint rgopher (s: tree) : tree :=
match s with
| EE => EE
| T _ sl k sr => match rgopher sr with
| T _ srl j srr => T Red  (T Red sl k srl) j srr
| EE => s
end
end.

Lemma compare'_interp_aux:
forall a lo hi b lo' hi',
searchtree lo hi a ->
searchtree lo' hi' b ->
(forall k, interp a k <-> interp b k) ->
compare' a b = Eq.