(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)


(* RECEIVE COPY 2 *)

(*definit la deuxieme transition receive copy et ses consequences*)

Require Export init.
Require Export table_act.
Require Export mess_act.

Unset Standard Proposition Elimination Names.

Section DEF_REC_COP2.

Definition rec_copy2_trans (c : Config) (s2 : Site) :=
  mkconfig (S (time c)) (dt c) (st c) (Set_rec_table (rt c) s2)
    (Collect_message (bm c) owner s2).

End DEF_REC_COP2.

Section REC_COP2_EFFECT.

(* invariants *)

Variable c0 : Config.

Variable s2 : Site.

Hypothesis rt_true : rt c0 s2 = false.

Lemma rcop2_trans_le_dt_time :
 forall s0 : Site,
 dt c0 s0 <= time c0 ->
 dt (rec_copy2_trans c0 s2) s0 <= time (rec_copy2_trans c0 s2).
Proof.
(* Goal: forall (s0 : Site) (_ : le (dt c0 s0) (time c0)), le (dt (rec_copy2_trans c0 s2) s0) (time (rec_copy2_trans c0 s2)) *)
 simpl in |- *; auto.
Qed.

Lemma rcop2_trans_diff_site :
 forall s3 s4 : Site,
 (In_queue Message copy (bm c0 s3 s4) -> s3 <> s4) ->
 In_queue Message copy (bm (rec_copy2_trans c0 s2) s3 s4) -> s3 <> s4.
Proof.
(* Goal: forall (s3 s4 : Site) (_ : forall _ : parent c0 s3 s4, lt (dt c0 s3) (dt c0 s4)) (_ : parent (rec_copy2_trans c0 s2) s3 s4), lt (dt (rec_copy2_trans c0 s2) s3) (dt (rec_copy2_trans c0 s2) s4) *)
 simpl in |- *; intros; apply H.
(* Goal: In_queue Message copy (bm c0 s3 s4) *)
 apply in_collect with (s1 := owner) (s2 := s2); trivial.
Qed.

Lemma rcop2_trans_rt :
 forall s0 : Site,
 Int (rt (rec_copy2_trans c0 s2) s0) =
 (if eq_site_dec s0 s2
  then  (Int (rt c0 s0) + 1)%Z
  else  Int (rt c0 s0)).
Proof.
(* Goal: forall s0 : Site, @eq Z (Int (rt (rec_copy2_trans c0 s2) s0)) (if eq_site_dec s0 s2 then Z.add (Int (rt c0 s0)) (Zpos xH) else Int (rt c0 s0)) *)
 intro; case (eq_site_dec s0 s2); simpl in |- *; intros.
(* Goal: @eq Z (Int (Set_rec_table (rt c0) s2 s0)) (Z.add (Int (rt c0 s0)) (Zpos xH)) *)
(* Goal: @eq Z (Int (Set_rec_table (rt c0) s2 s0)) (Int (rt c0 s0)) *)
 rewrite e; apply S_set_rec_table; auto.
(* Goal: @eq Z (Int (Set_rec_table (rt c0) s2 s0)) (Int (rt c0 s0)) *)
 apply no_set_rec_table; auto.
Qed.

Lemma rcop2_trans_in_queue :
 forall s0 s3 s4 : Site,
 In_queue Message (inc_dec s0) (bm (rec_copy2_trans c0 s2) s3 s4) ->
 In_queue Message (inc_dec s0) (bm c0 s3 s4).
Proof.
(* Goal: forall (s0 s3 s4 : Site) (_ : In_queue Message (inc_dec s0) (bm (rec_copy2_trans c0 s2) s3 s4)), In_queue Message (inc_dec s0) (bm c0 s3 s4) *)
 simpl in |- *; intros.
(* Goal: In_queue Message (inc_dec s0) (bm c0 s3 s4) *)
 apply in_collect with (s1 := owner) (s2 := s2); auto.
