Program Definition fstn_stream {A: Type} (n: nat) (h: stream A) : stream A :=
fun m => if le_lt_dec n m then None else h m.
Next Obligation.
destruct (le_lt_dec n x), (le_lt_dec n y); try congruence.
+ omega.
+ apply (stream_sound1 h x y); auto; omega.
Qed.
Definition skipn_stream {A: Type} (n: nat) (h: stream A) : stream A.
exists (fun m => h (m + n)).
intros.
revert H0; apply (stream_sound1 h).
omega.
Defined.

(* Specifications: *)
Lemma fstn_stream_Some {A: Type}: forall n m (h: stream A), m < n -> (fstn_stream n h) m = h m.
Lemma fstn_stream_None {A: Type}: forall n m (h: stream A), n <= m -> (fstn_stream n h) m = None.
Lemma fstn_stream_is_n_stream {A: Type}: forall n (h: stream A),
is_at_least_n_stream n h ->
is_n_stream n (fstn_stream n h).
Lemma fstn_stream_eq {A: Type}: forall n (h: stream A),
is_at_most_n_stream n h ->
fstn_stream n h = h.
Lemma fstn_stream_is_fin_stream {A: Type}: forall n (h: stream A),
is_fin_stream (fstn_stream n h).
(* Lemma fstn_stream_is_n_stream_inf {A: Type}: forall m (h: stream A), is_inf_stream h -> is_n_stream m (fstn_stream m h).  Lemma fstn_stream_is_n_stream' {A: Type}: forall n m (h: stream A), n <= m -> is_n_stream n h -> is_n_stream n (fstn_stream m h). *)
Lemma skipn_stream_spec {A: Type}: forall n m (h: stream A), (skipn_stream n h) m = h (m + n).
Lemma skipn_stream_empty {A: Type}: forall n (h: stream A),
is_at_most_n_stream n h ->
skipn_stream n h = empty_stream.