l3lab/ntp-mathlib huggingface dataset:
/-- The homset equivalence which helps show that `R` is a right adjoint. -/
@[simps!] -- Porting note: Originally `@[simps (config := { rhsMd := semireducible })]`
noncomputable def constructLeftAdjointEquiv [∀ X : B, RegularEpi (adj₁.counit.app X)] (Y : A)
    (X : B) : (constructLeftAdjointObj _ _ adj₁ adj₂ X ⟶ Y) ≃ (X ⟶ R.obj Y) :=
  calc
    (constructLeftAdjointObj _ _ adj₁ adj₂ X ⟶ Y) ≃
        { f : F'.obj (U.obj X) ⟶ Y //
          F'.map (U.map (adj₁.counit.app X)) ≫ f = otherMap _ _ adj₁ adj₂ _ ≫ f } :=
      Cofork.IsColimit.homIso (colimit.isColimit _) _
    _ ≃ { g : U.obj X ⟶ U.obj (R.obj Y) //
          U.map (F.map g ≫ adj₁.counit.app _) = U.map (adj₁.counit.app _) ≫ g } := by
      apply (adj₂.homEquiv _ _).subtypeEquiv _
      intro f
      rw [← (adj₂.homEquiv _ _).injective.eq_iff, eq_comm, adj₂.homEquiv_naturality_left,
        otherMap, assoc, adj₂.homEquiv_naturality_left, ← adj₂.counit_naturality,
        adj₂.homEquiv_naturality_left, adj₂.homEquiv_unit, adj₂.right_triangle_components,
        comp_id, Functor.comp_map, ← U.map_comp, assoc, ← adj₁.counit_naturality,
        adj₂.homEquiv_unit, adj₂.homEquiv_unit, F.map_comp, assoc]
      rfl
    _ ≃ { z : F.obj (U.obj X) ⟶ R.obj Y // _ } := by
      apply (adj₁.homEquiv _ _).symm.subtypeEquiv
      intro g
      rw [← (adj₁.homEquiv _ _).symm.injective.eq_iff, adj₁.homEquiv_counit,
        adj₁.homEquiv_counit, adj₁.homEquiv_counit, F.map_comp, assoc, U.map_comp, F.map_comp,
        assoc, adj₁.counit_naturality, adj₁.counit_naturality_assoc]
      

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
Y : A
X : B
g : U.obj X ⟶ U.obj (R.obj Y)
⊢ adj₁.counit.app (F.obj (U.obj X)) ≫ F.map g ≫ adj₁.counit.app (R.obj Y) =
      F.map (U.map (adj₁.counit.app X)) ≫ F.map g ≫ adj₁.counit.app ((𝟭 B).obj (R.obj Y)) ↔
    F.map (U.map (adj₁.counit.app X)) ≫ F.map g ≫ adj₁.counit.app (R.obj Y) =
      adj₁.counit.app (F.obj (U.obj X)) ≫ F.map g ≫ adj₁.counit.app (R.obj Y)

Next tactic:
apply eq_comm
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
⊢ B ⥤ A

Next tactic:
refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
⊢ ∀ (X : B) (Y Y' : A) (g : Y ⟶ Y') (h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y),
    ((fun X Y => constructLeftAdjointEquiv R F' adj₁ adj₂ Y X) X Y') (h ≫ g) =
      ((fun X Y => constructLeftAdjointEquiv R F' adj₁ adj₂ Y X) X Y) h ≫ R.map g

Next tactic:
intro X Y Y' g h
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ ((fun X Y => constructLeftAdjointEquiv R F' adj₁ adj₂ Y X) X Y') (h ≫ g) =
    ((fun X Y => constructLeftAdjointEquiv R F' adj₁ adj₂ Y X) X Y) h ≫ R.map g

Next tactic:
rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ ↑{
        val :=
          F.map
              ((Adjunction.homEquiv adj₂ (U.obj X) Y')
                ↑((Cofork.IsColimit.homIso
                      (colimit.isColimit
                        (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                      Y')
                    (h ≫ g))) ≫
            adj₁.counit.app (R.obj Y'),
        property :=
          (_ :
            (fun b => F.map (U.map (adj₁.counit.app X)) ≫ b = adj₁.counit.app (F.obj (U.obj X)) ≫ b)
              (F.map
                  ((Adjunction.homEquiv adj₂ (U.obj X) Y')
                    ↑((Cofork.IsColimit.homIso
                          (colimit.isColimit
                            (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                          Y')
                        (h ≫ g))) ≫
                adj₁.counit.app (R.obj Y'))) } =
    ↑((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y'))
        ((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y)).symm
            {
              val :=
                F.map
                    ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                      ↑((Cofork.IsColimit.homIso
                            (colimit.isColimit
                              (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                            Y)
                          h)) ≫
                  adj₁.counit.app (R.obj Y),
              property :=
                (_ :
                  (fun b => F.map (U.map (adj₁.counit.app X)) ≫ b = adj₁.counit.app (F.obj (U.obj X)) ≫ b)
                    (F.map
                        ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                          ↑((Cofork.IsColimit.homIso
                                (colimit.isColimit
                                  (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                Y)
                              h)) ≫
                      adj₁.counit.app (R.obj Y))) } ≫
          R.map g))

Next tactic:
dsimp
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
  dsimp
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ F.map
        ((Adjunction.homEquiv adj₂ (U.obj X) Y')
          ↑((Cofork.IsColimit.homIso
                (colimit.isColimit (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X))) Y')
              (h ≫ g))) ≫
      adj₁.counit.app (R.obj Y') =
    ↑((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y'))
        ((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y)).symm
            {
              val :=
                F.map
                    ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                      ↑((Cofork.IsColimit.homIso
                            (colimit.isColimit
                              (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                            Y)
                          h)) ≫
                  adj₁.counit.app (R.obj Y),
              property :=
                (_ :
                  F.map (U.map (adj₁.counit.app X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y) =
                    adj₁.counit.app (F.obj (U.obj X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y)) } ≫
          R.map g))

Next tactic:
erw [Cofork.IsColimit.homIso_natural, Cofork.IsColimit.homIso_natural]
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
  dsimp
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [Cofork.IsColimit.homIso_natural, Cofork.IsColimit.homIso_natural]
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ F.map
        ((Adjunction.homEquiv adj₂ (U.obj X) Y')
          (↑((Cofork.IsColimit.homIso
                  (colimit.isColimit (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X))) Y)
                h) ≫
            g)) ≫
      adj₁.counit.app (R.obj Y') =
    ↑((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y))
          ((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y)).symm
            {
              val :=
                F.map
                    ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                      ↑((Cofork.IsColimit.homIso
                            (colimit.isColimit
                              (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                            Y)
                          h)) ≫
                  adj₁.counit.app (R.obj Y),
              property :=
                (_ :
                  F.map (U.map (adj₁.counit.app X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y) =
                    adj₁.counit.app (F.obj (U.obj X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y)) })) ≫
      R.map g

Next tactic:
erw [adj₂.homEquiv_naturality_right]
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
  dsimp
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [Cofork.IsColimit.homIso_natural, Cofork.IsColimit.homIso_natural]
  erw [adj₂.homEquiv_naturality_right]
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ F.map
        ((Adjunction.homEquiv adj₂ (U.obj X) Y)
            ↑((Cofork.IsColimit.homIso
                  (colimit.isColimit (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X))) Y)
                h) ≫
          (R ⋙ U).map g) ≫
      adj₁.counit.app (R.obj Y') =
    ↑((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y))
          ((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y)).symm
            {
              val :=
                F.map
                    ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                      ↑((Cofork.IsColimit.homIso
                            (colimit.isColimit
                              (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                            Y)
                          h)) ≫
                  adj₁.counit.app (R.obj Y),
              property :=
                (_ :
                  F.map (U.map (adj₁.counit.app X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y) =
                    adj₁.counit.app (F.obj (U.obj X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y)) })) ≫
      R.map g

Next tactic:
simp_rw [Functor.comp_map]
/-- Construct the left adjoint to `R`, with object map `constructLeftAdjointObj`. -/
noncomputable def constructLeftAdjoint [∀ X : B, RegularEpi (adj₁.counit.app X)] : B ⥤ A := by
  refine' Adjunction.leftAdjointOfEquiv (fun X Y => constructLeftAdjointEquiv R _ adj₁ adj₂ Y X) _
  intro X Y Y' g h
  rw [constructLeftAdjointEquiv_apply, constructLeftAdjointEquiv_apply,
    Equiv.symm_apply_eq, Subtype.ext_iff]
  dsimp
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [Cofork.IsColimit.homIso_natural, Cofork.IsColimit.homIso_natural]
  erw [adj₂.homEquiv_naturality_right]
  simp_rw [Functor.comp_map]
  -- This used to be `simp`, but we need `aesop_cat` after leanprover/lean4#2644
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁴ : Category.{v₁, u₁} A
inst✝³ : Category.{v₂, u₂} B
inst✝² : Category.{v₃, u₃} C
U : B ⥤ C
F : C ⥤ B
R : A ⥤ B
F' : C ⥤ A
adj₁ : F ⊣ U
adj₂ : F' ⊣ R ⋙ U
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : (X : B) → RegularEpi (adj₁.counit.app X)
X : B
Y Y' : A
g : Y ⟶ Y'
h : constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y
⊢ F.map
        ((Adjunction.homEquiv adj₂ (U.obj X) Y)
            ↑((Cofork.IsColimit.homIso
                  (colimit.isColimit (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X))) Y)
                h) ≫
          U.map (R.map g)) ≫
      adj₁.counit.app (R.obj Y') =
    ↑((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y))
          ((Cofork.IsColimit.homIso (counitCoequalises adj₁ X) (R.obj Y)).symm
            {
              val :=
                F.map
                    ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                      ↑((Cofork.IsColimit.homIso
                            (colimit.isColimit
                              (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                            Y)
                          h)) ≫
                  adj₁.counit.app (R.obj Y),
              property :=
                (_ :
                  F.map (U.map (adj₁.counit.app X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y) =
                    adj₁.counit.app (F.obj (U.obj X)) ≫
                      F.map
                          ((Adjunction.homEquiv adj₂ (U.obj X) Y)
                            ↑((Cofork.IsColimit.homIso
                                  (colimit.isColimit
                                    (parallelPair (F'.map (U.map (adj₁.counit.app X))) (otherMap R F' adj₁ adj₂ X)))
                                  Y)
                                h)) ≫
                        adj₁.counit.app (R.obj Y)) })) ≫
      R.map g

Next tactic:
aesop_cat
/-- If `R ⋙ U` has a left adjoint, the domain of `R` has reflexive coequalizers and `U` is a monadic
functor, then `R` has a left adjoint.
This is a special case of `adjointTriangleLift` which is often more useful in practice.
-/
noncomputable def monadicAdjointTriangleLift (U : B ⥤ C) [MonadicRightAdjoint U] {R : A ⥤ B}
    [HasReflexiveCoequalizers A] [IsRightAdjoint (R ⋙ U)] : IsRightAdjoint R := by
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁵ : Category.{v₁, u₁} A
inst✝⁴ : Category.{v₂, u₂} B
inst✝³ : Category.{v₃, u₃} C
U : B ⥤ C
inst✝² : MonadicRightAdjoint U
R : A ⥤ B
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : IsRightAdjoint (R ⋙ U)
⊢ IsRightAdjoint R

Next tactic:
let R' : A ⥤ _ := R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
/-- If `R ⋙ U` has a left adjoint, the domain of `R` has reflexive coequalizers and `U` is a monadic
functor, then `R` has a left adjoint.
This is a special case of `adjointTriangleLift` which is often more useful in practice.
-/
noncomputable def monadicAdjointTriangleLift (U : B ⥤ C) [MonadicRightAdjoint U] {R : A ⥤ B}
    [HasReflexiveCoequalizers A] [IsRightAdjoint (R ⋙ U)] : IsRightAdjoint R := by
  let R' : A ⥤ _ := R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
  

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁵ : Category.{v₁, u₁} A
inst✝⁴ : Category.{v₂, u₂} B
inst✝³ : Category.{v₃, u₃} C
U : B ⥤ C
inst✝² : MonadicRightAdjoint U
R : A ⥤ B
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : IsRightAdjoint (R ⋙ U)
R' : A ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint U)) :=
  R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
⊢ IsRightAdjoint R

Next tactic:
rsuffices : IsRightAdjoint R'
/-- If `R ⋙ U` has a left adjoint, the domain of `R` has reflexive coequalizers and `U` is a monadic
functor, then `R` has a left adjoint.
This is a special case of `adjointTriangleLift` which is often more useful in practice.
-/
noncomputable def monadicAdjointTriangleLift (U : B ⥤ C) [MonadicRightAdjoint U] {R : A ⥤ B}
    [HasReflexiveCoequalizers A] [IsRightAdjoint (R ⋙ U)] : IsRightAdjoint R := by
  let R' : A ⥤ _ := R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
  rsuffices : IsRightAdjoint R'
  · 

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁵ : Category.{v₁, u₁} A
inst✝⁴ : Category.{v₂, u₂} B
inst✝³ : Category.{v₃, u₃} C
U : B ⥤ C
inst✝² : MonadicRightAdjoint U
R : A ⥤ B
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : IsRightAdjoint (R ⋙ U)
R' : A ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint U)) :=
  R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
this✝ : IsRightAdjoint R'
⊢ IsRightAdjoint R

Next tactic:
let this : IsRightAdjoint (R' ⋙ (Monad.comparison (Adjunction.ofRightAdjoint U)).inv) := by
      infer_instance
/-- If `R ⋙ U` has a left adjoint, the domain of `R` has reflexive coequalizers and `U` is a monadic
functor, then `R` has a left adjoint.
This is a special case of `adjointTriangleLift` which is often more useful in practice.
-/
noncomputable def monadicAdjointTriangleLift (U : B ⥤ C) [MonadicRightAdjoint U] {R : A ⥤ B}
    [HasReflexiveCoequalizers A] [IsRightAdjoint (R ⋙ U)] : IsRightAdjoint R := by
  let R' : A ⥤ _ := R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
  rsuffices : IsRightAdjoint R'
  · let this : IsRightAdjoint (R' ⋙ (Monad.comparison (Adjunction.ofRightAdjoint U)).inv) := by
      

Proof state:
A : Type u₁
B : Type u₂
C : Type u₃
inst✝⁵ : Category.{v₁, u₁} A
inst✝⁴ : Category.{v₂, u₂} B
inst✝³ : Category.{v₃, u₃} C
U : B ⥤ C
inst✝² : MonadicRightAdjoint U
R : A ⥤ B
inst✝¹ : HasReflexiveCoequalizers A
inst✝ : IsRightAdjoint (R ⋙ U)
R' : A ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint U)) :=
  R ⋙ Monad.comparison (Adjunction.ofRightAdjoint U)
this✝ : IsRightAdjoint R'
⊢ IsRightAdjoint (R' ⋙ Functor.inv (Monad.comparison (Adjunction.ofRightAdjoint U)))

Next tactic:
infer_instance