(* Contribution to the Coq Library   V6.3 (July 1999)                    *)

(****************************************************************************)
(* This contribution was updated for Coq V5.10 by the COQ workgroup.        *)
(* January 1995                                                             *)
(****************************************************************************)
(*                                                                          *)
(*      Coq V5.8                                                            *)
(*                                                                          *)
(*                                                                          *)
(*      Alternating Bit Protocol                                            *)
(*                                                                          *)
(*      Jan Friso Groote                                                    *)
(*      Utrecht University                                                  *)
(*                                                                          *)
(*      November 1992                                                       *)
(*                                                                          *)
(* From bezem@phil.ruu.nl Fri Apr  2 13:14:31 1993                          *)
(*                                                                          *)
(****************************************************************************)
(*                                abp_lem1.v                                *)
(****************************************************************************)

Require Import abp_base.
Require Import abp_defs.

Goal
forall (b : bit) (x y : proc),
D + (fun d : D => seq (ia D r1 d) (enc H (mer (seq (Sn_d d b) y) x))) =
enc H (Lmer (seq (Sn b) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
elim ProcSn.
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia D r1 d) (Sn_d d b))) y) (seq (Rn b') y')) *)
elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y).
elimtype
 ((fun d : D => seq (ia D r1 d) (seq (Sn_d d b) y)) =
  (fun d : D => seq (seq (ia D r1 d) (Sn_d d b)) y)).
2: apply EXTE; intro; elim A5; apply refl_equal.
elim (SUM6 D (fun d : D => seq (ia D r1 d) (seq (Sn_d d b) y)) x).
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
elimtype
 ((fun d : D => seq (ia D r1 d) (enc H (mer (seq (Sn_d d b) y) x))) =
  (fun d : D => enc H (Lmer (seq (ia D r1 d) (seq (Sn_d d b) y)) x))).
           
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq bool true true *)
apply refl_equal.
exact Inr1H.
Save LmerSn.

Goal forall x : proc, Delta = enc H (Lmer (K i) x).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM6 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) x).
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
elimtype
 ((fun d : Frame => Delta) =
  (fun d : Frame =>
   enc H
     (Lmer
        (seq (ia Frame r2 d)
           (seq
              (alt (seq (ia one int i) (ia Frame s3 d))
                 (seq (ia one int i) (ia Frame s3 lce))) 
              (K i))) x))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist r2 H *)
exact Inr2H.
Save LmerK.

Goal forall x : proc, Delta = enc H (Lmer (L i) x).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elim
 (SUM6 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) x).
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
elimtype
 ((fun d : frame => Delta) =
  (fun d : frame =>
   enc H
     (Lmer
        (seq (ia frame r5 d)
           (seq
              (alt (seq (ia one int i) (ia frame s6 d))
                 (seq (ia one int i) (ia frame s6 sce))) 
              (L i))) x))).
           
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist r5 H *)
exact Inr5H.
Save LmerL.

Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (seq (Rn b) y) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y).
elim
 (CM4
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y)
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y) x).
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
cut
 (Delta =
  enc H
    (Lmer
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y) x)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (ia frame s5 (tuple b)) (Rn b))).
elim
 (A4
    (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y).
elim
 (CM4
    (seq
       (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
          (seq (ia frame s5 (tuple b)) (Rn b))) y)
    (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y) x).
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* added *)
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* end added *)
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* removed
Elim (A5 (D+[d:D](ia Frame r3 (Tuple b d)))
        (seq (ia frame s5 (tuple b)) (Rn b))
             y).
Elim (SUM5 D ([d:D](ia Frame r3 (Tuple b d))) 
     (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)).
Elim (SUM6 D [d:D]
           (seq (ia Frame r3 (Tuple b d))
             (seq (seq (ia frame s5 (tuple b)) (Rn b))
                 y)) x). *)
(* added *)
(* Goal: @eq proc Delta (enc H (Lmer (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (seq (Rn b) y))) x)) *)
(* Goal: In_ehlist r3 H *)
(* Goal: @eq proc Delta (enc H (Lmer (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y) x)) *)
elim SUM5.
(* Goal: @eq proc (ia one delta i) (Lmer (sum D (fun _ : D => ia one delta i)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim SUM6.
(* end added *)
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
(* pattern changed*)
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   enc H
     (Lmer
        (seq (ia Frame r3 (Tuple b d))
           (seq (ia frame s5 (tuple b)) (seq (Rn b) y))) x))).
(* end pattern changed*)
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist r3 H *)
exact Inr3H.
(* Goal: In_ehlist r3 H *)
exact Inr3H. 
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y).
elim
 (SUM6 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b) d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y) x).
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   enc H
     (Lmer
        (seq
           (seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y) x))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist r3 H *)
exact Inr3H.

Save LmerRn.

Goal
forall (b : bit) (x y : proc),
Delta = enc H (Lmer (comm (L i) (seq (Rn b) y)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (Rn b) y)) x)) *)
cut (Delta = comm (L i) (seq (Rn b) y)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : frame => Delta) =
  (fun d : frame =>
   comm
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (Rn b) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y).

(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.

cut
 (Delta =
  comm
    (seq (ia frame r5 d)
       (seq
          (alt (seq (ia one int i) (ia frame s6 d))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i)))
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y)).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
cut
 (Delta =
  comm
    (seq (ia frame r5 d)
       (alt (seq (seq (ia one int i) (ia frame s6 d)) (L i))
          (seq (seq (ia one int i) (ia frame s6 sce)) (L i))))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y))).

(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)).
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b d0))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y))
     (seq (ia frame r5 d)
        (alt (seq (seq (ia one int i) (ia frame s6 d)) (L i))
           (seq (seq (ia one int i) (ia frame s6 sce)) (L i)))))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
apply EQFf.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y).
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3. 
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y)
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.   
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
Save CommLRn.

Goal forall x : proc, Delta = enc H (Lmer (comm (K i) (L i)) x).
(* Goal: forall x : proc, @eq proc Delta (enc H (Lmer (comm (K i) (L i)) x)) *)
cut (Delta = comm (K i) (L i)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : Frame => Delta) =
  (fun d : Frame =>
   comm
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (L i))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : frame => Delta) =
  (fun d0 : frame =>
   comm
     (seq (ia frame r5 d0)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d0))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i)))
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.   
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
red in |- *; intro.
(* Goal: False *)
apply EQFf.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.

Save CommKL.

Goal
forall (b : bit) (x y : proc),
Delta = enc H (Lmer (comm (K i) (seq (Rn b) y)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (Rn b) y)) x)) *)
cut (Delta = comm (K i) (seq (Rn b) y)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal. 

(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : Frame => Delta) =
  (fun d : Frame =>
   comm
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (Rn b) y))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.  
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
cut
 (Delta =
  comm
    (seq (ia Frame r2 d)
       (alt (seq (seq (ia one int i) (ia Frame s3 d)) (K i))
          (seq (seq (ia one int i) (ia Frame s3 lce)) (K i))))
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y)).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y).
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A7; elim A6.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)).
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b d0))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y))
     (seq (ia Frame r2 d)
        (alt (seq (ia one int i) (seq (ia Frame s3 d) (K i)))
           (seq (ia one int i) (seq (ia Frame s3 lce) (K i))))))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq bool true true *)
elim A7; apply refl_equal.  
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.

elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y)
     (seq (ia Frame r2 d)
        (alt (seq (seq (ia one int i) (ia Frame s3 d)) (K i))
           (seq (seq (ia one int i) (ia Frame s3 lce)) (K i)))))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.  
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.  
Save CommKRn.



Goal
forall (b : bit) (x y : proc),
Delta = enc H (Lmer (comm (seq (Sn b) y) (K i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (K i)) x)) *)
cut (Delta = comm (seq (Sn b) y) (K i)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0. 
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
elim ProcSn.
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia D r1 d) (Sn_d d b))) y) (seq (Rn b') y')) *)
elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (K i))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : Frame => Delta) =
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia D r1 d) (seq (Sn_d d b) y)))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.   
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame D) *)
exact EQFD.

Save CommSnK.

Goal
forall (b : bit) (x y : proc),
Delta = enc H (Lmer (comm (seq (Sn b) y) (L i)) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.    
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (L i)) x)) *)
cut (Delta = comm (seq (Sn b) y) (L i)).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.   
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
elim ProcSn.
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia D r1 d) (Sn_d d b))) y) (seq (Rn b') y')) *)
elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (L i))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : frame => Delta) =
  (fun d0 : frame =>
   comm
     (seq (ia frame r5 d0)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d0))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia D r1 d) (seq (Sn_d d b) y)))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ frame D) *)
exact EQfD.
Save CommSnL.


Goal
forall (b b' : bit) (x y y' : proc),
Delta = enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
cut (Delta = comm (seq (Sn b) y) (seq (Rn b') y')). 
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.   
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *. 
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal. 
 
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
elim ProcSn.
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia D r1 d) (Sn_d d b))) y) (seq (Rn b') y')) *)
elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y). 
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (seq (Rn b') y'))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.

