l3lab/ntp-mathlib huggingface dataset:
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
⊢ maxPowDiv p (p * n) = maxPowDiv p n + 1

Next tactic:
have : 0 < p := lt_trans (b := 1) (by simp) hp
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by 

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
⊢ 0 < 1

Next tactic:
simp
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ maxPowDiv p (p * n) = maxPowDiv p n + 1

Next tactic:
dsimp [maxPowDiv]
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  dsimp [maxPowDiv]
  

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ go 0 p (p * n) = go 0 p n + 1

Next tactic:
rw [maxPowDiv.go_eq, if_pos, mul_div_right _ this]
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  dsimp [maxPowDiv]
  rw [maxPowDiv.go_eq, if_pos, mul_div_right _ this]
  · 

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ go (0 + 1) p n = go 0 p n + 1

Next tactic:
apply go_succ
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  dsimp [maxPowDiv]
  rw [maxPowDiv.go_eq, if_pos, mul_div_right _ this]
  · apply go_succ
  · 

Proof state:
case hc
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ 1 < p ∧ 0 < p * n ∧ p * n % p = 0

Next tactic:
refine ⟨hp, ?_, by simp⟩
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  dsimp [maxPowDiv]
  rw [maxPowDiv.go_eq, if_pos, mul_div_right _ this]
  · apply go_succ
  · refine ⟨hp, ?_, by 

Proof state:
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ p * n % p = 0

Next tactic:
simp
theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1 := by
  have : 0 < p := lt_trans (b := 1) (by simp) hp
  dsimp [maxPowDiv]
  rw [maxPowDiv.go_eq, if_pos, mul_div_right _ this]
  · apply go_succ
  · refine ⟨hp, ?_, by simp⟩
    

Proof state:
case hc
p n : ℕ
hp : 1 < p
hn : 0 < n
this : 0 < p
⊢ 0 < p * n

Next tactic:
apply Nat.mul_pos this hn
theorem base_pow_mul {p n exp : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p ^ exp * n) = p.maxPowDiv n + exp := by
  

Proof state:
p n exp : ℕ
hp : 1 < p
hn : 0 < n
⊢ maxPowDiv p (p ^ exp * n) = maxPowDiv p n + exp

Next tactic:
match exp with
  | 0 => simp
  | e + 1 =>
    rw [pow_succ, mul_assoc, mul_comm, mul_assoc, base_mul_eq_succ hp, mul_comm, base_pow_mul hp hn]
    · ac_rfl
    · apply Nat.mul_pos hn <| pow_pos (pos_of_gt hp) e
theorem base_pow_mul {p n exp : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p ^ exp * n) = p.maxPowDiv n + exp := by
  match exp with
  | 0 => 

Proof state:
p n exp : ℕ
hp : 1 < p
hn : 0 < n
⊢ maxPowDiv p (p ^ 0 * n) = maxPowDiv p n + 0

Next tactic:
simp
theorem base_pow_mul {p n exp : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p ^ exp * n) = p.maxPowDiv n + exp := by
  match exp with
  | 0 => simp
  | e + 1 =>
    

Proof state:
p n exp : ℕ
hp : 1 < p
hn : 0 < n
e : ℕ
⊢ maxPowDiv p (p ^ (e + 1) * n) = maxPowDiv p n + (e + 1)

Next tactic:
rw [pow_succ, mul_assoc, mul_comm, mul_assoc, base_mul_eq_succ hp, mul_comm, base_pow_mul hp hn]
theorem base_pow_mul {p n exp : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p ^ exp * n) = p.maxPowDiv n + exp := by
  match exp with
  | 0 => simp
  | e + 1 =>
    rw [pow_succ, mul_assoc, mul_comm, mul_assoc, base_mul_eq_succ hp, mul_comm, base_pow_mul hp hn]
    · 

Proof state:
p n exp : ℕ
hp : 1 < p
hn : 0 < n
e : ℕ
⊢ maxPowDiv p n + e + 1 = maxPowDiv p n + (e + 1)

Next tactic:
ac_rfl
theorem base_pow_mul {p n exp : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p ^ exp * n) = p.maxPowDiv n + exp := by
  match exp with
  | 0 => simp
  | e + 1 =>
    rw [pow_succ, mul_assoc, mul_comm, mul_assoc, base_mul_eq_succ hp, mul_comm, base_pow_mul hp hn]
    · ac_rfl
    · 

Proof state:
p n exp : ℕ
hp : 1 < p
hn : 0 < n
e : ℕ
⊢ 0 < n * p ^ e

