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

Proof steps:
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' }
state_after: 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: cases show @m = @m' by funext α β f x; apply H
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' }
state_after: 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: congr
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'
state_after: 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: funext α β
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'
state_after: 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: 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
E1 : ∀ {α β : Type u_1}, mapConst = map ∘ Function.const β
⊢ mc = mc'
state_after: 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: 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 β
E2 : ∀ {α β : Type u_1}, mapConst = map ∘ Function.const β
⊢ mc = mc'
state_after: no goals
tactic: exact E1.trans E2.symm