The composition of QPFs is itself a QPF #
We define composition between one n-ary functor and n m-ary functors
and show that it preserves the QPF structure
def MvQPF.Comp {n m : ℕ} (F : TypeVec.{u} n → Type u_1) (G : Fin2 n → TypeVec.{u} m → Type u) (v : TypeVec.{u} m) :
Type u_1
Composition of an n-ary functor with n m-ary
functors gives us one m-ary functor
Equations
- MvQPF.Comp F G v = F fun (i : Fin2 n) => G i v
Instances For
@[instance_reducible]
instance MvQPF.Comp.instInhabited {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α : TypeVec.{u} m} [I : Inhabited (F fun (i : Fin2 n) => G i α)] :
Equations
def MvQPF.Comp.mk {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α : TypeVec.{u} m} (x : F fun (i : Fin2 n) => G i α) :
Comp F G α
Constructor for functor composition
Equations
- MvQPF.Comp.mk x = x
Instances For
def MvQPF.Comp.get {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α : TypeVec.{u} m} (x : Comp F G α) :
F fun (i : Fin2 n) => G i α
Destructor for functor composition
Instances For
@[simp]
theorem MvQPF.Comp.mk_get {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α : TypeVec.{u} m} (x : Comp F G α) :
@[simp]
theorem MvQPF.Comp.get_mk {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α : TypeVec.{u} m} (x : F fun (i : Fin2 n) => G i α) :
def MvQPF.Comp.map' {n m : ℕ} {G : Fin2 n → TypeVec.{u} m → Type u} {α β : TypeVec.{u} m} (f : α.Arrow β) [(i : Fin2 n) → MvFunctor (G i)] :
TypeVec.Arrow (fun (i : Fin2 n) => G i α) fun (i : Fin2 n) => G i β
map operation defined on a vector of functors
Equations
- MvQPF.Comp.map' f _i = MvFunctor.map f
Instances For
def MvQPF.Comp.map {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α β : TypeVec.{u} m} (f : α.Arrow β) [MvFunctor F] [(i : Fin2 n) → MvFunctor (G i)] :
The composition of functors is itself functorial
Equations
- MvQPF.Comp.map f = MvFunctor.map fun (_i : Fin2 n) => MvFunctor.map f
Instances For
@[instance_reducible]
instance MvQPF.Comp.instMvFunctor {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} [MvFunctor F] [(i : Fin2 n) → MvFunctor (G i)] :
Equations
- MvQPF.Comp.instMvFunctor = { map := fun {α β : TypeVec.{?u.2} m} (f : α.Arrow β) => MvQPF.Comp.map f }
theorem MvQPF.Comp.map_mk {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α β : TypeVec.{u} m} (f : α.Arrow β) [MvFunctor F] [(i : Fin2 n) → MvFunctor (G i)] (x : F fun (i : Fin2 n) => G i α) :
MvFunctor.map f (Comp.mk x) = Comp.mk (MvFunctor.map (fun (i : Fin2 n) (x : G i α) => MvFunctor.map f x) x)
theorem MvQPF.Comp.get_map {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} {α β : TypeVec.{u} m} (f : α.Arrow β) [MvFunctor F] [(i : Fin2 n) → MvFunctor (G i)] (x : Comp F G α) :
@[instance_reducible]
instance MvQPF.Comp.inst {n m : ℕ} {F : TypeVec.{u} n → Type u_1} {G : Fin2 n → TypeVec.{u} m → Type u} [MvQPF F] [(i : Fin2 n) → MvQPF (G i)] :
Equations
- One or more equations did not get rendered due to their size.