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
- A : Type u
The head type
- B : self.A → TypeVec.{u} n
The child family of types
Instances For
Equations
- MvPFunctor.instCoeFunMvPFunctorForAllTypeVecType = { coe := MvPFunctor.Obj }
Applying P
to a morphism of Type
Equations
- MvPFunctor.map P f x = match x with | { fst := a, snd := g } => { fst := a, snd := TypeVec.comp f g }
Instances For
Equations
- MvPFunctor.instInhabitedMvPFunctor = { default := { A := default, B := default } }
Equations
- MvPFunctor.Obj.inhabited P = { default := { fst := default, snd := fun (x : Fin2 n) (x_1 : P.B default x) => default } }
Equations
- MvPFunctor.instMvFunctorObj P = { map := @MvPFunctor.map n P }
Equations
- (_ : LawfulMvFunctor ↑P) = (_ : LawfulMvFunctor ↑P)
Constant functor where the input object does not affect the output
Equations
- MvPFunctor.const n A = { A := A, B := fun (x : A) (x : Fin2 n) => PEmpty.{u + 1} }
Instances For
Constructor for the constant functor
Equations
- MvPFunctor.const.mk n x = { fst := x, snd := fun (x_1 : Fin2 n) (a : (MvPFunctor.const n A).B x x_1) => PEmpty.elim a }
Instances For
Destructor for the constant functor
Equations
- MvPFunctor.const.get x = x.fst
Instances For
Functor composition on polynomial functors
Equations
- One or more equations did not get rendered due to their size.
Instances For
Constructor for functor composition
Equations
- One or more equations did not get rendered due to their size.
Instances For
Destructor for functor composition
Equations
- One or more equations did not get rendered due to their size.
Instances For
Split polynomial functor, get an n-ary functor
from an n+1
-ary functor
Equations
- MvPFunctor.drop P = { A := P.A, B := fun (a : P.A) => TypeVec.drop (P.B a) }
Instances For
Split polynomial functor, get a univariate functor
from an n+1
-ary functor
Equations
- MvPFunctor.last P = { A := P.A, B := fun (a : P.A) => TypeVec.last (P.B a) }
Instances For
append arrows of a polynomial functor application
Equations
- MvPFunctor.appendContents P f' f = TypeVec.splitFun f' f