Benedikt Ahrens and RΓ©gis Spadotti— Terminal semantics for codata types in intensional Martin-Löf type theory
Table of contents
Index
Require Import Category.RComod.
Require Import Theory.Category.
Require Import Theory.Functor.
Require Import Theory.Isomorphism.
Require Import Theory.RelativeComonad.
Require Import Theory.RelativeComonadWithCut.
Require Import Theory.Comodule.
Require Import Theory.Product.
Require Import Theory.CartesianStrongMonoidal.

Generalizable All Variables.

Precomposition with product

Definitions

Section PrecompositionWithProduct.

  Context `{BinaryProduct π’ž} `{BinaryProduct π’Ÿ} {F : Functor π’žπ’Ÿ}
          {E : π’ž} `{!CartesianStrongMonoidal F} {T : RelativeComonadWithCut F E}
          {β„° : Category} (M : Comodule T β„°).

  Program Definition precomposition_with_product : Comodule T β„° ≔
    Comodule.make⦃ M≔ Ξ» C βˆ™ M (E Γ— C)
    ; mcobind≔ Ξ» A B βˆ™ Ξ» f ↦ Mβ‹…mcobind (Tβ‹…extend(f)) ⦄.
  Show proof.
    intros f g eq_fg. now rewrite eq_fg.
  Show proof.
    rewrite cut_counit. rewrite <- ∘-Γ—. rewrite <- compose_assoc. rewrite iso_right.
    rewrite left_id. rewrite mcobind_counit. reflexivity.
  Show proof.
    rewrite mcobind_mcobind. apply Ξ .cong. repeat rewrite compose_assoc.
    rewrite ∘-Γ—. rewrite cut_cobind. unfold Extend. simpl.
    repeat rewrite compose_assoc. rewrite counit_cobind.
    repeat rewrite <- compose_assoc. rewrite Fπ₁_Ο†_inv. rewrite π₁_compose. reflexivity.

End PrecompositionWithProduct.

Arguments precomposition_with_product {_ _ _ _ _} _ {_ _ _} _.

Notation "M [ E '×─' ] " ≔ (precomposition_with_product E M) (at level 0).

Precomposition with product on morphisms

Section Morphisms.

  Context `{BinaryProduct π’ž} `{BinaryProduct π’Ÿ} (F : Functor π’žπ’Ÿ)
          (E : π’ž) `{!CartesianStrongMonoidal F} (T : RelativeComonadWithCut F E)
          (β„° : Category) (M : Comodule T β„°) (N : Comodule T β„°) (Ξ± : M β‡’ N).

  Program Definition precomposition_with_product_mor : ‡ M[E×─] β‡’ N[E×─] β€² ≔
    Comodule.make ⦃ Ξ± ≔ Ξ» A βˆ™ Ξ± (E Γ— A) ⦄.
  Show proof.
    now rewrite Ξ±_commutes.

End Morphisms.

Arguments precomposition_with_product_mor {_ _ _ _ _} _ {_ _ _ _ _} _.

Notation "Ξ± οΌ» E '×─' οΌ½" ≔ (precomposition_with_product_mor E Ξ±) (at level 0).
Benedikt Ahrens and RΓ©gis Spadotti— Terminal semantics for codata types in intensional Martin-Löf type theory
Table of contents
Index