/-
Copyright (c) 2018 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Bhavik Mehta

! This file was ported from Lean 3 source module category_theory.functor.const
! leanprover-community/mathlib commit 34ee86e6a59d911a8e4f89b68793ee7577ae79c7
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.CategoryTheory.Opposites

/-!
# The constant functor

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

`const J : C ⥤ (J ⥤ C)` is the functor that sends an object `X : C` to the functor `J ⥤ C` sending
every object in `J` to `X`, and every morphism to `𝟙 X`.

When `J` is nonempty, `const` is faithful.

We have `(const J).obj X ⋙ F ≅ (const J).obj (F.obj X)` for any `F : C ⥤ D`.
-/

-- declare the `v`'s first; see `category_theory.category` for an explanation
universe v₁ v₂ v₃ u₁ u₂ u₃

open CategoryTheory

namespace CategoryTheory.Functor

variable (J : Type u₁) [Category.{v₁} J]

variable {C : Type u₂} [Category.{v₂} C]

#print CategoryTheory.Functor.const /-
/-- The functor sending `X : C` to the constant functor `J ⥤ C` sending everything to `X`.
-/
@[simps]
def const : C ⥤ J ⥤ C
    where
  obj X :=
    { obj := fun j => X
      map := fun j j' f => 𝟙 X }
  map X Y f := { app := fun j => f }
#align category_theory.functor.const CategoryTheory.Functor.const
-/

namespace Const

open Opposite

variable {J}

/- warning: category_theory.functor.const.op_obj_op -> CategoryTheory.Functor.const.opObjOp is a dubious translation:
lean 3 declaration is
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : C), CategoryTheory.Iso.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (Opposite.op.{succ u4} C X)) (CategoryTheory.Functor.op.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2) X))
but is expected to have type
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : C), CategoryTheory.Iso.{max u3 u2, max (max (max u3 u1) u2) u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (Opposite.op.{succ u4} C X)) (CategoryTheory.Functor.op.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2)) X))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const.op_obj_op CategoryTheory.Functor.const.opObjOpₓ'. -/
/-- The contant functor `Jᵒᵖ ⥤ Cᵒᵖ` sending everything to `op X`
is (naturally isomorphic to) the opposite of the constant functor `J ⥤ C` sending everything to `X`.
-/
@[simps]
def opObjOp (X : C) : (const Jᵒᵖ).obj (op X) ≅ ((const J).obj X).op
    where
  Hom := { app := fun j => 𝟙 _ }
  inv := { app := fun j => 𝟙 _ }
#align category_theory.functor.const.op_obj_op CategoryTheory.Functor.const.opObjOp

/- warning: category_theory.functor.const.op_obj_unop -> CategoryTheory.Functor.const.opObjUnop is a dubious translation:
lean 3 declaration is
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C), CategoryTheory.Iso.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X))
but is expected to have type
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C), CategoryTheory.Iso.{max u3 u2, max (max (max u3 u1) u2) u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const.op_obj_unop CategoryTheory.Functor.const.opObjUnopₓ'. -/
/-- The contant functor `Jᵒᵖ ⥤ C` sending everything to `unop X`
is (naturally isomorphic to) the opposite of
the constant functor `J ⥤ Cᵒᵖ` sending everything to `X`.
-/
def opObjUnop (X : Cᵒᵖ) : (const Jᵒᵖ).obj (unop X) ≅ ((const J).obj X).leftOp
    where
  Hom := { app := fun j => 𝟙 _ }
  inv := { app := fun j => 𝟙 _ }
#align category_theory.functor.const.op_obj_unop CategoryTheory.Functor.const.opObjUnop

/- warning: category_theory.functor.const.op_obj_unop_hom_app -> CategoryTheory.Functor.const.opObjUnop_hom_app is a dubious translation:
lean 3 declaration is
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) (j : Opposite.{succ u3} J), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) j) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) j)) (CategoryTheory.NatTrans.app.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) (CategoryTheory.Iso.hom.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) (CategoryTheory.Functor.const.opObjUnop.{u1, u2, u3, u4} J _inst_1 C _inst_2 X)) j) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) j))
but is expected to have type
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) (j : Opposite.{succ u3} J), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X))) j) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X))) j)) (CategoryTheory.NatTrans.app.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X)) (CategoryTheory.Iso.hom.{max u2 u3, max (max (max u4 u1) u2) u3} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X)) (CategoryTheory.Functor.const.opObjUnop.{u1, u2, u3, u4} J _inst_1 C _inst_2 X)) j) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X))) j))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const.op_obj_unop_hom_app CategoryTheory.Functor.const.opObjUnop_hom_appₓ'. -/
-- Lean needs some help with universes here.
@[simp]
theorem opObjUnop_hom_app (X : Cᵒᵖ) (j : Jᵒᵖ) : (opObjUnop.{v₁, v₂} X).Hom.app j = 𝟙 _ :=
  rfl
