-- 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
⊢ X.map (CompHausLike.const (LightProfinite.of PUnit.{u + 1}) y).op
      ((isoFinYonedaComponents X (fiber f x)).inv (⇑f ∘ ⇑(ConcreteCategory.hom (sigmaIncl f x)))) =
    Function.Fiber.image (⇑f) x

Tactic:
simpa [← isoFinYonedaComponents_hom_apply] using x.map_eq_image f y

Result:
no goals

Proof state:
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✝
⊢ (fun f => ⇑f) ≫ (isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ≫ X.map g =
    (locallyConstantPresheaf (X.obj (Opposite.op (toLightProfinite.obj (of PUnit.{u + 1}))))).map g ≫
      counitAppApp (Opposite.unop S) X

Tactic:
erw [(counitApp.{u, u} X).naturality]

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✝
⊢ (fun f => ⇑f) ≫ (isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ≫ X.map g =
    (counitApp X).app (Opposite.op (toLightProfinite.obj (Opposite.unop Y))) ≫ X.map g

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
⊢ 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 (𝟙 (LightProfinite.of PUnit.{u + 1})).op (Function.Fiber.image (⇑f) x)

Tactic:
simp only [op_comp, FunctorToTypes.map_comp_apply, op_id, FunctorToTypes.map_id_apply]

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).op
      (X.map (sigmaIncl f x).op ((isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f)) =
    Function.Fiber.image (⇑f) x

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}))))
⊢ (isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f =
    counitAppApp (toLightProfinite.obj (Opposite.unop Y)) X f

Tactic:
apply presheaf_ext.{u, u} (X := X) (Y := X) (f := f)

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}))))
⊢ ∀ (a : Function.Fiber ⇑f),
    X.map (sigmaIncl f a).op ((isoFinYonedaComponents X (toLightProfinite.obj (Opposite.unop Y))).inv ⇑f) =
      X.map (sigmaIncl f a).op (counitAppApp (toLightProfinite.obj (Opposite.unop Y)) X f)

Proof state:
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

Tactic:
simp only [Category.assoc]

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