category_theory.adjunction.commaMathlib.CategoryTheory.Adjunction.Comma

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
 -/
 import CategoryTheory.Adjunction.Basic
-import CategoryTheory.Punit
-import CategoryTheory.StructuredArrow
+import CategoryTheory.PUnit
+import CategoryTheory.Comma.StructuredArrow
 
 #align_import category_theory.adjunction.comma from "leanprover-community/mathlib"@"69c6a5a12d8a2b159f20933e60115a4f2de62b58"
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
 -/
-import Mathbin.CategoryTheory.Adjunction.Basic
-import Mathbin.CategoryTheory.Punit
-import Mathbin.CategoryTheory.StructuredArrow
+import CategoryTheory.Adjunction.Basic
+import CategoryTheory.Punit
+import CategoryTheory.StructuredArrow
 
 #align_import category_theory.adjunction.comma from "leanprover-community/mathlib"@"69c6a5a12d8a2b159f20933e60115a4f2de62b58"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
-
-! This file was ported from Lean 3 source module category_theory.adjunction.comma
-! leanprover-community/mathlib commit 69c6a5a12d8a2b159f20933e60115a4f2de62b58
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.CategoryTheory.Adjunction.Basic
 import Mathbin.CategoryTheory.Punit
 import Mathbin.CategoryTheory.StructuredArrow
 
+#align_import category_theory.adjunction.comma from "leanprover-community/mathlib"@"69c6a5a12d8a2b159f20933e60115a4f2de62b58"
+
 /-!
 # Properties of comma categories relating to adjunctions
 
Diff
@@ -43,6 +43,7 @@ section OfInitials
 
 variable [∀ A, HasInitial (StructuredArrow A G)]
 
+#print CategoryTheory.leftAdjointOfStructuredArrowInitialsAux /-
 /-- Implementation: If each structured arrow category on `G` has an initial object, an equivalence
 which is helpful for constructing a left adjoint to `G`.
 -/
@@ -64,6 +65,7 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
     let B' : structured_arrow A G := structured_arrow.mk f
     apply (comma_morphism.w (initial.to B')).symm.trans (category.id_comp _)
 #align category_theory.left_adjoint_of_structured_arrow_initials_aux CategoryTheory.leftAdjointOfStructuredArrowInitialsAux
+-/
 
 #print CategoryTheory.leftAdjointOfStructuredArrowInitials /-
 /--
@@ -100,6 +102,7 @@ section OfTerminals
 
 variable [∀ A, HasTerminal (CostructuredArrow G A)]
 
+#print CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux /-
 /-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
 which is helpful for constructing a right adjoint to `G`.
 -/
@@ -120,6 +123,7 @@ def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
     rw [this]
     rfl
 #align category_theory.right_adjoint_of_costructured_arrow_terminals_aux CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux
+-/
 
 #print CategoryTheory.rightAdjointOfCostructuredArrowTerminals /-
 /--
@@ -158,6 +162,7 @@ variable {F : C ⥤ D}
 
 attribute [local tidy] tactic.discrete_cases
 
+#print CategoryTheory.mkInitialOfLeftAdjoint /-
 /-- Given a left adjoint to `G`, we can construct an initial object in each structured arrow
 category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
@@ -170,7 +175,9 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     rw [Equiv.eq_symm_apply, adjunction.hom_equiv_unit]
     apply structured_arrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
+-/
 
+#print CategoryTheory.mkTerminalOfRightAdjoint /-
 /-- Given a right adjoint to `F`, we can construct a terminal object in each costructured arrow
 category on `F`. -/
 def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
@@ -183,6 +190,7 @@ def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
     rw [h.eq_hom_equiv_apply, adjunction.hom_equiv_counit]
     exact costructured_arrow.w m
 #align category_theory.mk_terminal_of_right_adjoint CategoryTheory.mkTerminalOfRightAdjoint
+-/
 
 end
 
Diff
@@ -43,12 +43,6 @@ section OfInitials
 
 variable [∀ A, HasInitial (StructuredArrow A G)]
 
-/- warning: category_theory.left_adjoint_of_structured_arrow_initials_aux -> CategoryTheory.leftAdjointOfStructuredArrowInitialsAux is a dubious translation:
-lean 3 declaration is
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G)] (A : C) (B : D), Equiv.{succ u2, succ u1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Comma.right.{u1, u2, u1, u1, u4, u3} (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) D _inst_2 C _inst_1 (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) G (CategoryTheory.Limits.initial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G) (_inst_3 A))) B) (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) A (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G B))
-but is expected to have type
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G)] (A : C) (B : D), Equiv.{succ u2, succ u1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Comma.right.{u1, u2, u1, u1, u4, u3} (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) D _inst_2 C _inst_1 (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) G (CategoryTheory.Limits.initial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (_inst_3 A))) B) (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) A (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) B))
-Case conversion may be inaccurate. Consider using '#align category_theory.left_adjoint_of_structured_arrow_initials_aux CategoryTheory.leftAdjointOfStructuredArrowInitialsAuxₓ'. -/
 /-- Implementation: If each structured arrow category on `G` has an initial object, an equivalence
 which is helpful for constructing a left adjoint to `G`.
 -/
