Multivariate polynomial functors.
Multivariate polynomial functors are used for defining M-types and W-types.
They map a type vector α
to the type Σ a : A, B a ⟹ α
, with A : Type
and
B : A → typevec n
. They interact well with Lean's inductive definitions because
they guarantee that occurrences of α
are positive.
multivariate polynomial functors
Applying P
to an object of Type
Applying P
to a morphism of Type
Equations
- mvpfunctor.inhabited = {default := {A := inhabited.default (Type u_1) sort.inhabited, B := λ (_x : inhabited.default (Type u_1)), inhabited.default (typevec n)}}
Equations
- mvpfunctor.obj.inhabited P = {default := ⟨inhabited.default P.A _inst_1, λ (_x : fin2 n) (_x_1 : P.B (inhabited.default P.A) _x), inhabited.default (α _x)⟩}
Equations
- _ = _
Constant functor where the input object does not affect the output
Constructor for the constant functor
Equations
- mvpfunctor.const.mk n x = ⟨x, λ (i : fin2 n) (a : (mvpfunctor.const n A).B x i), pempty.elim a⟩
Destructor for the constant functor
Equations
- mvpfunctor.const.get x = x.fst
Functor composition on polynomial functors
Constructor for functor composition
Destructor for functor composition
Split polynomial functor, get a n-ary functor
from a n+1
-ary functor
append arrows of a polynomial functor application
Equations
- P.append_contents f' f = typevec.split_fun f' f