Theorem: Profinite.epi_iff_surjective
File: Mathlib/Topology/Category/Profinite/Basic.lean

tactic: constructor
state_before: X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ Epi f ↔ Function.Surjective ((forget Profinite).map f)

tactic: dsimp [Function.Surjective]
state_before: case mp
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ Epi f → Function.Surjective ((forget Profinite).map f)

tactic: contrapose!
state_before: case mp
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ Epi f → ∀ (b : (forget Profinite).obj Y), ∃ a, (forget Profinite).map f a = b

tactic: rintro ⟨y, hy⟩ hf
state_before: case mp
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ (∃ b, ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ b) → ¬Epi f

tactic: skip
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
⊢ False

tactic: let C := Set.range f
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
⊢ False

tactic: have hC : IsClosed C := (isCompact_range f.continuous).isClosed
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
⊢ False

tactic: let U := Cᶜ
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
⊢ False

tactic: have hyU : y ∈ U := by
  refine' Set.mem_compl _
  rintro ⟨y', hy'⟩
  exact hy y' hy'
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
⊢ False

tactic: have hUy : U ∈ 𝓝 y := hC.compl_mem_nhds hyU
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
⊢ False

tactic: obtain ⟨V, hV, hyV, hVU⟩ := isTopologicalBasis_clopen.mem_nhds_iff.mp hUy
state_before: case mp.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
⊢ False

tactic: classical
  let Z := of (ULift.{u} <| Fin 2)
  let g : Y ⟶ Z := ⟨(LocallyConstant.ofClopen hV).map ULift.up, LocallyConstant.continuous _⟩
  let h : Y ⟶ Z := ⟨fun _ => ⟨1⟩, continuous_const⟩
  have H : h = g := by
    rw [← cancel_epi f]
    ext x
    apply ULift.ext
    dsimp [LocallyConstant.ofClopen]
    simp only [FunctorToTypes.map_comp_apply, forget_ContinuousMap_mk, Function.comp_apply]
    rw [if_neg]
    refine' mt (fun α => hVU α) _
    simp only [Set.mem_range_self, not_true, not_false_iff, Set.mem_compl_iff]
  apply_fun fun e => (e y).down  at H
  dsimp [LocallyConstant.ofClopen] at H
  rw [if_pos hyV] at H
  exact top_ne_bot H
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
⊢ False

tactic: refine' Set.mem_compl _
state_before: X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
⊢ y ∈ U

tactic: rintro ⟨y', hy'⟩
state_before: X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
⊢ ¬y ∈ C

tactic: exact hy y' hy'
state_before: case intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
y' : (forget Profinite).obj X
hy' : (forget Profinite).map f y' = y
⊢ False

tactic: let Z := of (ULift.{u} <| Fin 2)
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
⊢ False

tactic: let g : Y ⟶ Z := ⟨(LocallyConstant.ofClopen hV).map ULift.up, LocallyConstant.continuous _⟩
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
⊢ False

tactic: let h : Y ⟶ Z := ⟨fun _ => ⟨1⟩, continuous_const⟩
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
⊢ False

tactic: have H : h = g := by
  rw [← cancel_epi f]
  ext x
  apply ULift.ext
  dsimp [LocallyConstant.ofClopen]
  simp only [FunctorToTypes.map_comp_apply, forget_ContinuousMap_mk, Function.comp_apply]
  rw [if_neg]
  refine' mt (fun α => hVU α) _
  simp only [Set.mem_range_self, not_true, not_false_iff, Set.mem_compl_iff]
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
⊢ False

tactic: apply_fun fun e => (e y).down  at H
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
H : h = g
⊢ False

tactic: dsimp [LocallyConstant.ofClopen] at H
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
H : ((forget Profinite).map h y).down = ((forget Profinite).map g y).down
⊢ False

tactic: rw [if_pos hyV] at H
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
H : 1 = if y ∈ V then 0 else 1
⊢ False

tactic: exact top_ne_bot H
state_before: case mp.intro.intro.intro.intro
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
H : 1 = 0
⊢ False

tactic: rw [← cancel_epi f]
state_before: X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
⊢ h = g

tactic: ext x
state_before: X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
⊢ f ≫ h = f ≫ g

tactic: apply ULift.ext
state_before: case w
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ (forget Profinite).map (f ≫ h) x = (forget Profinite).map (f ≫ g) x

tactic: dsimp [LocallyConstant.ofClopen]
state_before: case w.h
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ ((forget Profinite).map (f ≫ h) x).down = ((forget Profinite).map (f ≫ g) x).down

tactic: simp only [FunctorToTypes.map_comp_apply, forget_ContinuousMap_mk, Function.comp_apply]
state_before: case w.h
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ ((forget Profinite).map (f ≫ ContinuousMap.mk fun x => { down := 1 }) x).down =
    ((forget Profinite).map (f ≫ ContinuousMap.mk (ULift.up ∘ fun x => if x ∈ V then 0 else 1)) x).down

tactic: rw [if_neg]
state_before: case w.h
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ 1 = if (forget Profinite).map f x ∈ V then 0 else 1

tactic: refine' mt (fun α => hVU α) _
state_before: case w.h.hnc
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ ¬(forget Profinite).map f x ∈ V

tactic: simp only [Set.mem_range_self, not_true, not_false_iff, Set.mem_compl_iff]
state_before: case w.h.hnc
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
y : (forget Profinite).obj Y
hy : ∀ (a : (forget Profinite).obj X), (forget Profinite).map f a ≠ y
hf : Epi f
C : Set ((forget Profinite).obj Y) := Set.range ((forget Profinite).map f)
hC : IsClosed C
U : Set ((forget Profinite).obj Y) := Cᶜ
hyU : y ∈ U
hUy : U ∈ 𝓝 y
V : Set ((forget Profinite).obj Y)
hV : V ∈ {s | IsClopen s}
hyV : y ∈ V
hVU : V ⊆ U
Z : Profinite := of (ULift (Fin 2))
g : Y ⟶ Z := ContinuousMap.mk ↑(LocallyConstant.map ULift.up (LocallyConstant.ofClopen hV))
h : Y ⟶ Z := ContinuousMap.mk fun x => { down := 1 }
x : (forget Profinite).obj X
⊢ ¬(forget Profinite).map f x ∈ U

tactic: rw [← CategoryTheory.epi_iff_surjective]
state_before: case mpr
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ Function.Surjective ((forget Profinite).map f) → Epi f

tactic: apply (forget Profinite).epi_of_epi_map
state_before: case mpr
X✝ Y✝ : Profinite
f✝ : X✝ ⟶ Y✝
X Y : Profinite
f : X ⟶ Y
⊢ Epi ((forget Profinite).map f) → Epi f