(******************************)
(******************************)
(* Custom lemmas about arrays *)
(******************************)
(******************************)
Definition indx {I : finType} (x : I) := index x (enum I).
Prenex Implicits indx.
(***********************************)
(* Arrays indexed by a finite type *)
(***********************************)
Section Array.
Variables (p : ptr) (I : finType).
(* helper lemmas *)

Lemma updi_split T k (f : {ffun I -> T}) :
updi p (fgraph f) = updi p (take (indx k) (fgraph f)) \+
p.+(indx k) :-> f k \+
updi (p.+(indx k).+1) (drop (indx k).+1 (fgraph f)).