mathlib documentation

control.​functor

control.​functor

theorem functor.​map_id {F : Type uType v} {α : Type u} [functor F] [is_lawful_functor F] :

theorem functor.​map_comp_map {F : Type uType v} {α β γ : Type u} [functor F] [is_lawful_functor F] (f : α → β) (g : β → γ) :

theorem functor.​ext {F : Type u_1Type u_2} {F1 F2 : functor F} [is_lawful_functor F] [is_lawful_functor F] :
(∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x)F1 = F2

def id.​mk {α : Sort u} :
α → id α

Equations
@[nolint]
def functor.​const  :
Type u_1Type u_2Type u_1

const α is the constant functor, mapping every type to α

Equations
def functor.​const.​mk {α : Type u_1} {β : Type u_2} :
α → functor.const α β

Equations
def functor.​const.​mk' {α : Type u_1} :

Equations
def functor.​const.​run {α : Type u_1} {β : Type u_2} :
functor.const α β → α

Equations
theorem functor.​const.​ext {α : Type u_1} {β : Type u_2} {x y : functor.const α β} :
x.run = y.runx = y

@[nolint]
def functor.​const.​map {γ : Type u_1} {α : Type u_2} {β : Type u_3} :
(α → β)functor.const γ βfunctor.const γ α

The map operation of the const γ functor.

Equations
@[instance]
def functor.​const.​functor {γ : Type u_1} :

Equations
def functor.​add_const  :
Type u_1Type u_2Type u_1

Equations
def functor.​add_const.​mk {α : Type u_1} {β : Type u_2} :
α → functor.add_const α β

Equations
def functor.​add_const.​run {α : Type u_1} {β : Type u_2} :
functor.add_const α β → α

Equations
def functor.​comp  :
(Type uType w)(Type vType u)Type vType w

functor.comp is a wrapper around function.comp for types. It prevents Lean's type class resolution mechanism from trying a functor (comp F id) when functor F would do.

Equations
def functor.​comp.​mk {F : Type uType w} {G : Type vType u} {α : Type v} :
F (G α)functor.comp F G α

Equations
def functor.​comp.​run {F : Type uType w} {G : Type vType u} {α : Type v} :
functor.comp F G αF (G α)

Equations
theorem functor.​comp.​ext {F : Type uType w} {G : Type vType u} {α : Type v} {x y : functor.comp F G α} :
x.run = y.runx = y

def functor.​comp.​map {F : Type uType w} {G : Type vType u} [functor F] [functor G] {α β : Type v} :
(α → β)functor.comp F G αfunctor.comp F G β

Equations
@[instance]
def functor.​comp.​functor {F : Type uType w} {G : Type vType u} [functor F] [functor G] :

Equations
theorem functor.​comp.​map_mk {F : Type uType w} {G : Type vType u} [functor F] [functor G] {α β : Type v} (h : α → β) (x : F (G α)) :

@[simp]
theorem functor.​comp.​run_map {F : Type uType w} {G : Type vType u} [functor F] [functor G] {α β : Type v} (h : α → β) (x : functor.comp F G α) :

theorem functor.​comp.​id_map {F : Type uType w} {G : Type vType u} [functor F] [functor G] [is_lawful_functor F] [is_lawful_functor G] {α : Type v} (x : functor.comp F G α) :

theorem functor.​comp.​comp_map {F : Type uType w} {G : Type vType u} [functor F] [functor G] [is_lawful_functor F] [is_lawful_functor G] {α β γ : Type v} (g' : α → β) (h : β → γ) (x : functor.comp F G α) :

@[instance]
def functor.​comp.​is_lawful_functor {F : Type uType w} {G : Type vType u} [functor F] [functor G] [is_lawful_functor F] [is_lawful_functor G] :

Equations
theorem functor.​comp.​functor_comp_id {F : Type u_1Type u_2} [AF : functor F] [is_lawful_functor F] :

theorem functor.​comp.​functor_id_comp {F : Type u_1Type u_2} [AF : functor F] [is_lawful_functor F] :

def functor.​comp.​seq {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] {α β : Type v} :
functor.comp F G (α → β)functor.comp F G αfunctor.comp F G β

Equations
@[instance]
def functor.​comp.​has_pure {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] :

Equations
@[instance]
def functor.​comp.​has_seq {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] :

Equations
@[simp]
theorem functor.​comp.​run_pure {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] {α : Type v} (x : α) :

@[simp]
theorem functor.​comp.​run_seq {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] {α β : Type v} (f : functor.comp F G (α → β)) (x : functor.comp F G α) :

@[instance]
def functor.​comp.​applicative {F : Type uType w} {G : Type vType u} [applicative F] [applicative G] :

Equations
def functor.​liftp {F : Type uType u} [functor F] {α : Type u} :
(α → Prop)F α → Prop

If we consider x : F α to, in some sense, contain values of type α, predicate liftp p x holds iff, every value contained by x satisfies p

Equations
def functor.​liftr {F : Type uType u} [functor F] {α : Type u} :
(α → α → Prop)F αF α → Prop

liftr r x y relates x and y iff x and y have the same shape and that we can pair values a from x and b from y so that r a b holds

Equations
def functor.​supp {F : Type uType u} [functor F] {α : Type u} :
F αset α

supp x is the set of values of type α that x contains

Equations
theorem functor.​of_mem_supp {F : Type uType u} [functor F] {α : Type u} {x : F α} {p : α → Prop} (h : functor.liftp p x) (y : α) :
y functor.supp xp y

@[instance]

Equations