Built with Alectryon, running Coq+SerAPI v8.16.0+0.16.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
From Tealeaves Require Export
Functors.Early.Reader.From Tealeaves Require Import
Classes.Kleisli.Comonad.Import Kleisli.Comonad.Notations.#[local] Generalizable VariablesE T.(** * Decorated Functors *)(**********************************************************************)(** ** <<mapd>> Operation *)(**********************************************************************)ClassMapd (E: Type) (T: Type -> Type) :=
mapd: forall (AB: Type), (E * A -> B) -> T A -> T B.#[global] Arguments mapd {E}%type_scope {T}%function_scope
{Mapd} {A B}%type_scope _%function_scope _.(** ** Kleisli Composition *)(** Kleisli composition is [kc1] *)(**********************************************************************)(** ** Typeclasses *)(**********************************************************************)ClassDecoratedFunctor (E: Type) (T: Type -> Type) `{Mapd E T} :=
{ kdf_mapd1: forall (A: Type),
mapd (extract (A := A)) = @id (T A);
kdf_mapd2: forall (ABC: Type) (g: E * B -> C) (f: E * A -> B),
mapd g ∘ mapd f = mapd (g ⋆1 f);
}.(** ** Homomorphisms between Decorated Functors *)(**********************************************************************)ClassDecoratedHom
(E: Type) (T1T2: Type -> Type)
(ϕ: forallA: Type, T1 A -> T2 A)
`{Mapd E T1} `{Mapd E T2} :=
{ dhom_natural:
forall (AB: Type) (f: E * A -> B), mapd f ∘ ϕ A = ϕ B ∘ mapd f;
}.(** * Derived Structures *)(**********************************************************************)(** ** Derived Operations *)(**********************************************************************)ModuleDerivedOperations.#[export] InstanceMap_Mapd
(E: Type)
(T: Type -> Type)
`{Mapd_ET: Mapd E T}: Map T :=
fun (AB: Type) (f: A -> B) => mapd (f ∘ extract).EndDerivedOperations.ClassCompat_Map_Mapd (E: Type) (T: Type -> Type)
`{Map_T: Map T}
`{Mapd_ET: Mapd E T}: Prop :=
compat_map_mapd:
Map_T = @DerivedOperations.Map_Mapd E T Mapd_ET.
E: Type T: Type -> Type Mapd_ET: Mapd E T
Compat_Map_Mapd E T
E: Type T: Type -> Type Mapd_ET: Mapd E T
Compat_Map_Mapd E T
reflexivity.Qed.
E: Type T: Type -> Type Map_T: Map T Mapd_ET: Mapd E T H: Compat_Map_Mapd E T
forall (AB : Type) (f : A -> B),
map f = mapd (f ∘ extract)
E: Type T: Type -> Type Map_T: Map T Mapd_ET: Mapd E T H: Compat_Map_Mapd E T
forall (AB : Type) (f : A -> B),
map f = mapd (f ∘ extract)
E: Type T: Type -> Type Map_T: Map T Mapd_ET: Mapd E T H: Compat_Map_Mapd E T
forall (AB : Type) (f : A -> B),
DerivedOperations.Map_Mapd E T A B f =
mapd (f ∘ extract)
reflexivity.Qed.(** ** Derived Composition Laws *)(**********************************************************************)Sectionderived_instances.Context
`{DecoratedFunctor E T}
`{Map_T: Map T}
`{! Compat_Map_Mapd E T}.
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (g : B -> C) (f : E * A -> B),
map g ∘ mapd f = mapd (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (g : B -> C) (f : E * A -> B),
map g ∘ mapd f = mapd (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: B -> C f: E * A -> B
map g ∘ mapd f = mapd (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: B -> C f: E * A -> B
mapd (g ∘ extract) ∘ mapd f = mapd (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: B -> C f: E * A -> B
mapd (g ∘ extract ⋆1 f) = mapd (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: B -> C f: E * A -> B
mapd (g ∘ f) = mapd (g ∘ f)
reflexivity.Qed.
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (g : E * B -> C) (f : A -> B),
mapd g ∘ map f = mapd (g ∘ map f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (g : E * B -> C) (f : A -> B),
mapd g ∘ map f = mapd (g ∘ map f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: E * B -> C f: A -> B
mapd g ∘ map f = mapd (g ∘ map f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: E * B -> C f: A -> B
mapd g ∘ mapd (f ∘ extract) = mapd (g ∘ map f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: E * B -> C f: A -> B
mapd (g ⋆1 f ∘ extract) = mapd (g ∘ map f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type g: E * B -> C f: A -> B
mapd (g ∘ map f) = mapd (g ∘ map f)
reflexivity.Qed.
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (f : A -> B) (g : B -> C),
map g ∘ map f = map (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T
forall (ABC : Type) (f : A -> B) (g : B -> C),
map g ∘ map f = map (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type f: A -> B g: B -> C
map g ∘ map f = map (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type f: A -> B g: B -> C
mapd (g ∘ extract) ∘ map f = map (g ∘ f)
E: Type T: Type -> Type H: Mapd E T H0: DecoratedFunctor E T Map_T: Map T Compat_Map_Mapd0: Compat_Map_Mapd E T A, B, C: Type f: A -> B g: B -> C