(** In order to state our example equalities, we define the following four trees. *)
CoFixpoint eins : inftree := node 1 eins (node 2 eins zwei)
with       zwei : inftree := node 2 eins zwei.
(** *** Incremental proofs using [cofix]  As before, we define the tree equality as the greatest fixed point of its generating function. *)
Inductive teq_gen teq : inftree -> inftree -> Prop :=
| _teq_gen : forall n t1l t1r t2l t2r (Rl : teq t1l t2l : Prop) (Rr : teq t1r t2r),
teq_gen teq (node n t1l t1r) (node n t2l t2r).
Hint Constructors teq_gen.
CoInductive teq t1 t2 : Prop :=
| teq_fold (IN : teq_gen teq t1 t2).
(** We now prove, using [cofix], that [one] equals [eins] and, separately, that [two] equals [zwei].  Note the nested use of [cofix] in either proof script, which lets us strengthen the coinductive hypothesis in the middle of the proof.  For instance, in the proof [teq_one], we start out with the coinductive hypothesis that [one] and [eins] are equal ([CIH]).  Later on, we use [cofix] again to additionally assume that [two] and [zwei] are equal ([CIH']).  This is a prime example of _incremental_ proof: we start with no coinductive assumptions, and we progressively add more coinductive assumptions as the proof progresses. *)

Theorem teq_two : teq two zwei.
Definition teq' t1 t2 := paco2 teq_gen bot2 t1 t2.