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.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
  Show proof.
    intros f g eq_fg. now rewrite eq_fg.
map-id
  Show proof.
    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.
map-compose
  Show proof.
    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.

  Notation "'𝑻(𝑬×─)'" ≔ T_Ex (at level 0).

  Program Definition π‘ͺ𝒖𝒕 : NaturalTransformation 𝑻(𝑬×─) 𝑻 ≔
    NaturalTransformation.make ⦃ Ξ· ≔ Ξ» A βˆ™ Tβ‹…cut ⦄.
Ξ·-commutes
  Show proof.
    rewrite cut_cobind. unfold Extend. simpl. reflexivity.

End CUT_NT.

Benedikt Ahrens and RΓ©gis Spadotti— Terminal semantics for codata types in intensional Martin-Löf type theory
Table of contents
Index