l3lab/ntp-mathlib huggingface dataset:
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₁ : EffectiveEpiFamily Y π
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
⊢ ∀ (b : CoeSort.coe X), ∃ a x, (π₀ a) x = b

Next tactic:
simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
H₁ : ∀ (b : ↑(Stonean.toProfinite.obj X).toCompHaus.toTop), ∃ a x, (π a) x = b
⊢ ∀ (b : CoeSort.coe X), ∃ a x, (π₀ a) x = b

Next tactic:
intro b
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    intro b
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
H₁ : ∀ (b : ↑(Stonean.toProfinite.obj X).toCompHaus.toTop), ∃ a x, (π a) x = b
b : CoeSort.coe X
⊢ ∃ a x, (π₀ a) x = b

Next tactic:
obtain ⟨i, x, H₁⟩ := H₁ b
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    intro b
    obtain ⟨i, x, H₁⟩ := H₁ b
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
H₁✝ : ∀ (b : ↑(Stonean.toProfinite.obj X).toCompHaus.toTop), ∃ a x, (π a) x = b
b : CoeSort.coe X
i : α
x : ↑(Y i).toCompHaus.toTop
H₁ : (π i) x = b
⊢ ∃ a x, (π₀ a) x = b

Next tactic:
refine ⟨i, f₀ i x, ?_⟩
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    intro b
    obtain ⟨i, x, H₁⟩ := H₁ b
    refine ⟨i, f₀ i x, ?_⟩
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
H₁✝ : ∀ (b : ↑(Stonean.toProfinite.obj X).toCompHaus.toTop), ∃ a x, (π a) x = b
b : CoeSort.coe X
i : α
x : ↑(Y i).toCompHaus.toTop
H₁ : (π i) x = b
⊢ (π₀ i) ((f₀ i) x) = b

Next tactic:
rw [← H₁, (H₂ i).2]
theorem coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily (X : Stonean) (S : Sieve X) :
    (∃ (α : Type) (_ : Fintype α) (Y : α → Stonean) (π : (a : α) → (Y a ⟶ X)),
    EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) X) := by
  refine ⟨fun ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ ↦ ?_, fun hS ↦ ?_⟩
  · apply (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (Sieve.functorPushforward _ S)).mpr
    refine ⟨α, inferInstance, fun i => Stonean.toProfinite.obj (Y i),
      fun i => Stonean.toProfinite.map (π i), ⟨?_,
      fun a => Sieve.image_mem_functorPushforward Stonean.toCompHaus S (H₂ a)⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    exact Profinite.effectiveEpiFamily_of_jointly_surjective
        (fun i => Stonean.toProfinite.obj (Y i)) (fun i => Stonean.toProfinite.map (π i)) H₁
  · obtain ⟨α, _, Y, π, ⟨H₁, H₂⟩⟩ := (coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily _).mp hS
    refine ⟨α, inferInstance, ?_⟩
    obtain ⟨Y₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨π₀, H₂⟩ := Classical.skolem.mp H₂
    obtain ⟨f₀, H₂⟩ := Classical.skolem.mp H₂
    refine ⟨Y₀ , π₀, ⟨?_, fun i ↦ (H₂ i).1⟩⟩
    simp only [(Stonean.effectiveEpiFamily_tfae _ _).out 0 2]
    simp only [(Profinite.effectiveEpiFamily_tfae _ _).out 0 2] at H₁
    intro b
    obtain ⟨i, x, H₁⟩ := H₁ b
    refine ⟨i, f₀ i x, ?_⟩
    rw [← H₁, (H₂ i).2]
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
X : Stonean
S : Sieve X
hS :
  S ∈
    GrothendieckTopology.sieves (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
      X
α : Type
w✝ : Fintype α
Y : α → Profinite
π : (a : α) → Y a ⟶ Stonean.toProfinite.obj X
H₂✝² : ∀ (a : α), (Sieve.functorPushforward Stonean.toProfinite S).arrows (π a)
Y₀ : α → Stonean
H₂✝¹ : ∀ (x : α), ∃ g h, S.arrows g ∧ π x = h ≫ Stonean.toProfinite.map g
π₀ : (x : α) → Y₀ x ⟶ X
H₂✝ : ∀ (x : α), ∃ h, S.arrows (π₀ x) ∧ π x = h ≫ Stonean.toProfinite.map (π₀ x)
f₀ : (x : α) → Y x ⟶ Stonean.toProfinite.obj (Y₀ x)
H₂ : ∀ (x : α), S.arrows (π₀ x) ∧ π x = f₀ x ≫ Stonean.toProfinite.map (π₀ x)
H₁✝ : ∀ (b : ↑(Stonean.toProfinite.obj X).toCompHaus.toTop), ∃ a x, (π a) x = b
b : CoeSort.coe X
i : α
x : ↑(Y i).toCompHaus.toTop
H₁ : (π i) x = b
⊢ (π₀ i) ((f₀ i) x) = (f₀ i ≫ Stonean.toProfinite.map (π₀ i)) x

Next tactic:
rfl
lemma coherentTopology_is_induced :
    coherentTopology Stonean.{u} =
      Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) := by
  

