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

Proof state:
case w.h.w.e_a.h.h.a.h
X : LightProfiniteᵒᵖ ⥤ Type u
inst✝ : PreservesFiniteProducts X
hX : (S : LightProfinite) → IsColimit (X.mapCocone (coconeRightOpOfCone S.asLimitCone))
S : LightProfiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toLightProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toLightProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toLightProfinite.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
⊢ (isoFinYonedaComponents X (fiber f x)).hom
      (X.map (sigmaIncl f x).op ((isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f)) y =
    (isoFinYonedaComponents X (fiber f x)).hom
      (X.map (CompHausLike.isTerminalPUnit.from (fiber f x)).op (Function.Fiber.image (⇑f) x)) y

Tactic:
simp only [isoFinYonedaComponents_hom_apply, ← FunctorToTypes.map_comp_apply, ← op_comp]

Result:
case w.h.w.e_a.h.h.a.h
X : LightProfiniteᵒᵖ ⥤ Type u
inst✝ : PreservesFiniteProducts X
hX : (S : LightProfinite) → IsColimit (X.mapCocone (coconeRightOpOfCone S.asLimitCone))
S : LightProfiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toLightProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toLightProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toLightProfinite.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 (LightProfinite.of PUnit.{u + 1}) y ≫ sigmaIncl f x).op
      ((isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    X.map (CompHausLike.const (LightProfinite.of PUnit.{u + 1}) y ≫ CompHausLike.isTerminalPUnit.from (fiber f x)).op
      (Function.Fiber.image (⇑f) x)

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

Tactic:
dsimp [isoLocallyConstantOfIsColimit]

Result:
X : LightProfiniteᵒᵖ ⥤ Type u
inst✝ : PreservesFiniteProducts X
hX : (S : LightProfinite) → IsColimit (X.mapCocone (coconeRightOpOfCone S.asLimitCone))
⊢ ((lanPresheafNatIso fun x =>
            isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toLightProfinite.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
X : LightProfiniteᵒᵖ ⥤ Type u
inst✝ : PreservesFiniteProducts X
hX : (S : LightProfinite) → IsColimit (X.mapCocone (coconeRightOpOfCone S.asLimitCone))
S : LightProfiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toLightProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
f :
  LocallyConstant (↑(toLightProfinite.obj (Opposite.unop Y)).toTop)
    (X.obj (Opposite.op (toLightProfinite.obj (of PUnit.{u + 1}))))
x : Function.Fiber ⇑f
⊢ X.map (sigmaIncl f x).op ((isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f) =
    X.map (sigmaIncl f x).op (counitAppApp (toLightProfinite.obj (Opposite.unop Y)) X f)

Tactic:
rw [incl_of_counitAppApp]

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

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

Tactic:
intro ⟨Y, _, g⟩

Result:
case w.h.w
X : LightProfiniteᵒᵖ ⥤ Type u
inst✝ : PreservesFiniteProducts X
hX : (S : LightProfinite) → IsColimit (X.mapCocone (coconeRightOpOfCone S.asLimitCone))
S : LightProfiniteᵒᵖ
Y : FintypeCatᵒᵖ
right✝ : Discrete PUnit.{1}
g : toLightProfinite.op.obj Y ⟶ (fromPUnit S).obj right✝
⊢ colimit.ι
        (CostructuredArrow.proj toLightProfinite.op S ⋙
          toLightProfinite.op ⋙ locallyConstantPresheaf (X.obj (Opposite.op (toLightProfinite.obj (of PUnit.{u + 1})))))
        { left := Y, right := right✝, hom := g } ≫
      ((lanPresheafExt (isoFinYoneda X ≪≫ (locallyConstantIsoFinYoneda X).symm)).inv ≫ (lanPresheafNatIso hX).hom).app
        S =
    colimit.ι
        (CostructuredArrow.proj toLightProfinite.op S ⋙
          toLightProfinite.op ⋙ locallyConstantPresheaf (X.obj (Opposite.op (toLightProfinite.obj (of PUnit.{u + 1})))))
        { left := Y, right := right✝, hom := g } ≫
      ((lanPresheafNatIso fun x =>
                isColimitLocallyConstantPresheafDiagram (X.obj (Opposite.op (toLightProfinite.obj (of PUnit.{u + 1}))))
                  x).hom ≫
            counitApp X).app
        S

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