Theorem: UniformSpace.metrizable_uniformity
File: Mathlib/Topology/MetricSpace/MetrizableUniformity.lean

tactic: obtain ⟨U, hU_symm, hU_comp, hB⟩ :
  ∃ U : ℕ → Set (X × X),
    (∀ n, SymmetricRel (U n)) ∧
      (∀ ⦃m n⦄, m < n → U n ○ (U n ○ U n) ⊆ U m) ∧ (𝓤 X).HasAntitoneBasis U := by
  rcases UniformSpace.has_seq_basis X with ⟨V, hB, hV_symm⟩
  rcases hB.subbasis_with_rel fun m =>
      hB.tendsto_smallSets.eventually
        (eventually_uniformity_iterate_comp_subset (hB.mem m) 2) with
    ⟨φ, -, hφ_comp, hφB⟩
  exact ⟨V ∘ φ, fun n => hV_symm _, hφ_comp, hφB⟩
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: letI := UniformSpace.separationSetoid X
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: set d : X → X → ℝ≥0 := fun x y => if h : ∃ n, (x, y) ∉ U n then (1 / 2) ^ Nat.find h else 0
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: have hd_symm : ∀ x y, d x y = d y x := by
  intro x y
  simp only [@SymmetricRel.mk_mem_comm _ _ (hU_symm _) x y]
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: have hr : (1 / 2 : ℝ≥0) ∈ Ioo (0 : ℝ≥0) 1 := ⟨half_pos one_pos, NNReal.half_lt_self one_ne_zero⟩
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: letI I := PseudoMetricSpace.ofPreNNDist d (fun x => hd₀.2 (Setoid.refl _)) hd_symm
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: have hdist_le : ∀ x y, dist x y ≤ d x y := PseudoMetricSpace.dist_ofPreNNDist_le _ _ _
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: refine' ⟨I, uniformSpace_eq <| (uniformity_basis_dist_pow hr.1 hr.2).ext hB.toHasBasis _ _⟩
state_before: case intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
⊢ ∃ I, PseudoMetricSpace.toUniformSpace = inst✝¹

tactic: rcases UniformSpace.has_seq_basis X with ⟨V, hB, hV_symm⟩
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
⊢ ∃ U, (∀ (n : ℕ), SymmetricRel (U n)) ∧ (∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m) ∧ HasAntitoneBasis (𝓤 X) U

tactic: rcases hB.subbasis_with_rel fun m =>
    hB.tendsto_smallSets.eventually
      (eventually_uniformity_iterate_comp_subset (hB.mem m) 2) with
  ⟨φ, -, hφ_comp, hφB⟩
state_before: case intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
V : ℕ → Set (X × X)
hB : HasAntitoneBasis (𝓤 X) V
hV_symm : ∀ (n : ℕ), SymmetricRel (V n)
⊢ ∃ U, (∀ (n : ℕ), SymmetricRel (U n)) ∧ (∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m) ∧ HasAntitoneBasis (𝓤 X) U

tactic: exact ⟨V ∘ φ, fun n => hV_symm _, hφ_comp, hφB⟩
state_before: case intro.intro.intro.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
V : ℕ → Set (X × X)
hB : HasAntitoneBasis (𝓤 X) V
hV_symm : ∀ (n : ℕ), SymmetricRel (V n)
φ : ℕ → ℕ
hφ_comp : ∀ ⦃m n : ℕ⦄, m < n → ((fun x x_1 => x ○ x_1) (V (φ n))^[2]) (V (φ n)) ⊆ V (φ m)
hφB : HasAntitoneBasis (𝓤 X) (V ∘ φ)
⊢ ∃ U, (∀ (n : ℕ), SymmetricRel (U n)) ∧ (∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m) ∧ HasAntitoneBasis (𝓤 X) U

tactic: intro x y
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
⊢ ∀ {x y : X}, d x y = 0 ↔ x ≈ y

tactic: refine' Iff.trans _ hB.mem_separationRel.symm
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
⊢ d x y = 0 ↔ x ≈ y

tactic: simp only [true_imp_iff]
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
⊢ d x y = 0 ↔ ∀ (i : ℕ), True → (x, y) ∈ U i

tactic: split_ifs with h
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
⊢ (if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0) = 0 ↔ ∀ (i : ℕ), (x, y) ∈ U i

tactic: rw [← not_forall] at h
state_before: case inl
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
h : ∃ n, ¬(x, y) ∈ U n
⊢ (1 / 2) ^ Nat.find h = 0 ↔ ∀ (i : ℕ), (x, y) ∈ U i

