-- Mathlib/Condensed/Discrete/Colimit.lean
lemma isoLocallyConstantOfIsColimit_inv (X : Profinite.{u}ᵒᵖ ⥤ Type (u+1))
    [PreservesFiniteProducts X]
    (hX : ∀ S : Profinite.{u}, (IsColimit <| X.mapCocone S.asLimitCone.op)) :
    (isoLocallyConstantOfIsColimit X hX).inv =
      (CompHausLike.LocallyConstant.counitApp.{u, u+1} X)

Proof state:
case w.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
⊢ ((lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv ≫ (lanPresheafNatIso hX).hom).app S =
    ((lanPresheafNatIso fun x =>
              isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
                x).hom ≫
          counitApp X).app
      S

Tactic:
apply colimit.hom_ext

Result:
case w.h.w
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
⊢ ∀ (j : CostructuredArrow toProfinite.op S),
    colimit.ι
          (CostructuredArrow.proj toProfinite.op S ⋙
            toProfinite.op ⋙ locallyConstantPresheaf (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1})))))
          j ≫
        ((lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv ≫ (lanPresheafNatIso hX).hom).app
          S =
      colimit.ι
          (CostructuredArrow.proj toProfinite.op S ⋙
            toProfinite.op ⋙ locallyConstantPresheaf (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1})))))
          j ≫
        ((lanPresheafNatIso fun x =>
                  isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
                    x).hom ≫
              counitApp X).app
          S

Proof state:
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
⊢ (isoLocallyConstantOfIsColimit X hX).inv = counitApp X

Tactic:
dsimp [isoLocallyConstantOfIsColimit]

Result:
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
⊢ ((lanPresheafNatIso fun x =>
            isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1})))) x).inv ≫
        (lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv) ≫
      (lanPresheafNatIso hX).hom =
    counitApp X

Proof state:
case w.h.w.e_a.h.h.a.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
x : Function.Fiber ⇑f
this : Fintype ↑(fiber f x).toTop := Fintype.ofInjective ⇑(sigmaIncl f x).hom' ⋯
y : ↑(fiber f x).toTop
⊢ X.map (CompHausLike.const (Profinite.of PUnit.{u + 1}) y ≫ sigmaIncl f x).op
      ((isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    X.map (CompHausLike.const (Profinite.of PUnit.{u + 1}) y ≫ CompHausLike.isTerminalPUnit.from (fiber f x)).op
      (Function.Fiber.image (⇑f) x)

Tactic:
rw [show (Profinite.of PUnit.{u+1}).const y ≫ IsTerminal.from _ (fiber f x) = 𝟙 _ from rfl]

Result:
case w.h.w.e_a.h.h.a.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
x : Function.Fiber ⇑f
this : Fintype ↑(fiber f x).toTop := Fintype.ofInjective ⇑(sigmaIncl f x).hom' ⋯
y : ↑(fiber f x).toTop
⊢ X.map (CompHausLike.const (Profinite.of PUnit.{u + 1}) y ≫ sigmaIncl f x).op
      ((isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    X.map (𝟙 (Profinite.of PUnit.{u + 1})).op (Function.Fiber.image (⇑f) x)

Proof state:
case w.h.w.e_a.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
⊢ ((fun f => ⇑f) ≫ (isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv) f =
    (counitApp X).app (Opposite.op (toProfinite.obj (Opposite.unop Y))) f

Tactic:
simp only [types_comp_apply, isoFinYoneda_inv_app, counitApp_app]

Result:
case w.h.w.e_a.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
⊢ (isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv ⇑f =
    counitAppApp (toProfinite.obj (Opposite.unop Y)) X f

Proof state:
case w.h.w.e_a.h.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
x : Function.Fiber ⇑f
⊢ X.map (sigmaIncl f x).op ((isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    X.map (sigmaIncl f x).op (counitAppApp (toProfinite.obj (Opposite.unop Y)) X f)

Tactic:
rw [incl_of_counitAppApp]

Result:
case w.h.w.e_a.h.h
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
S : Profiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1}))))
x : Function.Fiber ⇑f
⊢ X.map (sigmaIncl f x).op ((isoFinYonedaComponents X (toProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    counitAppAppImage f x

Proof state:
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
⊢ (lanPresheafNatIso fun x =>
          isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1})))) x).inv ≫
      (lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv ≫ (lanPresheafNatIso hX).hom =
    counitApp X

Tactic:
rw [Iso.inv_comp_eq]

Result:
X : Profiniteᵒᵖ ⥤ Type (u + 1)
inst✝ : PreservesFiniteProducts X
hX : (S : Profinite) → IsColimit (X.mapCocone S.asLimitCone.op)
⊢ (lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv ≫ (lanPresheafNatIso hX).hom =
    (lanPresheafNatIso fun x =>
          isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toProfinite.obj (of PUnit.{u + 1})))) x).hom ≫
      counitApp X