(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq
       (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b')) (Rn b')))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b') d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y').

(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
cut
 (Delta =
  comm (seq (ia D r1 d) (seq (Sn_d d b) y))
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b')) (Rn b')) y').
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b' d))) 
    (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).  
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A7; elim A6.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b' d))
    (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b' d0))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
     (seq (ia D r1 d) (seq (Sn_d d b) y)))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal. 
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7. 
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''. 
(* Goal: @eq bool true true *)
elim A7; apply refl_equal. 
(* Goal: not (EQ Frame D) *)
exact EQFD.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
(* Goal: @eq proc Delta (comm (seq (ia D r1 d) (seq (Sn_d d b) y)) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')) *)
apply EQFD.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.

elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b') d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y').
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b') d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y')
     (seq (ia D r1 d) (seq (Sn_d d b) y)))).

(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.  
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame D) *)
exact EQFD.

Save CommSnRn.

Goal
forall (b : bit) (d : D) (x y : proc),
Delta = enc H (Lmer (seq (Sn_d d b) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist s2 H *)
exact Ins2H.
Save LmerSnd.

Goal
forall (b : bit) (d : D) (x y : proc),
Delta = enc H (Lmer (seq (Tn_d d b) y) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) (comm (seq (Tn_d d b) y) (seq (ia one int i) y''))) x)) *)
elim CM4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) (comm (seq (Tn_d d b) y) (seq (ia one int i) y''))) x)) *)
elim CM4.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist r6 H *)
exact Inr6H.
(* Goal: In_ehlist r6 H *)
exact Inr6H.
(* Goal: In_ehlist r6 H *)
exact Inr6H.
Save LmerTnd.

Goal
forall (f : frame) (x y : proc),
Delta = enc H (Lmer (seq (ia frame s5 f) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist s5 H *)
exact Ins5H.
Save Lmers5.

Goal
forall (d : D) (x y : proc),
seq (ia D s4 d) (enc H (mer y x)) = enc H (Lmer (seq (ia D s4 d) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist s4 H) *)
exact Ins4H.
Save Lmers4.

 
Goal
forall x y y' : proc,
alt (seq (ia one int i) (enc H (mer y x)))
  (seq (ia one int i) (enc H (mer y' x))) =
enc H (Lmer (alt (seq (ia one int i) y) (seq (ia one int i) y')) x).
 
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) (comm (seq (Tn_d d b) y) (seq (ia one int i) y''))) x)) *)
elim CM4.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist int H) *)
exact InintH.
Save Lmeri.

Goal
forall (f : Frame) (x y : proc),
Delta = enc H (Lmer (seq (ia Frame s3 f) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist s3 H *)
exact Ins3H.
Save Lmers3.

Goal
forall (f : frame) (x y : proc),
Delta = enc H (Lmer (seq (ia frame s6 f) y) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc Delta (seq (enc H (ia frame s6 f)) (enc H (mer y x))) *)
elim D2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: In_ehlist s6 H *)
exact Ins6H.
Save Lmers6.

Goal forall (c : bool) (p : proc), cond p c p = p.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: forall _ : forall _ : @eq bool false c, @eq proc x y, @eq proc (cond z c x) (cond z c y) *)
elim c.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq bool true true *)
apply refl_equal.
Save Bak4_2_1.

Goal
forall (c : bool) (x y z : proc),
(true = c -> x = y) -> cond x c z = cond y c z.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : forall _ : @eq bool false c, @eq proc x y, @eq proc (cond z c x) (cond z c y) *)
elim c.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq bool true true *)
apply refl_equal.
Save Def4_3_1_2.

Goal
forall (c : bool) (x y z : proc),
(false = c -> x = y) -> cond z c x = cond z c y.

(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: forall _ : forall _ : @eq bool false c, @eq proc x y, @eq proc (cond z c x) (cond z c y) *)
elim c.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
Save Def4_3_1_2'.

