Theorem: Profinite.exists_locallyConstant_fin_two
File: Mathlib/Topology/Category/Profinite/CofilteredLimit.lean

tactic: let U := f ⁻¹' {0}
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
⊢ ∃ j g, f = LocallyConstant.comap ((forget Profinite).map (C.π.app j)) g

tactic: have hU : IsClopen U := f.isLocallyConstant.isClopen_fiber _
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
⊢ ∃ j g, f = LocallyConstant.comap ((forget Profinite).map (C.π.app j)) g

tactic: obtain ⟨j, V, hV, h⟩ := exists_clopen_of_cofiltered C hC hU
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
⊢ ∃ j g, f = LocallyConstant.comap ((forget Profinite).map (C.π.app j)) g

tactic: use j, LocallyConstant.ofClopen hV
state_before: case intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
j : J
V : Set ↑(F.obj j).toCompHaus.toTop
hV : IsClopen V
h : U = (forget Profinite).map (C.π.app j) ⁻¹' V
⊢ ∃ j g, f = LocallyConstant.comap ((forget Profinite).map (C.π.app j)) g

tactic: apply LocallyConstant.locallyConstant_eq_of_fiber_zero_eq
state_before: case intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
j : J
V : Set ↑(F.obj j).toCompHaus.toTop
hV : IsClopen V
h : U = (forget Profinite).map (C.π.app j) ⁻¹' V
⊢ f = LocallyConstant.comap ((forget Profinite).map (C.π.app j)) (LocallyConstant.ofClopen hV)

tactic: rw [LocallyConstant.coe_comap ((forget Profinite).map _) _ (C.π.app j).continuous]
state_before: case intro.intro.intro.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
j : J
V : Set ↑(F.obj j).toCompHaus.toTop
hV : IsClopen V
h : U = (forget Profinite).map (C.π.app j) ⁻¹' V
⊢ ↑f ⁻¹' {0} = ↑(LocallyConstant.comap ((forget Profinite).map (C.π.app j)) (LocallyConstant.ofClopen hV)) ⁻¹' {0}

tactic: conv_rhs => rw [Set.preimage_comp]
state_before: case intro.intro.intro.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
j : J
V : Set ↑(F.obj j).toCompHaus.toTop
hV : IsClopen V
h : U = (forget Profinite).map (C.π.app j) ⁻¹' V
⊢ ↑f ⁻¹' {0} = ↑(LocallyConstant.ofClopen hV) ∘ (forget Profinite).map (C.π.1 j) ⁻¹' {0}

tactic: rw [LocallyConstant.ofClopen_fiber_zero hV, ← h]
state_before: case intro.intro.intro.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) (Fin 2)
U : Set ↑C.pt.toCompHaus.toTop := ↑f ⁻¹' {0}
hU : IsClopen U
j : J
V : Set ↑(F.obj j).toCompHaus.toTop
hV : IsClopen V
h : U = (forget Profinite).map (C.π.app j) ⁻¹' V
⊢ ↑f ⁻¹' {0} = (forget Profinite).map (C.π.1 j) ⁻¹' (↑(LocallyConstant.ofClopen hV) ⁻¹' {0})