induction F.
- intro i;rewrite get_empty; congruence.
- intro i;rewrite get_push_Full;trivial.
case_eq (i ?= index S);simpl.
+ left;congruence.
+ right;eauto.
+ congruence.
Qed.
End Store.
Arguments PNone {A}.
Arguments PSome [A] _.
Arguments Tempty {A}.
Arguments Branch0 [A] _ _.
Arguments Branch1 [A] _ _ _.
Arguments Tget [A] p T.
Arguments Tadd [A] p a T.
Arguments Tget_Tempty [A] p.
Arguments Tget_Tadd [A] i j a T.
Arguments mkStore [A] index contents.
Arguments index [A] s.
Arguments contents [A] s.
Arguments empty {A}.
Arguments get [A] i S.
Arguments push [A] a S.
Arguments get_empty [A] i.
Arguments get_push_Full [A] i a S _.
Arguments Full [A] _.
Arguments F_empty {A}.
Arguments F_push [A] a S _.
Arguments In [A] x S F.
Register empty as plugins.rtauto.empty.
Register push as plugins.rtauto.push.
Section Map.
Variables A B:Set.
Variable f: A -> B.
Fixpoint Tmap (T: Tree A) : Tree B :=
match T with
Tempty => Tempty
| Branch0 t1 t2 => Branch0 (Tmap t1) (Tmap t2)
| Branch1 a t1 t2 => Branch1 (f a) (Tmap t1) (Tmap t2)
end.

(* Specifications: *)
Lemma Tget_Tmap: forall T i,
Tget i (Tmap T)= match Tget i T with PNone => PNone
| PSome a => PSome (f a) end.