Theorem: Functor.ext
File: Mathlib/Control/Functor.lean

tactic: cases show @m = @m' by funext α β f x; apply H
state_before: F✝ : Type u → Type v
α β γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc : {α β : Type u_1} → α → F β → F α
m' : {α β : Type u_1} → (α → β) → F α → F β
mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
⊢ { map := m, mapConst := mc } = { map := m', mapConst := mc' }

tactic: congr
state_before: case refl
F✝ : Type u → Type v
α β γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
⊢ { map := m, mapConst := mc } = { map := m, mapConst := mc' }

tactic: funext α β
state_before: case refl.e_mapConst
F✝ : Type u → Type v
α β γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
⊢ mc = mc'

tactic: have E1 := @map_const _ ⟨@m, @mc⟩ H1
state_before: case refl.e_mapConst.h.h
F✝ : Type u → Type v
α✝ β✝ γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
α β : Type u_1
⊢ mc = mc'

tactic: have E2 := @map_const _ ⟨@m, @mc'⟩ H2
state_before: case refl.e_mapConst.h.h
F✝ : Type u → Type v
α✝ β✝ γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
α β : Type u_1
E1 : ∀ {α β : Type u_1}, mapConst = map ∘ Function.const β
⊢ mc = mc'

tactic: exact E1.trans E2.symm
state_before: case refl.e_mapConst.h.h
F✝ : Type u → Type v
α✝ β✝ γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
α β : Type u_1
E1 : ∀ {α β : Type u_1}, mapConst = map ∘ Function.const β
E2 : ∀ {α β : Type u_1}, mapConst = map ∘ Function.const β
⊢ mc = mc'

tactic: funext α β f x
state_before: F✝ : Type u → Type v
α β γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc : {α β : Type u_1} → α → F β → F α
m' : {α β : Type u_1} → (α → β) → F α → F β
mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
⊢ m = m'

tactic: apply H
state_before: case h.h.h.h
F✝ : Type u → Type v
α✝ β✝ γ : Type u
inst✝¹ : Functor F✝
inst✝ : LawfulFunctor F✝
F : Type u_1 → Type u_2
m : {α β : Type u_1} → (α → β) → F α → F β
mc : {α β : Type u_1} → α → F β → F α
m' : {α β : Type u_1} → (α → β) → F α → F β
mc' : {α β : Type u_1} → α → F β → F α
H1 : LawfulFunctor F
H2 : LawfulFunctor F
H : ∀ (α β : Type u_1) (f : α → β) (x : F α), f <$> x = f <$> x
α β : Type u_1
f : α → β
x : F α
⊢ m f x = m' f x