#align category_theory.functor.const.op_obj_unop_hom_app CategoryTheory.Functor.const.opObjUnop_hom_app

/- warning: category_theory.functor.const.op_obj_unop_inv_app -> CategoryTheory.Functor.const.opObjUnop_inv_app is a dubious translation:
lean 3 declaration is
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) (j : Opposite.{succ u3} J), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) j) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) j)) (CategoryTheory.NatTrans.app.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Iso.inv.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) (CategoryTheory.Functor.const.opObjUnop.{u1, u2, u3, u4} J _inst_1 C _inst_2 X)) j) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) X)) j))
but is expected to have type
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) (j : Opposite.{succ u3} J), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X))) j) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X))) j)) (CategoryTheory.NatTrans.app.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X)) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Iso.inv.{max u2 u3, max (max (max u4 u1) u2) u3} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2)) (Opposite.unop.{succ u4} C X)) (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X)) (CategoryTheory.Functor.const.opObjUnop.{u1, u2, u3, u4} J _inst_1 C _inst_2 X)) j) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.toCategoryStruct.{u1, u3} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} (Opposite.{succ u3} J) (CategoryTheory.Category.opposite.{u1, u3} J _inst_1) C _inst_2 (CategoryTheory.Functor.leftOp.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u2) u4} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2)) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) X))) j))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const.op_obj_unop_inv_app CategoryTheory.Functor.const.opObjUnop_inv_appₓ'. -/
@[simp]
theorem opObjUnop_inv_app (X : Cᵒᵖ) (j : Jᵒᵖ) : (opObjUnop.{v₁, v₂} X).inv.app j = 𝟙 _ :=
  rfl
#align category_theory.functor.const.op_obj_unop_inv_app CategoryTheory.Functor.const.opObjUnop_inv_app

/- warning: category_theory.functor.const.unop_functor_op_obj_map -> CategoryTheory.Functor.const.unop_functor_op_obj_map is a dubious translation:
lean 3 declaration is
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) {j₁ : J} {j₂ : J} (f : Quiver.Hom.{succ u1, u3} J (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} J (CategoryTheory.Category.toCategoryStruct.{u1, u3} J _inst_1)) j₁ j₂), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2)) X)) j₁) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2)) X)) j₂)) (CategoryTheory.Functor.map.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.obj.{u2, max u3 u2, u4, max u1 u2 u3 u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max u1 u2 u3 u4)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max u1 u2 u3 u4} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max u1 u2 u3 u4} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2)) X)) j₁ j₂ f) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (Opposite.unop.{succ u4} C X))
but is expected to have type
  forall {J : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} J] {C : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} C] (X : Opposite.{succ u4} C) {j₁ : J} {j₂ : J} (f : Quiver.Hom.{succ u1, u3} J (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} J (CategoryTheory.Category.toCategoryStruct.{u1, u3} J _inst_1)) j₁ j₂), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} J (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} J (CategoryTheory.Category.toCategoryStruct.{u1, u3} J _inst_1)) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{max (max (max (succ u3) (succ u1)) (succ u4)) (succ u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2))) X))) j₁) (Prefunctor.obj.{succ u1, succ u2, u3, u4} J (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} J (CategoryTheory.Category.toCategoryStruct.{u1, u3} J _inst_1)) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{max (max (max (succ u3) (succ u1)) (succ u4)) (succ u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2))) X))) j₂)) (Prefunctor.map.{succ u1, succ u2, u3, u4} J (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} J (CategoryTheory.Category.toCategoryStruct.{u1, u3} J _inst_1)) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} J _inst_1 C _inst_2 (Opposite.unop.{max (max (max (succ u3) (succ u1)) (succ u4)) (succ u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (Prefunctor.obj.{succ u2, max (succ u3) (succ u2), u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.toCategoryStruct.{u2, u4} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2))) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.CategoryStruct.toQuiver.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.toCategoryStruct.{max u3 u2, max (max (max u3 u1) u4) u2} (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)))) (CategoryTheory.Functor.toPrefunctor.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} (Opposite.{succ u4} C) (CategoryTheory.Category.opposite.{u2, u4} C _inst_2) (Opposite.{succ (max (max (max u3 u1) u4) u2)} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Category.opposite.{max u3 u2, max (max (max u3 u1) u4) u2} (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2)) (CategoryTheory.Functor.op.{u2, max u3 u2, u4, max (max (max u3 u1) u4) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u3, u4} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u3, u4} J _inst_1 C _inst_2))) X))) j₁ j₂ f) (CategoryTheory.CategoryStruct.id.{u2, u4} C (CategoryTheory.Category.toCategoryStruct.{u2, u4} C _inst_2) (Opposite.unop.{succ u4} C X))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const.unop_functor_op_obj_map CategoryTheory.Functor.const.unop_functor_op_obj_mapₓ'. -/
