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
Classes.Kleisli.DecoratedFunctor
Classes.Categorical.ContainerFunctor
Classes.Categorical.Comonad (Extract, extract)
Functors.Early.Subset
Functors.Early.Ctxset.Import ContainerFunctor.Notations.Import Monoid.Notations.Import Functor.Notations.Import Subset.Notations.Import List.ListNotations.#[local] Generalizable VariablesE T.(** * Decorated Container-Like *)(**********************************************************************)(** ** Operation <<toctxset>> *)(**********************************************************************)ClassToCtxset (E: Type) (F: Type -> Type) :=
toctxset: forallA: Type, F A -> ctxset E A.#[global] Arguments toctxset {E}%type_scope {F}%function_scope
{ToCtxset} {A}%type_scope _.(** ** Compatibility with <<tosubset>> *)(**********************************************************************)DefinitionToSubset_ToCtxset
`{ToCtxset_ET: ToCtxset E T}: ToSubset T :=
funA => map (F := subset) extract ∘ toctxset.ClassCompat_ToSubset_ToCtxset (E: Type) (T: Type -> Type)
`{ToCtxset_ET: ToCtxset E T}
`{ToSubset_T: ToSubset T}: Prop :=
compat_tosubset_toctxset:
ToSubset_T =
(ToSubset_ToCtxset (ToCtxset_ET := ToCtxset_ET)).
E: Type T: Type -> Type ToCtxset_ET: ToCtxset E T ToSubset_T: ToSubset T Compat_ToSubset_ToCtxset0: Compat_ToSubset_ToCtxset E
T
forallA : Type, tosubset = map extract ∘ toctxset
E: Type T: Type -> Type ToCtxset_ET: ToCtxset E T ToSubset_T: ToSubset T Compat_ToSubset_ToCtxset0: Compat_ToSubset_ToCtxset E
T
forallA : Type, tosubset = map extract ∘ toctxset
E: Type T: Type -> Type ToCtxset_ET: ToCtxset E T ToSubset_T: ToSubset T Compat_ToSubset_ToCtxset0: Compat_ToSubset_ToCtxset E
T A: Type
tosubset = map extract ∘ toctxset
E: Type T: Type -> Type ToCtxset_ET: ToCtxset E T ToSubset_T: ToSubset T Compat_ToSubset_ToCtxset0: Compat_ToSubset_ToCtxset E
T A: Type
ToSubset_ToCtxset A = map extract ∘ toctxset
reflexivity.Qed.(** ** <<element_ctx_of>> operation (∈d) *)(**********************************************************************)Definitionelement_ctx_of `{ToCtxset E T} {A: Type}:
E * A -> T A -> Prop := funpt => toctxset t p.#[local] Notation"x ∈d t" :=
(element_ctx_of x t) (at level50): tealeaves_scope.
E: Type T: Type -> Type H: ToCtxset E T A: Type
forallp : E * A,
element_ctx_of p = evalAt p ∘ toctxset
E: Type T: Type -> Type H: ToCtxset E T A: Type
forallp : E * A,
element_ctx_of p = evalAt p ∘ toctxset
reflexivity.Qed.(** ** Typeclass *)(**********************************************************************)ClassDecoratedContainerFunctor
(E: Type) (F: Type -> Type)
`{Mapd E F} `{ToCtxset E F} :=
{ dcont_functor :> DecoratedFunctor E F;
dcont_natural :> DecoratedHom E F (ctxset E) (@toctxset E _ _);
dcont_pointwise:
forall (AB: Type) (t: F A) (fg: E * A -> B),
(forallea, (e, a) ∈d t -> f (e, a) = g (e, a)) ->
mapd f t = mapd g t;
}.(** ** Homomorphisms of Decorated Container Functors *)(**********************************************************************)ClassDecoratedContainerTransformation
{E: Type} {FG: Type -> Type}
`{Map F} `{Mapd E F} `{ToCtxset E F}
`{Map G} `{Mapd E G} `{ToCtxset E G}
(η: F ⇒ G) :=
{ dcont_trans_natural: Natural η;
dcont_trans_commute:
forallA, toctxset (F := F) = toctxset (F := G) ∘ η A;
}.(** * Notations *)(**********************************************************************)ModuleNotations.Notation"x ∈d t" :=
(element_ctx_of x t) (at level50): tealeaves_scope.EndNotations.