File: Mathlib/Control/Bifunctor.lean

full_name: Bifunctor.bimap
code: /-- Lawless bifunctor. This typeclass only holds the data for the bimap. -/
class Bifunctor (F : Type u₀ → Type u₁ → Type u₂) where
  bimap : ∀ {α α' β β'}, (α → α') → (β → β') → F α β → F α' β'
goal: (α → α') → (β → β') → F α β → F α' β'

full_name: Bifunctor
code: /-- Lawless bifunctor. This typeclass only holds the data for the bimap. -/
class Bifunctor (F : Type u₀ → Type u₁ → Type u₂) where
  bimap : ∀ {α α' β β'}, (α → α') → (β → β') → F α β → F α' β'
goal: Type (max (max (u₀ + 1) (u₁ + 1)) u₂)

full_name: LawfulBifunctor
code: /-- Bifunctor. This typeclass asserts that a lawless `Bifunctor` is lawful. -/
class LawfulBifunctor (F : Type u₀ → Type u₁ → Type u₂) [Bifunctor F] : Prop where
  id_bimap : ∀ {α β} (x : F α β), bimap id id x = x
  bimap_bimap :
    ∀ {α₀ α₁ α₂ β₀ β₁ β₂} (f : α₀ → α₁) (f' : α₁ → α₂) (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α₀ β₀),
      bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x
goal: Prop

full_name: LawfulBifunctor.id_bimap
code: /-- Bifunctor. This typeclass asserts that a lawless `Bifunctor` is lawful. -/
class LawfulBifunctor (F : Type u₀ → Type u₁ → Type u₂) [Bifunctor F] : Prop where
  id_bimap : ∀ {α β} (x : F α β), bimap id id x = x
  bimap_bimap :
    ∀ {α₀ α₁ α₂ β₀ β₁ β₂} (f : α₀ → α₁) (f' : α₁ → α₂) (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α₀ β₀),
      bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x
goal: bimap id id x = x

full_name: LawfulBifunctor.bimap_bimap
code: /-- Bifunctor. This typeclass asserts that a lawless `Bifunctor` is lawful. -/
class LawfulBifunctor (F : Type u₀ → Type u₁ → Type u₂) [Bifunctor F] : Prop where
  id_bimap : ∀ {α β} (x : F α β), bimap id id x = x
  bimap_bimap :
    ∀ {α₀ α₁ α₂ β₀ β₁ β₂} (f : α₀ → α₁) (f' : α₁ → α₂) (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α₀ β₀),
      bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x
goal: bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x

full_name: Bifunctor.fst
code: /-- Left map of a bifunctor. -/
abbrev fst {α α' β} (f : α → α') : F α β → F α' β 
goal: F α β → F α' β

full_name: Bifunctor.snd
code: /-- Right map of a bifunctor. -/
abbrev snd {α β β'} (f : β → β') : F α β → F α β' 
goal: F α β → F α β'

full_name: Bifunctor.id_fst
code: @[higher_order fst_id]
theorem id_fst : ∀ {α β} (x : F α β), fst id x = x 
goal: Bifunctor.fst id x = x

full_name: Bifunctor.fst_id
code: @[higher_order fst_id]
theorem id_fst : ∀ {α β} (x : F α β), fst id x = x 
goal: Bifunctor.fst id = id

full_name: Bifunctor.snd_id
code: @[higher_order snd_id]
theorem id_snd : ∀ {α β} (x : F α β), snd id x = x 
goal: Bifunctor.snd id = id

full_name: Bifunctor.id_snd
code: @[higher_order snd_id]
theorem id_snd : ∀ {α β} (x : F α β), snd id x = x 
goal: Bifunctor.snd id x = x

full_name: Bifunctor.comp_fst
code: @[higher_order fst_comp_fst]
theorem comp_fst {α₀ α₁ α₂ β} (f : α₀ → α₁) (f' : α₁ → α₂) (x : F α₀ β) :
    fst f' (fst f x) = fst (f' ∘ f) x 
goal: Bifunctor.fst f' (Bifunctor.fst f x) = Bifunctor.fst (f' ∘ f) x

full_name: Bifunctor.fst_comp_fst
code: @[higher_order fst_comp_fst]
theorem comp_fst {α₀ α₁ α₂ β} (f : α₀ → α₁) (f' : α₁ → α₂) (x : F α₀ β) :
    fst f' (fst f x) = fst (f' ∘ f) x 
goal: Bifunctor.fst f' ∘ Bifunctor.fst f = Bifunctor.fst (f' ∘ f)

full_name: Bifunctor.fst_comp_snd
code: @[higher_order fst_comp_snd]
theorem fst_snd {α₀ α₁ β₀ β₁} (f : α₀ → α₁) (f' : β₀ → β₁) (x : F α₀ β₀) :
    fst f (snd f' x) = bimap f f' x 
goal: Bifunctor.fst f ∘ Bifunctor.snd f' = bimap f f'

full_name: Bifunctor.fst_snd
code: @[higher_order fst_comp_snd]
theorem fst_snd {α₀ α₁ β₀ β₁} (f : α₀ → α₁) (f' : β₀ → β₁) (x : F α₀ β₀) :
    fst f (snd f' x) = bimap f f' x 
goal: Bifunctor.fst f (Bifunctor.snd f' x) = bimap f f' x

full_name: Bifunctor.snd_comp_fst
code: @[higher_order snd_comp_fst]
theorem snd_fst {α₀ α₁ β₀ β₁} (f : α₀ → α₁) (f' : β₀ → β₁) (x : F α₀ β₀) :
    snd f' (fst f x) = bimap f f' x 
goal: Bifunctor.snd f' ∘ Bifunctor.fst f = bimap f f'

full_name: Bifunctor.snd_fst
code: @[higher_order snd_comp_fst]
theorem snd_fst {α₀ α₁ β₀ β₁} (f : α₀ → α₁) (f' : β₀ → β₁) (x : F α₀ β₀) :
    snd f' (fst f x) = bimap f f' x 
goal: Bifunctor.snd f' (Bifunctor.fst f x) = bimap f f' x

full_name: Bifunctor.snd_comp_snd
code: @[higher_order snd_comp_snd]
theorem comp_snd {α β₀ β₁ β₂} (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α β₀) :
    snd g' (snd g x) = snd (g' ∘ g) x 
goal: Bifunctor.snd g' ∘ Bifunctor.snd g = Bifunctor.snd (g' ∘ g)

full_name: Bifunctor.comp_snd
code: @[higher_order snd_comp_snd]
theorem comp_snd {α β₀ β₁ β₂} (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α β₀) :
    snd g' (snd g x) = snd (g' ∘ g) x 
goal: Bifunctor.snd g' (Bifunctor.snd g x) = Bifunctor.snd (g' ∘ g) x

full_name: Prod.bifunctor
code: instance Prod.bifunctor : Bifunctor Prod 
goal: Bifunctor Prod

full_name: Prod.lawfulBifunctor
code: instance Prod.lawfulBifunctor : LawfulBifunctor Prod 
goal: LawfulBifunctor Prod

full_name: Bifunctor.const
code: instance Bifunctor.const : Bifunctor Const 
goal: Bifunctor Functor.Const

full_name: LawfulBifunctor.const
code: instance LawfulBifunctor.const : LawfulBifunctor Const 
goal: LawfulBifunctor Functor.Const

full_name: Bifunctor.flip
code: instance Bifunctor.flip : Bifunctor (flip F) 
goal: Bifunctor (flip F)

full_name: LawfulBifunctor.flip
code: instance LawfulBifunctor.flip [LawfulBifunctor F] : LawfulBifunctor (flip F) 
goal: LawfulBifunctor (flip F)

full_name: Sum.bifunctor
code: instance Sum.bifunctor : Bifunctor Sum 
goal: Bifunctor Sum

full_name: Sum.lawfulBifunctor
code: instance Sum.lawfulBifunctor : LawfulBifunctor Sum 
goal: LawfulBifunctor Sum

full_name: Bifunctor.functor
code: instance (priority := 10) Bifunctor.functor {α} : Functor (F α) 
goal: Functor (F α)

full_name: Bifunctor.lawfulFunctor
code: instance (priority := 10) Bifunctor.lawfulFunctor [LawfulBifunctor F] {α} :
    LawfulFunctor (F α) 
goal: LawfulFunctor (F α)

full_name: Function.bicompl.bifunctor
code: instance Function.bicompl.bifunctor : Bifunctor (bicompl F G H) 
goal: Bifunctor (Function.bicompl F G H)

full_name: Function.bicompl.lawfulBifunctor
code: instance Function.bicompl.lawfulBifunctor [LawfulFunctor G] [LawfulFunctor H] [LawfulBifunctor F] :
    LawfulBifunctor (bicompl F G H) 
goal: LawfulBifunctor (Function.bicompl F G H)

full_name: Function.bicompr.bifunctor
code: instance Function.bicompr.bifunctor : Bifunctor (bicompr G F) 
goal: Bifunctor (Function.bicompr G F)

full_name: Function.bicompr.lawfulBifunctor
code: instance Function.bicompr.lawfulBifunctor [LawfulFunctor G] [LawfulBifunctor F] :
    LawfulBifunctor (bicompr G F) 
goal: LawfulBifunctor (Function.bicompr G F)