Qed.

Lemma rcop2_trans_st_rt :
 forall s0 : Site,
 ((st c0 s0 > 0)%Z -> rt c0 s0 = true) ->
 (st (rec_copy2_trans c0 s2) s0 > 0)%Z ->
 rt (rec_copy2_trans c0 s2) s0 = true.
Proof.
(* Goal: forall (s0 : Site) (_ : forall _ : Z.gt (st c0 s0) Z0, @eq bool (rt c0 s0) true) (_ : Z.gt (st (rec_copy2_trans c0 s2) s0) Z0), @eq bool (rt (rec_copy2_trans c0 s2) s0) true *)
 simpl in |- *; intros; auto; case (eq_site_dec s0 s2); intro.
(* Goal: @eq bool (Set_rec_table (rt c0) s2 s0) true *)
(* Goal: @eq bool (Set_rec_table (rt c0) s2 s0) true *)
 rewrite e; apply true_set_rec_table.

(* Goal: @eq bool (Set_rec_table (rt c0) s2 s0) true *)
 rewrite inch_set_rec_table; auto.
Qed.

End REC_COP2_EFFECT.

Section REC_COP2_CTRL.

(* decompte de messages *)

Variable c0 : Config.

Variable s0 s2 : Site.

Hypothesis first_mess : first Message (bm c0 owner s2) = value Message copy.

Lemma rcop2_trans_ctrl_copy :
 forall s1 : Site,
 ctrl_copy s0 s1 (bm (rec_copy2_trans c0 s2)) =
 (if eq_site_dec s0 owner
  then
   
   if eq_site_dec s1 s2
   then  (ctrl_copy s0 s1 (bm c0) - 1)%Z
   else  ctrl_copy s0 s1 (bm c0)
  else  ctrl_copy s0 s1 (bm c0)).
Proof.
(* Goal: forall s1 : Site, @eq Z (ctrl_copy s0 s1 (bm (rec_copy2_trans c0 s2))) (if eq_site_dec s0 owner then if eq_site_dec s1 s2 then Z.sub (ctrl_copy s0 s1 (bm c0)) (Zpos xH) else ctrl_copy s0 s1 (bm c0) else ctrl_copy s0 s1 (bm c0)) *)
 intros; unfold ctrl_copy in |- *; simpl in |- *.
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (if eq_site_dec s0 owner then if eq_site_dec s1 s2 then Z.sub (card_mess copy (bm c0 s0 s1)) (Zpos xH) else card_mess copy (bm c0 s0 s1) else card_mess copy (bm c0 s0 s1)) *)
 case (eq_site_dec s0 owner); intro.
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (if eq_site_dec s1 s2 then Z.sub (card_mess copy (bm c0 s0 s1)) (Zpos xH) else card_mess copy (bm c0 s0 s1)) *)
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
 case (eq_site_dec s1 s2); intro.
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (Z.sub (card_mess copy (bm c0 s0 s1)) (Zpos xH)) *)
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
 rewrite e; rewrite e0; apply collect_card_mess; trivial.