@@ -106,12 +100,6 @@ section OfTerminals
 
 variable [∀ A, HasTerminal (CostructuredArrow G A)]
 
-/- warning: category_theory.right_adjoint_of_costructured_arrow_terminals_aux -> CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux is a dubious translation:
-lean 3 declaration is
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasTerminal.{max u2 u1, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.CostructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 G A)] (B : D) (A : C), Equiv.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G B) A) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) B (CategoryTheory.Comma.left.{u2, u1, u1, u4, u1, u3} D _inst_2 (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) C _inst_1 G (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) (CategoryTheory.Limits.terminal.{max u2 u1, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.CostructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 G A) (_inst_3 A))))
-but is expected to have type
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasTerminal.{max u1 u2, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.instCategoryCostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A)] (B : D) (A : C), Equiv.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) B) A) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) B (CategoryTheory.Comma.left.{u2, u1, u1, u4, u1, u3} D _inst_2 (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) C _inst_1 G (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) (CategoryTheory.Limits.terminal.{max u1 u2, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.instCategoryCostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (_inst_3 A))))
-Case conversion may be inaccurate. Consider using '#align category_theory.right_adjoint_of_costructured_arrow_terminals_aux CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAuxₓ'. -/
 /-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
 which is helpful for constructing a right adjoint to `G`.
 -/
@@ -170,12 +158,6 @@ variable {F : C ⥤ D}
 
 attribute [local tidy] tactic.discrete_cases
 