Next tactic:
apply Nat.mul_pos hn <| pow_pos (pos_of_gt hp) e
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  

Proof state:
p n : ℕ
⊢ p ^ maxPowDiv p n ∣ n

Next tactic:
dsimp [maxPowDiv]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  

Proof state:
p n : ℕ
⊢ p ^ go 0 p n ∣ n

Next tactic:
rw [go_eq]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  

Proof state:
p n : ℕ
⊢ (p ^ if 1 < p ∧ 0 < n ∧ n % p = 0 then go (0 + 1) p (n / p) else 0) ∣ n

Next tactic:
by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · 

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
⊢ (p ^ if 1 < p ∧ 0 < n ∧ n % p = 0 then go (0 + 1) p (n / p) else 0) ∣ n

Next tactic:
have : n / p < n := by apply Nat.div_lt_self <;> aesop
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by 

Proof state:
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
⊢ n / p < n

Next tactic:
apply Nat.div_lt_self
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> 

Proof state:
case hLtN
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
⊢ 0 < n

Next tactic:
aesop
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> 

Proof state:
case hLtK
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
⊢ 1 < p

Next tactic:
aesop
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
⊢ (p ^ if 1 < p ∧ 0 < n ∧ n % p = 0 then go (0 + 1) p (n / p) else 0) ∣ n

Next tactic:
rw [if_pos h]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
⊢ p ^ go (0 + 1) p (n / p) ∣ n

Next tactic:
have ⟨c,hc⟩ := pow_dvd p (n / p)
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ p ^ go (0 + 1) p (n / p) ∣ n

Next tactic:
rw [go_succ, pow_succ]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ p ^ go 0 p (n / p) * p ∣ n

