Library UniMath.Induction.PolynomialFunctors
Polynomial functors
Require Import UniMath.Foundations.Preamble.
Require Import UniMath.Foundations.PartA.
Require Import UniMath.Foundations.UnivalenceAxiom.
Require Import UniMath.CategoryTheory.Categories.
Require Import UniMath.CategoryTheory.functor_categories.
Require Import UniMath.CategoryTheory.FunctorAlgebras.
Require Import UniMath.CategoryTheory.categories.Types.
Section PolynomialFunctors.
Context (A : UU).
Context (B : A → UU).
Definition polynomial_functor_obj := fun (X : UU) ⇒ ∑ (a : A), B a → X.
The action on arrows is defined by composition in the second projection.
Definition polynomial_functor_arr {X Y : UU} (f : X → Y) :
(polynomial_functor_obj X) → (polynomial_functor_obj Y) :=
fun o ⇒ (pr1 o,, (f ∘ pr2 o)%functions).
(polynomial_functor_obj X) → (polynomial_functor_obj Y) :=
fun o ⇒ (pr1 o,, (f ∘ pr2 o)%functions).
Polynomial functors aren't functors in the usual sense, since UU is an
(∞,1)-category. However, they are functors in the sense of UniMath's
definition.
Definition polynomial_functor_data : functor_data type_precat type_precat :=
functor_data_constr _ _
(polynomial_functor_obj : type_precat → type_precat)
(@polynomial_functor_arr).
Lemma polynomial_functor_is_functor : is_functor polynomial_functor_data.
Proof.
split.
- intro.
reflexivity.
- intros ? ? ? ? ?.
reflexivity.
Defined.
Definition polynomial_functor : functor type_precat type_precat :=
mk_functor polynomial_functor_data polynomial_functor_is_functor.
functor_data_constr _ _
(polynomial_functor_obj : type_precat → type_precat)
(@polynomial_functor_arr).
Lemma polynomial_functor_is_functor : is_functor polynomial_functor_data.
Proof.
split.
- intro.
reflexivity.
- intros ? ? ? ? ?.
reflexivity.
Defined.
Definition polynomial_functor : functor type_precat type_precat :=
mk_functor polynomial_functor_data polynomial_functor_is_functor.
An algebra with an uncurried structure map
The uncurried and curried versions are equivalent