Section SF_seq.
Context {T : Type}.
Record SF_seq := mkSF_seq {SF_h : R ; SF_t : seq (R * T)}.
Definition SF_lx (s : SF_seq) : seq R := (SF_h s)::(unzip1 (SF_t s)).
Definition SF_ly (s : SF_seq) : seq T := unzip2 (SF_t s).
Definition SF_make (lx : seq R) (ly : seq T) (Hs : size lx = S (size ly)) : SF_seq :=
mkSF_seq (head 0 lx) (zip (behead lx) ly).
(** ** Constructors *)
Definition SF_nil (x0 : R) : SF_seq := mkSF_seq x0 [::].
Definition SF_cons (h : R*T) (s : SF_seq) :=
mkSF_seq (fst h) ((SF_h s,snd h)::(SF_t s)).
Definition SF_rcons (s : SF_seq) (t : R*T) :=
mkSF_seq (SF_h s) (rcons (SF_t s) t).
(** ** SF_seq and seq *)
(** ** SF_size *)
Definition SF_size (s : SF_seq) := size (SF_t s).

Lemma SF_size_lx (s : SF_seq) : size (SF_lx s) = S (SF_size s).
Lemma SF_size_ly (s : SF_seq) : size (SF_ly s) = SF_size s.