@[simp]
theorem unop_functor_op_obj_map (X : Cᵒᵖ) {j₁ j₂ : J} (f : j₁ ⟶ j₂) :
    (unop ((Functor.op (const J)).obj X)).map f = 𝟙 (unop X) :=
  rfl
#align category_theory.functor.const.unop_functor_op_obj_map CategoryTheory.Functor.const.unop_functor_op_obj_map

end Const

section

variable {D : Type u₃} [Category.{v₃} D]

/- warning: category_theory.functor.const_comp -> CategoryTheory.Functor.constComp is a dubious translation:
lean 3 declaration is
  forall (J : Type.{u4}) [_inst_1 : CategoryTheory.Category.{u1, u4} J] {C : Type.{u5}} [_inst_2 : CategoryTheory.Category.{u2, u5} C] {D : Type.{u6}} [_inst_3 : CategoryTheory.Category.{u3, u6} D] (X : C) (F : CategoryTheory.Functor.{u2, u3, u5, u6} C _inst_2 D _inst_3), CategoryTheory.Iso.{max u4 u3, max u1 u3 u4 u6} (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.category.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.comp.{u1, u2, u3, u4, u5, u6} J _inst_1 C _inst_2 D _inst_3 (CategoryTheory.Functor.obj.{u2, max u4 u2, u5, max u1 u2 u4 u5} C _inst_2 (CategoryTheory.Functor.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u4, u5} J _inst_1 C _inst_2) X) F) (CategoryTheory.Functor.obj.{u3, max u4 u3, u6, max u1 u3 u4 u6} D _inst_3 (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.category.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.const.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.obj.{u2, u3, u5, u6} C _inst_2 D _inst_3 F X))
but is expected to have type
  forall (J : Type.{u4}) [_inst_1 : CategoryTheory.Category.{u1, u4} J] {C : Type.{u5}} [_inst_2 : CategoryTheory.Category.{u2, u5} C] {D : Type.{u6}} [_inst_3 : CategoryTheory.Category.{u3, u6} D] (X : C) (F : CategoryTheory.Functor.{u2, u3, u5, u6} C _inst_2 D _inst_3), CategoryTheory.Iso.{max u4 u3, max (max (max u6 u4) u3) u1} (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.category.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.comp.{u1, u2, u3, u4, u5, u6} J _inst_1 C _inst_2 D _inst_3 (Prefunctor.obj.{succ u2, max (succ u4) (succ u2), u5, max (max (max u4 u1) u2) u5} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u5} C (CategoryTheory.Category.toCategoryStruct.{u2, u5} C _inst_2)) (CategoryTheory.Functor.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.CategoryStruct.toQuiver.{max u4 u2, max (max (max u4 u1) u5) u2} (CategoryTheory.Functor.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Category.toCategoryStruct.{max u4 u2, max (max (max u4 u1) u5) u2} (CategoryTheory.Functor.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u4, u5} J _inst_1 C _inst_2))) (CategoryTheory.Functor.toPrefunctor.{u2, max u4 u2, u5, max (max (max u4 u1) u5) u2} C _inst_2 (CategoryTheory.Functor.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Functor.category.{u1, u2, u4, u5} J _inst_1 C _inst_2) (CategoryTheory.Functor.const.{u1, u2, u4, u5} J _inst_1 C _inst_2)) X) F) (Prefunctor.obj.{succ u3, max (succ u4) (succ u3), u6, max (max (max u4 u1) u3) u6} D (CategoryTheory.CategoryStruct.toQuiver.{u3, u6} D (CategoryTheory.Category.toCategoryStruct.{u3, u6} D _inst_3)) (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.CategoryStruct.toQuiver.{max u4 u3, max (max (max u4 u1) u6) u3} (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Category.toCategoryStruct.{max u4 u3, max (max (max u4 u1) u6) u3} (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.category.{u1, u3, u4, u6} J _inst_1 D _inst_3))) (CategoryTheory.Functor.toPrefunctor.{u3, max u4 u3, u6, max (max (max u4 u1) u6) u3} D _inst_3 (CategoryTheory.Functor.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.category.{u1, u3, u4, u6} J _inst_1 D _inst_3) (CategoryTheory.Functor.const.{u1, u3, u4, u6} J _inst_1 D _inst_3)) (Prefunctor.obj.{succ u2, succ u3, u5, u6} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u5} C (CategoryTheory.Category.toCategoryStruct.{u2, u5} C _inst_2)) D (CategoryTheory.CategoryStruct.toQuiver.{u3, u6} D (CategoryTheory.Category.toCategoryStruct.{u3, u6} D _inst_3)) (CategoryTheory.Functor.toPrefunctor.{u2, u3, u5, u6} C _inst_2 D _inst_3 F) X))
