l3lab/ntp-mathlib huggingface dataset:
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  

Proof state:
case neg.intro
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
⊢ (∃ p k, Prime p ∧ 0 < k ∧ p ^ k = ↑a) → ∃ n, ↑a = ↑n ∧ ∃ p k, Nat.Prime p ∧ 0 < k ∧ p ^ k = n

Next tactic:
rintro ⟨p, k, hp, hk, hpk⟩
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  

Proof state:
case neg.intro.intro.intro.intro.intro
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
⊢ ∃ n, ↑a = ↑n ∧ ∃ p k, Nat.Prime p ∧ 0 < k ∧ p ^ k = n

Next tactic:
have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    

Proof state:
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
⊢ p ^ 1 ≤ ↑a

Next tactic:
rw [← hpk]
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; 

Proof state:
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
⊢ p ^ 1 ≤ p ^ k

Next tactic:
apply power_le_power_left hp.ne_zero
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; apply power_le_power_left hp.ne_zero; 

Proof state:
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
⊢ 1 ≤ ↑k

Next tactic:
exact mod_cast hk
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
  

Proof state:
case neg.intro.intro.intro.intro.intro
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
key : p ^ 1 ≤ ↑a
⊢ ∃ n, ↑a = ↑n ∧ ∃ p k, Nat.Prime p ∧ 0 < k ∧ p ^ k = n

Next tactic:
rw [power_one] at key
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
  rw [power_one] at key
  

Proof state:
case neg.intro.intro.intro.intro.intro
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
p : Cardinal.{u_1}
k : ℕ
hp : Prime p
hk : 0 < k
hpk : p ^ k = ↑a
key : p ≤ ↑a
⊢ ∃ n, ↑a = ↑n ∧ ∃ p k, Nat.Prime p ∧ 0 < k ∧ p ^ k = n

Next tactic:
lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
  by_cases h : ℵ₀ ≤ a
  · simp [h, (prime_of_aleph0_le h).isPrimePow]
  simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff]
  lift a to ℕ using not_le.mp h
  rw [isPrimePow_def]
  refine'
    ⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
          ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
  rintro ⟨p, k, hp, hk, hpk⟩
  have key : p ^ (1 : Cardinal) ≤ ↑a := by
    rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
  rw [power_one] at key
  lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
  

Proof state:
case neg.intro.intro.intro.intro.intro.intro
a✝ b : Cardinal.{u}
n m a : ℕ
h : ¬ℵ₀ ≤ ↑a
k : ℕ
hk : 0 < k
p : ℕ
hp : Prime ↑p
hpk : ↑p ^ k = ↑a
key : ↑p ≤ ↑a
⊢ ∃ n, ↑a = ↑n ∧ ∃ p k, Nat.Prime p ∧ 0 < k ∧ p ^ k = n

Next tactic:
exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩
/-- Version of `Quot.recOnSubsingleton` tagged with `elab_as_elim` -/
@[elab_as_elim] -- Porting note: this attribute is missing in core
protected abbrev Quot.recOnSubsingleton'
    [h : (a : α) → Subsingleton (motive (Quot.mk r a))]
    (q : Quot r)
    (f : (a : α) → motive (Quot.mk r a)) :
    motive q := by
  

Proof state:
α : Sort u
r : α → α → Prop
motive : Quot r → Sort v
h : ∀ (a : α), Subsingleton (motive (mk r a))
q : Quot r
f : (a : α) → motive (mk r a)
⊢ motive q

Next tactic:
induction q using Quot.rec
/-- Version of `Quot.recOnSubsingleton` tagged with `elab_as_elim` -/
@[elab_as_elim] -- Porting note: this attribute is missing in core
protected abbrev Quot.recOnSubsingleton'
    [h : (a : α) → Subsingleton (motive (Quot.mk r a))]
    (q : Quot r)
    (f : (a : α) → motive (Quot.mk r a)) :
    motive q := by
  induction q using Quot.rec
  

Proof state:
case f
α : Sort u
r : α → α → Prop
motive : Quot r → Sort v
h : ∀ (a : α), Subsingleton (motive (mk r a))
f : (a : α) → motive (mk r a)
a✝ : α
⊢ motive (mk r a✝)
case h
α : Sort u
r : α → α → Prop
motive : Quot r → Sort v
h : ∀ (a : α), Subsingleton (motive (mk r a))
q : Quot r
f : (a : α) → motive (mk r a)
a✝ b✝ : α
p✝ : r a✝ b✝
⊢ (_ : mk r a✝ = mk r b✝) ▸ ?m.408 a✝ = ?m.408 b✝