Next tactic:
nth_rw 2 [← mod_add_div' n p]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ p ^ go 0 p (n / p) * p ∣ n % p + n / p * p

Next tactic:
rw [h.right.right, zero_add]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    rw [h.right.right, zero_add]
    

Proof state:
case pos
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ p ^ go 0 p (n / p) * p ∣ n / p * p

Next tactic:
exact ⟨c,by nth_rw 1 [hc]; ac_rfl⟩
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    rw [h.right.right, zero_add]
    exact ⟨c,by 

Proof state:
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ n / p * p = p ^ go 0 p (n / p) * p * c

Next tactic:
nth_rw 1 [hc]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    rw [h.right.right, zero_add]
    exact ⟨c,by nth_rw 1 [hc]; 

Proof state:
p n : ℕ
h : 1 < p ∧ 0 < n ∧ n % p = 0
this : n / p < n
c : ℕ
hc : n / p = p ^ maxPowDiv p (n / p) * c
⊢ p ^ maxPowDiv p (n / p) * c * p = p ^ go 0 p (n / p) * p * c

Next tactic:
ac_rfl
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    rw [h.right.right, zero_add]
    exact ⟨c,by nth_rw 1 [hc]; ac_rfl⟩
  · 

Proof state:
case neg
p n : ℕ
h : ¬(1 < p ∧ 0 < n ∧ n % p = 0)
⊢ (p ^ if 1 < p ∧ 0 < n ∧ n % p = 0 then go (0 + 1) p (n / p) else 0) ∣ n

Next tactic:
rw [if_neg h]
theorem pow_dvd (p n : ℕ) : p ^ (p.maxPowDiv n) ∣ n := by
  dsimp [maxPowDiv]
  rw [go_eq]
  by_cases h : (1 < p ∧ 0 < n ∧ n % p = 0)
  · have : n / p < n := by apply Nat.div_lt_self <;> aesop
    rw [if_pos h]
    have ⟨c,hc⟩ := pow_dvd p (n / p)
    rw [go_succ, pow_succ]
    nth_rw 2 [← mod_add_div' n p]
    rw [h.right.right, zero_add]
    exact ⟨c,by nth_rw 1 [hc]; ac_rfl⟩
  · rw [if_neg h]
    

Proof state:
case neg
p n : ℕ
h : ¬(1 < p ∧ 0 < n ∧ n % p = 0)
⊢ p ^ 0 ∣ n

Next tactic:
simp
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  

Proof state:
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
⊢ pow ≤ maxPowDiv p n

Next tactic:
have ⟨c, hc⟩ := h
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  

Proof state:
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = p ^ pow * c
⊢ pow ≤ maxPowDiv p n

Next tactic:
have : 0 < c := by
    apply Nat.pos_of_ne_zero
    intro h'
    rw [h',mul_zero] at hc
    exact not_eq_zero_of_lt hn hc
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  have : 0 < c := by
    

Proof state:
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = p ^ pow * c
⊢ 0 < c

Next tactic:
apply Nat.pos_of_ne_zero
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  have : 0 < c := by
    apply Nat.pos_of_ne_zero
    

Proof state:
case a
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = p ^ pow * c
⊢ c ≠ 0

Next tactic:
intro h'
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  have : 0 < c := by
    apply Nat.pos_of_ne_zero
    intro h'
    

Proof state:
case a
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = p ^ pow * c
h' : c = 0
⊢ False

Next tactic:
rw [h',mul_zero] at hc
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  have : 0 < c := by
    apply Nat.pos_of_ne_zero
    intro h'
    rw [h',mul_zero] at hc
    

Proof state:
case a
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = 0
h' : c = 0
⊢ False

Next tactic:
exact not_eq_zero_of_lt hn hc
theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n := by
  have ⟨c, hc⟩ := h
  have : 0 < c := by
    apply Nat.pos_of_ne_zero
    intro h'
    rw [h',mul_zero] at hc
    exact not_eq_zero_of_lt hn hc
  

Proof state:
p n pow : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ pow ∣ n
c : ℕ
hc : n = p ^ pow * c
this : 0 < c
⊢ pow ≤ maxPowDiv p n

Next tactic:
simp [hc, base_pow_mul hp this]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
    FirstCountableTopology α where
  nhds_generated_countable := by 

Proof state:
α : Type u_1
inst✝¹ : TopologicalSpace α
inst✝ : DiscreteTopology α
⊢ ∀ (a : α), IsCountablyGenerated (nhds a)

Next tactic:
rw [nhds_discrete]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
    FirstCountableTopology α where
  nhds_generated_countable := by rw [nhds_discrete]; 

Proof state:
α : Type u_1
inst✝¹ : TopologicalSpace α
inst✝ : DiscreteTopology α
⊢ ∀ (a : α), IsCountablyGenerated (pure a)

Next tactic:
exact isCountablyGenerated_pure
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
    [hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
  haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
    { is_open_generated_countable :=
        ⟨{univ}, countable_singleton _, by 

Proof state:
α : Type u_1
inst✝¹ : TopologicalSpace α
hd : DiscreteTopology α
inst✝ : Encodable α
i : α
⊢ instTopologicalSpaceSubtype = generateFrom {univ}

Next tactic:
simp only [eq_iff_true_of_subsingleton]
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}

Next tactic:
refine' (eq_bot_of_singletons_open fun a => _).symm
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
⊢ IsOpen {a}

Next tactic:
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    rw [inter_comm, Ici_inter_Iic, Icc_self a]
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
⊢ {a} = Iio (succ a) ∩ Ioi (pred a)

Next tactic:
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · 

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
⊢ {a} = Iio (succ a) ∩ Ioi (pred a)

Next tactic:
rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    

Proof state:
case h_singleton_eq_inter'
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
⊢ {a} = Iic a ∩ Ici a

Next tactic:
rw [inter_comm, Ici_inter_Iic, Icc_self a]
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    rw [inter_comm, Ici_inter_Iic, Icc_self a]
  

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen {a}

Next tactic:
rw [h_singleton_eq_inter]
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    rw [inter_comm, Ici_inter_Iic, Icc_self a]
  rw [h_singleton_eq_inter]
  -- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
  

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Iio (succ a) ∩ Ioi (pred a))

Next tactic:
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    rw [inter_comm, Ici_inter_Iic, Icc_self a]
  rw [h_singleton_eq_inter]
  -- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
  apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
  · 

Proof state:
case h₁
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Iio (succ a))

Next tactic:
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
    (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
  refine' (eq_bot_of_singletons_open fun a => _).symm
  have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
    suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
    · rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
    rw [inter_comm, Ici_inter_Iic, Icc_self a]
  rw [h_singleton_eq_inter]
  -- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
  apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
  · exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
  · 

Proof state:
case h₂
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Ioi (pred a))

Next tactic:
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
  

Proof state:
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
⊢ DiscreteTopology α ↔ OrderTopology α

Next tactic:
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
  refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
  · 

Proof state:
case refine'_1
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : DiscreteTopology α
⊢ inst✝⁵ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}

Next tactic:
rw [h.eq_bot]
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
  refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
  · rw [h.eq_bot]
    

Proof state:
case refine'_1
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : DiscreteTopology α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}

Next tactic:
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
  refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
  · rw [h.eq_bot]
    exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
  · 

Proof state:
case refine'_2
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : OrderTopology α
⊢ inst✝⁵ = ⊥

Next tactic:
rw [h.topology_eq_generate_intervals]