tactic: simp [h, pow_eq_zero_iff']
state_before: case inl
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
h✝ : ∃ n, ¬(x, y) ∈ U n
h : ¬∀ (x_1 : ℕ), (x, y) ∈ U x_1
⊢ (1 / 2) ^ Nat.find h✝ = 0 ↔ ∀ (i : ℕ), (x, y) ∈ U i

tactic: simpa only [not_exists, Classical.not_not, eq_self_iff_true, true_iff_iff] using h
state_before: case inr
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
x y : X
h : ¬∃ n, ¬(x, y) ∈ U n
⊢ 0 = 0 ↔ ∀ (i : ℕ), (x, y) ∈ U i

tactic: intro x y
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
⊢ ∀ (x y : X), d x y = d y x

tactic: simp only [@SymmetricRel.mk_mem_comm _ _ (hU_symm _) x y]
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
x y : X
⊢ d x y = d y x

tactic: intro x y n
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
⊢ ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n

tactic: dsimp only []
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
⊢ (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n

tactic: split_ifs with h
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
⊢ ((1 / 2) ^ n ≤ if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0) ↔ ¬(x, y) ∈ U n

tactic: rw [(strictAnti_pow hr.1 hr.2).le_iff_le, Nat.find_le_iff]
state_before: case inl
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
h : ∃ n, ¬(x, y) ∈ U n
⊢ (1 / 2) ^ n ≤ (1 / 2) ^ Nat.find h ↔ ¬(x, y) ∈ U n

tactic: exact ⟨fun ⟨m, hmn, hm⟩ hn => hm (hB.antitone hmn hn), fun h => ⟨n, le_rfl, h⟩⟩
state_before: case inl
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
h : ∃ n, ¬(x, y) ∈ U n
⊢ (∃ m, m ≤ n ∧ ¬(x, y) ∈ U m) ↔ ¬(x, y) ∈ U n

tactic: push_neg  at h
state_before: case inr
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
h : ¬∃ n, ¬(x, y) ∈ U n
⊢ (1 / 2) ^ n ≤ 0 ↔ ¬(x, y) ∈ U n

tactic: simp only [h, not_true, (pow_pos hr.1 _).not_le]
state_before: case inr
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
x y : X
n : ℕ
h : ∀ (n : ℕ), (x, y) ∈ U n
⊢ (1 / 2) ^ n ≤ 0 ↔ ¬(x, y) ∈ U n

tactic: refine' PseudoMetricSpace.le_two_mul_dist_ofPreNNDist _ _ _ fun x₁ x₂ x₃ x₄ => _
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
⊢ ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y

tactic: by_cases H : ∃ n, (x₁, x₄) ∉ U n
state_before: X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
⊢ d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))

tactic: refine' (dif_pos H).trans_le _
state_before: case pos
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
⊢ d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))

tactic: rw [← NNReal.div_le_iff' two_ne_zero, ← mul_one_div (_ ^ _), ← pow_succ']
state_before: case pos
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
⊢ (1 / 2) ^ Nat.find H ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))

tactic: simp only [le_max_iff, hle_d, ← not_and_or]
state_before: case pos
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
⊢ (1 / 2) ^ (Nat.find H + 1) ≤ max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))

tactic: rintro ⟨h₁₂, h₂₃, h₃₄⟩
state_before: case pos
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
⊢ ¬((x₁, x₂) ∈ U (Nat.find H + 1) ∧ (x₂, x₃) ∈ U (Nat.find H + 1) ∧ (x₃, x₄) ∈ U (Nat.find H + 1))

tactic: refine' Nat.find_spec H (hU_comp (lt_add_one <| Nat.find H) _)
state_before: case pos.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
h₁₂ : (x₁, x₂) ∈ U (Nat.find H + 1)
h₂₃ : (x₂, x₃) ∈ U (Nat.find H + 1)
h₃₄ : (x₃, x₄) ∈ U (Nat.find H + 1)
⊢ False

tactic: exact ⟨x₂, h₁₂, x₃, h₂₃, h₃₄⟩
state_before: case pos.intro.intro
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ∃ n, ¬(x₁, x₄) ∈ U n
h₁₂ : (x₁, x₂) ∈ U (Nat.find H + 1)
h₂₃ : (x₂, x₃) ∈ U (Nat.find H + 1)
h₃₄ : (x₃, x₄) ∈ U (Nat.find H + 1)
⊢ (x₁, x₄) ∈ U (Nat.find H + 1) ○ (U (Nat.find H + 1) ○ U (Nat.find H + 1))