Case conversion may be inaccurate. Consider using '#align category_theory.functor.const_comp CategoryTheory.Functor.constCompₓ'. -/
/-- These are actually equal, of course, but not definitionally equal
  (the equality requires F.map (𝟙 _) = 𝟙 _). A natural isomorphism is
  more convenient than an equality between functors (compare id_to_iso). -/
@[simps]
def constComp (X : C) (F : C ⥤ D) : (const J).obj X ⋙ F ≅ (const J).obj (F.obj X)
    where
  Hom := { app := fun _ => 𝟙 _ }
  inv := { app := fun _ => 𝟙 _ }
#align category_theory.functor.const_comp CategoryTheory.Functor.constComp

/-- If `J` is nonempty, then the constant functor over `J` is faithful. -/
instance [Nonempty J] : Faithful (const J : C ⥤ J ⥤ C)
    where map_injective' X Y f g e := NatTrans.congr_app e (Classical.arbitrary J)

end

end CategoryTheory.Functor


/-
Copyright (c) 2022 Anatole Dedecker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anatole Dedecker

! This file was ported from Lean 3 source module topology.metric_space.equicontinuity
! leanprover-community/mathlib commit f47581155c818e6361af4e4fda60d27d020c226b
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Topology.MetricSpace.Basic
import Mathbin.Topology.UniformSpace.Equicontinuity

/-!
# Equicontinuity in metric spaces

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

This files contains various facts about (uniform) equicontinuity in metric spaces. Most
importantly, we prove the usual characterization of equicontinuity of `F` at `x₀` in the case of
(pseudo) metric spaces: `∀ ε > 0, ∃ δ > 0, ∀ x, dist x x₀ < δ → ∀ i, dist (F i x₀) (F i x) < ε`,
and we prove that functions sharing a common (local or global) continuity modulus are
(locally or uniformly) equicontinuous.

## Main statements

* `equicontinuous_at_iff`: characterization of equicontinuity for families of functions between
  (pseudo) metric spaces.
* `equicontinuous_at_of_continuity_modulus`: convenient way to prove equicontinuity at a point of
  a family of functions to a (pseudo) metric space by showing that they share a common *local*
  continuity modulus.
* `uniform_equicontinuous_of_continuity_modulus`: convenient way to prove uniform equicontinuity
  of a family of functions to a (pseudo) metric space by showing that they share a common *global*
  continuity modulus.

## Tags

equicontinuity, continuity modulus
-/

open Filter

open Topology uniformity

variable {α β ι : Type _} [PseudoMetricSpace α]

namespace Metric

/- warning: metric.equicontinuous_at_iff_right -> Metric.equicontinuousAt_iff_right is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Filter.Eventually.{u2} β (fun (x : β) => forall (i : ι), LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x₀) (F i x)) ε) (nhds.{u2} β _inst_2 x₀)))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Filter.Eventually.{u2} β (fun (x : β) => forall (i : ι), LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x₀) (F i x)) ε) (nhds.{u2} β _inst_2 x₀)))
Case conversion may be inaccurate. Consider using '#align metric.equicontinuous_at_iff_right Metric.equicontinuousAt_iff_rightₓ'. -/
/-- Characterization of equicontinuity for families of functions taking values in a (pseudo) metric
space. -/
theorem equicontinuousAt_iff_right {ι : Type _} [TopologicalSpace β] {F : ι → β → α} {x₀ : β} :
    EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∀ᶠ x in 𝓝 x₀, ∀ i, dist (F i x₀) (F i x) < ε :=
  uniformity_basis_dist.equicontinuousAt_iff_right
#align metric.equicontinuous_at_iff_right Metric.equicontinuousAt_iff_right

/- warning: metric.equicontinuous_at_iff -> Metric.equicontinuousAt_iff is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α (UniformSpace.toTopologicalSpace.{u2} β (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2)) (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Exists.{1} Real (fun (δ : Real) => Exists.{0} (GT.gt.{0} Real Real.hasLt δ (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (fun (H : GT.gt.{0} Real Real.hasLt δ (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) => forall (x : β), (LT.lt.{0} Real Real.hasLt (Dist.dist.{u2} β (PseudoMetricSpace.toHasDist.{u2} β _inst_2) x x₀) δ) -> (forall (i : ι), LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x₀) (F i x)) ε)))))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α (UniformSpace.toTopologicalSpace.{u2} β (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2)) (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Exists.{1} Real (fun (δ : Real) => And (GT.gt.{0} Real Real.instLTReal δ (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (forall (x : β), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u2} β (PseudoMetricSpace.toDist.{u2} β _inst_2) x x₀) δ) -> (forall (i : ι), LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x₀) (F i x)) ε)))))
Case conversion may be inaccurate. Consider using '#align metric.equicontinuous_at_iff Metric.equicontinuousAt_iffₓ'. -/
/-- Characterization of equicontinuity for families of functions between (pseudo) metric spaces. -/
theorem equicontinuousAt_iff {ι : Type _} [PseudoMetricSpace β] {F : ι → β → α} {x₀ : β} :
    EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ δ > 0, ∀ x, dist x x₀ < δ → ∀ i, dist (F i x₀) (F i x) < ε :=
  nhds_basis_ball.equicontinuousAt_iff uniformity_basis_dist
