Section ComposeApplicative.
Variable (F G :Applicative).
Let FG (a:Type) := F (G a).
Definition Compose_pure (a:Type) (x:a) : FG a :=
pure F (pure G x).
Definition Compose_ap (a b:Type) (f:FG (a -> b)) (x:FG a) : FG b :=
ap (ap (pure F (fun g x => ap g x)) f) x.
Definition ComposeApplicative : Applicative.
exists FG Compose_pure Compose_ap.
apply Compose_identity.
apply Compose_composition.
apply Compose_homomorphism.
apply Compose_interchange.
Defined.
End ComposeApplicative.

Lemma sequenceVector_map n a b (F:Applicative) (f : a -> b) (v :Vector.t (F a) n) :
map (Vector.map f) (sequenceVector v) = sequenceVector (Vector.map (map f) v).