(* Benedikt Ahrens and RΓ©gis Spadotti Coinitial semantics for redecoration of triangular matrices http://arxiv.org/abs/1401.1053 *) (* Content of this file: a cut operation is a natural transformation *) Require Import Category.RComonad. Require Import Category.RComonadWithCut. Require Import Theory.Category. Require Import Theory.Isomorphism. Require Import Theory.Functor. Require Import Theory.NaturalTransformation. Require Import Theory.RelativeComonad. Require Import Theory.RelativeComonadWithCut. Require Import Theory.Product. Require Import Theory.CartesianStrongMonoidal. Generalizable All Variables. (** * Cut is a natural transformation **) Section CUT_NT. Context `{BinaryProduct π’ž} `{BinaryProduct π’Ÿ} {F : Functor π’ž π’Ÿ} `{!CartesianStrongMonoidal F} {E : π’ž} (T : RelativeComonadWithCut F E). (** ** Functor 𝑻 : π’ž β†’ π’Ÿ **) Notation 𝑻 := (Lift(T)). Program Definition T_Ex : Functor π’ž π’Ÿ := Functor.make ⦃ F ≔ Ξ» A βˆ™ T (E Γ— A) ; map ≔ Ξ» A B βˆ™ Ξ» f ↦ Tβ‹…cobind (Tβ‹…extend (Fβ‹…f ∘ Tβ‹…counit)) ⦄. (** map-cong **) Next Obligation. intros f g eq_fg. now rewrite eq_fg. Qed. (** map-id **) Next Obligation. rewrite <- identity, left_id, cut_counit. symmetry. etransitivity. apply Ξ .cong. apply Ξ β‚‚.cong; [ reflexivity |]. symmetry. apply ∘-Γ—. rewrite <- compose_assoc, iso_right, left_id. apply cobind_counit. Qed. (** map-compose **) Next Obligation. symmetry. rewrite cobind_cobind. repeat rewrite compose_assoc. apply Ξ .cong. apply Ξ β‚‚.cong ; [ reflexivity |]. rewrite ∘-Γ—, compose_assoc, counit_cobind. rewrite <- compose_assoc, Fπ₁_Ο†_inv, π₁_compose. rewrite cut_counit. repeat rewrite compose_assoc. rewrite counit_cobind. setoid_rewrite <- compose_assoc at 2. now rewrite FΟ€β‚‚_Ο†_inv, Ο€β‚‚_compose, map_compose, <- compose_assoc. Qed. Notation "'𝑻(𝑬×─)'" := T_Ex (at level 0). Program Definition π‘ͺ𝒖𝒕 : NaturalTransformation 𝑻(𝑬×─) 𝑻 := NaturalTransformation.make ⦃ Ξ· ≔ Ξ» A βˆ™ Tβ‹…cut ⦄. (** Ξ·-commutes **) Next Obligation. rewrite cut_cobind. unfold Extend. simpl. reflexivity. Qed. End CUT_NT.