#align metric.equicontinuous_at_iff Metric.equicontinuousAt_iff

/- warning: metric.equicontinuous_at_iff_pair -> Metric.equicontinuousAt_iff_pair is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Exists.{succ u2} (Set.{u2} β) (fun (U : Set.{u2} β) => Exists.{0} (Membership.Mem.{u2, u2} (Set.{u2} β) (Filter.{u2} β) (Filter.hasMem.{u2} β) U (nhds.{u2} β _inst_2 x₀)) (fun (H : Membership.Mem.{u2, u2} (Set.{u2} β) (Filter.{u2} β) (Filter.hasMem.{u2} β) U (nhds.{u2} β _inst_2 x₀)) => forall (x : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x U) -> (forall (x' : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x' U) -> (forall (i : ι), LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x) (F i x')) ε))))))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {F : ι -> β -> α} {x₀ : β}, Iff (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀) (forall (ε : Real), (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Exists.{succ u2} (Set.{u2} β) (fun (U : Set.{u2} β) => And (Membership.mem.{u2, u2} (Set.{u2} β) (Filter.{u2} β) (instMembershipSetFilter.{u2} β) U (nhds.{u2} β _inst_2 x₀)) (forall (x : β), (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) x U) -> (forall (x' : β), (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) x' U) -> (forall (i : ι), LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x) (F i x')) ε))))))
Case conversion may be inaccurate. Consider using '#align metric.equicontinuous_at_iff_pair Metric.equicontinuousAt_iff_pairₓ'. -/
/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x x' «expr ∈ » U) -/
/-- Reformulation of `equicontinuous_at_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type _} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ (x) (_ : x ∈ U) (x') (_ : x' ∈ U), ∀ i, dist (F i x) (F i x') < ε :=
  by
  rw [equicontinuousAt_iff_pair]
  constructor <;> intro H
  · intro ε hε
    refine' Exists.imp (fun V => Exists.imp fun hV h => _) (H _ (dist_mem_uniformity hε))
    exact fun x hx x' hx' => h _ hx _ hx'
  · intro U hU
    rcases mem_uniformity_dist.mp hU with ⟨ε, hε, hεU⟩
    refine' Exists.imp (fun V => Exists.imp fun hV h => _) (H _ hε)
    exact fun x hx x' hx' i => hεU (h _ hx _ hx' i)
#align metric.equicontinuous_at_iff_pair Metric.equicontinuousAt_iff_pair

/- warning: metric.uniform_equicontinuous_iff_right -> Metric.uniformEquicontinuous_iff_right is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : UniformSpace.{u2} β] {F : ι -> β -> α}, Iff (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) _inst_2 F) (forall (ε : Real), (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Filter.Eventually.{u2} (Prod.{u2, u2} β β) (fun (xy : Prod.{u2, u2} β β) => forall (i : ι), LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i (Prod.fst.{u2, u2} β β xy)) (F i (Prod.snd.{u2, u2} β β xy))) ε) (uniformity.{u2} β _inst_2)))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : UniformSpace.{u2} β] {F : ι -> β -> α}, Iff (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) _inst_2 F) (forall (ε : Real), (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Filter.Eventually.{u2} (Prod.{u2, u2} β β) (fun (xy : Prod.{u2, u2} β β) => forall (i : ι), LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i (Prod.fst.{u2, u2} β β xy)) (F i (Prod.snd.{u2, u2} β β xy))) ε) (uniformity.{u2} β _inst_2)))
Case conversion may be inaccurate. Consider using '#align metric.uniform_equicontinuous_iff_right Metric.uniformEquicontinuous_iff_rightₓ'. -/
/-- Characterization of uniform equicontinuity for families of functions taking values in a
(pseudo) metric space. -/
theorem uniformEquicontinuous_iff_right {ι : Type _} [UniformSpace β] {F : ι → β → α} :
    UniformEquicontinuous F ↔ ∀ ε > 0, ∀ᶠ xy : β × β in 𝓤 β, ∀ i, dist (F i xy.1) (F i xy.2) < ε :=
  uniformity_basis_dist.uniformEquicontinuous_iff_right
#align metric.uniform_equicontinuous_iff_right Metric.uniformEquicontinuous_iff_right

/- warning: metric.uniform_equicontinuous_iff -> Metric.uniformEquicontinuous_iff is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] {F : ι -> β -> α}, Iff (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2) F) (forall (ε : Real), (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Exists.{1} Real (fun (δ : Real) => Exists.{0} (GT.gt.{0} Real Real.hasLt δ (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (fun (H : GT.gt.{0} Real Real.hasLt δ (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) => forall (x : β) (y : β), (LT.lt.{0} Real Real.hasLt (Dist.dist.{u2} β (PseudoMetricSpace.toHasDist.{u2} β _inst_2) x y) δ) -> (forall (i : ι), LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x) (F i y)) ε)))))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] {F : ι -> β -> α}, Iff (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2) F) (forall (ε : Real), (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Exists.{1} Real (fun (δ : Real) => And (GT.gt.{0} Real Real.instLTReal δ (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (forall (x : β) (y : β), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u2} β (PseudoMetricSpace.toDist.{u2} β _inst_2) x y) δ) -> (forall (i : ι), LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x) (F i y)) ε)))))
Case conversion may be inaccurate. Consider using '#align metric.uniform_equicontinuous_iff Metric.uniformEquicontinuous_iffₓ'. -/
/-- Characterization of uniform equicontinuity for families of functions between
(pseudo) metric spaces. -/
theorem uniformEquicontinuous_iff {ι : Type _} [PseudoMetricSpace β] {F : ι → β → α} :
    UniformEquicontinuous F ↔
      ∀ ε > 0, ∃ δ > 0, ∀ x y, dist x y < δ → ∀ i, dist (F i x) (F i y) < ε :=
  uniformity_basis_dist.uniformEquicontinuous_iff uniformity_basis_dist
#align metric.uniform_equicontinuous_iff Metric.uniformEquicontinuous_iff

/- warning: metric.equicontinuous_at_of_continuity_modulus -> Metric.equicontinuousAt_of_continuity_modulus is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {x₀ : β} (b : β -> Real), (Filter.Tendsto.{u2, 0} β Real b (nhds.{u2} β _inst_2 x₀) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))))) -> (forall (F : ι -> β -> α), (Filter.Eventually.{u2} β (fun (x : β) => forall (i : ι), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x₀) (F i x)) (b x)) (nhds.{u2} β _inst_2 x₀)) -> (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : TopologicalSpace.{u2} β] {x₀ : β} (b : β -> Real), (Filter.Tendsto.{u2, 0} β Real b (nhds.{u2} β _inst_2 x₀) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)))) -> (forall (F : ι -> β -> α), (Filter.Eventually.{u2} β (fun (x : β) => forall (i : ι), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x₀) (F i x)) (b x)) (nhds.{u2} β _inst_2 x₀)) -> (EquicontinuousAt.{u3, u2, u1} ι β α _inst_2 (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F x₀))
Case conversion may be inaccurate. Consider using '#align metric.equicontinuous_at_of_continuity_modulus Metric.equicontinuousAt_of_continuity_modulusₓ'. -/
/-- For a family of functions to a (pseudo) metric spaces, a convenient way to prove
equicontinuity at a point is to show that all of the functions share a common *local* continuity
modulus. -/
theorem equicontinuousAt_of_continuity_modulus {ι : Type _} [TopologicalSpace β] {x₀ : β}
    (b : β → ℝ) (b_lim : Tendsto b (𝓝 x₀) (𝓝 0)) (F : ι → β → α)
    (H : ∀ᶠ x in 𝓝 x₀, ∀ i, dist (F i x₀) (F i x) ≤ b x) : EquicontinuousAt F x₀ :=
  by
  rw [Metric.equicontinuousAt_iff_right]
  intro ε ε0
  filter_upwards [b_lim (Iio_mem_nhds ε0), H]using fun x hx₁ hx₂ i => (hx₂ i).trans_lt hx₁
#align metric.equicontinuous_at_of_continuity_modulus Metric.equicontinuousAt_of_continuity_modulus

/- warning: metric.uniform_equicontinuous_of_continuity_modulus -> Metric.uniformEquicontinuous_of_continuity_modulus is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] (b : Real -> Real), (Filter.Tendsto.{0, 0} Real Real b (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))))) -> (forall (F : ι -> β -> α), (forall (x : β) (y : β) (i : ι), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x) (F i y)) (b (Dist.dist.{u2} β (PseudoMetricSpace.toHasDist.{u2} β _inst_2) x y))) -> (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2) F))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] (b : Real -> Real), (Filter.Tendsto.{0, 0} Real Real b (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)))) -> (forall (F : ι -> β -> α), (forall (x : β) (y : β) (i : ι), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x) (F i y)) (b (Dist.dist.{u2} β (PseudoMetricSpace.toDist.{u2} β _inst_2) x y))) -> (UniformEquicontinuous.{u3, u1, u2} ι α β (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2) F))
Case conversion may be inaccurate. Consider using '#align metric.uniform_equicontinuous_of_continuity_modulus Metric.uniformEquicontinuous_of_continuity_modulusₓ'. -/
/-- For a family of functions between (pseudo) metric spaces, a convenient way to prove
uniform equicontinuity is to show that all of the functions share a common *global* continuity
modulus. -/
theorem uniformEquicontinuous_of_continuity_modulus {ι : Type _} [PseudoMetricSpace β] (b : ℝ → ℝ)
    (b_lim : Tendsto b (𝓝 0) (𝓝 0)) (F : ι → β → α)
    (H : ∀ (x y : β) (i), dist (F i x) (F i y) ≤ b (dist x y)) : UniformEquicontinuous F :=
  by
  rw [Metric.uniformEquicontinuous_iff]
  intro ε ε0
  rcases tendsto_nhds_nhds.1 b_lim ε ε0 with ⟨δ, δ0, hδ⟩
  refine' ⟨δ, δ0, fun x y hxy i => _⟩
  calc
    dist (F i x) (F i y) ≤ b (dist x y) := H x y i
    _ ≤ |b (dist x y)| := (le_abs_self _)
    _ = dist (b (dist x y)) 0 := by simp [Real.dist_eq]
    _ < ε := hδ (by simpa only [Real.dist_eq, tsub_zero, abs_dist] using hxy)

#align metric.uniform_equicontinuous_of_continuity_modulus Metric.uniformEquicontinuous_of_continuity_modulus

/- warning: metric.equicontinuous_of_continuity_modulus -> Metric.equicontinuous_of_continuity_modulus is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] (b : Real -> Real), (Filter.Tendsto.{0, 0} Real Real b (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))))) -> (forall (F : ι -> β -> α), (forall (x : β) (y : β) (i : ι), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} α (PseudoMetricSpace.toHasDist.{u1} α _inst_1) (F i x) (F i y)) (b (Dist.dist.{u2} β (PseudoMetricSpace.toHasDist.{u2} β _inst_2) x y))) -> (Equicontinuous.{u3, u2, u1} ι β α (UniformSpace.toTopologicalSpace.{u2} β (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2)) (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F))
but is expected to have type
  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u1} α] {ι : Type.{u3}} [_inst_2 : PseudoMetricSpace.{u2} β] (b : Real -> Real), (Filter.Tendsto.{0, 0} Real Real b (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (nhds.{0} Real (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)))) -> (forall (F : ι -> β -> α), (forall (x : β) (y : β) (i : ι), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} α (PseudoMetricSpace.toDist.{u1} α _inst_1) (F i x) (F i y)) (b (Dist.dist.{u2} β (PseudoMetricSpace.toDist.{u2} β _inst_2) x y))) -> (Equicontinuous.{u3, u2, u1} ι β α (UniformSpace.toTopologicalSpace.{u2} β (PseudoMetricSpace.toUniformSpace.{u2} β _inst_2)) (PseudoMetricSpace.toUniformSpace.{u1} α _inst_1) F))
Case conversion may be inaccurate. Consider using '#align metric.equicontinuous_of_continuity_modulus Metric.equicontinuous_of_continuity_modulusₓ'. -/
/-- For a family of functions between (pseudo) metric spaces, a convenient way to prove
equicontinuity is to show that all of the functions share a common *global* continuity modulus. -/
theorem equicontinuous_of_continuity_modulus {ι : Type _} [PseudoMetricSpace β] (b : ℝ → ℝ)
    (b_lim : Tendsto b (𝓝 0) (𝓝 0)) (F : ι → β → α)
    (H : ∀ (x y : β) (i), dist (F i x) (F i y) ≤ b (dist x y)) : Equicontinuous F :=
  (uniformEquicontinuous_of_continuity_modulus b b_lim F H).Equicontinuous
#align metric.equicontinuous_of_continuity_modulus Metric.equicontinuous_of_continuity_modulus

end Metric


/-
Copyright (c) 2020 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import algebra.big_operators.basic
import data.nat.enat

/-!
# Big operators in `enat`

A simple lemma about sums in `enat`.
-/
open_locale big_operators
variables {α : Type*}

namespace finset
lemma sum_nat_coe_enat (s : finset α) (f : α → ℕ) :
  (∑ x in s, (f x : enat)) = (∑ x  in s, f x : ℕ) :=
(enat.coe_hom.map_sum _ _).symm

end finset


/-
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
-/

import .setup_properties
import .algorithm_properties

local attribute [instance] classical.prop_decidable

open set
open measure_theory
open well_founded

namespace stump

variables (μ: probability_measure ℍ) (target: ℍ) (n: ℕ)

lemma partition:
  ∀ θ,
  θ > 0 →
  {x : ℍ | ∀ (a: ℍ) (b: bool), (a,b) = label target x → ite b a 0 < θ}
  = - Icc θ target :=
begin
  introv h1,
  apply ext,
  intros,
  unfold Icc, unfold label, unfold rle,
  simp,
  split; intros,
  {
    simp at *, intros,
    by_contradiction, simp at a_2,
    have FOO:= a x tt _ _,
    {
      simp at FOO,
      have BAR: ¬ (θ ≤ x), simp, assumption,
      contradiction,
    },
    trivial,
    tidy,
  },
  {
    by_cases (b = tt),
    {
      rw h at *, simp, rw a_2,
      by_contradiction, simp at a_4,
      have INEQ1 := a a_4,
      have INEQ2: ¬ (x > target), {simp,tidy,},
      contradiction,
    },
    {
      simp at h, rw h at *, simp at *,
      tidy,
    },
  },
end

lemma miss_prob:
  ∀ ε, ∀ θ: nnreal, θ > 0 →
  μ (Icc θ target) ≥ ε →
  μ {x : ℍ | ∀ (a: ℍ) (b: bool), (a,b) = label target x → ite b a 0 < θ} ≤ 1 - ε:=
begin
  intros,
  rw partition,
  have STO := probability_measure.prob_comp μ (Icc θ target) _,
  have SWAP: μ (- Icc θ target) = 1 - μ (Icc θ target),
  {
    exact lc_nnreal (μ (-Icc θ target)) (μ (Icc θ target)) STO,
  },
  rw SWAP,
  {
    apply nnreal_sub_trans,
    assumption,
  },
  {
    apply is_measurable_of_is_closed,
    apply is_closed_Icc,
  },
  assumption,
end

lemma all_missed:
  ∀ ε: nnreal,
  ∀ θ: nnreal,
  μ (Ioc θ target) ≤ ε →
  {S: vec ℍ n | error μ target (choose n (label_sample target n S)) > ε} ⊆
  {S: vec ℍ n |  ∀ (i: dfin (nat.succ n)), ∀ p = label target (kth_projn S i), (if p.snd then p.fst else 0) < θ} :=
begin
  intros,
  conv {
    congr, congr, funext, rw (error_interval_1 μ target (choose n (label_sample target n S)) (choose_property_1 target n S)), skip, skip,
  },
  rw set_of_subset_set_of,
  intros,
  have QENI: not (μ (Ioc (choose n (label_sample target n a_1)) target) ≤ μ (Ioc θ target)),
  {
    simp,
    have BREAK_LEQ: μ (Ioc θ target) < ε ∨ μ (Ioc θ target) = ε,
    {
      exact lt_or_eq_of_le a,
    },
    cases BREAK_LEQ,
    transitivity ε; try {assumption,},
    rw BREAK_LEQ, assumption,
  },
  by_cases (p.snd = tt),
  {
    have PROP := choose_property_2 target n a_1 i p _ h,
    {
      rw h, simp,
      have INEQ1 := error_mono_interval μ target _ _ PROP _,
      by_contradiction, simp at a_3,
      have INEQ2 := error_mono_interval μ target _ _ a_3 _,
      have INEQ: μ (Ioc (choose n (label_sample target n a_1)) target) ≤ μ (Ioc θ target),
      {
        transitivity (μ (Ioc p.fst target)); try {assumption},
      }, clear INEQ1 INEQ2,
      contradiction,
      apply choose_property_3; try {assumption},
      {
        dunfold label_sample,
        rw ← kth_projn_map_comm,
        assumption,
      },
      apply choose_property_1,
    },
    {
      dunfold label_sample,
      rw ← kth_projn_map_comm,
      assumption,
    },
  },
  {
    simp at h, rw h, simp,
    have INEQ1': 0 ≤ choose n (label_sample target n a_1),
    {
      apply choose_property_4,
    },
    have INEQ1 := error_mono_interval μ target _ _ INEQ1' _, clear INEQ1',
    by_contradiction, simp at a_3,
    have GEN: θ ≤ 0,
    {
      exact le_of_eq a_3,
    },
    have INEQ2 := error_mono_interval μ target _ _ GEN _, clear GEN,
    have INEQ: μ (Ioc (choose n (label_sample target n a_1)) target) ≤ μ (Ioc θ target),
      {
        transitivity (μ (Ioc 0 target)); try {assumption},
      }, clear INEQ1 INEQ2,
    contradiction,
    tidy,
    apply choose_property_1,
  },
end

lemma always_succeed:
  ∀ ε: nnreal, ε > 0 → ∀ n: ℕ,
  μ (Ioc 0 target) ≤ ε →
  ∀ S: vec ℍ n, error μ target (choose n (label_sample target n S)) ≤ ε :=
begin
  intros,
  transitivity (μ (Ioc 0 target)); try {assumption},
  have HypIN := choose_property_1 target n S,
  have ERMONO := error_mono μ _ 0 (choose n (label_sample target n S)) _ HypIN,
  rw ← error_max,
  assumption,
  tidy,
end

end stump