Theorem: Perfect.small_diam_aux
File: Mathlib/Topology/MetricSpace/Perfect.lean

tactic: have : x ∈ EMetric.ball x (ε / 2) := by
  apply EMetric.mem_ball_self
  rw [ENNReal.div_pos_iff]
  exact ⟨ne_of_gt ε_pos, by norm_num⟩
state_before: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ let D := closure (EMetric.ball x (ε / 2) ∩ C);
  Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε
state_after: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this : x ∈ EMetric.ball x (ε / 2)
⊢ let D := closure (EMetric.ball x (ε / 2) ∩ C);
  Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε

tactic: have := hC.closure_nhds_inter x xC this EMetric.isOpen_ball
state_before: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this : x ∈ EMetric.ball x (ε / 2)
⊢ let D := closure (EMetric.ball x (ε / 2) ∩ C);
  Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε
state_after: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ let D := closure (EMetric.ball x (ε / 2) ∩ C);
  Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε

tactic: refine ⟨this.1, this.2, ?_, ?_⟩
state_before: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ let D := closure (EMetric.ball x (ε / 2) ∩ C);
  Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε
state_after: case refine_1
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ closure (EMetric.ball x (ε / 2) ∩ C) ⊆ C

case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (closure (EMetric.ball x (ε / 2) ∩ C)) ≤ ε

tactic: rw [EMetric.diam_closure]
state_before: case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (closure (EMetric.ball x (ε / 2) ∩ C)) ≤ ε
state_after: case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (EMetric.ball x (ε / 2) ∩ C) ≤ ε

tactic: apply le_trans (EMetric.diam_mono inter_subset_left)
state_before: case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (EMetric.ball x (ε / 2) ∩ C) ≤ ε
state_after: case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (EMetric.ball x (ε / 2)) ≤ ε

tactic: convert EMetric.diam_ball (x := x)
state_before: case refine_2
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.diam (EMetric.ball x (ε / 2)) ≤ ε
state_after: case h.e'_4
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ ε = 2 * (ε / 2)

tactic: rw [mul_comm, ENNReal.div_mul_cancel] <;> norm_num
state_before: case h.e'_4
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ ε = 2 * (ε / 2)
state_after: no goals

tactic: apply EMetric.mem_ball_self
state_before: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ x ∈ EMetric.ball x (ε / 2)
state_after: case h
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ 0 < ε / 2

tactic: rw [ENNReal.div_pos_iff]
state_before: case h
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ 0 < ε / 2
state_after: case h
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ ε ≠ 0 ∧ 2 ≠ ⊤

tactic: exact ⟨ne_of_gt ε_pos, by norm_num⟩
state_before: case h
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ ε ≠ 0 ∧ 2 ≠ ⊤
state_after: no goals

tactic: norm_num
state_before: α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
⊢ 2 ≠ ⊤
state_after: no goals

tactic: rw [IsClosed.closure_subset_iff hC.closed]
state_before: case refine_1
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ closure (EMetric.ball x (ε / 2) ∩ C) ⊆ C
state_after: case refine_1
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.ball x (ε / 2) ∩ C ⊆ C

tactic: apply inter_subset_right
state_before: case refine_1
α : Type u_1
inst✝ : MetricSpace α
C : Set α
hC : Perfect C
ε : ℝ≥0∞
ε_pos : 0 < ε
x : α
xC : x ∈ C
this✝ : x ∈ EMetric.ball x (ε / 2)
this : Perfect (closure (EMetric.ball x (ε / 2) ∩ C)) ∧ (closure (EMetric.ball x (ε / 2) ∩ C)).Nonempty
⊢ EMetric.ball x (ε / 2) ∩ C ⊆ C
state_after: no goals