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

tactic: have hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis
    ((fun j ↦ {W : Set (F.obj j)| IsClopen W}) j)
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have compat : ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j ↦ {W | IsClopen W}) j → (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈
    (fun j ↦ {W | IsClopen W}) i
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have hB := TopCat.isTopologicalBasis_cofiltered_limit.{u, u} (F ⋙ Profinite.toTopCat)
    (Profinite.toTopCat.mapCone C) (isLimitOfPreserves _ hC) (fun j => {W | IsClopen W}) hT
    (fun i => isClopen_univ) (fun i U1 U2 hU1 hU2 => hU1.inter hU2) compat
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: obtain ⟨S, hS, h⟩ := hB.open_eq_sUnion hU.1
state_before: J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
hB :
  TopologicalSpace.IsTopologicalBasis
    {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: clear hB
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
hB :
  TopologicalSpace.IsTopologicalBasis
    {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: let j : S → J := fun s => (hS s.2).choose
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: let V : ∀ s : S, Set (F.obj (j s)) := fun s => (hS s.2).choose_spec.choose
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have hV : ∀ s : S, IsClopen (V s) ∧ s.1 = C.π.app (j s) ⁻¹' V s := fun s =>
  (hS s.2).choose_spec.choose_spec
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have hUo : ∀ (i : ↑S), IsOpen ((fun s ↦ (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have hsU : U ⊆ ⋃ (i : ↑S), (fun s ↦ (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: have := hU.2.isCompact.elim_finite_subcover (fun s : S => C.π.app (j s) ⁻¹' V s) hUo hsU
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: obtain ⟨G, hG⟩ := this
state_before: case intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
this : ∃ t, U ⊆ ⋃ (i : ↑S) (_ : i ∈ t), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: obtain ⟨j0, hj0⟩ := IsCofiltered.inf_objs_exists (G.image j)
state_before: case intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: let f : ∀ (s : S) (_ : s ∈ G), j0 ⟶ j s := fun s hs =>
  (hj0 (Finset.mem_image.mpr ⟨s, hs, rfl⟩)).some
state_before: case intro.intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: let W : S → Set (F.obj j0) := fun s => if hs : s ∈ G then F.map (f s hs) ⁻¹' V s else Set.univ
state_before: case intro.intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: refine' ⟨j0, ⋃ (s : S) (_ : s ∈ G), W s, _, _⟩
state_before: case intro.intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
⊢ ∃ j V x, U = (forget Profinite).map (C.π.app j) ⁻¹' V

tactic: intro i
state_before: case hT
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
⊢ ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)

tactic: change TopologicalSpace.IsTopologicalBasis {W : Set (F.obj i) | IsClopen W}
state_before: case hT
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
i : J
⊢ TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) i)

tactic: apply isTopologicalBasis_clopen
state_before: case hT
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
i : J
⊢ TopologicalSpace.IsTopologicalBasis {W | IsClopen W}

tactic: rintro i j f V (hV : IsClopen _)
state_before: case compat
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
⊢ ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i

tactic: exact ⟨hV.1.preimage ((F ⋙ toTopCat).map f).continuous,
  hV.2.preimage ((F ⋙ toTopCat).map f).continuous⟩
state_before: case compat
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
i j : J
f : i ⟶ j
V : Set ↑((F ⋙ toTopCat).obj j)
hV : IsClopen V
⊢ (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i

tactic: intro s
state_before: case hUo
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
⊢ ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)

tactic: exact (hV s).1.1.preimage (C.π.app (j s)).continuous
state_before: case hUo
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
s : ↑S
⊢ IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) s)

tactic: dsimp only
state_before: case hsU
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
⊢ U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i

tactic: rw [h]
state_before: case hsU
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
⊢ U ⊆
    ⋃ (i : ↑S),
      (forget Profinite).map
          (C.π.app
            (Exists.choose
              (_ :
                ↑i ∈
                  {U |
                    ∃ j V,
                      V ∈ (fun j => {W | IsClopen W}) j ∧
                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
        Exists.choose
          (_ :
            ∃ V,
              V ∈ {W | IsClopen W} ∧
                ↑i =
                  (forget TopCat).map
                      ((toTopCat.mapCone C).π.app
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                    V)

tactic: rintro x ⟨T, hT, hx⟩
state_before: case hsU
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
⊢ ⋃₀ S ⊆
    ⋃ (i : ↑S),
      (forget Profinite).map
          (C.π.app
            (Exists.choose
              (_ :
                ↑i ∈
                  {U |
                    ∃ j V,
                      V ∈ (fun j => {W | IsClopen W}) j ∧
                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
        Exists.choose
          (_ :
            ∃ V,
              V ∈ {W | IsClopen W} ∧
                ↑i =
                  (forget TopCat).map
                      ((toTopCat.mapCone C).π.app
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                    V)

tactic: refine' ⟨_, ⟨⟨T, hT⟩, rfl⟩, _⟩
state_before: case hsU.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT✝ : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
x : ↑C.pt.toCompHaus.toTop
T : Set ↑(toTopCat.mapCone C).pt
hT : T ∈ S
hx : x ∈ T
⊢ x ∈
    ⋃ (i : ↑S),
      (forget Profinite).map
          (C.π.app
            (Exists.choose
              (_ :
                ↑i ∈
                  {U |
                    ∃ j V,
                      V ∈ (fun j => {W | IsClopen W}) j ∧
                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
        Exists.choose
          (_ :
            ∃ V,
              V ∈ {W | IsClopen W} ∧
                ↑i =
                  (forget TopCat).map
                      ((toTopCat.mapCone C).π.app
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                    V)

tactic: dsimp only
state_before: case hsU.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT✝ : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
x : ↑C.pt.toCompHaus.toTop
T : Set ↑(toTopCat.mapCone C).pt
hT : T ∈ S
hx : x ∈ T
⊢ x ∈
    (fun i =>
        (forget Profinite).map
            (C.π.app
              (Exists.choose
                (_ :
                  ↑i ∈
                    {U |
                      ∃ j V,
                        V ∈ (fun j => {W | IsClopen W}) j ∧
                          U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈ {W | IsClopen W} ∧
                  ↑i =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑i ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V))
      { val := T, property := hT }

tactic: rwa [← (hV ⟨T, hT⟩).2]
state_before: case hsU.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT✝ : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
x : ↑C.pt.toCompHaus.toTop
T : Set ↑(toTopCat.mapCone C).pt
hT : T ∈ S
hx : x ∈ T
⊢ x ∈
    (forget Profinite).map
        (C.π.app
          (Exists.choose
            (_ :
              T ∈
                {U |
                  ∃ j V,
                    V ∈ (fun j => {W | IsClopen W}) j ∧
                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
      Exists.choose
        (_ :
          ∃ V,
            V ∈ {W | IsClopen W} ∧
              T =
                (forget TopCat).map
                    ((toTopCat.mapCone C).π.app
                      (Exists.choose
                        (_ :
                          T ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                  V)

tactic: apply isClopen_biUnion_finset
state_before: case intro.intro.intro.intro.refine'_1
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
⊢ IsClopen (⋃ (s : ↑S) (_ : s ∈ G), W s)

tactic: intro s hs
state_before: case intro.intro.intro.intro.refine'_1.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
⊢ ∀ (i : ↑S), i ∈ G → IsClopen (W i)

tactic: dsimp
state_before: case intro.intro.intro.intro.refine'_1.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
s : ↑S
hs : s ∈ G
⊢ IsClopen (W s)

tactic: rw [dif_pos hs]
state_before: case intro.intro.intro.intro.refine'_1.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
s : ↑S
hs : s ∈ G
⊢ IsClopen
    (if hs : s ∈ G then
      (forget Profinite).map
          (F.map
            (Nonempty.some
              (_ :
                Nonempty
                  (j0 ⟶
                    Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))))) ⁻¹'
        Exists.choose
          (_ :
            ∃ V,
              IsClopen V ∧
                ↑s =
                  (forget TopCat).map
                      (C.π.app
                        (Exists.choose
                          (_ :
                            ↑s ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                    V)
    else Set.univ)

tactic: exact ⟨(hV s).1.1.preimage (F.map _).continuous, (hV s).1.2.preimage (F.map _).continuous⟩
state_before: case intro.intro.intro.intro.refine'_1.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
s : ↑S
hs : s ∈ G
⊢ IsClopen
    ((forget Profinite).map
        (F.map
          (Nonempty.some
            (_ :
              Nonempty
                (j0 ⟶
                  Exists.choose
                    (_ :
                      ↑s ∈
                        {U |
                          ∃ j V,
                            V ∈ (fun j => {W | IsClopen W}) j ∧
                              U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))))) ⁻¹'
      Exists.choose
        (_ :
          ∃ V,
            IsClopen V ∧
              ↑s =
                (forget TopCat).map
                    (C.π.app
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                  V))

tactic: ext x
state_before: case intro.intro.intro.intro.refine'_2
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
⊢ U = (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s

tactic: constructor
state_before: case intro.intro.intro.intro.refine'_2.h
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
⊢ x ∈ U ↔ x ∈ (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s

tactic: intro hx
state_before: case intro.intro.intro.intro.refine'_2.h.mp
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
⊢ x ∈ U → x ∈ (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s

tactic: simp_rw [Set.preimage_iUnion, Set.mem_iUnion]
state_before: case intro.intro.intro.intro.refine'_2.h.mp
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx : x ∈ U
⊢ x ∈ (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s

tactic: obtain ⟨_, ⟨s, rfl⟩, _, ⟨hs, rfl⟩, hh⟩ := hG hx
state_before: case intro.intro.intro.intro.refine'_2.h.mp
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx : x ∈ U
⊢ ∃ i i_1,
    x ∈
      (forget Profinite).map (C.π.app j0) ⁻¹'
        if h : i ∈ G then
          (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j i)))) ⁻¹'
            Exists.choose
              (_ :
                ∃ V,
                  V ∈
                      (fun j => {W | IsClopen W})
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                    ↑i =
                      (forget TopCat).map
                          ((toTopCat.mapCone C).π.app
                            (Exists.choose
                              (_ :
                                ↑i ∈
                                  {U |
                                    ∃ j V,
                                      V ∈ (fun j => {W | IsClopen W}) j ∧
                                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                        V)
        else Set.univ

tactic: refine' ⟨s, hs, _⟩
state_before: case intro.intro.intro.intro.refine'_2.h.mp.intro.intro.intro.intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx : x ∈ U
s : ↑S
hs : s ∈ G
hh : x ∈ (fun h => (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) s) hs
⊢ ∃ i i_1,
    x ∈
      (forget Profinite).map (C.π.app j0) ⁻¹'
        if h : i ∈ G then
          (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j i)))) ⁻¹'
            Exists.choose
              (_ :
                ∃ V,
                  V ∈
                      (fun j => {W | IsClopen W})
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                    ↑i =
                      (forget TopCat).map
                          ((toTopCat.mapCone C).π.app
                            (Exists.choose
                              (_ :
                                ↑i ∈
                                  {U |
                                    ∃ j V,
                                      V ∈ (fun j => {W | IsClopen W}) j ∧
                                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                        V)
        else Set.univ

tactic: rwa [dif_pos hs, ← Set.preimage_comp, ← Profinite.coe_comp, ← Functor.map_comp, C.w]
state_before: case intro.intro.intro.intro.refine'_2.h.mp.intro.intro.intro.intro.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx : x ∈ U
s : ↑S
hs : s ∈ G
hh : x ∈ (fun h => (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) s) hs
⊢ x ∈
    (forget Profinite).map (C.π.app j0) ⁻¹'
      if h : s ∈ G then
        (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j s)))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈
                    (fun j => {W | IsClopen W})
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                  ↑s =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑s ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V)
      else Set.univ

tactic: intro hx
state_before: case intro.intro.intro.intro.refine'_2.h.mpr
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
⊢ (x ∈ (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s) → x ∈ U

tactic: simp_rw [Set.preimage_iUnion, Set.mem_iUnion] at hx
state_before: case intro.intro.intro.intro.refine'_2.h.mpr
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx : x ∈ (forget Profinite).map (C.π.app j0) ⁻¹' ⋃ (s : ↑S) (_ : s ∈ G), W s
⊢ x ∈ U

tactic: obtain ⟨s, hs, hx⟩ := hx
state_before: case intro.intro.intro.intro.refine'_2.h.mpr
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
hx :
  ∃ i i_1,
    x ∈
      (forget Profinite).map (C.π.app j0) ⁻¹'
        if h : i ∈ G then
          (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j i)))) ⁻¹'
            Exists.choose
              (_ :
                ∃ V,
                  V ∈
                      (fun j => {W | IsClopen W})
                        (Exists.choose
                          (_ :
                            ↑i ∈
                              {U |
                                ∃ j V,
                                  V ∈ (fun j => {W | IsClopen W}) j ∧
                                    U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                    ↑i =
                      (forget TopCat).map
                          ((toTopCat.mapCone C).π.app
                            (Exists.choose
                              (_ :
                                ↑i ∈
                                  {U |
                                    ∃ j V,
                                      V ∈ (fun j => {W | IsClopen W}) j ∧
                                        U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                        V)
        else Set.univ
⊢ x ∈ U

tactic: rw [h]
state_before: case intro.intro.intro.intro.refine'_2.h.mpr.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
s : ↑S
hs : s ∈ G
hx :
  x ∈
    (forget Profinite).map (C.π.app j0) ⁻¹'
      if h : s ∈ G then
        (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j s)))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈
                    (fun j => {W | IsClopen W})
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                  ↑s =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑s ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V)
      else Set.univ
⊢ x ∈ U

tactic: refine' ⟨s.1, s.2, _⟩
state_before: case intro.intro.intro.intro.refine'_2.h.mpr.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
s : ↑S
hs : s ∈ G
hx :
  x ∈
    (forget Profinite).map (C.π.app j0) ⁻¹'
      if h : s ∈ G then
        (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j s)))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈
                    (fun j => {W | IsClopen W})
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                  ↑s =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑s ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V)
      else Set.univ
⊢ x ∈ ⋃₀ S

tactic: rw [(hV s).2]
state_before: case intro.intro.intro.intro.refine'_2.h.mpr.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
s : ↑S
hs : s ∈ G
hx :
  x ∈
    (forget Profinite).map (C.π.app j0) ⁻¹'
      if h : s ∈ G then
        (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j s)))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈
                    (fun j => {W | IsClopen W})
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                  ↑s =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑s ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V)
      else Set.univ
⊢ x ∈ ↑s

tactic: rwa [dif_pos hs, ← Set.preimage_comp, ← Profinite.coe_comp, ← Functor.map_comp, C.w] at hx
state_before: case intro.intro.intro.intro.refine'_2.h.mpr.intro.intro
J : Type u
inst✝¹ : SmallCategory J
inst✝ : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
U : Set ↑C.pt.toCompHaus.toTop
hC : IsLimit C
hU : IsClopen U
hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis ((fun j => {W | IsClopen W}) j)
compat :
  ∀ (i j : J) (f : i ⟶ j) (V : Set ↑((F ⋙ toTopCat).obj j)),
    V ∈ (fun j_1 => {W | IsClopen W}) j →
      (forget TopCat).map ((F ⋙ toTopCat).map f) ⁻¹' V ∈ (fun j => {W | IsClopen W}) i
S : Set (Set ↑(toTopCat.mapCone C).pt)
hS : S ⊆ {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}
h : U = ⋃₀ S
j : ↑S → J :=
  fun s =>
    Exists.choose
      (_ :
        ↑s ∈
          {U | ∃ j V, V ∈ (fun j => {W | IsClopen W}) j ∧ U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})
V : (s : ↑S) → Set ↑(F.obj (j s)).toCompHaus.toTop :=
  fun s =>
    Exists.choose
      (_ :
        ∃ V,
          V ∈
              (fun j => {W | IsClopen W})
                (Exists.choose
                  (_ :
                    ↑s ∈
                      {U |
                        ∃ j V,
                          V ∈ (fun j => {W | IsClopen W}) j ∧
                            U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
            ↑s =
              (forget TopCat).map
                  ((toTopCat.mapCone C).π.app
                    (Exists.choose
                      (_ :
                        ↑s ∈
                          {U |
                            ∃ j V,
                              V ∈ (fun j => {W | IsClopen W}) j ∧
                                U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                V)
hV : ∀ (s : ↑S), IsClopen (V s) ∧ ↑s = (forget Profinite).map (C.π.app (j s)) ⁻¹' V s
hUo : ∀ (i : ↑S), IsOpen ((fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i)
hsU : U ⊆ ⋃ (i : ↑S), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
G : Finset ↑S
hG : U ⊆ ⋃ (i : ↑S) (_ : i ∈ G), (fun s => (forget Profinite).map (C.π.app (j s)) ⁻¹' V s) i
j0 : J
hj0 : ∀ {X : J}, X ∈ Finset.image j G → Nonempty (j0 ⟶ X)
f : (s : ↑S) → s ∈ G → (j0 ⟶ j s) := fun s hs => Nonempty.some (_ : Nonempty (j0 ⟶ j s))
W : ↑S → Set ↑(F.obj j0).toCompHaus.toTop :=
  fun s => if hs : s ∈ G then (forget Profinite).map (F.map (f s hs)) ⁻¹' V s else Set.univ
x : ↑C.pt.toCompHaus.toTop
s : ↑S
hs : s ∈ G
hx :
  x ∈
    (forget Profinite).map (C.π.app j0) ⁻¹'
      if h : s ∈ G then
        (forget Profinite).map (F.map (Nonempty.some (_ : Nonempty (j0 ⟶ j s)))) ⁻¹'
          Exists.choose
            (_ :
              ∃ V,
                V ∈
                    (fun j => {W | IsClopen W})
                      (Exists.choose
                        (_ :
                          ↑s ∈
                            {U |
                              ∃ j V,
                                V ∈ (fun j => {W | IsClopen W}) j ∧
                                  U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V})) ∧
                  ↑s =
                    (forget TopCat).map
                        ((toTopCat.mapCone C).π.app
                          (Exists.choose
                            (_ :
                              ↑s ∈
                                {U |
                                  ∃ j V,
                                    V ∈ (fun j => {W | IsClopen W}) j ∧
                                      U = (forget TopCat).map ((toTopCat.mapCone C).π.app j) ⁻¹' V}))) ⁻¹'
                      V)
      else Set.univ
⊢ x ∈ (forget Profinite).map (C.π.app (j s)) ⁻¹' V s