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.

Lemma append_first_out : forall (q1 : queue data) (d : data), first_out data (append q1 (input data d (empty data))) = q1.