Theorem: CategoryTheory.Functor.ext
File: Mathlib/CategoryTheory/EqToHom.lean

tactic: match F, G with
| mk F_pre _ _ , mk G_pre _ _ =>
  match F_pre, G_pre with  | Prefunctor.mk F_obj _ , Prefunctor.mk G_obj _ =>
  obtain rfl : F_obj = G_obj := by
    ext X
    apply h_obj
  congr
  funext X Y f
  simpa using h_map X Y f
state_before: C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
h_obj : ∀ (X : C), F.obj X = G.obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y), F.map f = eqToHom (_ : F.obj X = G.obj X) ≫ G.map f ≫ eqToHom (_ : G.obj Y = F.obj Y))
    _auto✝
⊢ F = G

tactic: match F_pre, G_pre with  | Prefunctor.mk F_obj _ , Prefunctor.mk G_obj _ =>
obtain rfl : F_obj = G_obj := by
  ext X
  apply h_obj
congr
funext X Y f
simpa using h_map X Y f
state_before: C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre : C ⥤q D
map_id✝¹ : ∀ (X : C), F_pre.map (𝟙 X) = 𝟙 (F_pre.obj X)
map_comp✝¹ : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), F_pre.map (f ≫ g) = F_pre.map f ≫ F_pre.map g
G_pre : C ⥤q D
map_id✝ : ∀ (X : C), G_pre.map (𝟙 X) = 𝟙 (G_pre.obj X)
map_comp✝ : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), G_pre.map (f ≫ g) = G_pre.map f ≫ G_pre.map g
h_obj : ∀ (X : C), (mk F_pre).obj X = (mk G_pre).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk F_pre).map f =
        eqToHom (_ : (mk F_pre).obj X = (mk G_pre).obj X) ≫
          (mk G_pre).map f ≫ eqToHom (_ : (mk G_pre).obj Y = (mk F_pre).obj Y))
    _auto✝
⊢ mk F_pre = mk G_pre

tactic: obtain rfl : F_obj = G_obj := by
  ext X
  apply h_obj
state_before: C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
G_obj : C → D
map✝ : {X Y : C} → (X ⟶ Y) → (G_obj X ⟶ G_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map_id✝ : ∀ (X : C), { obj := G_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := G_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := G_obj, map := map✝ }.map (f ≫ g) =
      { obj := G_obj, map := map✝ }.map f ≫ { obj := G_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X) ≫
          (mk { obj := G_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := G_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
⊢ mk { obj := F_obj, map := map✝¹ } = mk { obj := G_obj, map := map✝ }

tactic: congr
state_before: C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map✝ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝ : ∀ (X : C), { obj := F_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝ }.map (f ≫ g) =
      { obj := F_obj, map := map✝ }.map f ≫ { obj := F_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X) ≫
          (mk { obj := F_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := F_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
⊢ mk { obj := F_obj, map := map✝¹ } = mk { obj := F_obj, map := map✝ }

tactic: funext X Y f
state_before: case e_toPrefunctor.e_map
C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map✝ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝ : ∀ (X : C), { obj := F_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝ }.map (f ≫ g) =
      { obj := F_obj, map := map✝ }.map f ≫ { obj := F_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X) ≫
          (mk { obj := F_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := F_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
⊢ map✝¹ = map✝

tactic: simpa using h_map X Y f
state_before: case e_toPrefunctor.e_map.h.h.h
C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map✝ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
map_id✝ : ∀ (X : C), { obj := F_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝ }.map (f ≫ g) =
      { obj := F_obj, map := map✝ }.map f ≫ { obj := F_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := F_obj, map := map✝ }).obj X) ≫
          (mk { obj := F_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := F_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
X Y : C
f : X ⟶ Y
⊢ map✝¹ f = map✝ f

tactic: ext X
state_before: C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
G_obj : C → D
map✝ : {X Y : C} → (X ⟶ Y) → (G_obj X ⟶ G_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map_id✝ : ∀ (X : C), { obj := G_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := G_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := G_obj, map := map✝ }.map (f ≫ g) =
      { obj := G_obj, map := map✝ }.map f ≫ { obj := G_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X) ≫
          (mk { obj := G_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := G_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
⊢ F_obj = G_obj

tactic: apply h_obj
state_before: case h
C : Type u₁
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
F G : C ⥤ D
F_pre G_pre : C ⥤q D
F_obj : C → D
map✝¹ : {X Y : C} → (X ⟶ Y) → (F_obj X ⟶ F_obj Y)
G_obj : C → D
map✝ : {X Y : C} → (X ⟶ Y) → (G_obj X ⟶ G_obj Y)
map_id✝¹ : ∀ (X : C), { obj := F_obj, map := map✝¹ }.map (𝟙 X) = 𝟙 ({ obj := F_obj, map := map✝¹ }.obj X)
map_comp✝¹ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := F_obj, map := map✝¹ }.map (f ≫ g) =
      { obj := F_obj, map := map✝¹ }.map f ≫ { obj := F_obj, map := map✝¹ }.map g
map_id✝ : ∀ (X : C), { obj := G_obj, map := map✝ }.map (𝟙 X) = 𝟙 ({ obj := G_obj, map := map✝ }.obj X)
map_comp✝ :
  ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := G_obj, map := map✝ }.map (f ≫ g) =
      { obj := G_obj, map := map✝ }.map f ≫ { obj := G_obj, map := map✝ }.map g
h_obj : ∀ (X : C), (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X
h_map :
  autoParam
    (∀ (X Y : C) (f : X ⟶ Y),
      (mk { obj := F_obj, map := map✝¹ }).map f =
        eqToHom (_ : (mk { obj := F_obj, map := map✝¹ }).obj X = (mk { obj := G_obj, map := map✝ }).obj X) ≫
          (mk { obj := G_obj, map := map✝ }).map f ≫
            eqToHom (_ : (mk { obj := G_obj, map := map✝ }).obj Y = (mk { obj := F_obj, map := map✝¹ }).obj Y))
    _auto✝
X : C
⊢ F_obj X = G_obj X