Proof state:
⊢ coherentTopology Stonean = Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite)

Next tactic:
ext X S
lemma coherentTopology_is_induced :
    coherentTopology Stonean.{u} =
      Stonean.toProfinite.inducedTopologyOfIsCoverDense (coherentTopology _) := by
  ext X S
  

Proof state:
case h.h.h
X : Stonean
S : Sieve X
⊢ S ∈ GrothendieckTopology.sieves (coherentTopology Stonean) X ↔
    S ∈
      GrothendieckTopology.sieves
        (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite)) X

Next tactic:
rw [← coverDense.inducedTopology_Sieve_iff_EffectiveEpiFamily X,
    ← coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily S]
lemma coverPreserving :
    CoverPreserving (coherentTopology _) (coherentTopology _) Stonean.toProfinite := by
  

Proof state:
⊢ CoverPreserving (coherentTopology Stonean) (coherentTopology Profinite) Stonean.toProfinite

Next tactic:
rw [coherentTopology_is_induced]
lemma coverPreserving :
    CoverPreserving (coherentTopology _) (coherentTopology _) Stonean.toProfinite := by
  rw [coherentTopology_is_induced]
  

Proof state:
⊢ CoverPreserving (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
    (coherentTopology Profinite) Stonean.toProfinite

Next tactic:
apply LocallyCoverDense.inducedTopology_coverPreserving
instance isCocontinuous :
    Stonean.toProfinite.IsCocontinuous (coherentTopology _) (coherentTopology _) := by
  

Proof state:
⊢ Functor.IsCocontinuous Stonean.toProfinite (coherentTopology Stonean) (coherentTopology Profinite)

Next tactic:
rw [coherentTopology_is_induced]
instance isCocontinuous :
    Stonean.toProfinite.IsCocontinuous (coherentTopology _) (coherentTopology _) := by
  rw [coherentTopology_is_induced]
  

Proof state:
⊢ Functor.IsCocontinuous Stonean.toProfinite
    (Functor.inducedTopologyOfIsCoverDense Stonean.toProfinite (coherentTopology Profinite))
    (coherentTopology Profinite)

Next tactic:
apply LocallyCoverDense.inducedTopology_isCocontinuous
/-- Map a Ctop to an equivalent representation type. -/
def ofEquiv (E : σ ≃ τ) : Ctop α σ → Ctop α τ
  | ⟨f, T, h₁, I, h₂, h₃⟩ =>
    { f := fun a ↦ f (E.symm a)
      top := fun x ↦ E (T x)
      top_mem := fun x ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
F : Ctop α σ
E : σ ≃ τ
f : σ → Set α
T : α → σ
h₁ : ∀ (x : α), x ∈ f (T x)
I : (a b : σ) → (x : α) → x ∈ f a ∩ f b → σ
h₂ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), x ∈ f (I a b x h)
h₃ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), f (I a b x h) ⊆ f a ∩ f b
x : α
⊢ x ∈ (fun a => f (E.symm a)) ((fun x => E (T x)) x)

