fact: Definition safer_nth (xs : list A) := match xs as l return (forall n : nat, n < length l -> A) with | nil => fun n Hn => False_rect A (False_ind False (Lt.lt_n_O n Hn)) | x :: xs0 => fun n Hn => let f:= (fix safer_nth'' (xs1:list A) (n0:nat) {struct n0}:n0<length (x::xs1)->A := match n0 as n1 return (n1 < length (x :: xs1) -> A) with | 0 => fun _ => x | S n1 => fun Hn0 => safer_nth'' xs1 n1 (Lt.lt_trans n1 (S n1) (length (x :: xs1)) (Lt.lt_n_Sn n1) Hn0) end) in f xs0 n Hn end.
imports: List Streams Omega