End OCCUR.
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.

Lemma case_first_value :
forall (E : Set) (x y : E) (d : data) (q : queue data),
first data q = value data d ->
match q with
| empty => x
| input _ _ => y
end = y.