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

tactic: inhabit α
state_before: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g
state_after: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g

tactic: obtain ⟨j, gg, h⟩ := exists_locallyConstant_finite_aux _ hC f
state_before: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g
state_after: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g

tactic: let ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
state_before: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g
state_after: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g

tactic: let σ : (α → Fin 2) → α := fun f => if h : ∃ a : α, ι a = f then h.choose else default
state_before: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g
state_after: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g

tactic: refine ⟨j, gg.map σ, ?_⟩
state_before: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
⊢ ∃ j g, f = LocallyConstant.comap (C.π.app j) g
state_after: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
⊢ f = LocallyConstant.comap (C.π.app j) (LocallyConstant.map σ gg)

tactic: ext x
state_before: case intro.intro
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
⊢ f = LocallyConstant.comap (C.π.app j) (LocallyConstant.map σ gg)
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = (LocallyConstant.comap (C.π.app j) (LocallyConstant.map σ gg)) x

tactic: simp only [Functor.const_obj_obj, LocallyConstant.coe_comap, LocallyConstant.map_apply,
  Function.comp_apply]
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = (LocallyConstant.comap (C.π.app j) (LocallyConstant.map σ gg)) x
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = σ (gg ((C.π.app j) x))

tactic: dsimp [σ]
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = σ (gg ((C.π.app j) x))
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default

tactic: have h1 : ι (f x) = gg (C.π.app j x) := by
  change f.map (fun a b => if a = b then (0 : Fin 2) else 1) x = _
  erw [h]
  rfl
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default

tactic: have h2 : ∃ a : α, ι a = gg (C.π.app j x) := ⟨f x, h1⟩
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default

tactic: erw [dif_pos h2]
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ f x = if h : ∃ a, ι a = gg ((C.π.app j) x) then h.choose else default
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ f x = h2.choose

tactic: apply_fun ι
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ f x = h2.choose
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ ι (f x) = ι h2.choose

case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ Function.Injective ι

tactic: change f.map (fun a b => if a = b then (0 : Fin 2) else 1) x = _
state_before: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ ι (f x) = gg ((C.π.app j) x)
state_after: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ (LocallyConstant.map (fun a b => if a = b then 0 else 1) f) x = gg ((C.π.app j) x)

tactic: erw [h]
state_before: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ (LocallyConstant.map (fun a b => if a = b then 0 else 1) f) x = gg ((C.π.app j) x)
state_after: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ (LocallyConstant.comap (C.π.app j) gg) x = gg ((C.π.app j) x)

tactic: rfl
state_before: J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
⊢ (LocallyConstant.comap (C.π.app j) gg) x = gg ((C.π.app j) x)
state_after: no goals

tactic: rw [h2.choose_spec]
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ ι (f x) = ι h2.choose
state_after: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ ι (f x) = gg ((C.π.app j) x)

tactic: exact h1
state_before: case intro.intro.h
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ ι (f x) = gg ((C.π.app j) x)
state_after: no goals

tactic: intro a b hh
state_before: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
⊢ Function.Injective ι
state_after: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
⊢ a = b

tactic: have hhh := congr_fun hh a
state_before: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
⊢ a = b
state_after: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : ι a a = ι b a
⊢ a = b

tactic: dsimp [ι] at hhh
state_before: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : ι a a = ι b a
⊢ a = b
state_after: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : (if a = a then 0 else 1) = if b = a then 0 else 1
⊢ a = b

tactic: rw [if_pos rfl] at hhh
state_before: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : (if a = a then 0 else 1) = if b = a then 0 else 1
⊢ a = b
state_after: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : 0 = if b = a then 0 else 1
⊢ a = b

tactic: split_ifs at hhh with hh1
state_before: case intro.intro.h.inj
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hhh : 0 = if b = a then 0 else 1
⊢ a = b
state_after: case pos
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hh1 : b = a
hhh : 0 = 0
⊢ a = b

case neg
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hh1 : ¬b = a
hhh : 0 = 1
⊢ a = b

tactic: exact hh1.symm
state_before: case pos
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hh1 : b = a
hhh : 0 = 0
⊢ a = b
state_after: no goals

tactic: exact False.elim (bot_ne_top hhh)
state_before: case neg
J : Type v
inst✝³ : SmallCategory J
inst✝² : IsCofiltered J
F : J ⥤ Profinite
C : Cone F
α : Type u_1
inst✝¹ : Finite α
inst✝ : Nonempty α
hC : IsLimit C
f : LocallyConstant (↑C.pt.toCompHaus.toTop) α
inhabited_h : Inhabited α
j : J
gg : LocallyConstant (↑(F.obj j).toCompHaus.toTop) (α → Fin 2)
h : LocallyConstant.map (fun a b => if a = b then 0 else 1) f = LocallyConstant.comap (C.π.app j) gg
ι : α → α → Fin 2 := fun a b => if a = b then 0 else 1
σ : (α → Fin 2) → α := fun f => if h : ∃ a, ι a = f then h.choose else default
x : ↑C.pt.toCompHaus.toTop
h1 : ι (f x) = gg ((C.π.app j) x)
h2 : ∃ a, ι a = gg ((C.π.app j) x)
a b : α
hh : ι a = ι b
hh1 : ¬b = a
hhh : 0 = 1
⊢ a = b
state_after: no goals