(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
 apply diff_collect_card_mess; auto.

(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
 apply diff_collect_card_mess; auto.
Qed.

Lemma rcop2_trans_ctrl_dec :
 forall s1 : Site,
 ctrl_dec s0 s1 (bm (rec_copy2_trans c0 s2)) = ctrl_dec s0 s1 (bm c0).
Proof.
(* Goal: forall s1 : Site, @eq Z (ctrl_dec s0 s1 (bm (rec_copy2_trans c0 s2))) (ctrl_dec s0 s1 (bm c0)) *)
 intros; unfold ctrl_dec in |- *; simpl in |- *.
(* Goal: @eq Z (card_mess (inc_dec s0) (Collect_message (bm c0) owner s2 s1 owner)) (card_mess (inc_dec s0) (bm c0 s1 owner)) *)
 apply diff_collect_card_mess.
(* Goal: or (not (@eq (exc Message) (first Message (bm c0 s1 owner)) (value Message (inc_dec s0)))) (or (not (@eq Site s1 owner)) (not (@eq Site owner s2))) *)
 apply diff_or_elsewhere with (m := copy); [ trivial | discriminate ].
Qed.

Lemma rcop2_trans_ctrl_inc :
 forall s1 : Site,
 ctrl_inc s0 s1 (bm (rec_copy2_trans c0 s2)) = ctrl_inc s0 s1 (bm c0).
Proof.
(* Goal: forall s1 : Site, @eq Z (ctrl_inc s0 s1 (bm (rec_copy2_trans c0 s2))) (ctrl_inc s0 s1 (bm c0)) *)
 intros; unfold ctrl_inc in |- *; simpl in |- *.
(* Goal: @eq Z (card_mess (inc_dec s0) (Collect_message (bm c0) owner s2 s1 owner)) (card_mess (inc_dec s0) (bm c0 s1 owner)) *)
 apply diff_collect_card_mess.
(* Goal: or (not (@eq (exc Message) (first Message (bm c0 s1 owner)) (value Message (inc_dec s0)))) (or (not (@eq Site s1 owner)) (not (@eq Site owner s2))) *)
 apply diff_or_elsewhere with (m := copy); [ trivial | discriminate ].
Qed.

Remark rcop2_trans_sigma_copy :
 s0 <> owner ->
 sigma_ctrl_copy s0 (bm (rec_copy2_trans c0 s2)) = sigma_ctrl_copy s0 (bm c0).
Proof.
(* Goal: forall _ : not (@eq Site s0 owner), @eq Z (sigma_ctrl_copy s0 (bm (rec_copy2_trans c0 s2))) (sigma_ctrl_copy s0 (bm c0)) *)
 intros; unfold sigma_ctrl_copy in |- *.
(* Goal: @eq Z (sigma Site LS (fun si : Site => ctrl_copy s0 si (bm (rec_copy2_trans c0 s2)))) (sigma Site LS (fun si : Site => ctrl_copy s0 si (bm c0))) *)
 apply sigma_simpl; intros.
(* Goal: @eq Z (Z.add (Z.add (Int (rt (rec_copy2_trans c0 s2) s1)) (ctrl_copy owner s1 (bm (rec_copy2_trans c0 s2)))) (ctrl_dec owner s1 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
 rewrite rcop2_trans_ctrl_copy.
(* Goal: @eq Z (if eq_site_dec s0 owner then if eq_site_dec x s2 then Z.sub (ctrl_copy s0 x (bm c0)) (Zpos xH) else ctrl_copy s0 x (bm c0) else ctrl_copy s0 x (bm c0)) (ctrl_copy s0 x (bm c0)) *)
 apply case_ineq; trivial.
Qed.

Remark rcop2_trans_sigma_dec :
 sigma_ctrl_dec s0 (bm (rec_copy2_trans c0 s2)) = sigma_ctrl_dec s0 (bm c0).
Proof.
(* Goal: @eq Z (sigma_ctrl_dec s0 (bm (rec_copy2_trans c0 s2))) (sigma_ctrl_dec s0 (bm c0)) *)
 intros; unfold sigma_ctrl_dec in |- *.
(* Goal: @eq Z (sigma Site LS (fun si : Site => ctrl_dec s0 si (bm (rec_copy2_trans c0 s2)))) (sigma Site LS (fun si : Site => ctrl_dec s0 si (bm c0))) *)
 apply sigma_simpl; intros; apply rcop2_trans_ctrl_dec.
Qed.

Remark rcop2_trans_sigma_inc :
 sigma_ctrl_inc s0 (bm (rec_copy2_trans c0 s2)) = sigma_ctrl_inc s0 (bm c0).
Proof.
(* Goal: @eq Z (sigma_ctrl_inc s0 (bm (rec_copy2_trans c0 s2))) (sigma_ctrl_inc s0 (bm c0)) *)
 intros; unfold sigma_ctrl_inc in |- *.
(* Goal: @eq Z (sigma Site LS (fun si : Site => ctrl_inc s0 si (bm (rec_copy2_trans c0 s2)))) (sigma Site LS (fun si : Site => ctrl_inc s0 si (bm c0))) *)
 apply sigma_simpl; intros; apply rcop2_trans_ctrl_inc.
Qed.

Lemma rcop2_trans_sigma_ctrl :
 s0 <> owner ->
 sigma_ctrl s0 (bm (rec_copy2_trans c0 s2)) = sigma_ctrl s0 (bm c0).
Proof.
(* Goal: forall _ : not (@eq Site s0 owner), @eq Z (sigma_ctrl s0 (bm (rec_copy2_trans c0 s2))) (sigma_ctrl s0 (bm c0)) *)
 intros; unfold sigma_ctrl in |- *.
(* Goal: @eq Z (Z.add (Z.add (sigma_ctrl_copy s0 (bm (rec_copy2_trans c0 s2))) (sigma_ctrl_dec s0 (bm (rec_copy2_trans c0 s2)))) (sigma_ctrl_inc s0 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (sigma_ctrl_copy s0 (bm c0)) (sigma_ctrl_dec s0 (bm c0))) (sigma_ctrl_inc s0 (bm c0))) *)
 rewrite rcop2_trans_sigma_copy.
(* Goal: @eq Z (Z.add (Z.add (sigma_ctrl_copy s0 (bm c0)) (sigma_ctrl_dec s0 (bm (rec_copy2_trans c0 s2)))) (sigma_ctrl_inc s0 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (sigma_ctrl_copy s0 (bm c0)) (sigma_ctrl_dec s0 (bm c0))) (sigma_ctrl_inc s0 (bm c0))) *)
(* Goal: not (@eq Site s0 owner) *)
 rewrite rcop2_trans_sigma_dec.
(* Goal: @eq Z (Z.add (Z.add (sigma_ctrl_copy s0 (bm c0)) (sigma_ctrl_dec s0 (bm c0))) (sigma_ctrl_inc s0 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (sigma_ctrl_copy s0 (bm c0)) (sigma_ctrl_dec s0 (bm c0))) (sigma_ctrl_inc s0 (bm c0))) *)
(* Goal: not (@eq Site s0 owner) *)
 rewrite rcop2_trans_sigma_inc.
(* Goal: not (@eq Site s2 s0) *)
 trivial.

(* Goal: not (@eq Site s2 s0) *)
 trivial.
Qed.

End REC_COP2_CTRL.

Section REC_COP2_XY.

Variable c0 : Config.

Variable s0 s2 : Site.

Hypothesis rt_true : rt c0 s2 = false.

Hypothesis first_mess : first Message (bm c0 owner s2) = value Message copy.

Remark rcop2_trans_xi :
 forall s1 : Site, xi (rec_copy2_trans c0 s2) s1 = xi c0 s1.
Proof.
(* Goal: forall s1 : Site, @eq Z (xi (rec_copy2_trans c0 s2) s1) (xi c0 s1) *)
 intro; unfold xi in |- *.
(* Goal: @eq Z (Z.add (Z.add (Int (rt (rec_copy2_trans c0 s2) s1)) (ctrl_copy owner s1 (bm (rec_copy2_trans c0 s2)))) (ctrl_dec owner s1 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
 rewrite rcop2_trans_ctrl_copy.
(* Goal: @eq Z (Z.add (Z.add (Int (rt (rec_copy2_trans c0 s2) s1)) (if eq_site_dec owner owner then if eq_site_dec s1 s2 then Z.sub (ctrl_copy owner s1 (bm c0)) (Zpos xH) else ctrl_copy owner s1 (bm c0) else ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm (rec_copy2_trans c0 s2)))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
(* Goal: @eq (exc Message) (first Message (bm c0 owner s2)) (value Message copy) *)
 rewrite rcop2_trans_ctrl_dec.
(* Goal: @eq Z (Z.add (Z.add (Int (rt (rec_copy2_trans c0 s2) s1)) (if eq_site_dec owner owner then if eq_site_dec s1 s2 then Z.sub (ctrl_copy owner s1 (bm c0)) (Zpos xH) else ctrl_copy owner s1 (bm c0) else ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
(* Goal: @eq (exc Message) (first Message (bm c0 owner s2)) (value Message copy) *)
(* Goal: @eq (exc Message) (first Message (bm c0 owner s2)) (value Message copy) *)
 rewrite rcop2_trans_rt.
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (if eq_site_dec s1 s2 then Z.sub (card_mess copy (bm c0 s0 s1)) (Zpos xH) else card_mess copy (bm c0 s0 s1)) *)
(* Goal: @eq Z (card_mess copy (Collect_message (bm c0) owner s2 s0 s1)) (card_mess copy (bm c0 s0 s1)) *)
 rewrite case_eq; case (eq_site_dec s1 s2); intro.
(* Goal: @eq Z (Z.add (Z.add (Z.add (Int (rt c0 s1)) (Zpos xH)) (Z.sub (ctrl_copy owner s1 (bm c0)) (Zpos xH))) (ctrl_dec owner s1 (bm c0))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
(* Goal: @eq Z (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) (Z.add (Z.add (Int (rt c0 s1)) (ctrl_copy owner s1 (bm c0))) (ctrl_dec owner s1 (bm c0))) *)
(* Goal: @eq bool (rt c0 s2) false *)
(* Goal: @eq (exc Message) (first Message (bm c0 owner s2)) (value Message copy) *)
(* Goal: @eq (exc Message) (first Message (bm c0 owner s2)) (value Message copy) *)
 omega.

(* Goal: not (@eq Site s2 s0) *)
 trivial.

(* Goal: not (@eq Site s2 s0) *)
 trivial.

(* Goal: not (@eq Site s2 s0) *)
 trivial.

(* Goal: not (@eq Site s2 s0) *)
 trivial.
Qed.

Remark rcop2_trans_yi :
 forall s1 : Site, yi (rec_copy2_trans c0 s2) s1 = yi c0 s1.
Proof.
(* Goal: forall s1 : Site, @eq Z (yi (rec_copy2_trans c0 s2) s1) (yi c0 s1) *)
 intro; unfold yi in |- *; apply sigma_simpl.
(* Goal: not (@eq Site s2 s0) *)
 intros; apply rcop2_trans_ctrl_inc; trivial.
Qed.

Lemma rcop2_trans_sigma_xi : sigma_xi (rec_copy2_trans c0 s2) = sigma_xi c0.
Proof.
(* Goal: @eq Z (sigma_xi (rec_copy2_trans c0 s2)) (sigma_xi c0) *)
 unfold sigma_xi in |- *; apply sigma_simpl; intros; apply rcop2_trans_xi.
Qed.

Lemma rcop2_trans_sigma_yi : sigma_yi (rec_copy2_trans c0 s2) = sigma_yi c0.
Proof.
(* Goal: @eq Z (sigma_yi (rec_copy2_trans c0 s2)) (sigma_yi c0) *)
 unfold sigma_yi in |- *; apply sigma_simpl; intros; apply rcop2_trans_yi.
Qed.

End REC_COP2_XY.

Section REC_COP2_ALT.

(* structure de file d'attente *)

Variable c0 : Config.

Variable s0 s2 : Site.

Lemma rcop2_trans_D :
 (rt c0 s0 = false -> D_queue (bm c0 s0 owner)) ->
 rt (rec_copy2_trans c0 s2) s0 = false ->
 D_queue (bm (rec_copy2_trans c0 s2) s0 owner).
Proof.
(* Goal: forall (_ : forall _ : @eq bool (rt c0 s0) false, D_queue (bm c0 s0 owner)) (_ : @eq bool (rt (rec_copy2_trans c0 s2) s0) false), D_queue (bm (rec_copy2_trans c0 s2) s0 owner) *)
 simpl in |- *; case (eq_site_dec s2 s0); intro.
(* Goal: forall (_ : forall _ : @eq bool (rt c0 s0) false, D_queue (bm c0 s0 owner)) (_ : @eq bool (Set_rec_table (rt c0) s2 s0) false), D_queue (Collect_message (bm c0) owner s2 s0 owner) *)
(* Goal: forall (_ : forall _ : @eq bool (rt c0 s0) false, D_queue (bm c0 s0 owner)) (_ : @eq bool (Set_rec_table (rt c0) s2 s0) false), D_queue (Collect_message (bm c0) owner s2 s0 owner) *)
 rewrite e; rewrite true_set_rec_table; intros; discriminate H0.

(* Goal: forall (_ : forall _ : @eq bool (rt c0 s0) false, D_queue (bm c0 s0 owner)) (_ : @eq bool (Set_rec_table (rt c0) s2 s0) false), D_queue (Collect_message (bm c0) owner s2 s0 owner) *)
 rewrite inch_set_rec_table.
(* Goal: forall (_ : forall _ : @eq bool (rt c0 s0) false, D_queue (bm c0 s0 owner)) (_ : @eq bool (rt c0 s0) false), D_queue (Collect_message (bm c0) owner s2 s0 owner) *)
(* Goal: not (@eq Site s2 s0) *)
 intros; apply D_collect; auto.

(* Goal: not (@eq Site s2 s0) *)
 trivial.
Qed.

Lemma rcop2_trans_alt :
 alternate (bm c0 s0 owner) ->
 alternate (bm (rec_copy2_trans c0 s2) s0 owner).
Proof.
(* Goal: not (@eq Site s2 s0) *)
 intros; simpl in |- *; apply alt_collect; trivial.
Qed.

End REC_COP2_ALT.

Section REC_COP2_RELAT.

(* relation parent *)

Variable c0 : Config.

Variable s2 : Site.

Remark rcop2_trans_parent :
 forall s3 s4 : Site, parent (rec_copy2_trans c0 s2) s4 s3 -> parent c0 s4 s3.
Proof.
(* Goal: forall (s3 s4 : Site) (_ : parent (rec_copy2_trans c0 s2) s4 s3), parent c0 s4 s3 *)
 intros; elim H.
(* Goal: forall (s1 s0 : Site) (_ : In_queue Message (inc_dec s1) (bm (rec_copy2_trans c0 s2) s0 owner)), parent c0 s1 s0 *)
 intros; apply parent_intro.
(* Goal: not (@eq Site s2 s0) *)
 apply rcop2_trans_in_queue with (s2 := s2); trivial.
Qed.

Lemma rcop2_trans_parent_cr :
 forall s3 s4 : Site,
 (parent c0 s3 s4 -> dt c0 s3 < dt c0 s4) ->
 parent (rec_copy2_trans c0 s2) s3 s4 ->
 dt (rec_copy2_trans c0 s2) s3 < dt (rec_copy2_trans c0 s2) s4.
Proof.
(* Goal: forall (s3 s4 : Site) (_ : forall _ : parent c0 s3 s4, lt (dt c0 s3) (dt c0 s4)) (_ : parent (rec_copy2_trans c0 s2) s3 s4), lt (dt (rec_copy2_trans c0 s2) s3) (dt (rec_copy2_trans c0 s2) s4) *)
 simpl in |- *; intros; apply H.
(* Goal: not (@eq Site s2 s0) *)
 apply rcop2_trans_parent; trivial.
Qed.

End REC_COP2_RELAT.