Next tactic:
simpa using h₁ x
/-- Map a Ctop to an equivalent representation type. -/
def ofEquiv (E : σ ≃ τ) : Ctop α σ → Ctop α τ
  | ⟨f, T, h₁, I, h₂, h₃⟩ =>
    { f := fun a ↦ f (E.symm a)
      top := fun x ↦ E (T x)
      top_mem := fun x ↦ by simpa using h₁ x
      inter := fun a b x h ↦ E (I (E.symm a) (E.symm b) x h)
      inter_mem := fun a b x h ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
F : Ctop α σ
E : σ ≃ τ
f : σ → Set α
T : α → σ
h₁ : ∀ (x : α), x ∈ f (T x)
I : (a b : σ) → (x : α) → x ∈ f a ∩ f b → σ
h₂ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), x ∈ f (I a b x h)
h₃ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), f (I a b x h) ⊆ f a ∩ f b
a b : τ
x : α
h : x ∈ (fun a => f (E.symm a)) a ∩ (fun a => f (E.symm a)) b
⊢ x ∈ (fun a => f (E.symm a)) ((fun a b x h => E (I (E.symm a) (E.symm b) x h)) a b x h)

Next tactic:
simpa using h₂ (E.symm a) (E.symm b) x h
/-- Map a Ctop to an equivalent representation type. -/
def ofEquiv (E : σ ≃ τ) : Ctop α σ → Ctop α τ
  | ⟨f, T, h₁, I, h₂, h₃⟩ =>
    { f := fun a ↦ f (E.symm a)
      top := fun x ↦ E (T x)
      top_mem := fun x ↦ by simpa using h₁ x
      inter := fun a b x h ↦ E (I (E.symm a) (E.symm b) x h)
      inter_mem := fun a b x h ↦ by simpa using h₂ (E.symm a) (E.symm b) x h
      inter_sub := fun a b x h ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
F : Ctop α σ
E : σ ≃ τ
f : σ → Set α
T : α → σ
h₁ : ∀ (x : α), x ∈ f (T x)
I : (a b : σ) → (x : α) → x ∈ f a ∩ f b → σ
h₂ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), x ∈ f (I a b x h)
h₃ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), f (I a b x h) ⊆ f a ∩ f b
a b : τ
x : α
h : x ∈ (fun a => f (E.symm a)) a ∩ (fun a => f (E.symm a)) b
⊢ (fun a => f (E.symm a)) ((fun a b x h => E (I (E.symm a) (E.symm b) x h)) a b x h) ⊆
    (fun a => f (E.symm a)) a ∩ (fun a => f (E.symm a)) b

Next tactic:
simpa using h₃ (E.symm a) (E.symm b) x h
@[simp]
theorem ofEquiv_val (E : σ ≃ τ) (F : Ctop α σ) (a : τ) : F.ofEquiv E a = F (E.symm a) := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
F✝ : Ctop α σ
E : σ ≃ τ
F : Ctop α σ
a : τ
⊢ f (ofEquiv E F) a = f F (E.symm a)

