intros.
unfold as_tree in H.
repeat
match goal with
| [ H : match ?x with _ => _  end = _ |- _ ] => destruct x;
try (apply some_none in H; contradiction) end.
congruence.
inversion H. subst. auto.
Admitted. (*Qed.*)

Lemma as_tree_r : forall e t,
as_tree e = Some (inr t) ->
e = (Inj (inr (Data (fleaf t)))).