\$\begingroup\$

Catalin Hritcu published some notes on coinduction in Coq, including a discussion of coinduction principles in the style of Giménez and Castéran. One of the exercises is to show that stream bisimulation is transitive using the following coinduction principle:

stream_eq_coind : forall (A : Type) (R : stream A -> stream A -> Prop), (forall s1 s2 : stream A, R s1 s2 -> head s1 = head s2) -> (forall s1 s2 : stream A, R s1 s2 -> R (tail s1) (tail s2)) -> forall s1 s2 : stream A, R s1 s2 -> stream_eq s1 s2

The "hard part", if any, is finding a coinduction hypothesis. Here is mine:

Definition stream_eq_trans_principle {A : Type} (t1 t3 : stream A) := exists t2, stream_eq t1 t2 /\ stream_eq t2 t3.

The proof follows naturally.

My question: is this the "canonical" induction hypothesis for this problem, or is there a different one which is considered more elegant?

Here is some stand-alone code for experimenting with.