Next tactic:
apply f
/-- Version of `Quot.recOnSubsingleton` tagged with `elab_as_elim` -/
@[elab_as_elim] -- Porting note: this attribute is missing in core
protected abbrev Quot.recOnSubsingleton'
    [h : (a : α) → Subsingleton (motive (Quot.mk r a))]
    (q : Quot r)
    (f : (a : α) → motive (Quot.mk r a)) :
    motive q := by
  induction q using Quot.rec
  apply f
  

Proof state:
case h
α : Sort u
r : α → α → Prop
motive : Quot r → Sort v
h : ∀ (a : α), Subsingleton (motive (mk r a))
q : Quot r
f : (a : α) → motive (mk r a)
a✝ b✝ : α
p✝ : r a✝ b✝
⊢ (_ : mk r a✝ = mk r b✝) ▸ f a✝ = f b✝

Next tactic:
apply Subsingleton.elim
instance : LocallyBoundedMapClass (LocallyBoundedMap α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Bornology α
inst✝² : Bornology β
inst✝¹ : Bornology γ
inst✝ : Bornology δ
f g : LocallyBoundedMap α β
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g

Next tactic:
cases f
instance : LocallyBoundedMapClass (LocallyBoundedMap α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    

Proof state:
case mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Bornology α
inst✝² : Bornology β
inst✝¹ : Bornology γ
inst✝ : Bornology δ
g : LocallyBoundedMap α β
toFun✝ : α → β
comap_cobounded_le'✝ : comap toFun✝ (cobounded β) ≤ cobounded α
h : (fun f => f.toFun) { toFun := toFun✝, comap_cobounded_le' := comap_cobounded_le'✝ } = (fun f => f.toFun) g
⊢ { toFun := toFun✝, comap_cobounded_le' := comap_cobounded_le'✝ } = g

Next tactic:
cases g
instance : LocallyBoundedMapClass (LocallyBoundedMap α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    cases g
    

Proof state:
case mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Bornology α
inst✝² : Bornology β
inst✝¹ : Bornology γ
inst✝ : Bornology δ
toFun✝¹ : α → β
comap_cobounded_le'✝¹ : comap toFun✝¹ (cobounded β) ≤ cobounded α
toFun✝ : α → β
comap_cobounded_le'✝ : comap toFun✝ (cobounded β) ≤ cobounded α
h :
  (fun f => f.toFun) { toFun := toFun✝¹, comap_cobounded_le' := comap_cobounded_le'✝¹ } =
    (fun f => f.toFun) { toFun := toFun✝, comap_cobounded_le' := comap_cobounded_le'✝ }
⊢ { toFun := toFun✝¹, comap_cobounded_le' := comap_cobounded_le'✝¹ } =
    { toFun := toFun✝, comap_cobounded_le' := comap_cobounded_le'✝ }

Next tactic:
congr
@[simp]
theorem cancel_left {g : LocallyBoundedMap β γ} {f₁ f₂ : LocallyBoundedMap α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
  ⟨fun h => ext fun a => hg <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Bornology α
inst✝² : Bornology β
inst✝¹ : Bornology γ
inst✝ : Bornology δ
g : LocallyBoundedMap β γ
f₁ f₂ : LocallyBoundedMap α β
hg : Injective ⇑g
h : comp g f₁ = comp g f₂
a : α
⊢ g (f₁ a) = g (f₂ a)

Next tactic:
rw [← comp_apply, h, comp_apply]
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  

Proof state:
X Y : TopCat
f : X ⟶ Y
⊢ Epi f ↔ Function.Surjective ⇑f

Next tactic:
suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    rfl
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    

Proof state:
X Y : TopCat
f : X ⟶ Y
this : Epi f ↔ Epi ((forget TopCat).map f)
⊢ Epi f ↔ Function.Surjective ⇑f

Next tactic:
rw [this, CategoryTheory.epi_iff_surjective]
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    

Proof state:
X Y : TopCat
f : X ⟶ Y
this : Epi f ↔ Epi ((forget TopCat).map f)
⊢ Function.Surjective ((forget TopCat).map f) ↔ Function.Surjective ⇑f

Next tactic:
rfl
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    rfl
  

Proof state:
X Y : TopCat
f : X ⟶ Y
⊢ Epi f ↔ Epi ((forget TopCat).map f)

Next tactic:
constructor
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    rfl
  constructor
  · 

Proof state:
case mp
X Y : TopCat
f : X ⟶ Y
⊢ Epi f → Epi ((forget TopCat).map f)

Next tactic:
intro
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    rfl
  constructor
  · intro
    

Proof state:
case mp
X Y : TopCat
f : X ⟶ Y
a✝ : Epi f
⊢ Epi ((forget TopCat).map f)

Next tactic:
infer_instance
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
  suffices Epi f ↔ Epi ((forget TopCat).map f) by
    rw [this, CategoryTheory.epi_iff_surjective]
    rfl
  constructor
  · intro
    infer_instance
  · 

Proof state:
case mpr
X Y : TopCat
f : X ⟶ Y
⊢ Epi ((forget TopCat).map f) → Epi f

Next tactic:
apply Functor.epi_of_epi_map
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  

Proof state:
X Y : TopCat
f : X ⟶ Y
⊢ Mono f ↔ Function.Injective ⇑f

Next tactic:
suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    rfl
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    

Proof state:
X Y : TopCat
f : X ⟶ Y
this : Mono f ↔ Mono ((forget TopCat).map f)
⊢ Mono f ↔ Function.Injective ⇑f

Next tactic:
rw [this, CategoryTheory.mono_iff_injective]
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    

Proof state:
X Y : TopCat
f : X ⟶ Y
this : Mono f ↔ Mono ((forget TopCat).map f)
⊢ Function.Injective ((forget TopCat).map f) ↔ Function.Injective ⇑f

Next tactic:
rfl
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    rfl
  

Proof state:
X Y : TopCat
f : X ⟶ Y
⊢ Mono f ↔ Mono ((forget TopCat).map f)

Next tactic:
constructor
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    rfl
  constructor
  · 

Proof state:
case mp
X Y : TopCat
f : X ⟶ Y
⊢ Mono f → Mono ((forget TopCat).map f)

Next tactic:
intro
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    rfl
  constructor
  · intro
    

Proof state:
case mp
X Y : TopCat
f : X ⟶ Y
a✝ : Mono f
⊢ Mono ((forget TopCat).map f)

Next tactic:
infer_instance
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
  suffices Mono f ↔ Mono ((forget TopCat).map f) by
    rw [this, CategoryTheory.mono_iff_injective]
    rfl
  constructor
  · intro
    infer_instance
  · 

Proof state:
case mpr
X Y : TopCat
f : X ⟶ Y
⊢ Mono ((forget TopCat).map f) → Mono f

Next tactic:
apply Functor.mono_of_mono_map
instance cocompact_inf_nhds_neBot : NeBot (cocompact ℚ ⊓ 𝓝 p) := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ NeBot (cocompact ℚ ⊓ 𝓝 p)

Next tactic:
refine' (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 _
instance cocompact_inf_nhds_neBot : NeBot (cocompact ℚ ⊓ 𝓝 p) := by
  refine' (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 _
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ ∀ {i : Set ℚ × Set ℚ}, IsCompact i.1 ∧ p ∈ i.2 ∧ IsOpen i.2 → Set.Nonempty (i.1ᶜ ∩ i.2)

Next tactic:
rintro ⟨s, o⟩ ⟨hs, hpo, ho⟩
instance cocompact_inf_nhds_neBot : NeBot (cocompact ℚ ⊓ 𝓝 p) := by
  refine' (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 _
  rintro ⟨s, o⟩ ⟨hs, hpo, ho⟩; 

Proof state:
case mk.intro.intro
p q : ℚ
s✝ t s o : Set ℚ
hs : IsCompact (s, o).1
hpo : p ∈ (s, o).2
ho : IsOpen (s, o).2
⊢ Set.Nonempty ((s, o).1ᶜ ∩ (s, o).2)

Next tactic:
rw [inter_comm]
instance cocompact_inf_nhds_neBot : NeBot (cocompact ℚ ⊓ 𝓝 p) := by
  refine' (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 _
  rintro ⟨s, o⟩ ⟨hs, hpo, ho⟩; rw [inter_comm]
  

Proof state:
case mk.intro.intro
p q : ℚ
s✝ t s o : Set ℚ
hs : IsCompact (s, o).1
hpo : p ∈ (s, o).2
ho : IsOpen (s, o).2
⊢ Set.Nonempty ((s, o).2 ∩ (s, o).1ᶜ)

Next tactic:
exact (dense_compl_compact hs).inter_open_nonempty _ ho ⟨p, hpo⟩
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ ¬IsCountablyGenerated (cocompact ℚ)

Next tactic:
intro H
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  

Proof state:
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
⊢ False

Next tactic:
rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
  

Proof state:
case intro
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hx : Tendsto x atTop (cocompact ℚ ⊓ 𝓝 0)
⊢ False

Next tactic:
rw [tendsto_inf] at hx
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
  rw [tendsto_inf] at hx; 

Proof state:
case intro
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hx : Tendsto x atTop (cocompact ℚ) ∧ Tendsto x atTop (𝓝 0)
⊢ False

Next tactic:
rcases hx with ⟨hxc, hx0⟩
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
  rw [tendsto_inf] at hx; rcases hx with ⟨hxc, hx0⟩
  

Proof state:
case intro.intro
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hxc : Tendsto x atTop (cocompact ℚ)
hx0 : Tendsto x atTop (𝓝 0)
⊢ False

Next tactic:
obtain ⟨n, hn⟩ : ∃ n : ℕ, x n ∉ insert (0 : ℚ) (range x)
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
  rw [tendsto_inf] at hx; rcases hx with ⟨hxc, hx0⟩
  obtain ⟨n, hn⟩ : ∃ n : ℕ, x n ∉ insert (0 : ℚ) (range x)
  

Proof state:
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hxc : Tendsto x atTop (cocompact ℚ)
hx0 : Tendsto x atTop (𝓝 0)
⊢ ∃ n, x n ∉ insert 0 (range x)
case intro.intro.intro
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hxc : Tendsto x atTop (cocompact ℚ)
hx0 : Tendsto x atTop (𝓝 0)
n : ℕ
hn : x n ∉ insert 0 (range x)
⊢ False

Next tactic:
exact (hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists
theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by
  intro H
  rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
  rw [tendsto_inf] at hx; rcases hx with ⟨hxc, hx0⟩
  obtain ⟨n, hn⟩ : ∃ n : ℕ, x n ∉ insert (0 : ℚ) (range x)
  exact (hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists
  

Proof state:
case intro.intro.intro
p q : ℚ
s t : Set ℚ
H : IsCountablyGenerated (cocompact ℚ)
x : ℕ → ℚ
hxc : Tendsto x atTop (cocompact ℚ)
hx0 : Tendsto x atTop (𝓝 0)
n : ℕ
hn : x n ∉ insert 0 (range x)
⊢ False

Next tactic:
exact hn (Or.inr ⟨n, rfl⟩)
theorem not_countably_generated_nhds_infty_opc : ¬IsCountablyGenerated (𝓝 (∞ : ℚ∞)) := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ ¬IsCountablyGenerated (𝓝 ∞)

Next tactic:
intro
theorem not_countably_generated_nhds_infty_opc : ¬IsCountablyGenerated (𝓝 (∞ : ℚ∞)) := by
  intro
  

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : IsCountablyGenerated (𝓝 ∞)
⊢ False

Next tactic:
have : IsCountablyGenerated (comap (OnePoint.some : ℚ → ℚ∞) (𝓝 ∞)) := by infer_instance
theorem not_countably_generated_nhds_infty_opc : ¬IsCountablyGenerated (𝓝 (∞ : ℚ∞)) := by
  intro
  have : IsCountablyGenerated (comap (OnePoint.some : ℚ → ℚ∞) (𝓝 ∞)) := by 

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : IsCountablyGenerated (𝓝 ∞)
⊢ IsCountablyGenerated (comap OnePoint.some (𝓝 ∞))

Next tactic:
infer_instance
theorem not_countably_generated_nhds_infty_opc : ¬IsCountablyGenerated (𝓝 (∞ : ℚ∞)) := by
  intro
  have : IsCountablyGenerated (comap (OnePoint.some : ℚ → ℚ∞) (𝓝 ∞)) := by infer_instance
  

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : IsCountablyGenerated (𝓝 ∞)
this : IsCountablyGenerated (comap OnePoint.some (𝓝 ∞))
⊢ False

Next tactic:
rw [OnePoint.comap_coe_nhds_infty, coclosedCompact_eq_cocompact] at this
theorem not_countably_generated_nhds_infty_opc : ¬IsCountablyGenerated (𝓝 (∞ : ℚ∞)) := by
  intro
  have : IsCountablyGenerated (comap (OnePoint.some : ℚ → ℚ∞) (𝓝 ∞)) := by infer_instance
  rw [OnePoint.comap_coe_nhds_infty, coclosedCompact_eq_cocompact] at this
  

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : IsCountablyGenerated (𝓝 ∞)
this : IsCountablyGenerated (cocompact ℚ)
⊢ False

Next tactic:
exact not_countably_generated_cocompact this
theorem not_firstCountableTopology_opc : ¬FirstCountableTopology ℚ∞ := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ ¬FirstCountableTopology ℚ∞

Next tactic:
intro
theorem not_firstCountableTopology_opc : ¬FirstCountableTopology ℚ∞ := by
  intro
  

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : FirstCountableTopology ℚ∞
⊢ False

Next tactic:
exact not_countably_generated_nhds_infty_opc inferInstance
theorem not_secondCountableTopology_opc : ¬SecondCountableTopology ℚ∞ := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ ¬SecondCountableTopology ℚ∞

Next tactic:
intro
theorem not_secondCountableTopology_opc : ¬SecondCountableTopology ℚ∞ := by
  intro
  

Proof state:
p q : ℚ
s t : Set ℚ
a✝ : SecondCountableTopology ℚ∞
⊢ False

Next tactic:
exact not_firstCountableTopology_opc inferInstance
instance : TotallyDisconnectedSpace ℚ := by
  

Proof state:
p q : ℚ
s t : Set ℚ
⊢ TotallyDisconnectedSpace ℚ

Next tactic:
refine' ⟨fun s hsu hs x hx y hy => _⟩
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; 

Proof state:
p q : ℚ
s✝ t s : Set ℚ
hsu : s ⊆ univ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
⊢ x = y

Next tactic:
clear hsu
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; clear hsu
  

Proof state:
p q : ℚ
s✝ t s : Set ℚ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
⊢ x = y

Next tactic:
by_contra! H : x ≠ y
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; clear hsu
  by_contra! H : x ≠ y
  

Proof state:
p q : ℚ
s✝ t s : Set ℚ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
H : x ≠ y
⊢ False

Next tactic:
wlog hlt : x < y
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; clear hsu
  by_contra! H : x ≠ y
  wlog hlt : x < y
  · 

Proof state:
case inr
p q : ℚ
s✝ t s : Set ℚ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
H : x ≠ y
this : ∀ {p q : ℚ} {s t : Set ℚ} (s : Set ℚ), IsPreconnected s → ∀ x ∈ s, ∀ y ∈ s, x ≠ y → x < y → False
hlt : ¬x < y
⊢ False

Next tactic:
refine' this s hs y hy x hx H.symm <| H.lt_or_lt.resolve_left hlt
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; clear hsu
  by_contra! H : x ≠ y
  wlog hlt : x < y
  · refine' this s hs y hy x hx H.symm <| H.lt_or_lt.resolve_left hlt <;> 

Proof state:
case inr.refine'_1
p q : ℚ
s✝ t s : Set ℚ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
H : x ≠ y
this : ∀ {p q : ℚ} {s t : Set ℚ} (s : Set ℚ), IsPreconnected s → ∀ x ∈ s, ∀ y ∈ s, x ≠ y → x < y → False
hlt : ¬x < y
⊢ ℚ

Next tactic:
assumption
instance : TotallyDisconnectedSpace ℚ := by
  refine' ⟨fun s hsu hs x hx y hy => _⟩; clear hsu
  by_contra! H : x ≠ y
  wlog hlt : x < y
  · refine' this s hs y hy x hx H.symm <| H.lt_or_lt.resolve_left hlt <;> 

Proof state:
case inr.refine'_2
p q : ℚ
s✝ t s : Set ℚ
hs : IsPreconnected s
x : ℚ
hx : x ∈ s
y : ℚ
hy : y ∈ s
H : x ≠ y
this : ∀ {p q : ℚ} {s t : Set ℚ} (s : Set ℚ), IsPreconnected s → ∀ x ∈ s, ∀ y ∈ s, x ≠ y → x < y → False
hlt : ¬x < y
⊢ ℚ

Next tactic:
assumption