Functors between the category of tuples of types, and the category Type #
Features:
MvFunctor n
: the type class of multivariate functorsf <$$> x
: notation for map
Multivariate functors, i.e. functor between the category of type vectors and the category of Type
- map : {α β : TypeVec.{u_2} n} → α.Arrow β → F α → F β
Multivariate map, if
f : α ⟹ β
andx : F α
thenf <$$> x : F β
.
Instances
Multivariate map, if f : α ⟹ β
and x : F α
then f <$$> x : F β
Equations
- MvFunctor.«term_<$$>_» = Lean.ParserDescr.trailingNode `MvFunctor.«term_<$$>_» 100 101 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " <$$> ") (Lean.ParserDescr.cat `term 100))
Instances For
predicate lifting over multivariate functors
Equations
- MvFunctor.LiftP P x = ∃ (u : F fun (i : Fin2 n) => Subtype (P i)), MvFunctor.map (fun (i : Fin2 n) => Subtype.val) u = x
Instances For
relational lifting over multivariate functors
Equations
- One or more equations did not get rendered due to their size.
Instances For
given x : F α
and a projection i
of type vector α
, supp x i
is the set
of α.i
contained in x
Equations
- MvFunctor.supp x i = {y : α i | ∀ ⦃P : (i : Fin2 n) → α i → Prop⦄, MvFunctor.LiftP P x → P i y}
Instances For
laws for MvFunctor
- id_map : ∀ {α : TypeVec.{u_2} n} (x : F α), MvFunctor.map TypeVec.id x = x
map
preserved identities, i.e., maps identity onα
to identity onF α
- comp_map : ∀ {α β γ : TypeVec.{u_2} n} (g : α.Arrow β) (h : β.Arrow γ) (x : F α), MvFunctor.map (TypeVec.comp h g) x = MvFunctor.map h (MvFunctor.map g x)
map
preserves compositions
Instances
map
preserved identities, i.e., maps identity on α
to identity on F α
map
preserves compositions
adapt MvFunctor.LiftP
to accept predicates as arrows
Equations
- MvFunctor.LiftP' P = MvFunctor.LiftP fun (i : Fin2 n) (x : α i) => TypeVec.ofRepeat (P i x)
Instances For
adapt MvFunctor.LiftR
to accept relations as arrows
Equations
- MvFunctor.LiftR' R = MvFunctor.LiftR fun (i : Fin2 n) (x y : α i) => TypeVec.ofRepeat (R i (TypeVec.prod.mk i x y))
Instances For
Any type function that is (extensionally) equivalent to a functor, is itself a functor
Equations
- MvFunctor.ofEquiv eqv = { map := fun {α β : TypeVec.{?u.41} n} (f : α.Arrow β) (x : F α) => (eqv β).symm (MvFunctor.map f ((eqv α) x)) }