tactic: exact (dif_neg H).trans_le (zero_le _)
state_before: case neg
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
x₁ x₂ x₃ x₄ : X
H : ¬∃ n, ¬(x₁, x₄) ∈ U n
⊢ d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))

tactic: refine' fun n hn => ⟨n, hn, fun x hx => (hdist_le _ _).trans_lt _⟩
state_before: case intro.intro.intro.refine'_1
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
⊢ ∀ (i : ℕ), True → ∃ i', True ∧ U i' ⊆ {p | dist p.fst p.snd < (fun a => ↑a) (1 / 2) ^ i}

tactic: change _ < (toReal _) ^ _
state_before: case intro.intro.intro.refine'_1
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
hn : True
x : X × X
hx : x ∈ U n
⊢ ↑(d x.fst x.snd) < (fun a => ↑a) (1 / 2) ^ n

tactic: rwa [← NNReal.coe_pow, NNReal.coe_lt_coe, ← not_le, hle_d, Classical.not_not, Prod.mk.eta]
state_before: case intro.intro.intro.refine'_1
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
hn : True
x : X × X
hx : x ∈ U n
⊢ ↑(d x.fst x.snd) < ↑(1 / 2) ^ n

tactic: refine' fun n _ => ⟨n + 1, trivial, fun x hx => _⟩
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
⊢ ∀ (i' : ℕ), True → ∃ i, True ∧ {p | dist p.fst p.snd < (fun a => ↑a) (1 / 2) ^ i} ⊆ U i'

tactic: rw [mem_setOf_eq] at hx
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
x✝ : True
x : X × X
hx : x ∈ {p | dist p.fst p.snd < (fun a => ↑a) (1 / 2) ^ (n + 1)}
⊢ x ∈ U n

tactic: contrapose! hx
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
x✝ : True
x : X × X
hx : dist x.fst x.snd < (fun a => ↑a) (1 / 2) ^ (n + 1)
⊢ x ∈ U n

tactic: refine' le_trans _ ((div_le_iff' (zero_lt_two' ℝ)).2 (hd_le x.1 x.2))
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
x✝ : True
x : X × X
hx : ¬x ∈ U n
⊢ ↑(1 / 2) ^ (n + 1) ≤ dist x.fst x.snd

tactic: change (toReal _) ^ _ ≤ _
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
x✝ : True
x : X × X
hx : ¬x ∈ U n
⊢ ↑(1 / 2) ^ (n + 1) ≤ ↑(d x.fst x.snd) / 2

tactic: rwa [← NNReal.coe_two, ← NNReal.coe_div, ← NNReal.coe_pow, NNReal.coe_le_coe, pow_succ',
  mul_one_div, NNReal.div_le_iff two_ne_zero, div_mul_cancel _ (two_ne_zero' ℝ≥0), hle_d,
  Prod.mk.eta]
state_before: case intro.intro.intro.refine'_2
X✝ : Type ?u.116434
X : Type u_1
inst✝¹ : UniformSpace X
inst✝ : IsCountablyGenerated (𝓤 X)
U : ℕ → Set (X × X)
hU_symm : ∀ (n : ℕ), SymmetricRel (U n)
hU_comp : ∀ ⦃m n : ℕ⦄, m < n → U n ○ (U n ○ U n) ⊆ U m
hB : HasAntitoneBasis (𝓤 X) U
this : Setoid X := separationSetoid X
d : X → X → ℝ≥0 := fun x y => if h : ∃ n, ¬(x, y) ∈ U n then (1 / 2) ^ Nat.find h else 0
hd₀ : ∀ {x y : X}, d x y = 0 ↔ x ≈ y
hd_symm : ∀ (x y : X), d x y = d y x
hr : 1 / 2 ∈ Ioo 0 1
I : PseudoMetricSpace X := PseudoMetricSpace.ofPreNNDist d (_ : ∀ (x : X), d x x = 0) hd_symm
hdist_le : ∀ (x y : X), dist x y ≤ ↑(d x y)
hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ ¬(x, y) ∈ U n
hd_le : ∀ (x y : X), ↑(d x y) ≤ 2 * dist x y
n : ℕ
x✝ : True
x : X × X
hx : ¬x ∈ U n
⊢ ↑(1 / 2) ^ (n + 1) ≤ ↑(d x.fst x.snd) / 2