Definition KSap i j a b (g : KleeneStore i j (a -> b)) (k : KleeneStore i j a) :
  KleeneStore i j b :=
  kleeneStore (fun v => append_view (P := fun _ => b) (fun v1 v2 => (peek (k:=g) v1) (peek (k:=k) v2)) v)
              (Vector.append (pos g) (pos k)).

Lemma KSpure_KSap_KSmap i j a b (f : a -> b) (k : KleeneStore i j a) : KSap (KSpure i j f) k = KSmap f k.