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.
(** *** [asm] combinators *)

(** Correctness of the [app_asm] combinator. The resulting [asm] gets denoted to the bimap of its subcomponent. The proof is a bit more complicated. It makes a lot more sense if drawn. *)
Theorem app_asm_correct {A B C D} (ab : asm A B) (cd : asm C D) :
denote_asm (app_asm ab cd)
⩯ bimap (denote_asm ab) (denote_asm cd).