Section APPEND.
Variable data : Set.
Fixpoint append (q : queue data) : queue data -> queue data :=
fun q2 : queue data =>
match q with
| empty => q2
| input d q' => input data d (append q' q2)
end.
(* This one was a nightmare!! *)

Lemma append_first_out2 :
forall (d : data) (q1 : queue data),
first data q1 = value data d ->
append (first_out data q1) (input data d (empty data)) = q1.