Next tactic:
cases F
@[simp]
theorem ofEquiv_val (E : σ ≃ τ) (F : Ctop α σ) (a : τ) : F.ofEquiv E a = F (E.symm a) := by
  cases F; 

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
F : Ctop α σ
E : σ ≃ τ
a : τ
f✝ : σ → Set α
top✝ : α → σ
top_mem✝ : ∀ (x : α), x ∈ f✝ (top✝ x)
inter✝ : (a b : σ) → (x : α) → x ∈ f✝ a ∩ f✝ b → σ
inter_mem✝ : ∀ (a b : σ) (x : α) (h : x ∈ f✝ a ∩ f✝ b), x ∈ f✝ (inter✝ a b x h)
inter_sub✝ : ∀ (a b : σ) (x : α) (h : x ∈ f✝ a ∩ f✝ b), f✝ (inter✝ a b x h) ⊆ f✝ a ∩ f✝ b
⊢ f
      (ofEquiv E
        { f := f✝, top := top✝, top_mem := top_mem✝, inter := inter✝, inter_mem := inter_mem✝,
          inter_sub := inter_sub✝ })
      a =
    f { f := f✝, top := top✝, top_mem := top_mem✝, inter := inter✝, inter_mem := inter_mem✝, inter_sub := inter_sub✝ }
      (E.symm a)

Next tactic:
rfl
protected theorem is_basis [T : TopologicalSpace α] (F : Realizer α) :
    TopologicalSpace.IsTopologicalBasis (Set.range F.F.f) := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
T : TopologicalSpace α
F : Realizer α
⊢ TopologicalSpace.IsTopologicalBasis (range F.F.f)

Next tactic:
have := toTopsp_isTopologicalBasis F.F
protected theorem is_basis [T : TopologicalSpace α] (F : Realizer α) :
    TopologicalSpace.IsTopologicalBasis (Set.range F.F.f) := by
  have := toTopsp_isTopologicalBasis F.F; 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
T : TopologicalSpace α
F : Realizer α
this : TopologicalSpace.IsTopologicalBasis (range F.F.f)
⊢ TopologicalSpace.IsTopologicalBasis (range F.F.f)

Next tactic:
rwa [F.eq] at this
protected theorem mem_nhds [T : TopologicalSpace α] (F : Realizer α) {s : Set α} {a : α} :
    s ∈ 𝓝 a ↔ ∃ b, a ∈ F.F b ∧ F.F b ⊆ s := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
T : TopologicalSpace α
F : Realizer α
s : Set α
a : α
⊢ s ∈ 𝓝 a ↔ ∃ b, a ∈ f F.F b ∧ f F.F b ⊆ s

Next tactic:
have := @mem_nhds_toTopsp _ _ F.F s a
protected theorem mem_nhds [T : TopologicalSpace α] (F : Realizer α) {s : Set α} {a : α} :
    s ∈ 𝓝 a ↔ ∃ b, a ∈ F.F b ∧ F.F b ⊆ s := by
  have := @mem_nhds_toTopsp _ _ F.F s a; 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
T : TopologicalSpace α
F : Realizer α
s : Set α
a : α
this : s ∈ 𝓝 a ↔ ∃ b, a ∈ f F.F b ∧ f F.F b ⊆ s
⊢ s ∈ 𝓝 a ↔ ∃ b, a ∈ f F.F b ∧ f F.F b ⊆ s

Next tactic:
rwa [F.eq] at this
theorem isClosed_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} :
    IsClosed s ↔ ∀ a, (∀ b, a ∈ F.F b → ∃ z, z ∈ F.F b ∩ s) → a ∈ s :=
  isOpen_compl_iff.symm.trans <|
    F.isOpen_iff.trans <|
      forall_congr' fun a ↦
        show (a ∉ s → ∃ b : F.σ, a ∈ F.F b ∧ ∀ z ∈ F.F b, z ∉ s) ↔ _ by
          

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : TopologicalSpace α
F : Realizer α
s : Set α
a : α
⊢ (a ∉ s → ∃ b, a ∈ f F.F b ∧ ∀ z ∈ f F.F b, z ∉ s) ↔ (∀ (b : F.σ), a ∈ f F.F b → ∃ z, z ∈ f F.F b ∩ s) → a ∈ s

