Multivariate polynomial functors. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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
Instances for mvpfunctor
- mvpfunctor.has_sizeof_inst
- mvpfunctor.inhabited
Applying P
to an object of Type
Instances for mvpfunctor.obj
Equations
Equations
- mvpfunctor.obj.inhabited P = {default := ⟨inhabited.default _inst_1, λ (_x : fin2 n) (_x_1 : P.B inhabited.default _x), inhabited.default⟩}
Equations
- mvpfunctor.obj.mvfunctor P = {map := P.map}
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