Section CategoryTheory.
Context
{obj : Type} {C : obj -> obj -> Type}
{bif : obj -> obj -> obj}
{Eq2_C : Eq2 C}
`{forall a b, Equivalence (eq2 (a := a) (b := b))}
`{Category obj C (Eq2C := _)}
`{Coproduct obj C (Eq2_C := _) (Cat_C := _) bif}.
Local Lemma aux_app_asm_correct1 (I J A B : obj) :
(assoc_r >>>
bimap (id_ I) (assoc_l >>> bimap swap (id_ B) >>> assoc_r) >>>
assoc_l)
⩯ bimap swap (id_ (bif A B)) >>>
(assoc_r >>>
(bimap (id_ J) assoc_l >>>
(assoc_l >>> (bimap swap (id_ B) >>> assoc_r)))).
(** Denotes a list of instruction by binding the resulting trees. *)
Definition denote_list: list instr -> itree E unit :=
traverse_ denote_instr.

(** Correctness of the [after] operator. Its denotation binds the denotation of the instructions with the one of the branch. *)
Lemma denote_after :
forall {label} instrs (b: branch (fin label)),
denote_bk (after instrs b) ≅ (denote_list instrs ;; denote_br b).