Ltac cgen  H := generalize H; clear H.Ltac celim H := elim H; clear H.(** A binary relation is a predicate over pairs of processes *)
Definition relation2(X Y: Type) := X -> Y -> Prop.Definition relation (X: Type) := relation2 X X.Definition set(X: Type) := X -> Prop.(** Inclusion *)
  Definition incl: relation (relation2 X Y) := fun R1 R2 => forall x y, R1 x y -> R2 x y.(** Extensional equality *)
  Definition eeq: relation (relation2 X Y) := fun R1 R2 => incl R1 R2 /\ incl R2 R1.Definition reflexive     := forall x, R x x.Definition transitive    := forall y x z, R x y -> R y z -> R x z.Definition symmetric     := forall x y, R x y -> R y x.Definition antisymmetric := forall x y, R x y -> R y x -> x=y.(* begin hide *)
    Definition eta2: relation2 X Y := fun x y => Rxy x y.(* end hide *)

    (** Transposition, composition, union, union `such that' *)
    Definition trans:  relation2 Y X := fun y x => Rxy x y.Definition comp:   relation2 X Z := fun x z => exists2 y, Rxy x y & Ryz y z.Definition union2: relation2 X Y := fun x y => Rxy x y \/ Rxy' x y.Definition union (I: Type) R: relation2 X Y := fun x y => exists i: I, R i x y.Definition union_st (P: set (relation2 X Y)) := fun x y => exists2 R, P R & R x y.(** Reflexive, transitive closure *) 
  Inductive star: relation X := 
    | star_refl: forall x, star x x
    | S_star: forall y x z, R x y -> star y z -> star x z.(** Reflexive, transitive closure *) 
  Inductive star: relation X := 
    | star_refl: forall x, star x x
    | S_star: forall y x z, R x y -> star y z -> star x z.(** Reflexive, transitive closure *) 
  Inductive star: relation X := 
    | star_refl: forall x, star x x
    | S_star: forall y x z, R x y -> star y z -> star x z.(** Transitive closure *) 
  Definition plus: relation X := comp R star.

Lemma comp_incl: incl R R' -> incl S S' -> incl (comp R S) (comp R' S').