-/- warning: category_theory.mk_initial_of_left_adjoint -> CategoryTheory.mkInitialOfLeftAdjoint is a dubious translation:
-lean 3 declaration is
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : C), CategoryTheory.Limits.IsInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.mk.{u2, u1, u4, u3} D _inst_2 C _inst_1 A (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) G (CategoryTheory.NatTrans.app.{u1, u1, u3, u3} C _inst_1 C _inst_1 (CategoryTheory.Functor.id.{u1, u3} C _inst_1) (CategoryTheory.Functor.comp.{u1, u2, u1, u3, u4, u3} C _inst_1 D _inst_2 C _inst_1 F G) (CategoryTheory.Adjunction.unit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
-but is expected to have type
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : C), CategoryTheory.Limits.IsInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.mk.{u2, u1, u4, u3} D _inst_2 C _inst_1 A (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 F) A) G (CategoryTheory.NatTrans.app.{u1, u1, u3, u3} C _inst_1 C _inst_1 (CategoryTheory.Functor.id.{u1, u3} C _inst_1) (CategoryTheory.Functor.comp.{u1, u2, u1, u3, u4, u3} C _inst_1 D _inst_2 C _inst_1 F G) (CategoryTheory.Adjunction.unit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
-Case conversion may be inaccurate. Consider using '#align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjointₓ'. -/
 /-- Given a left adjoint to `G`, we can construct an initial object in each structured arrow
 category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
@@ -189,12 +171,6 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     apply structured_arrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
 
-/- warning: category_theory.mk_terminal_of_right_adjoint -> CategoryTheory.mkTerminalOfRightAdjoint is a dubious translation:
-lean 3 declaration is
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : D), CategoryTheory.Limits.IsTerminal.{max u1 u2, max u3 u2} (CategoryTheory.CostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.category.{u2, u4, u3, u1} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.mk.{u1, u2, u3, u4} C _inst_1 D _inst_2 A (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) F (CategoryTheory.NatTrans.app.{u2, u2, u4, u4} D _inst_2 D _inst_2 (CategoryTheory.Functor.comp.{u2, u1, u2, u4, u3, u4} D _inst_2 C _inst_1 D _inst_2 G F) (CategoryTheory.Functor.id.{u2, u4} D _inst_2) (CategoryTheory.Adjunction.counit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
-but is expected to have type
-  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : D), CategoryTheory.Limits.IsTerminal.{max u1 u2, max u3 u2} (CategoryTheory.CostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.instCategoryCostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.mk.{u1, u2, u3, u4} C _inst_1 D _inst_2 A (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) A) F (CategoryTheory.NatTrans.app.{u2, u2, u4, u4} D _inst_2 D _inst_2 (CategoryTheory.Functor.comp.{u2, u1, u2, u4, u3, u4} D _inst_2 C _inst_1 D _inst_2 G F) (CategoryTheory.Functor.id.{u2, u4} D _inst_2) (CategoryTheory.Adjunction.counit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
-Case conversion may be inaccurate. Consider using '#align category_theory.mk_terminal_of_right_adjoint CategoryTheory.mkTerminalOfRightAdjointₓ'. -/
 /-- Given a right adjoint to `F`, we can construct a terminal object in each costructured arrow
 category on `F`. -/
 def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
Diff
@@ -62,9 +62,7 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
     by
     let B' : structured_arrow A G := structured_arrow.mk ((⊥_ structured_arrow A G).Hom ≫ G.map g)
     let g' : ⊥_ structured_arrow A G ⟶ B' := structured_arrow.hom_mk g rfl
-    have : initial.to _ = g' := by
-      apply colimit.hom_ext
-      rintro ⟨⟨⟩⟩
+    have : initial.to _ = g' := by apply colimit.hom_ext; rintro ⟨⟨⟩⟩
     change comma_morphism.right (initial.to B') = _
     rw [this]
     rfl
@@ -129,9 +127,7 @@ def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
     let B' : costructured_arrow G A :=
       costructured_arrow.mk (G.map g ≫ (⊤_ costructured_arrow G A).Hom)
     let g' : B' ⟶ ⊤_ costructured_arrow G A := costructured_arrow.hom_mk g rfl
-    have : terminal.from _ = g' := by
-      apply limit.hom_ext
-      rintro ⟨⟨⟩⟩
+    have : terminal.from _ = g' := by apply limit.hom_ext; rintro ⟨⟨⟩⟩
     change comma_morphism.left (terminal.from B') = _
     rw [this]
     rfl
@@ -144,9 +140,7 @@ It is shown that it is a right adjoint in `adjunction_of_structured_arrow_initia
 -/
 def rightAdjointOfCostructuredArrowTerminals : C ⥤ D :=
   Adjunction.rightAdjointOfEquiv (rightAdjointOfCostructuredArrowTerminalsAux G) fun B₁ B₂ A f g =>
-    by
-    rw [← Equiv.eq_symm_apply]
-    simp
+    by rw [← Equiv.eq_symm_apply]; simp
 #align category_theory.right_adjoint_of_costructured_arrow_terminals CategoryTheory.rightAdjointOfCostructuredArrowTerminals
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
 
 ! This file was ported from Lean 3 source module category_theory.adjunction.comma
-! leanprover-community/mathlib commit 8a318021995877a44630c898d0b2bc376fceef3b
+! leanprover-community/mathlib commit 69c6a5a12d8a2b159f20933e60115a4f2de62b58
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.CategoryTheory.StructuredArrow
 /-!
 # Properties of comma categories relating to adjunctions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file shows that for a functor `G : D ⥤ C` the data of an initial object in each
 `structured_arrow` category on `G` is equivalent to a left adjoint to `G`, as well as the dual.
 
Diff
@@ -40,6 +40,12 @@ section OfInitials
 
 variable [∀ A, HasInitial (StructuredArrow A G)]
 
+/- warning: category_theory.left_adjoint_of_structured_arrow_initials_aux -> CategoryTheory.leftAdjointOfStructuredArrowInitialsAux is a dubious translation:
+lean 3 declaration is
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G)] (A : C) (B : D), Equiv.{succ u2, succ u1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Comma.right.{u1, u2, u1, u1, u4, u3} (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) D _inst_2 C _inst_1 (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) G (CategoryTheory.Limits.initial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G) (_inst_3 A))) B) (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) A (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G B))
+but is expected to have type
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G)] (A : C) (B : D), Equiv.{succ u2, succ u1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Comma.right.{u1, u2, u1, u1, u4, u3} (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) D _inst_2 C _inst_1 (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) G (CategoryTheory.Limits.initial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (_inst_3 A))) B) (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) A (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) B))
+Case conversion may be inaccurate. Consider using '#align category_theory.left_adjoint_of_structured_arrow_initials_aux CategoryTheory.leftAdjointOfStructuredArrowInitialsAuxₓ'. -/
 /-- Implementation: If each structured arrow category on `G` has an initial object, an equivalence
 which is helpful for constructing a left adjoint to `G`.
 -/
@@ -64,6 +70,7 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
     apply (comma_morphism.w (initial.to B')).symm.trans (category.id_comp _)
 #align category_theory.left_adjoint_of_structured_arrow_initials_aux CategoryTheory.leftAdjointOfStructuredArrowInitialsAux
 
+#print CategoryTheory.leftAdjointOfStructuredArrowInitials /-
 /--
 If each structured arrow category on `G` has an initial object, construct a left adjoint to `G`. It
 is shown that it is a left adjoint in `adjunction_of_structured_arrow_initials`.
@@ -71,7 +78,9 @@ is shown that it is a left adjoint in `adjunction_of_structured_arrow_initials`.
 def leftAdjointOfStructuredArrowInitials : C ⥤ D :=
   Adjunction.leftAdjointOfEquiv (leftAdjointOfStructuredArrowInitialsAux G) fun _ _ => by simp
 #align category_theory.left_adjoint_of_structured_arrow_initials CategoryTheory.leftAdjointOfStructuredArrowInitials
+-/
 
+#print CategoryTheory.adjunctionOfStructuredArrowInitials /-
 /--
 If each structured arrow category on `G` has an initial object, we have a constructed left adjoint
 to `G`.
@@ -79,13 +88,16 @@ to `G`.
 def adjunctionOfStructuredArrowInitials : leftAdjointOfStructuredArrowInitials G ⊣ G :=
   Adjunction.adjunctionOfEquivLeft _ _
 #align category_theory.adjunction_of_structured_arrow_initials CategoryTheory.adjunctionOfStructuredArrowInitials
+-/
 
+#print CategoryTheory.isRightAdjointOfStructuredArrowInitials /-
 /-- If each structured arrow category on `G` has an initial object, `G` is a right adjoint. -/
 def isRightAdjointOfStructuredArrowInitials : IsRightAdjoint G
     where
   left := _
   adj := adjunctionOfStructuredArrowInitials G
 #align category_theory.is_right_adjoint_of_structured_arrow_initials CategoryTheory.isRightAdjointOfStructuredArrowInitials
+-/
 
 end OfInitials
 
@@ -93,6 +105,12 @@ section OfTerminals
 
 variable [∀ A, HasTerminal (CostructuredArrow G A)]
 
+/- warning: category_theory.right_adjoint_of_costructured_arrow_terminals_aux -> CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux is a dubious translation:
+lean 3 declaration is
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasTerminal.{max u2 u1, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.CostructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 G A)] (B : D) (A : C), Equiv.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G B) A) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) B (CategoryTheory.Comma.left.{u2, u1, u1, u4, u1, u3} D _inst_2 (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) C _inst_1 G (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) (CategoryTheory.Limits.terminal.{max u2 u1, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.CostructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 G A) (_inst_3 A))))
+but is expected to have type
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) [_inst_3 : forall (A : C), CategoryTheory.Limits.HasTerminal.{max u1 u2, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.instCategoryCostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A)] (B : D) (A : C), Equiv.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) B) A) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) B (CategoryTheory.Comma.left.{u2, u1, u1, u4, u1, u3} D _inst_2 (CategoryTheory.Discrete.{u1} PUnit.{succ u1}) (CategoryTheory.discreteCategory.{u1} PUnit.{succ u1}) C _inst_1 G (CategoryTheory.Functor.fromPUnit.{u1, u3} C _inst_1 A) (CategoryTheory.Limits.terminal.{max u1 u2, max u4 u1} (CategoryTheory.CostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (CategoryTheory.instCategoryCostructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) (_inst_3 A))))
+Case conversion may be inaccurate. Consider using '#align category_theory.right_adjoint_of_costructured_arrow_terminals_aux CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAuxₓ'. -/
 /-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
 which is helpful for constructing a right adjoint to `G`.
 -/
@@ -116,6 +134,7 @@ def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
     rfl
 #align category_theory.right_adjoint_of_costructured_arrow_terminals_aux CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux
 
+#print CategoryTheory.rightAdjointOfCostructuredArrowTerminals /-
 /--
 If each costructured arrow category on `G` has a terminal object, construct a right adjoint to `G`.
 It is shown that it is a right adjoint in `adjunction_of_structured_arrow_initials`.
@@ -126,20 +145,25 @@ def rightAdjointOfCostructuredArrowTerminals : C ⥤ D :=
     rw [← Equiv.eq_symm_apply]
     simp
 #align category_theory.right_adjoint_of_costructured_arrow_terminals CategoryTheory.rightAdjointOfCostructuredArrowTerminals
+-/
 
+#print CategoryTheory.adjunctionOfCostructuredArrowTerminals /-
 /-- If each costructured arrow category on `G` has a terminal object, we have a constructed right
 adjoint to `G`.
 -/
 def adjunctionOfCostructuredArrowTerminals : G ⊣ rightAdjointOfCostructuredArrowTerminals G :=
   Adjunction.adjunctionOfEquivRight _ _
 #align category_theory.adjunction_of_costructured_arrow_terminals CategoryTheory.adjunctionOfCostructuredArrowTerminals
+-/
 
+#print CategoryTheory.isLeftAdjointOfCostructuredArrowTerminals /-
 /-- If each costructured arrow category on `G` has an terminal object, `G` is a left adjoint. -/
 def isLeftAdjointOfCostructuredArrowTerminals : IsLeftAdjoint G
     where
   right := rightAdjointOfCostructuredArrowTerminals G
   adj := Adjunction.adjunctionOfEquivRight _ _
 #align category_theory.is_left_adjoint_of_costructured_arrow_terminals CategoryTheory.isLeftAdjointOfCostructuredArrowTerminals
+-/
 
 end OfTerminals
 
@@ -149,6 +173,12 @@ variable {F : C ⥤ D}
 
 attribute [local tidy] tactic.discrete_cases
 
+/- warning: category_theory.mk_initial_of_left_adjoint -> CategoryTheory.mkInitialOfLeftAdjoint is a dubious translation:
+lean 3 declaration is
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : C), CategoryTheory.Limits.IsInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.category.{u1, u3, u4, u2} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.mk.{u2, u1, u4, u3} D _inst_2 C _inst_1 A (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) G (CategoryTheory.NatTrans.app.{u1, u1, u3, u3} C _inst_1 C _inst_1 (CategoryTheory.Functor.id.{u1, u3} C _inst_1) (CategoryTheory.Functor.comp.{u1, u2, u1, u3, u4, u3} C _inst_1 D _inst_2 C _inst_1 F G) (CategoryTheory.Adjunction.unit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
+but is expected to have type
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : C), CategoryTheory.Limits.IsInitial.{max u1 u2, max u4 u1} (CategoryTheory.StructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.instCategoryStructuredArrow.{u2, u1, u4, u3} D _inst_2 C _inst_1 A G) (CategoryTheory.StructuredArrow.mk.{u2, u1, u4, u3} D _inst_2 C _inst_1 A (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 F) A) G (CategoryTheory.NatTrans.app.{u1, u1, u3, u3} C _inst_1 C _inst_1 (CategoryTheory.Functor.id.{u1, u3} C _inst_1) (CategoryTheory.Functor.comp.{u1, u2, u1, u3, u4, u3} C _inst_1 D _inst_2 C _inst_1 F G) (CategoryTheory.Adjunction.unit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
+Case conversion may be inaccurate. Consider using '#align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjointₓ'. -/
 /-- Given a left adjoint to `G`, we can construct an initial object in each structured arrow
 category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
@@ -162,6 +192,12 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     apply structured_arrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
 
+/- warning: category_theory.mk_terminal_of_right_adjoint -> CategoryTheory.mkTerminalOfRightAdjoint is a dubious translation:
+lean 3 declaration is
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : D), CategoryTheory.Limits.IsTerminal.{max u1 u2, max u3 u2} (CategoryTheory.CostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.category.{u2, u4, u3, u1} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.mk.{u1, u2, u3, u4} C _inst_1 D _inst_2 A (CategoryTheory.Functor.obj.{u2, u1, u4, u3} D _inst_2 C _inst_1 G A) F (CategoryTheory.NatTrans.app.{u2, u2, u4, u4} D _inst_2 D _inst_2 (CategoryTheory.Functor.comp.{u2, u1, u2, u4, u3, u4} D _inst_2 C _inst_1 D _inst_2 G F) (CategoryTheory.Functor.id.{u2, u4} D _inst_2) (CategoryTheory.Adjunction.counit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
+but is expected to have type
+  forall {C : Type.{u3}} {D : Type.{u4}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u2, u1, u4, u3} D _inst_2 C _inst_1) {F : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2} (h : CategoryTheory.Adjunction.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G) (A : D), CategoryTheory.Limits.IsTerminal.{max u1 u2, max u3 u2} (CategoryTheory.CostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.instCategoryCostructuredArrow.{u1, u2, u3, u4} C _inst_1 D _inst_2 F A) (CategoryTheory.CostructuredArrow.mk.{u1, u2, u3, u4} C _inst_1 D _inst_2 A (Prefunctor.obj.{succ u2, succ u1, u4, u3} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u1, u4, u3} D _inst_2 C _inst_1 G) A) F (CategoryTheory.NatTrans.app.{u2, u2, u4, u4} D _inst_2 D _inst_2 (CategoryTheory.Functor.comp.{u2, u1, u2, u4, u3, u4} D _inst_2 C _inst_1 D _inst_2 G F) (CategoryTheory.Functor.id.{u2, u4} D _inst_2) (CategoryTheory.Adjunction.counit.{u1, u2, u3, u4} C _inst_1 D _inst_2 F G h) A))
+Case conversion may be inaccurate. Consider using '#align category_theory.mk_terminal_of_right_adjoint CategoryTheory.mkTerminalOfRightAdjointₓ'. -/
 /-- Given a right adjoint to `F`, we can construct a terminal object in each costructured arrow
 category on `F`. -/
 def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
@@ -177,17 +213,21 @@ def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
 
 end
 
+#print CategoryTheory.nonempty_isRightAdjoint_iff_hasInitial_structuredArrow /-
 theorem nonempty_isRightAdjoint_iff_hasInitial_structuredArrow {G : D ⥤ C} :
     Nonempty (IsRightAdjoint G) ↔ ∀ A, HasInitial (StructuredArrow A G) :=
   ⟨fun ⟨h⟩ A => (mk_initial_of_left_adjoint _ h.adj A).HasInitial, fun h =>
     ⟨is_right_adjoint_of_structured_arrow_initials _⟩⟩
 #align category_theory.nonempty_is_right_adjoint_iff_has_initial_structured_arrow CategoryTheory.nonempty_isRightAdjoint_iff_hasInitial_structuredArrow
+-/
 
+#print CategoryTheory.nonempty_isLeftAdjoint_iff_hasTerminal_costructuredArrow /-
 theorem nonempty_isLeftAdjoint_iff_hasTerminal_costructuredArrow {F : C ⥤ D} :
     Nonempty (IsLeftAdjoint F) ↔ ∀ A, HasTerminal (CostructuredArrow F A) :=
   ⟨fun ⟨h⟩ A => (mk_terminal_of_right_adjoint _ h.adj A).HasTerminal, fun h =>
     ⟨is_left_adjoint_of_costructured_arrow_terminals _⟩⟩
 #align category_theory.nonempty_is_left_adjoint_iff_has_terminal_costructured_arrow CategoryTheory.nonempty_isLeftAdjoint_iff_hasTerminal_costructuredArrow
+-/
 
 end CategoryTheory
 
Diff
@@ -154,7 +154,7 @@ category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     IsInitial (StructuredArrow.mk (h.Unit.app A) : StructuredArrow A G)
     where
-  desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.x.Hom) (by tidy)
+  desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.pt.Hom) (by tidy)
   uniq s m w := by
     ext
     dsimp
@@ -167,7 +167,7 @@ category on `F`. -/
 def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
     IsTerminal (CostructuredArrow.mk (h.counit.app A) : CostructuredArrow F A)
     where
-  lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.x.Hom) (by tidy)
+  lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.pt.Hom) (by tidy)
   uniq s m w := by
     ext
     dsimp
Diff
@@ -155,7 +155,7 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     IsInitial (StructuredArrow.mk (h.Unit.app A) : StructuredArrow A G)
     where
   desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.x.Hom) (by tidy)
-  uniq' s m w := by
+  uniq s m w := by
     ext
     dsimp
     rw [Equiv.eq_symm_apply, adjunction.hom_equiv_unit]
@@ -168,7 +168,7 @@ def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
     IsTerminal (CostructuredArrow.mk (h.counit.app A) : CostructuredArrow F A)
     where
   lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.x.Hom) (by tidy)
-  uniq' s m w := by
+  uniq s m w := by
     ext
     dsimp
     rw [h.eq_hom_equiv_apply, adjunction.hom_equiv_counit]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
 
 ! This file was ported from Lean 3 source module category_theory.adjunction.comma
-! leanprover-community/mathlib commit 18302a460eb6a071cf0bfe11a4df025c8f8af244
+! leanprover-community/mathlib commit 8a318021995877a44630c898d0b2bc376fceef3b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -59,11 +59,8 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
     change comma_morphism.right (initial.to B') = _
     rw [this]
     rfl
-  right_inv f :=
-    by
-    let B' : structured_arrow A G :=
-      { right := B
-        Hom := f }
+  right_inv f := by
+    let B' : structured_arrow A G := structured_arrow.mk f
     apply (comma_morphism.w (initial.to B')).symm.trans (category.id_comp _)
 #align category_theory.left_adjoint_of_structured_arrow_initials_aux CategoryTheory.leftAdjointOfStructuredArrowInitialsAux
 

Changes in mathlib4

mathlib3
mathlib4
refactor: create folder CategoryTheory/Comma (#10108)
Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
 -/
 import Mathlib.CategoryTheory.Adjunction.Basic
+import Mathlib.CategoryTheory.Comma.StructuredArrow
 import Mathlib.CategoryTheory.PUnit
-import Mathlib.CategoryTheory.StructuredArrow
 
 #align_import category_theory.adjunction.comma from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b"
 
fix: attribute [simp] ... in -> attribute [local simp] ... in (#7678)

Mathlib.Logic.Unique contains the line attribute [simp] eq_iff_true_of_subsingleton in ...:

https://github.com/leanprover-community/mathlib4/blob/96a11c7aac574c00370c2b3dab483cb676405c5d/Mathlib/Logic/Unique.lean#L255-L256

Despite what the in part may imply, this adds the lemma to the simp set "globally", including for downstream files; it is likely that attribute [local simp] eq_iff_true_of_subsingleton in ... was meant instead (or maybe scoped simp, but I think "scoped" refers to the current namespace). Indeed, the relevant lemma is not marked with @[simp] for possible slowness: https://github.com/leanprover/std4/blob/846e9e1d6bb534774d1acd2dc430e70987da3c18/Std/Logic.lean#L749. Adding it to the simp set causes the example at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Regression.20in.20simp to slow down.

This PR changes this and fixes the relevant downstream simps. There was also one ocurrence of attribute [simp] FullSubcategory.comp_def FullSubcategory.id_def in in Mathlib.CategoryTheory.Monoidal.Subcategory but that was much easier to fix.

https://github.com/leanprover-community/mathlib4/blob/bc49eb9ba756a233370b4b68bcdedd60402f71ed/Mathlib/CategoryTheory/Monoidal/Subcategory.lean#L118-L119

Diff
@@ -37,6 +37,7 @@ section OfInitials
 
 variable [∀ A, HasInitial (StructuredArrow A G)]
 
+attribute [local simp] eq_iff_true_of_subsingleton in
 /-- Implementation: If each structured arrow category on `G` has an initial object, an equivalence
 which is helpful for constructing a left adjoint to `G`.
 -/
@@ -87,6 +88,7 @@ section OfTerminals
 
 variable [∀ A, HasTerminal (CostructuredArrow G A)]
 
+attribute [local simp] eq_iff_true_of_subsingleton in
 /-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
 which is helpful for constructing a right adjoint to `G`.
 -/
Revert "chore: revert #7703 (#7710)"

This reverts commit f3695eb2.

Diff
@@ -147,7 +147,8 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
   uniq s m _ := by
     apply StructuredArrow.ext
     dsimp
-    rw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
+    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+    erw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
     apply StructuredArrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
 
chore: revert #7703 (#7710)

This reverts commit 26eb2b0a.

Diff
@@ -147,8 +147,7 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
   uniq s m _ := by
     apply StructuredArrow.ext
     dsimp
-    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-    erw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
+    rw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
     apply StructuredArrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
 
chore: bump toolchain to v4.2.0-rc2 (#7703)

This includes all the changes from #7606.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -147,7 +147,8 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
   uniq s m _ := by
     apply StructuredArrow.ext
     dsimp
-    rw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
+    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+    erw [Equiv.eq_symm_apply, Adjunction.homEquiv_unit]
     apply StructuredArrow.w m
 #align category_theory.mk_initial_of_left_adjoint CategoryTheory.mkInitialOfLeftAdjoint
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta
-
-! This file was ported from Lean 3 source module category_theory.adjunction.comma
-! leanprover-community/mathlib commit 8a318021995877a44630c898d0b2bc376fceef3b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.CategoryTheory.Adjunction.Basic
 import Mathlib.CategoryTheory.PUnit
 import Mathlib.CategoryTheory.StructuredArrow
 
+#align_import category_theory.adjunction.comma from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b"
+
 /-!
 # Properties of comma categories relating to adjunctions
 
feat: add Aesop rules for Discrete category (#2519)

Adds a global Aesop cases rule for the Discrete category. This rule was previously added locally in several places.

Diff
@@ -141,8 +141,6 @@ section
 
 variable {F : C ⥤ D}
 
-attribute [local aesop safe cases (rule_sets [CategoryTheory])] Discrete
-
 /-- Given a left adjoint to `G`, we can construct an initial object in each structured arrow
 category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
feat: more consistent use of ext, and updating porting notes. (#5242)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -52,9 +52,7 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
   left_inv g := by
     let B' : StructuredArrow A G := StructuredArrow.mk ((⊥_ StructuredArrow A G).hom ≫ G.map g)
     let g' : ⊥_ StructuredArrow A G ⟶ B' := StructuredArrow.homMk g rfl
-    have : initial.to _ = g' := by
-      apply colimit.hom_ext
-      rintro ⟨⟨⟩⟩
+    have : initial.to _ = g' := by aesop_cat
     change CommaMorphism.right (initial.to B') = _
     rw [this]
     rfl
@@ -106,9 +104,7 @@ def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
     let B' : CostructuredArrow G A :=
       CostructuredArrow.mk (G.map g ≫ (⊤_ CostructuredArrow G A).hom)
     let g' : B' ⟶ ⊤_ CostructuredArrow G A := CostructuredArrow.homMk g rfl
-    have : terminal.from _ = g' := by
-      apply limit.hom_ext
-      rintro ⟨⟨⟩⟩
+    have : terminal.from _ = g' := by aesop_cat
     change CommaMorphism.left (terminal.from B') = _
     rw [this]
     rfl
chore: fix grammar 1/3 (#5001)

All of these are doc fixes

Diff
@@ -132,7 +132,7 @@ def adjunctionOfCostructuredArrowTerminals : G ⊣ rightAdjointOfCostructuredArr
   Adjunction.adjunctionOfEquivRight _ _
 #align category_theory.adjunction_of_costructured_arrow_terminals CategoryTheory.adjunctionOfCostructuredArrowTerminals
 
-/-- If each costructured arrow category on `G` has an terminal object, `G` is a left adjoint. -/
+/-- If each costructured arrow category on `G` has a terminal object, `G` is a left adjoint. -/
 def isLeftAdjointOfCostructuredArrowTerminals : IsLeftAdjoint G
     where
   right := rightAdjointOfCostructuredArrowTerminals G
chore: review of automation in category theory (#4793)

Clean up of automation in the category theory library. Leaving out unnecessary proof steps, or fields done by aesop_cat, and making more use of available autoparameters.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -152,7 +152,7 @@ category on `G`. -/
 def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     IsInitial (StructuredArrow.mk (h.unit.app A) : StructuredArrow A G)
     where
-  desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.pt.hom) (by aesop_cat)
+  desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.pt.hom)
   uniq s m _ := by
     apply StructuredArrow.ext
     dsimp
@@ -165,7 +165,7 @@ category on `F`. -/
 def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
     IsTerminal (CostructuredArrow.mk (h.counit.app A) : CostructuredArrow F A)
     where
-  lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.pt.hom) (by aesop_cat)
+  lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.pt.hom)
   uniq s m _ := by
     apply CostructuredArrow.ext
     dsimp
chore: cleanup Discrete porting notes (#4780)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -145,8 +145,7 @@ section
 
 variable {F : C ⥤ D}
 
--- porting note: aesop can't seem to add something locally. Also no tactic.discrete_cases.
--- attribute [local tidy] tactic.discrete_cases
+attribute [local aesop safe cases (rule_sets [CategoryTheory])] Discrete
 
 /-- Given a left adjoint to `G`, we can construct an initial object in each structured arrow
 category on `G`. -/
@@ -154,7 +153,6 @@ def mkInitialOfLeftAdjoint (h : F ⊣ G) (A : C) :
     IsInitial (StructuredArrow.mk (h.unit.app A) : StructuredArrow A G)
     where
   desc B := StructuredArrow.homMk ((h.homEquiv _ _).symm B.pt.hom) (by aesop_cat)
-  fac _ := by rintro ⟨⟨⟩⟩
   uniq s m _ := by
     apply StructuredArrow.ext
     dsimp
@@ -168,7 +166,6 @@ def mkTerminalOfRightAdjoint (h : F ⊣ G) (A : D) :
     IsTerminal (CostructuredArrow.mk (h.counit.app A) : CostructuredArrow F A)
     where
   lift B := CostructuredArrow.homMk (h.homEquiv _ _ B.pt.hom) (by aesop_cat)
-  fac _ := by rintro ⟨⟨⟩⟩
   uniq s m _ := by
     apply CostructuredArrow.ext
     dsimp
chore: bye-bye, solo bys! (#3825)

This PR puts, with one exception, every single remaining by that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh. The exception is when the by begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.

Essentially this is s/\n *by$/ by/g, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated bys".

Diff
@@ -49,8 +49,7 @@ def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
     where
   toFun g := (⊥_ StructuredArrow A G).hom ≫ G.map g
   invFun f := CommaMorphism.right (initial.to (StructuredArrow.mk f))
-  left_inv g :=
-    by
+  left_inv g := by
     let B' : StructuredArrow A G := StructuredArrow.mk ((⊥_ StructuredArrow A G).hom ≫ G.map g)
     let g' : ⊥_ StructuredArrow A G ⟶ B' := StructuredArrow.homMk g rfl
     have : initial.to _ = g' := by
@@ -103,8 +102,7 @@ def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
   toFun g := CommaMorphism.left (terminal.from (CostructuredArrow.mk g))
   invFun g := G.map g ≫ (⊤_ CostructuredArrow G A).hom
   left_inv := by aesop_cat
-  right_inv g :=
-    by
+  right_inv g := by
     let B' : CostructuredArrow G A :=
       CostructuredArrow.mk (G.map g ≫ (⊤_ CostructuredArrow G A).hom)
     let g' : B' ⟶ ⊤_ CostructuredArrow G A := CostructuredArrow.homMk g rfl
@@ -121,8 +119,8 @@ If each costructured arrow category on `G` has a terminal object, construct a ri
 It is shown that it is a right adjoint in `adjunctionOfStructuredArrowInitials`.
 -/
 def rightAdjointOfCostructuredArrowTerminals : C ⥤ D :=
-  Adjunction.rightAdjointOfEquiv (rightAdjointOfCostructuredArrowTerminalsAux G) fun B₁ B₂ A f g =>
-    by
+  Adjunction.rightAdjointOfEquiv (rightAdjointOfCostructuredArrowTerminalsAux G)
+      fun B₁ B₂ A f g => by
     rw [← Equiv.eq_symm_apply]
     simp
 #align category_theory.right_adjoint_of_costructured_arrow_terminals CategoryTheory.rightAdjointOfCostructuredArrowTerminals
feat: port CategoryTheory.Adjunction.Comma (#2591)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: adamtopaz <github@adamtopaz.com>

Dependencies 106

107 files ported (100.0%)
40352 lines ported (100.0%)

All dependencies are ported!