Goal
forall (x : Frame -> proc) (d : Frame),
x d = Frame + (fun e : Frame => cond (x d) (eqF e d) Delta).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (x d) (sum D (fun e : D => cond (x d) (eqD e d) Delta)) *)
pattern (x d) at 1 in |- *.
(* Goal: (fun p : proc => @eq proc (sum Frame (fun _ : Frame => x d)) (alt (sum Frame (fun e : Frame => cond (x d) (eqF e d) Delta)) p)) (x d) *)
(* Goal: forall e : Frame, @eq proc (x d) (alt (cond (x d) (eqF e d) Delta) (x d)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
elimtype (Frame + (fun e : Frame => x d) = x d).
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (sum Frame (fun e : Frame => cond (x d) (eqF e d) Delta)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
cut (forall e : Frame, x d = alt (cond (x d) (eqF e d) Delta) (x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (sum Frame (fun e : Frame => cond (x d) (eqF e d) Delta)) *)
(* Goal: forall e : Frame, @eq proc (x d) (alt (cond (x d) (eqF e d) Delta) (x d)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
elim (SUM3 Frame d (fun e : Frame => cond (x d) (eqF e d) Delta)).

(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (alt (sum Frame (fun e : Frame => cond (x d) (eqF e d) Delta)) (cond (x d) (eqF d d) Delta)) *)
(* Goal: forall e : Frame, @eq proc (x d) (alt (cond (x d) (eqF e d) Delta) (x d)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
elim eqF7.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (x d)) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
pattern (x d) at 3 in |- *.
(* Goal: (fun p : proc => @eq proc (sum Frame (fun _ : Frame => x d)) (alt (sum Frame (fun e : Frame => cond (x d) (eqF e d) Delta)) p)) (x d) *)
(* Goal: forall e : Frame, @eq proc (x d) (alt (cond (x d) (eqF e d) Delta) (x d)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
elimtype (Frame + (fun e : Frame => x d) = x d).
cut
 (forall x y : Frame -> proc,
  Frame + (fun d : Frame => alt (x d) (y d)) = alt (Frame + x) (Frame + y)).
(* Goal: forall _ : forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)), @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro SUM4r.

(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM4r.
cut
 ((fun e : Frame => alt (cond (x d) (eqF e d) Delta) (x d)) =
  (fun e : Frame => x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall d0 : D, @eq proc (alt (cond (x d) (eqD d0 d) Delta) (x d)) (x d) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro; apply sym_equal; trivial.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (sum D (fun d : D => alt (x0 d) (y d))) (alt (sum D x0) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply sym_equal.
(* Goal: @eq proc (alt (sum D x0) (sum D y)) (sum D (fun d : D => alt (x0 d) (y d))) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply SUM4.


(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (x d) (alt (cond (x d) (eqF e d) Delta) (x d)) *)
(* Goal: @eq proc (sum Frame (fun _ : Frame => x d)) (x d) *)
elim (eqF e d).
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (x d) (alt (x d) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A3; auto.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc (x d) (alt Delta (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A1; elim A6; auto.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
Save Sum_EliminationF.

Goal
forall (x : frame -> proc) (d : frame),
x d = frame + (fun e : frame => cond (x d) (eqf e d) Delta).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (x d) (sum D (fun e : D => cond (x d) (eqD e d) Delta)) *)
pattern (x d) at 1 in |- *.
(* Goal: (fun p : proc => @eq proc (sum frame (fun _ : frame => x d)) (alt (sum frame (fun e : frame => cond (x d) (eqf e d) Delta)) p)) (x d) *)
(* Goal: forall e : frame, @eq proc (x d) (alt (cond (x d) (eqf e d) Delta) (x d)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
elimtype (frame + (fun e : frame => x d) = x d).
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (sum frame (fun e : frame => cond (x d) (eqf e d) Delta)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
cut (forall e : frame, x d = alt (cond (x d) (eqf e d) Delta) (x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (sum frame (fun e : frame => cond (x d) (eqf e d) Delta)) *)
(* Goal: forall e : frame, @eq proc (x d) (alt (cond (x d) (eqf e d) Delta) (x d)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
elim (SUM3 frame d (fun e : frame => cond (x d) (eqf e d) Delta)).

(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (alt (sum frame (fun e : frame => cond (x d) (eqf e d) Delta)) (cond (x d) (eqf d d) Delta)) *)
(* Goal: forall e : frame, @eq proc (x d) (alt (cond (x d) (eqf e d) Delta) (x d)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
elim eqf7.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (x d)) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
pattern (x d) at 3 in |- *.
(* Goal: (fun p : proc => @eq proc (sum frame (fun _ : frame => x d)) (alt (sum frame (fun e : frame => cond (x d) (eqf e d) Delta)) p)) (x d) *)
(* Goal: forall e : frame, @eq proc (x d) (alt (cond (x d) (eqf e d) Delta) (x d)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
elimtype (frame + (fun e : frame => x d) = x d).
cut
 (forall x y : frame -> proc,
  frame + (fun d : frame => alt (x d) (y d)) = alt (frame + x) (frame + y)).
(* Goal: forall _ : forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)), @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro SUM4r.

(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM4r.
cut
 ((fun e : frame => alt (cond (x d) (eqf e d) Delta) (x d)) =
  (fun e : frame => x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall d0 : D, @eq proc (alt (cond (x d) (eqD d0 d) Delta) (x d)) (x d) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro; apply sym_equal; trivial.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (sum D (fun d : D => alt (x0 d) (y d))) (alt (sum D x0) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply sym_equal.
(* Goal: @eq proc (alt (sum D x0) (sum D y)) (sum D (fun d : D => alt (x0 d) (y d))) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply SUM4.
 
 
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (x d) (alt (cond (x d) (eqf e d) Delta) (x d)) *)
(* Goal: @eq proc (sum frame (fun _ : frame => x d)) (x d) *)
elim (eqf e d).
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (x d) (alt (x d) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A3; auto.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc (x d) (alt Delta (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A1; elim A6; auto.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
Save Sum_Eliminationf.
 

Goal
forall (x : D -> proc) (d : D),
x d = D + (fun e : D => cond (x d) (eqD e d) Delta).
 
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (x d) (sum D (fun e : D => cond (x d) (eqD e d) Delta)) *)
pattern (x d) at 1 in |- *.
(* Goal: (fun p : proc => @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) p)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elimtype (D + (fun e : D => x d) = x d).
(* Goal: @eq proc (sum D (fun _ : D => x d)) (sum D (fun e : D => cond (x d) (eqD e d) Delta)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
cut (forall e : D, x d = alt (cond (x d) (eqD e d) Delta) (x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.  
(* Goal: @eq proc (sum D (fun _ : D => x d)) (sum D (fun e : D => cond (x d) (eqD e d) Delta)) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim (SUM3 D d (fun e : D => cond (x d) (eqD e d) Delta)).
 
(* Goal: @eq bool (eqD d d) true *)
elim eqD7.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (x d)) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
pattern (x d) at 3 in |- *.
(* Goal: (fun p : proc => @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) p)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elimtype (D + (fun e : D => x d) = x d).
cut
 (forall x y : D -> proc,
  D + (fun d : D => alt (x d) (y d)) = alt (D + x) (D + y)).
(* Goal: forall _ : forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)), @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro SUM4r.
 
(* Goal: @eq proc (sum D (fun _ : D => x d)) (alt (sum D (fun e : D => cond (x d) (eqD e d) Delta)) (sum D (fun _ : D => x d))) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM4r.
cut
 ((fun e : D => alt (cond (x d) (eqD e d) Delta) (x d)) = (fun e : D => x d)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.  
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq bool true true *)
apply refl_equal.
 
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall d0 : D, @eq proc (alt (cond (x d) (eqD d0 d) Delta) (x d)) (x d) *)
(* Goal: forall x y : forall _ : D, proc, @eq proc (sum D (fun d : D => alt (x d) (y d))) (alt (sum D x) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
intro; apply sym_equal; trivial.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.  
(* Goal: @eq proc (sum D (fun d : D => alt (x0 d) (y d))) (alt (sum D x0) (sum D y)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply sym_equal.
(* Goal: @eq proc (alt (sum D x0) (sum D y)) (sum D (fun d : D => alt (x0 d) (y d))) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
(* Goal: forall e : D, @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
apply SUM4.
 
 
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.   
(* Goal: @eq proc (x d) (alt (cond (x d) (eqD e d) Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim (eqD e d).
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (x d) (alt (x d) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A3; auto.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc (x d) (alt Delta (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim A1; elim A6; auto.
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim SUM1; auto.
Save Sum_EliminationD.
 

Goal
forall (d : D) (n : bit) (y : proc),
seq (ia Frame c2 (Tuple n d))
  (mer y
     (seq
        (alt (seq (ia one int i) (ia Frame s3 (Tuple n d)))
           (seq (ia one int i) (ia Frame s3 lce))) 
        (K i))) = comm (seq (ia Frame s2 (Tuple n d)) y) (K i).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
pattern (K i) at 2 in |- *.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.

elimtype
 ((fun d0 : Frame =>
   cond
     (seq (ia Frame c2 (Tuple n d))
        (mer y
           (seq
              (alt (seq (ia one int i) (ia Frame s3 (Tuple n d)))
                 (seq (ia one int i) (ia Frame s3 lce))) 
              (K i)))) (eqF d0 (Tuple n d)) Delta) =
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia Frame s2 (Tuple n d)) y))).


(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
2: apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
2: elim CM7.
2: elim
    (Bak4_2_1 (eqF d0 (Tuple n d))
       (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d)))
          (mer
             (seq
                (alt (seq (ia one int i) (ia Frame s3 d0))
                   (seq (ia one int i) (ia Frame s3 lce))) 
                (K i)) y))).
2: elim
    (Def4_3_1_2' (eqF d0 (Tuple n d)) Delta
       (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d)))
          (mer
             (seq
                (alt (seq (ia one int i) (ia Frame s3 d0))
                   (seq (ia one int i) (ia Frame s3 lce))) 
                (K i)) y))
       (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d)))
          (mer
             (seq
                (alt (seq (ia one int i) (ia Frame s3 d0))
                   (seq (ia one int i) (ia Frame s3 lce))) 
                (K i)) y))).
2: elim
    (Def4_3_1_2 (eqF d0 (Tuple n d))
       (seq (ia Frame c2 (Tuple n d))
          (mer y
             (seq
                (alt (seq (ia one int i) (ia Frame s3 (Tuple n d)))
                   (seq (ia one int i) (ia Frame s3 lce))) 
                (K i))))
       (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d)))
          (mer
             (seq
                (alt (seq (ia one int i) (ia Frame s3 d0))
                   (seq (ia one int i) (ia Frame s3 lce))) 
                (K i)) y)) Delta).
(* Goal: @eq bool true true *)
2: apply refl_equal.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
2: intros.
2: elim (eqF_intro d0 (Tuple n d)).
(* Goal: P true *)
(* Goal: @eq bool true false *)
3: assumption.
2: elim CF1.
2: unfold gamma in |- *.
2: elim SC6.
(* Goal: @eq bool true true *)
2: apply refl_equal.

(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
2: intro.
2: elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
2: elim A7.
(* Goal: @eq bool true true *)
2: apply refl_equal.

2: apply eqF_intro'.
(* Goal: P true *)
(* Goal: @eq bool true false *)
2: assumption.
elim
 (Sum_EliminationF
    (fun d' : Frame =>
     seq (ia Frame c2 d')
       (mer y
          (seq
             (alt (seq (ia one int i) (ia Frame s3 d'))
                (seq (ia one int i) (ia Frame s3 lce))) 
             (K i)))) (Tuple n d)).
(* Goal: @eq bool true true *)
apply refl_equal.
Save comms2K.


Goal
forall (d : D) (n : bit) (y x : proc),
seq (ia Frame c2 (Tuple n d))
  (enc H
     (mer
        (mer y
           (seq
              (alt (seq (ia one int i) (ia Frame s3 (Tuple n d)))
                 (seq (ia one int i) (ia Frame s3 lce))) 
              (K i))) x)) =
enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (K i)) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c2 (Tuple n d)) (enc H (mer (mer y (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple n d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) x))) (enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (K i)) x)) *)
elim comms2K.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist c2 H) *)
(* Goal: @eq proc (sum Frame (fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta)) (sum Frame (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))) *)
exact Inc2H.
Save Comms2K.

Goal
forall (d : D) (n n' : bit) (y y' : proc),
Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (seq (Rn n') y').
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq
       (alt (D + (fun d : D => ia Frame r3 (Tuple n' d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple n')) (Rn n')))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle n') d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle n')))))) y').
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple n' d))) 
    (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))).
elim
 (A4
    (seq (D + (fun d : D => ia Frame r3 (Tuple n' d)))
       (seq (ia frame s5 (tuple n')) (Rn n')))
    (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y').           
elim
 (CM9 (seq (ia Frame s2 (Tuple n d)) y)
    (seq
       (seq (D + (fun d : D => ia Frame r3 (Tuple n' d)))
          (seq (ia frame s5 (tuple n')) (Rn n'))) y')
    (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y')).

elimtype
 (Delta =
  comm (seq (ia Frame s2 (Tuple n d)) y)
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle n') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle n')))))) y')).


elimtype
 (Delta =
  comm (seq (ia Frame s2 (Tuple n d)) y)
    (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y')).

(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
repeat elim A6.
elim
 (A5 (D + (fun d : D => ia Frame r3 (Tuple n' d)))
    (seq (ia frame s5 (tuple n')) (Rn n')) y').
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.

elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple n' d))
    (seq (seq (ia frame s5 (tuple n')) (Rn n')) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d0 : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple n' d0))
        (seq (seq (ia frame s5 (tuple n')) (Rn n')) y'))
     (seq (ia Frame s2 (Tuple n d)) y))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq bool true true *)
apply refl_equal. 
(* Goal: @eq bool true true *)
apply refl_equal. 
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle n') d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle n'))))) y').
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d0 : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle n') d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle n'))))) y')
     (seq (ia Frame s2 (Tuple n d)) y))).

(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal. 
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.

Save comms2Rn.

Goal
forall (n n' : bit) (d : D) (x y y' : proc),
Delta =
enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (seq (Rn n') y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (seq (Rn n') y')) x)) *)
elim comms2Rn.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.

Save Comms2Rn.

Goal
forall (d : D) (n : bit) (y : proc),
Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (L i).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d0 : frame => Delta) =
  (fun d0 : frame =>
   comm
     (seq (ia frame r5 d0)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d0))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia Frame s2 (Tuple n d)) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
apply EQFf.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
Save comms2L.

Goal
forall (d : D) (n : bit) (x y : proc),
Delta = enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (L i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (L i)) x)) *)
elim comms2L.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.
Save Comms2L.

Goal
forall x y y' : proc,
Delta =
enc H
  (Lmer (comm (alt (seq (ia one int i) y) (seq (ia one int i) y')) (L i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elimtype
 (Delta =
  comm
    (frame +
     (fun n : frame =>
      seq (ia frame r5 n)
        (seq
           (alt (seq (ia one int i) (ia frame s6 n))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i)))) (seq (ia one int i) y')).

elimtype
 (Delta =
  comm
    (frame +
     (fun n : frame =>
      seq (ia frame r5 n)
        (seq
           (alt (seq (ia one int i) (ia frame s6 n))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i)))) (seq (ia one int i) y)).
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : frame => Delta) =
  (fun d : frame =>
   comm
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia one int i) y))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ frame one) *)
exact EQfi.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : frame => Delta) =
  (fun d : frame =>
   comm
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia one int i) y'))).

(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal. 
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal. 
(* Goal: not (EQ frame one) *)
exact EQfi.

Save CommiL.

Goal
forall x y y' : proc,
Delta =
enc H
  (Lmer (comm (alt (seq (ia one int i) y) (seq (ia one int i) y')) (K i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (alt (seq (ia one int i) y) (seq (ia one int i) y'))).
elimtype
 ((fun d : Frame => Delta) =
  (fun d : Frame =>
   comm
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (alt (seq (ia one int i) y) (seq (ia one int i) y')))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5. elim D3.
(* Goal: @eq bool true true *)
elim A7. apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame one) *)
exact EQFi.

Save CommiK.



Goal
forall (x y y' : proc) (b : bit),
Delta = enc H (Lmer (comm (seq (ia one int i) y) (seq (Rn b) y')) x).   
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elimtype
 (Delta =
  comm
    (seq
       (alt
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)))
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))))) y')
    (seq (ia one int i) y)).

(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal. 

elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y').
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
elimtype
 (Delta =
  comm
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')
    (seq (ia one int i) y)).
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y').
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
elimtype
 (Delta =
  comm (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia one int i) y)).
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq (ia Frame r3 (Tuple b d))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) 
     (seq (ia one int i) y))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame one) *)
exact EQFi.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame one) *)
exact EQFi. 
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y').
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
     (seq (ia one int i) y))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame one) *)
exact EQFi.
Save commiRn.

Goal
forall (x y y' y'' : proc) (b : bit),
Delta =
enc H
  (Lmer
     (comm (alt (seq (ia one int i) y) (seq (ia one int i) y'))
        (seq (Rn b) y'')) x).   
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) (comm (seq (Tn_d d b) y) (seq (ia one int i) y''))) x)) *)
elim CM4.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc Delta (alt Delta (enc H (Lmer (comm (seq (ia one int i) y') (seq (Rn b) y'')) x))) *)
elim commiRn.
(* Goal: @eq proc Delta (alt Delta (enc H (Lmer (comm (seq (ia one int i) y') (seq (Rn b) y'')) x))) *)
elim commiRn.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq bool true true *)
apply refl_equal.
Save CommiRn.

Goal
forall (x y : proc) (b : bit) (d : D),
Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (L i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (SC3
    (alt
       (seq
          (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce))
             (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))
    (frame +
     (fun n : frame =>
      seq (ia frame r5 n)
        (seq
           (alt (seq (ia one int i) (ia frame s6 n))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))))).
elim
 (SUM7 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i)))
    (alt
       (seq
          (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce))
             (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))).
elim
 (SUM6 frame
    (fun d0 : frame =>
     comm
       (seq (ia frame r5 d0)
          (seq
             (alt (seq (ia one int i) (ia frame s6 d0))
                (seq (ia one int i) (ia frame s6 sce))) 
             (L i)))
       (alt
          (seq
             (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce))
                (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x).
(* Goal: @eq proc Delta (enc H (sum frame (fun d0 : frame => Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))) *)
elim SUM9.
elimtype
 ((fun d : frame => Delta) =
  (fun d0 : frame =>
   enc H
     (Lmer
        (comm
           (seq (ia frame r5 d0)
              (seq
                 (alt (seq (ia one int i) (ia frame s6 d0))
                    (seq (ia one int i) (ia frame s6 sce))) 
                 (L i)))
           (alt
              (seq
                 (seq
                    (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce))
                    (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))).
(* Goal: @eq bool true true *)
elim SUM1; apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
Save CommTn_dL.


Goal
forall (x y y' : proc) (b : bit) (d : D),
Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ frame one) *)
exact EQfi.
(* Goal: not (EQ frame one) *)
exact EQfi.
(* Goal: not (EQ frame one) *)
exact EQfi.
Save commTn_di1.

Goal
forall (x y y' y'' : proc) (b : bit) (d : D),
Delta =
enc H
  (Lmer
     (comm (seq (Tn_d d b) y)
        (alt (seq (ia one int i) y') (seq (ia one int i) y''))) x). 
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) (comm (seq (Tn_d d b) y) (seq (ia one int i) y''))) x)) *)
elim CM4.
(* Goal: @eq proc Delta (enc H (alt (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x) (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim D4.
(* Goal: @eq proc Delta (alt Delta (enc H (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim commTn_di1.
(* Goal: @eq proc Delta (alt Delta (enc H (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y'')) x))) *)
elim commTn_di1.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq bool true true *)
apply refl_equal.
Save CommTn_di. 

Goal
forall (x y : proc) (b : bit) (d : D),
Delta = enc H (Lmer (comm (seq (Sn_d d b) y) (L i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elim
 (SUM7 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))).
elimtype
 ((fun d : frame => Delta) =
  (fun d0 : frame =>
   comm
     (seq (ia frame r5 d0)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d0))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5. elim D3.
(* Goal: @eq bool true true *)
elim A7. apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
red in |- *. intro.
(* Goal: False *)
apply EQFf.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
Save CommSn_dL.

Goal
forall (x y : proc) (b : bit) (d : D),
seq (ia Frame c2 (Tuple b d))
  (enc H
     (mer (seq (Tn_d d b) y)
        (mer
           (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i)))
              (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x))) =
enc H (Lmer (comm (seq (Sn_d d b) y) (K i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc (seq (ia Frame c2 (Tuple b d)) (enc H (mer (seq (Tn_d d b) y) (mer (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x)))) (enc H (Lmer (comm (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)) (K i)) x)) *)
pattern (K i) at 3 in |- *.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SC3 (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))
    (Frame +
     (fun x : Frame =>
      seq (ia Frame r2 x)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 x))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))))).
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))).
elimtype
 (Frame +
  (fun d0 : Frame =>
   cond
     (comm
        (seq (ia Frame r2 (Tuple b d))
           (seq
              (alt (seq (ia one int i) (ia Frame s3 (Tuple b d)))
                 (seq (ia one int i) (ia Frame s3 lce))) 
              (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))
     (eqF d0 (Tuple b d)) Delta) =
  Frame +
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))).
elim
 (Sum_EliminationF
    (fun d0 : Frame =>
     comm
       (seq (ia Frame r2 d0)
          (seq
             (alt (seq (ia one int i) (ia Frame s3 d0))
                (seq (ia one int i) (ia Frame s3 lce))) 
             (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))
    (Tuple b d)).
(* Goal: @eq proc (seq (ia Frame c2 (Tuple b d)) (enc H (mer (seq (Tn_d d b) y) (mer (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x)))) (enc H (Lmer (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) x)) *)
(* Goal: @eq proc (sum Frame (fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta)) (sum Frame (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))) *)
elim CM7; elim CF1.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3; elim D5.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
elim
 (SC6 (seq (Tn_d d b) y)
    (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i)))
       (seq (ia one int i) (seq (ia Frame s3 lce) (K i))))).
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq proc (seq (ia Frame c2 (Tuple b d)) (enc H (mer (seq (Tn_d d b) y) (mer (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x)))) (seq (enc H (ia Frame (gamma r2 s2) (Tuple b d))) (enc H (mer (seq (Tn_d d b) y) (mer (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x)))) *)
(* Goal: @eq proc (sum Frame (fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta)) (sum Frame (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))) *)
unfold gamma in |- *; trivial.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: not (In_ehlist c2 H) *)
(* Goal: @eq proc (sum Frame (fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta)) (sum Frame (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))) *)
exact Inc2H.
elimtype
 ((fun d0 : Frame =>
   cond
     (comm
        (seq (ia Frame r2 (Tuple b d))
           (seq
              (alt (seq (ia one int i) (ia Frame s3 (Tuple b d)))
                 (seq (ia one int i) (ia Frame s3 lce))) 
              (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))
     (eqF d0 (Tuple b d)) Delta) =
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))).
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
apply EXTE; intros.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
cut (true = eqF d0 (Tuple b d) \/ false = eqF d0 (Tuple b d)).
cut
 (true = eqF d0 (Tuple b d) ->
  cond
    (comm
       (seq (ia Frame r2 (Tuple b d))
          (seq
             (alt (seq (ia one int i) (ia Frame s3 (Tuple b d)))
                (seq (ia one int i) (ia Frame s3 lce))) 
             (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))
    (eqF d0 (Tuple b d)) Delta =
  comm
    (seq (ia Frame r2 d0)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 d0))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))).
cut
 (false = eqF d0 (Tuple b d) ->
  cond
    (comm
       (seq (ia Frame r2 (Tuple b d))
          (seq
             (alt (seq (ia one int i) (ia Frame s3 (Tuple b d)))
                (seq (ia one int i) (ia Frame s3 lce))) 
             (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))
    (eqF d0 (Tuple b d)) Delta =
  comm
    (seq (ia Frame r2 d0)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 d0))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))). 
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool false (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
exact (or_ind H0 H H1).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim COND2.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: not (@eq Frame d0 (Tuple b d)) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
exact (eqF_intro' d0 (Tuple b d) H).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim (eqF_intro d0 (Tuple b d) H).
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim eqF7; elim COND1.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
apply Lemma4.
Save CommSn_dK.

Goal
forall (x y y' : proc) (b b' : bit) (d : D),
Delta = enc H (Lmer (comm (seq (Sn_d d b) y) (seq (Rn b') y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq
       (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b')) (Rn b')))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b') d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y').
elim
 (CM8
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b' d)))
             (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')
    (seq (Sn_d d b) y)).
elimtype
 (Delta =
  comm
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b' d)))
             (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) y')
    (seq (Sn_d d b) y)).
elim
 (A6'
    (comm
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')
       (seq (Sn_d d b) y))).
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b') d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y').
elim
 (SUM7 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b') d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y')
    (seq (Sn_d d b) y)).

elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b') d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y')
     (seq (Sn_d d b) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq bool true true *)
elim CM2. elim D5. elim D3. elim A7. apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b' d))) 
    (ia Frame r3 lce) (seq (ia frame s5 (tuple b')) (Rn b'))). 
elim
 (A4
    (seq (D + (fun d : D => ia Frame r3 (Tuple b' d)))
       (seq (ia frame s5 (tuple b')) (Rn b')))
    (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b')) (Rn b'))) y').
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
elimtype
 (Delta =
  comm
    (seq
       (seq (D + (fun d : D => ia Frame r3 (Tuple b' d)))
          (seq (ia frame s5 (tuple b')) (Rn b'))) y') 
    (seq (Sn_d d b) y)).
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
elim
 (A5 (D + (fun d : D => ia Frame r3 (Tuple b' d)))
    (seq (ia frame s5 (tuple b')) (Rn b')) y').
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b' d))
    (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b' d0))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) 
     (seq (Sn_d d b) y))).
(* Goal: @eq bool true true *)
elim SUM1. apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y)) *)
elim ProcSn_d.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
Save CommSn_dRn.

Goal
forall (x y y' : proc) (b : bit) (d : D),
Delta = enc H (Lmer (comm (seq (ia D s4 d) y) (seq (Tn_d d b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4. 
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4. 
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8. 
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5. 
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7. 
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7. 
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7. 
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''. 
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''. 
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''. 
  
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6. 
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6. 
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *. 
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2. 
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5. 
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3. 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7. 
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ frame D) *)
exact EQfD.
(* Goal: not (EQ frame D) *)
exact EQfD.
(* Goal: not (EQ frame D) *)
exact EQfD.


Save CommTn_ds4.

Goal
forall (x y y' : proc) (b : bit) (d : D) (f : frame),
Delta = enc H (Lmer (comm (seq (ia frame s5 f) y) (seq (Tn_d d b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
(* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia frame s5 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *)
(* Goal: @eq act (gamma s5 r6) delta *)
(* Goal: @eq act (gamma s5 r6) delta *)
elim CF2.
 
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.

(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool true true *)
apply refl_equal.

Save CommTn_ds5.

Goal
forall (x y : proc) (b : bit) (d : D),
Delta = enc H (Lmer (comm (K i) (seq (Tn_d d b) y)) x).

(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (Tn_d d b) y)).
elimtype
 ((fun f : Frame => Delta) =
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (Tn_d d b) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.

(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
Save CommTn_dK.

Goal
forall (x y : proc) (d : D),
Delta = enc H (Lmer (comm (seq (ia D s4 d) y) (L i)) x). 
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elim
 (SUM7 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia D s4 d) y)).
elimtype
 ((fun d : frame => Delta) =
  (fun d0 : frame =>
   comm
     (seq (ia frame r5 d0)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d0))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia D s4 d) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ frame D) *)
exact EQfD.
Save CommLs4.

Goal
forall (x y : proc) (f : frame),
seq (ia frame c5 f)
  (enc H
     (mer y
        (mer
           (alt (seq (ia one int i) (seq (ia frame s6 f) (L i)))
              (seq (ia one int i) (seq (ia frame s6 sce) (L i)))) x))) =
enc H (Lmer (comm (seq (ia frame s5 f) y) (L i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
pattern (L i) at 3 in |- *.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elim
 (SC3 (seq (ia frame s5 f) y)
    (frame +
     (fun n : frame =>
      seq (ia frame r5 n)
        (seq
           (alt (seq (ia one int i) (ia frame s6 n))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))))).
elim
 (SUM7 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia frame s5 f) y)).
elimtype
 ((fun d : frame =>
   cond
     (comm
        (seq (ia frame r5 f)
           (seq
              (alt (seq (ia one int i) (ia frame s6 f))
                 (seq (ia one int i) (ia frame s6 sce))) 
              (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta) =
  (fun d : frame =>
   comm
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia frame s5 f) y))).
elim
 (Sum_Eliminationf
    (fun e : frame =>
     comm
       (seq (ia frame r5 e)
          (seq
             (alt (seq (ia one int i) (ia frame s6 e))
                (seq (ia one int i) (ia frame s6 sce))) 
             (L i))) (seq (ia frame s5 e) y)) f).
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
unfold gamma in |- *.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (SC6 y
    (alt (seq (seq (ia one int i) (ia frame s6 f)) (L i))
       (seq (seq (ia one int i) (ia frame s6 sce)) (L i)))).
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5; elim A5.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
exact Inc5H.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
cut (true = eqf d f \/ false = eqf d f).
cut
 (true = eqf d f ->
  cond
    (comm
       (seq (ia frame r5 f)
          (seq
             (alt (seq (ia one int i) (ia frame s6 f))
                (seq (ia one int i) (ia frame s6 sce))) 
             (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta =
  comm
    (seq (ia frame r5 d)
       (seq
          (alt (seq (ia one int i) (ia frame s6 d))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia frame s5 f) y)).
cut
 (false = eqf d f ->
  cond
    (comm
       (seq (ia frame r5 f)
          (seq
             (alt (seq (ia one int i) (ia frame s6 f))
                (seq (ia one int i) (ia frame s6 sce))) 
             (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta =
  comm
    (seq (ia frame r5 d)
       (seq
          (alt (seq (ia one int i) (ia frame s6 d))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia frame s5 f) y)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool false (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
exact (or_ind H0 H H1).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim H; elim COND2.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CM7; elim CF2'.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim A7; trivial.
exact (eqf_intro' d f H).
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
2: apply Lemma4.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
elim (eqf_intro d f H).
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
Save CommLs5.


Goal
forall (x y : proc) (f : frame),
Delta = enc H (Lmer (comm (seq (ia frame s6 f) y) (K i)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia frame s6 f) y)).
elimtype
 ((fun d : Frame => Delta) =
  (fun d : Frame =>
   comm
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia frame s6 f) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.


Save CommKs6.


Goal
forall (x y y' : proc) (b : bit) (f : frame),
Delta = enc H (Lmer (comm (seq (ia frame s6 f) y) (seq (Rn b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y').
elim
 (CM8
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')
    (seq (ia frame s6 f) y)).

elimtype
 (Delta =
  comm
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')
    (seq (ia frame s6 f) y)).

elim
 (A6
    (comm
       (seq
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')
       (seq (ia frame s6 f) y))).
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (ia frame s5 (tuple b)) (Rn b))).

elim
 (A4
    (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y').
elim
 (CM8
    (seq
       (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq (ia frame s6 f) y)).

elimtype
 (Delta =
  comm
    (seq
       (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
          (seq (ia frame s5 (tuple b)) (Rn b))) y') 
    (seq (ia frame s6 f) y)).
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer Delta x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: @eq proc Delta (comm (seq (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)) *)
(* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)) *)
unfold Delta at 2 in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
elim
 (A5 (D + (fun d : D => ia Frame r3 (Tuple b d)))
    (seq (ia frame s5 (tuple b)) (Rn b)) y').
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq (ia Frame r3 (Tuple b d))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
     (seq (ia frame s6 f) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y').
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
     (seq (ia frame s6 f) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal. 
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro. 
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
Save CommRns6.

Goal
forall (x y y' : proc) (b : bit) (d : D),
seq (ia frame c6 sce) (enc H (mer y (mer (seq (Sn_d d b) y') x))) =
enc H (Lmer (comm (seq (ia frame s6 sce) y) (seq (Tn_d d b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
exact Inc6H.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf sce (tuple (toggle b))) *)
apply eqf2.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf sce (tuple (toggle b))) *)
apply eqf2.
Save CommTn_ds6_sce.

Goal
forall (x y y' : proc) (b : bit) (d : D),
seq (ia frame c6 (tuple (toggle b)))
  (enc H (mer y (mer (seq (Sn_d d b) y') x))) =
enc H
  (Lmer (comm (seq (ia frame s6 (tuple (toggle b))) y) (seq (Tn_d d b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
exact Inc6H.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf (tuple b) (tuple (toggle b))) *)
elim eqf4.
(* Goal: @eq bool false (eqb (toggle b) b) *)
(* Goal: not (@eq frame (tuple (toggle b)) sce) *)
apply bit3.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf3.

Save CommTn_ds6_b.

Goal
forall (x y y' : proc) (b : bit) (d : D),
seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x))) =
enc H (Lmer (comm (seq (ia frame s6 (tuple b)) y) (seq (Tn_d d b) y')) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
exact Inc6H.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf3.
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
apply eqf_intro'.
(* Goal: @eq bool false (eqf (tuple b) (tuple (toggle b))) *)
elim eqf4.
(* Goal: @eq bool false (eqb b (toggle b)) *)
apply bit2.
Save CommTn_ds6_b'.

Goal
forall (x y : proc) (d : D),
Delta = enc H (Lmer (comm (K i) (seq (ia D s4 d) y)) x).   
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia D s4 d) y)).
elimtype
 ((fun d : Frame => Delta) =
  (fun d0 : Frame =>
   comm
     (seq (ia Frame r2 d0)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d0))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia D s4 d) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1. 
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame D) *)
exact EQFD.
Save CommKs4.

Goal
forall (x y : proc) (f : frame),
Delta = enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x)) *)
elim ChanK.
elim
 (SUM7 Frame
    (fun x : Frame =>
     seq (ia Frame r2 x)
       (seq
          (alt (seq (ia one int i) (ia Frame s3 x))
             (seq (ia one int i) (ia Frame s3 lce))) 
          (K i))) (seq (ia frame s5 f) y)).
elimtype
 ((fun f : Frame => Delta) =
  (fun d : Frame =>
   comm
     (seq (ia Frame r2 d)
        (seq
           (alt (seq (ia one int i) (ia Frame s3 d))
              (seq (ia one int i) (ia Frame s3 lce))) 
           (K i))) (seq (ia frame s5 f) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
Save CommKs5.

Theorem CommTn_dRn :
 forall (x y y' : proc) (b b' : bit) (d : D),
 Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (seq (Rn b') y')) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcTn_d; elim ProcRn.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (CM8
    (seq
       (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce))
          (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y)
    (seq
       (alt
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b' d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b')))
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))))) y')).
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
elim
 (CM8 (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
    (seq (ia frame r6 sce) (seq (Sn_d d b) y))
    (seq
       (alt
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b' d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b')))
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))))) y')).
elim
 (A4
    (seq
       (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b')) (Rn b')))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b') d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y').
elim
 (CM9 (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b' d)))
             (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')).
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b')) (Rn b')) y').
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b' d))) 
    (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).
elim
 (CM9 (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
    (seq (D + (fun d : D => ia Frame r3 (Tuple b' d)))
       (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))).
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b' d))
    (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).
elim
 (SC3 (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))).
elim
 (SUM7 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple b' d))
       (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
    (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))).
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
cut
 (forall d0 : D,
  Delta =
  comm
    (seq (ia Frame r3 (Tuple b' d0))
       (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
    (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
2: intro.
2: elim
    (CM7 (seq (seq (ia frame s5 (tuple b')) (Rn b')) y') 
       (seq (Sn_d d b) y) Frame frame (Tuple b' d0) 
       (tuple (toggle b)) r3 r6).
2: elim (CF2'' r3 r6 Frame frame (Tuple b' d0) (tuple (toggle b)) EQFf).
2: elim A7; auto.
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
elim
 (EXTE D (fun d0 : D => Delta)
    (fun d0 : D =>
     comm
       (seq (ia Frame r3 (Tuple b' d0))
          (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
       (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))) H0).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
elim (CF2'' r6 r3 frame Frame (tuple (toggle b)) lce).
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
2: red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
2: intro.
(* Goal: False *)
2: apply EQFf.
2: exact (EQ_sym frame Frame H).
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
elim (A3 Delta).
elim
 (A1
    (comm (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y'))
    Delta).
elim
 (A6
    (comm (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y'))).
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b') d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'). 
elim
 (SC3 (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'))).
elim
 (SUM7 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b') d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y')
    (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y))).
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b') d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y')
     (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y)))).
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
2: apply EXTE; intro.

2: elim
    (A5 (ia Frame r3 (Tuple (toggle b') d0))
       (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b')))) y').
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
2: elim CM7.
2: elim
    (CF2'' r3 r6 Frame frame (Tuple (toggle b') d0) (tuple (toggle b)) EQFf).
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
2: elim A7.
auto.
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
elim
 (CM9 (seq (ia frame r6 sce) (seq (Sn_d d b) y))
    (alt
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple b' d))
           (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
       (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'))).
elim
 (CM9 (seq (ia frame r6 sce) (seq (Sn_d d b) y))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))).
elim
 (SC3 (seq (ia frame r6 sce) (seq (Sn_d d b) y))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))).
elim
 (SUM7 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple b' d))
       (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
    (seq (ia frame r6 sce) (seq (Sn_d d b) y))).
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b' d0))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
     (seq (ia frame r6 sce) (seq (Sn_d d b) y)))).
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
2: apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
2: elim CM7.
2: elim (CF2'' r3 r6 Frame frame (Tuple b' d0) sce EQFf).
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
2: elim A7.
2: auto.
elim (CM7 (seq (Sn_d d b) y) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')).
elim (CF2'' r6 r3).
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
elim
 (SC3 (seq (ia frame r6 sce) (seq (Sn_d d b) y))
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'))).
elim
 (SUM7 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b') d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y')
    (seq (ia frame r6 sce) (seq (Sn_d d b) y))).
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b') d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y')
     (seq (ia frame r6 sce) (seq (Sn_d d b) y)))).
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
2: apply EXTE; intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
2: elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
2: elim CM7.
2: elim (CF2'' r3 r6 Frame frame (Tuple (toggle b') d0) sce EQFf).
2: elim A7; auto.
elimtype
 (Delta =
  comm (seq (ia frame r6 (tuple b)) y)
    (alt
       (alt
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple b' d))
              (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
          (seq (ia Frame r3 lce)
             (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
       (D +
        (fun d : D =>
         seq
           (seq (ia Frame r3 (Tuple (toggle b') d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y')))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
auto.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
2: red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
2: intro.
(* Goal: False *)
2: apply EQFf.
2: exact (EQ_sym frame Frame H).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
elimtype
 (Delta =
  comm (seq (ia frame r6 (tuple b)) y)
    (alt
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple b' d))
           (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
       (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))).
elimtype
 (Delta =
  comm (seq (ia frame r6 (tuple b)) y)
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'))).
elim A6; auto.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b') d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y')
     (seq (ia frame r6 (tuple b)) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
auto.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
elim
 (A5 (ia Frame r3 (Tuple (toggle b') d0))
    (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b')))) y').
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
auto.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
apply EQFf.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
elim
 (CM9 (seq (ia frame r6 (tuple b)) y)
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))).
elim
 (SC3 (seq (ia frame r6 (tuple b)) y)
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')))).
elim
 (SUM7 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple b' d))
       (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
    (seq (ia frame r6 (tuple b)) y)).
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq (ia Frame r3 (Tuple b' d))
        (seq (seq (ia frame s5 (tuple b')) (Rn b')) y'))
     (seq (ia frame r6 (tuple b)) y))).
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
elim SUM1; elim A6; auto.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
apply EQFf.
exact (EQ_sym frame Frame H).
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CM7; elim CF2''.
elim A7; auto.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
apply EQFf.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
Qed.

Theorem Comms3Tn_d :
 forall (x y y' : proc) (b : bit) (d : D) (f : Frame),
 Delta = enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *)
elim ProcTn_d.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim A4.
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *)
elim CM9.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
(* Goal: not (EQ Frame frame) *)
elim A6.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
(* Goal: not (EQ Frame frame) *)
exact EQFf.
Qed.



Theorem Comms3L :
 forall (x y : proc) (f : Frame),
 Delta = enc H (Lmer (comm (seq (ia Frame s3 f) y) (L i)) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
(* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *)
elim ChanL.
elim
 (SUM7 frame
    (fun n : frame =>
     seq (ia frame r5 n)
       (seq
          (alt (seq (ia one int i) (ia frame s6 n))
             (seq (ia one int i) (ia frame s6 sce))) 
          (L i))) (seq (ia Frame s3 f) y)).
elimtype
 ((fun d : frame => Delta) =
  (fun d : frame =>
   comm
     (seq (ia frame r5 d)
        (seq
           (alt (seq (ia one int i) (ia frame s6 d))
              (seq (ia one int i) (ia frame s6 sce))) 
           (L i))) (seq (ia Frame s3 f) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *)
(* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *)
elim D3.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
apply EXTE. intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *)
elim CF2''.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
red in |- *. intro.
(* Goal: False *)
apply EQFf.
(* Goal: EQ Frame frame *)
apply EQ_sym.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
Qed.


Theorem Comms3Rn_lce :
 forall (x y y' : proc) (b : bit),
 seq (ia Frame c3 lce)
   (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x)) =
 enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (Rn b) y')) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x)) *)
pattern (Rn b) at 2 in |- *.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y').
elim
 (CM9 (seq (ia Frame s3 lce) y)
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')).
elim
 (CM4
    (comm (seq (ia Frame s3 lce) y)
       (seq
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y'))
    (comm (seq (ia Frame s3 lce) y)
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x).
elimtype
 (Delta =
  Lmer
    (comm (seq (ia Frame s3 lce) y)
       (seq
          (D +
           (fun d : D =>
            seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x).
elim
 (A6
    (Lmer
       (comm (seq (ia Frame s3 lce) y)
          (seq
             (seq
                (alt (D + (fun d : D => ia Frame r3 (Tuple b d)))
                   (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)))
             y')) x)).
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y').
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
elim
 (CM9 (seq (ia Frame s3 lce) y)
    (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))).
elimtype
 (Delta =
  comm (seq (ia Frame s3 lce) y)
    (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))).
(* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *)
elim A6'.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq bool true true *)
apply refl_equal.

(* Goal: not (In_ehlist (gamma r3 s3) H) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
exact Inc3H.

(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq (ia Frame r3 (Tuple b d))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
     (seq (ia Frame s3 lce) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1. 
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE. 
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq Frame (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply eqF_intro'.
(* Goal: @eq bool false (eqF (Tuple (toggle b) d) lce) *)
apply eqF3.
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y').
elim
 (SC3 (seq (ia Frame s3 lce) y)
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'))).
elim
 (SUM7 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b) d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
    (seq (ia Frame s3 lce) y)).
elimtype
 ((fun d : D => Delta) =
  (fun d : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
     (seq (ia Frame s3 lce) y))).
(* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
unfold Delta in |- *.
(* Goal: @eq proc (ia one delta i) (Lmer (sum D (fun _ : D => ia one delta i)) x) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim SUM6.
(* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *)
elim CM2.
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq Frame (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply eqF_intro'.
(* Goal: @eq bool false (eqF (Tuple (toggle b) d) lce) *)
apply eqF3.
Qed.

Theorem Comms3Rn_b' :
 forall (x y y' : proc) (b : bit) (d : D),
 seq (ia Frame c3 (Tuple b d))
   (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x)) =
 enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x)) *)
pattern (Rn b) at 2 in |- *.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y').
elim
 (CM9 (seq (ia Frame s3 (Tuple b d)) y)
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')).
elimtype
 (Delta =
  comm (seq (ia Frame s3 (Tuple b d)) y)
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')).
elim
 (A6
    (comm (seq (ia Frame s3 (Tuple b d)) y)
       (seq
          (seq
             (alt (D + (fun d : D => ia Frame r3 (Tuple b d)))
                (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y'))).

elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y').
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
elim
 (CM9 (seq (ia Frame s3 (Tuple b d)) y)
    (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))).
elimtype
 (Delta =
  comm (seq (ia Frame s3 (Tuple b d)) y)
    (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))).
elim
 (A6
    (comm (seq (ia Frame s3 (Tuple b d)) y)
       (seq (D + (fun d : D => ia Frame r3 (Tuple b d)))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))).
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
elim
 (SC3 (seq (ia Frame s3 (Tuple b d)) y)
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple b d))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))).
elim
 (SUM7 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple b d))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia Frame s3 (Tuple b d)) y)).
elimtype
 ((fun d0 : D =>
   cond
     (comm
        (seq (ia Frame r3 (Tuple b d))
           (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
        (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b d0))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
     (seq (ia Frame s3 (Tuple b d)) y))).
elim
 (Sum_EliminationD
    (fun d : D =>
     comm
       (seq (ia Frame r3 (Tuple b d))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y)) d).
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.           
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (In_ehlist (gamma r3 s3) H) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
exact Inc3H.
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply EXTE; intro.
pattern
 (comm
    (seq (ia Frame r3 (Tuple b d0))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia Frame s3 (Tuple b d)) y)) at 1 in |- *.
elim
 (Bak4_2_1 (eqD d0 d)
    (comm
       (seq (ia Frame r3 (Tuple b d0))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))).
elim
 (Def4_3_1_2 (eqD d0 d)
    (comm
       (seq (ia Frame r3 (Tuple b d))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))
    (comm
       (seq (ia Frame r3 (Tuple b d0))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))
    (comm
       (seq (ia Frame r3 (Tuple b d0))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))).
elim
 (Def4_3_1_2' (eqD d0 d) Delta
    (comm
       (seq (ia Frame r3 (Tuple b d0))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))
    (comm
       (seq (ia Frame r3 (Tuple b d))
          (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
       (seq (ia Frame s3 (Tuple b d)) y))).
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
absurd (true = false).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
red in |- *; intro.
(* Goal: False *)
(* Goal: @eq bool true false *)
cut (forall P : bool -> Prop, P true -> P false).
(* Goal: forall _ : forall (P : forall _ : bool, Prop) (_ : P true), P false, False *)
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intro L.
apply
 (L
    (fun b : bool =>
     match b return Prop with
     | true => True
     | false => False
     end)).
(* Goal: True *)
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
exact I.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: P false *)
(* Goal: @eq bool true false *)
(* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim H1.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
(* Goal: @eq bool true false *)
(* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elimtype (eqD d0 d = false).
(* Goal: @eq bool true (eqD d0 d) *)
(* Goal: @eq bool (eqD d0 d) false *)
(* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elimtype (eqF (Tuple b d0) (Tuple b d) = eqD d0 d).
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: @eq bool (eqD d d) true *)
elim eqD7.
(* Goal: @eq bool (andb (eqb b b) (eqD d d)) true *)
elim bit1.
(* Goal: @eq bool (andb true (eqD d d)) true *)
elim andb1.
(* Goal: @eq bool true true *)
apply refl_equal.
 
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: @eq bool (andb (eqb b b) (eqD d d)) true *)
elim bit1.
(* Goal: @eq bool (andb true (eqD d d)) true *)
elim andb1.
(* Goal: @eq bool true true *)
apply refl_equal.
 
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim (eqD_intro d0 d).
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: not (@eq Frame (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply eqF_intro'.
(* Goal: @eq bool false (eqF (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim eqF3.
(* Goal: @eq bool true true *)
apply refl_equal.
 
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y').
(* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM7.
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y')
     (seq (ia Frame s3 (Tuple b d)) y))).
(* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *)
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim SUM1.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
apply EXTE.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
red in |- *; intro.
(* Goal: False *)
absurd (true = false).
(* Goal: not (@eq bool true false) *)
(* Goal: @eq bool true false *)
red in |- *.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: False *)
(* Goal: @eq bool true false *)
cut (forall P : bool -> Prop, P true -> P false).
(* Goal: forall _ : forall (P : forall _ : bool, Prop) (_ : P true), P false, False *)
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intro L.
apply
 (L
    (fun b : bool =>
     match b return Prop with
     | true => True
     | false => False
     end)).
(* Goal: True *)
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
exact I.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: P false *)
(* Goal: @eq bool true false *)
elim H0.
(* Goal: P true *)
(* Goal: @eq bool true false *)
assumption.
(* Goal: @eq bool true false *)
elimtype (eqF (Tuple b d) (Tuple b d) = true).
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) false *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
pattern (Tuple b d) at 2 in |- *.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: @eq bool (andb (eqb b (toggle b)) (eqD d d0)) false *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim bit2.
(* Goal: @eq bool (andb false (eqD d d0)) false *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim andb2.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: @eq bool (andb (eqb b b) (eqD d d)) true *)
elim bit1.
(* Goal: @eq bool (andb true (eqD d d)) true *)
elim andb1.
(* Goal: @eq bool (eqD d d) true *)
elim eqD7.
(* Goal: @eq bool true true *)
apply refl_equal.
Qed.


Theorem Comms3Rn_b :
 forall (x y y' : proc) (b : bit) (d : D),
 seq (ia Frame c3 (Tuple (toggle b) d))
   (enc H
      (mer y
         (mer (seq (ia D s4 d) (seq (ia frame s5 (tuple (toggle b))) y')) x))) =
 enc H
   (Lmer (comm (seq (ia Frame s3 (Tuple (toggle b) d)) y) (seq (Rn b) y')) x).
Proof.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
(* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *)
elim ProcRn.
elim
 (A4
    (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
       (seq (ia frame s5 (tuple b)) (Rn b)))
    (D +
     (fun d : D =>
      seq (ia Frame r3 (Tuple (toggle b) d))
        (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y').
elim
 (CM9 (seq (ia Frame s3 (Tuple (toggle b) d)) y)
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')
    (seq
       (D +
        (fun d : D =>
         seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')).
elimtype
 (Delta =
  comm (seq (ia Frame s3 (Tuple (toggle b) d)) y)
    (seq
       (seq
          (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
          (seq (ia frame s5 (tuple b)) (Rn b))) y')).
elim
 (SUM5 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple (toggle b) d))
       (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y').
elim
 (SC3 (seq (ia Frame s3 (Tuple (toggle b) d)) y)
    (D +
     (fun d : D =>
      seq
        (seq (ia Frame r3 (Tuple (toggle b) d))
           (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'))).
cut (forall p : proc, p = alt Delta p).
(* Goal: forall _ : @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')), @eq proc Delta (enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x)) *)
(* Goal: @eq proc Delta (comm (seq (Sn b) y) (seq (Rn b') y')) *)
intro H0.
elim
 (H0
    (comm
       (D +
        (fun d : D =>
         seq
           (seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'))
       (seq (ia Frame s3 (Tuple (toggle b) d)) y))).
elim
 (SUM7 D
    (fun d : D =>
     seq
       (seq (ia Frame r3 (Tuple (toggle b) d))
          (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
    (seq (ia Frame s3 (Tuple (toggle b) d)) y)).
elimtype
 ((fun d1 : D =>
   cond
     (comm
        (seq
           (seq (ia Frame r3 (Tuple (toggle b) d))
              (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
        (seq (ia Frame s3 (Tuple (toggle b) d)) y)) 
     (eqD d1 d) Delta) =
  (fun d0 : D =>
   comm
     (seq
        (seq (ia Frame r3 (Tuple (toggle b) d0))
           (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y')
     (seq (ia Frame s3 (Tuple (toggle b) d)) y))).
elim
 (Sum_EliminationD
    (fun d : D =>
     comm
       (seq
          (seq (ia Frame r3 (Tuple (toggle b) d))
             (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
       (seq (ia Frame s3 (Tuple (toggle b) d)) y)) d).
(* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CF1.
unfold gamma in |- *.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim CM3.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D5.
(* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim D1.
elim (SC6 y (seq (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))) y')).
(* Goal: @eq proc (seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x)))) (seq (ia frame (gamma s6 r6) (tuple b)) (enc H (mer (mer y y') x))) *)
(* Goal: not (In_ehlist (gamma s6 r6) H) *)
(* Goal: not (@eq frame (tuple b) sce) *)
(* Goal: not (@eq frame (tuple b) (tuple (toggle b))) *)
elim SC7.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim A5; trivial.
(* Goal: not (In_ehlist (gamma r3 s3) H) *)
(* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
exact Inc3H.
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
apply EXTE; intros.
cut (true = eqD d0 d \/ false = eqD d0 d).
cut
 (true = eqD d0 d ->
  cond
    (comm
       (seq
          (seq (ia Frame r3 (Tuple (toggle b) d))
             (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
       (seq (ia Frame s3 (Tuple (toggle b) d)) y)) 
    (eqD d0 d) Delta =
  comm
    (seq
       (seq (ia Frame r3 (Tuple (toggle b) d0))
          (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y')
    (seq (ia Frame s3 (Tuple (toggle b) d)) y)).
cut
 (false = eqD d0 d ->
  cond
    (comm
       (seq
          (seq (ia Frame r3 (Tuple (toggle b) d))
             (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')
       (seq (ia Frame s3 (Tuple (toggle b) d)) y)) 
    (eqD d0 d) Delta =
  comm
    (seq
       (seq (ia Frame r3 (Tuple (toggle b) d0))
          (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y')
    (seq (ia Frame s3 (Tuple (toggle b) d)) y)).
(* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *)
(* Goal: @eq bool true false *)
intros.
exact (or_ind H1 H H2).
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
(* Goal: @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) false Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: forall _ : @eq bool true (eqF d0 (Tuple b d)), @eq proc (cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim H; elim COND2.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim A5; elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
(* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
(* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *)
elim A7.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: not (@eq Frame (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply eqF_intro'.
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim H.
(* Goal: @eq bool (andb (eqb b b) (eqD d d)) true *)
elim bit1.
(* Goal: @eq bool (andb true (eqD d d)) true *)
elim andb1.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
(* Goal: forall _ : @eq bool true false, False *)
(* Goal: @eq bool true false *)
intro.
elim (eqD_intro d0 d H).
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
elimtype (true = eqD d0 d0).
(* Goal: @eq proc (x d) (alt (cond (x d) true Delta) (x d)) *)
(* Goal: @eq proc (x d) (alt (cond (x d) false Delta) (x d)) *)
(* Goal: @eq proc (sum D (fun _ : D => x d)) (x d) *)
elim COND1.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
trivial.
apply eqD7.
elim (eqD d0 d).
left.
(* Goal: @eq bool true true *)
apply refl_equal.
right.
(* Goal: @eq bool true true *)
apply refl_equal.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
intro; elim A1; elim A6; trivial.
elim
 (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce))
    (seq (ia frame s5 (tuple b)) (Rn b)) y').
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
elim SC3.
elim
 (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
(* Goal: @eq proc Delta (enc H (Lmer (alt (comm (alt (seq (seq (ia frame r6 (tuple (toggle b))) (Sn_d d b)) y') (seq (seq (ia frame r6 sce) (Sn_d d b)) y')) (seq (ia D s4 d) y)) (comm (seq (ia frame r6 (tuple b)) y') (seq (ia D s4 d) y))) x)) *)
elim CM8.
(* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *)
elim CM7.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
elim CF2'.
2: apply eqF_intro'.
2: elim eqF2.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
2: trivial.
elim
 (SUM5 D (fun d : D => ia Frame r3 (Tuple b d))
    (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')).
elim
 (SUM7 D
    (fun d : D =>
     seq (ia Frame r3 (Tuple b d))
       (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
    (seq (ia Frame s3 (Tuple (toggle b) d)) y)).
elimtype
 ((fun d : D => Delta) =
  (fun d0 : D =>
   comm
     (seq (ia Frame r3 (Tuple b d0))
        (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))
     (seq (ia Frame s3 (Tuple (toggle b) d)) y))).
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim A7; elim SUM1; elim A6; trivial.
(* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *)
apply EXTE; intro; elim CM7; elim CF2'.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim A7; trivial.
(* Goal: not (@eq Frame (Tuple b d) lce) *)
(* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *)
apply eqF_intro'.
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim eqF4.
(* Goal: @eq bool (andb (eqb b (toggle b)) (eqD d d0)) false *)
(* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *)
elim bit2.
(* Goal: @eq proc (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) (comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 d0) (seq (Tn_d d b) y))) *)
(* Goal: or (@eq bool true (eqF d0 (Tuple b d))) (@eq bool false (eqF d0 (Tuple b d))) *)
elim andb2; trivial.
Qed.