Next tactic:
haveI := Classical.propDecidable
theorem isClosed_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} :
    IsClosed s ↔ ∀ a, (∀ b, a ∈ F.F b → ∃ z, z ∈ F.F b ∩ s) → a ∈ s :=
  isOpen_compl_iff.symm.trans <|
    F.isOpen_iff.trans <|
      forall_congr' fun a ↦
        show (a ∉ s → ∃ b : F.σ, a ∈ F.F b ∧ ∀ z ∈ F.F b, z ∉ s) ↔ _ by
          haveI := Classical.propDecidable; 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : TopologicalSpace α
F : Realizer α
s : Set α
a : α
this : (a : Prop) → Decidable a
⊢ (a ∉ s → ∃ b, a ∈ f F.F b ∧ ∀ z ∈ f F.F b, z ∉ s) ↔ (∀ (b : F.σ), a ∈ f F.F b → ∃ z, z ∈ f F.F b ∩ s) → a ∈ s

Next tactic:
rw [not_imp_comm]
theorem isClosed_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} :
    IsClosed s ↔ ∀ a, (∀ b, a ∈ F.F b → ∃ z, z ∈ F.F b ∩ s) → a ∈ s :=
  isOpen_compl_iff.symm.trans <|
    F.isOpen_iff.trans <|
      forall_congr' fun a ↦
        show (a ∉ s → ∃ b : F.σ, a ∈ F.F b ∧ ∀ z ∈ F.F b, z ∉ s) ↔ _ by
          haveI := Classical.propDecidable; rw [not_imp_comm]
          

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : TopologicalSpace α
F : Realizer α
s : Set α
a : α
this : (a : Prop) → Decidable a
⊢ (¬∃ b, a ∈ f F.F b ∧ ∀ z ∈ f F.F b, z ∉ s) → a ∈ s ↔ (∀ (b : F.σ), a ∈ f F.F b → ∃ z, z ∈ f F.F b ∩ s) → a ∈ s

Next tactic:
simp [not_exists, not_and, not_forall, and_comm]
protected theorem isOpen [TopologicalSpace α] (F : Realizer α) (s : F.σ) : IsOpen (F.F s) :=
  isOpen_iff_nhds.2 fun a m ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : TopologicalSpace α
F : Realizer α
s : F.σ
a : α
m : a ∈ f F.F s
⊢ 𝓝 a ≤ 𝓟 (f F.F s)

Next tactic:
simpa using F.mem_nhds.2 ⟨s, m, Subset.refl _⟩
theorem ext' [T : TopologicalSpace α] {σ : Type*} {F : Ctop α σ}
    (H : ∀ a s, s ∈ 𝓝 a ↔ ∃ b, a ∈ F b ∧ F b ⊆ s) : F.toTopsp = T := by
  

Proof state:
α : Type u_1
β : Type u_2
σ✝ : Type u_3
τ : Type u_4
T : TopologicalSpace α
σ : Type u_5
F : Ctop α σ
H : ∀ (a : α) (s : Set α), s ∈ 𝓝 a ↔ ∃ b, a ∈ f F b ∧ f F b ⊆ s
⊢ toTopsp F = T

Next tactic:
refine' eq_of_nhds_eq_nhds fun x ↦ _
theorem ext' [T : TopologicalSpace α] {σ : Type*} {F : Ctop α σ}
    (H : ∀ a s, s ∈ 𝓝 a ↔ ∃ b, a ∈ F b ∧ F b ⊆ s) : F.toTopsp = T := by
  refine' eq_of_nhds_eq_nhds fun x ↦ _
  

Proof state:
α : Type u_1
β : Type u_2
σ✝ : Type u_3
τ : Type u_4
T : TopologicalSpace α
σ : Type u_5
F : Ctop α σ
H : ∀ (a : α) (s : Set α), s ∈ 𝓝 a ↔ ∃ b, a ∈ f F b ∧ f F b ⊆ s
x : α
⊢ 𝓝 x = 𝓝 x

Next tactic:
ext s