awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Topology.Metrizable.CompletelyMetrizable (goal)
Goal:
X : Type u_1
Y : Type u_2
inst : TopologicalSpace X
inst_1 : DiscreteTopology X
let let₁ let₂ : IsCompletelyMetrizableSpace X
refine_1 :
  let m :=
    { dist := fun (x y : X) ↦ if x = y then 0 else 1, dist_self := ⋯, dist_comm := ⋯, dist_triangle := ⋯,
      edist_dist := ⋯, uniformity_dist := ⋯, cobounded_sets := ⋯, eq_of_dist_eq_zero := ⋯ : MetricSpace X };
  UniformSpace.toTopologicalSpace = inst
⊢ IsCompletelyMetrizableSpace X
have refine_2 : let m :=
  { dist := fun (x y : X) ↦ if x = y then 0 else 1, dist_self := sorry, dist_comm := sorry, dist_triangle := sorry, edist_dist := sorry,
    uniformity_dist := sorry, cobounded_sets := sorry, eq_of_dist_eq_zero := sorry : MetricSpace X };
CompleteSpace X
Tactic: classical
  let m : MetricSpace X :=
    { dist x y := if x = y then 0 else 1
      dist_self x := by simp
      dist_comm x y := by
        obtain h | h := eq_or_ne x y
        · simp [h]
        · simp [h, h.symm]
      dist_triangle x y z := by
        by_cases x = y <;> by_cases x = z <;> by_cases y = z <;> simp_all
      eq_of_dist_eq_zero := by simp }
  refine ⟨m, ?_, ?_⟩
  · rw [DiscreteTopology.eq_bot (α := X)]
    refine eq_bot_of_singletons_open fun x ↦ ?_
    convert! @Metric.isOpen_ball _ _ x 1
    refine subset_antisymm (singleton_subset_iff.2 (Metric.mem_ball_self (by simp)))
      fun y hy ↦ ?_
    simp only [Metric.mem_ball, mem_singleton_iff] at *
    by_contra
    change (if y = x then 0 else 1) < 1 at hy
    simp_all
  · refine Metric.complete_of_cauchySeq_tendsto fun u hu ↦ ?_
    rw [Metric.cauchySeq_iff'] at hu
    obtain ⟨N, hN⟩ := hu 1 (by simp)
    refine ⟨u N, @tendsto_atTop_of_eventually_const X UniformSpace.toTopologicalSpace (u N) _ _ _ N
      fun n hn ↦ ?_⟩
    specialize hN n hn
    by_contra
    change (if u n = u N then 0 else 1) < 1 at hN
    simp_all
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y : X
⊢ Eq (α := ℝ≥0) (⨅ (l : List X), (zipWith d (x :: l) (l ++ [y])).sum)
    (⨅ (l : List X), (zipWith d (y :: l) (l ++ [x])).sum)
have refine : ∀ (l : List X), (zipWith d (y :: l.reverse) (l.reverse ++ [x])).sum = (zipWith d (x :: l) (l ++ [y])).sum
Tactic: refine reverse_surjective.iInf_congr _ fun l ↦ ?_
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y : X
l : List X
⊢ (zipWith d (y :: l.reverse) (l.reverse ++ [x])).sum = (zipWith d (x :: l) (l ++ [y])).sum
have rw : (y :: l.reverse).length = (l.reverse ++ [x]).length
Tactic: rw [← sum_reverse, reverse_zipWith, reverse_append, reverse_reverse,
        reverse_singleton, singleton_append, reverse_cons, reverse_reverse,
        zipWith_comm_of_comm dist_comm]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
⊢ ⨅ (l : List X), (zipWith d (x :: l) (l ++ [z])).sum ≤
    HAdd.hAdd (α := ℝ≥0) (⨅ (l : List X), (zipWith d (x :: l) (l ++ [y])).sum)
      (⨅ (l : List X), (zipWith d (y :: l) (l ++ [z])).sum)
have refine : ∀ (lxy lyz : List X),
  ⨅ (l : List X), (zipWith d (x :: l) (l ++ [z])).sum ≤
    (zipWith d (x :: lxy) (lxy ++ [y])).sum + (zipWith d (y :: lyz) (lyz ++ [z])).sum
Tactic: refine NNReal.le_iInf_add_iInf fun lxy lyz ↦ ?_
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
lxy lyz : List X
⊢ (zipWith d (x :: lxy ++ y :: lyz) (lxy ++ y :: lyz ++ [z])).sum =
    (zipWith d (x :: lxy) (lxy ++ [y])).sum + (zipWith d (y :: lyz) (lyz ++ [z])).sum
have rw : (x :: lxy).length = (lxy ++ [y]).length
Tactic: rw [← sum_append, ← zipWith_append, cons_append, ← @singleton_append _ y, append_assoc,
          append_assoc, append_assoc]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
lxy lyz : List X
⊢ (x :: lxy).length = (lxy ++ [y]).length
have rw : lxy.length + 1 = (lxy ++ [y]).length
Tactic: rw [length_cons, length_append, length_singleton]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
lxy lyz : List X
rw : lxy.length + 1 = (lxy ++ [y]).length
⊢ (x :: lxy).length = (lxy ++ [y]).length
have rw₁ : lxy.length + 1 = lxy.length + [y].length
Tactic: rw [length_cons, length_append, length_singleton]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
lxy lyz : List X
rw : lxy.length + 1 = (lxy ++ [y]).length
rw₁ : lxy.length + 1 = lxy.length + [y].length
⊢ (x :: lxy).length = (lxy ++ [y]).length
have rw₂ : lxy.length + 1 = lxy.length + 1
Tactic: rw [length_cons, length_append, length_singleton]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
x y z : X
lxy lyz : List X
⊢ ⨅ (l : List X), (zipWith d (x :: l) (l ++ [z])).sum ≤
    (zipWith d (x :: lxy) (lxy ++ [y])).sum + (zipWith d (y :: lyz) (lyz ++ [z])).sum
have d₁ : (zipWith d (x :: lxy ++ y :: lyz) (lxy ++ y :: lyz ++ [z])).sum =
  (zipWith d (x :: lxy) (lxy ++ [y])).sum + (zipWith d (y :: lyz) (lyz ++ [z])).sum
Tactic: calc
      ⨅ l, (zipWith d (x::l) (l ++ [z])).sum ≤
          (zipWith d (x::lxy ++ y::lyz) ((lxy ++ y::lyz) ++ [z])).sum :=
        ciInf_le (OrderBot.bddBelow _) (lxy ++ y::lyz)
      _ = (zipWith d (x::lxy) (lxy ++ [y])).sum + (zipWith d (y::lyz) (lyz ++ [z])).sum := by
        rw [← sum_append, ← zipWith_append, cons_append, ← @singleton_append _ y, append_assoc,
          append_assoc, append_assoc]
        rw [length_cons, length_append, length_singleton]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
⊢ (↑(d x y) : ℝ) ≤ 2 * dist x y
have rw : d x y ≤ ⨅ (i : List X), 2 * (zipWith d (x :: i) (i ++ [y])).sum
Tactic: rw [dist_ofPreNNDist, ← NNReal.coe_two, ← NNReal.coe_mul, NNReal.mul_iInf, NNReal.coe_le_coe]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
⊢ d x y ≤ ⨅ (i : List X), 2 * (zipWith d (x :: i) (i ++ [y])).sum
have refine : ∀ (l : List X), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
Tactic: refine le_ciInf fun l => ?_
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
l : List X
⊢ IsTrans X fun (x y : X) ↦ d x y = 0
have refine : ∀ (a b c : X) (hab : d a b = 0) (hbc : d b c = 0), d a c = 0
Tactic: refine ⟨fun a b c hab hbc ↦ ?_⟩
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
l : List X
a b c : X
hab : d a b = 0
hbc : d b c = 0
⊢ d a c = 0
have rw : d a c ≤ 0
Tactic: rw [← nonpos_iff_eq_zero]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
l : List X
⊢ d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
have this : IsTrans X fun (x y : X) ↦ d x y = 0
Tactic: haveI : IsTrans X fun x y => d x y = 0 := by
    refine ⟨fun a b c hab hbc ↦ ?_⟩
    rw [← nonpos_iff_eq_zero]
    simpa only [nonpos_iff_eq_zero, hab, hbc, dist_self c, max_self, mul_zero] using hd a b c c
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
x y : X
l : List X
this : IsTrans X fun (x y : X) ↦ d x y = 0
⊢ d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
have suffices : ∀ (n : ℕ), l.length = n → d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
Tactic: suffices ∀ n, length l = n → d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum by exact this _ rfl
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
n : ℕ
ihn : ∀ m < n, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
x y : X
l : List X
hn : l.length = n
⊢ d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
have ihn₁ : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
Tactic: subst n
Cleared hypotheses: n, ihn, hn
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
⊢ d x y ≤ 2 * L.sum
have hL_len : L.length = l.length + 1
Tactic: have hL_len : length L = length l + 1 := by simp [L]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
⊢ d x y ≤ 2 * L.sum
have h : ∀ (hd₀ : d x y = 0), d x y ≤ 2 * L.sum
Tactic: rcases eq_or_ne (d x y) 0 with hd₀ | hd₀
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
h : ∀ (hd₀ : d x y = 0), d x y ≤ 2 * L.sum
⊢ d x y ≤ 2 * L.sum
have h₁ : ∀ (hd₀ : d x y ≠ 0), d x y ≤ 2 * L.sum
Tactic: rcases eq_or_ne (d x y) 0 with hd₀ | hd₀
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
⊢ d x y ≤ 2 * L.sum
have h : ∀ (z z' : X) (hxz : d x z ≤ L.sum) (hzz' : d z z' ≤ L.sum) (hz'y : d z' y ≤ L.sum), d x y ≤ 2 * L.sum
Tactic: rsuffices ⟨z, z', hxz, hzz', hz'y⟩ : ∃ z z' : X, d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
h : ∀ (z z' : X) (hxz : d x z ≤ L.sum) (hzz' : d z z' ≤ L.sum) (hz'y : d z' y ≤ L.sum), d x y ≤ 2 * L.sum
⊢ d x y ≤ 2 * L.sum
have rsuffices : ∃ (z : X) (z' : X), d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
Tactic: rsuffices ⟨z, z', hxz, hzz', hz'y⟩ : ∃ z z' : X, d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
z z' : X
hxz : d x z ≤ L.sum
hzz' : d z z' ≤ L.sum
hz'y : d z' y ≤ L.sum
⊢ d x y ≤ 2 * L.sum
have h : 2 * max (d x z) (max (d z z') (d z' y)) ≤ 2 * L.sum
Tactic: grw [hd x z z' y, max_le hxz (max_le hzz' hz'y)]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
z z' : X
hxz : d x z ≤ L.sum
hzz' : d z z' ≤ L.sum
hz'y : d z' y ≤ L.sum
h : 2 * max (d x z) (max (d z z') (d z' y)) ≤ 2 * L.sum
⊢ d x y ≤ 2 * L.sum
have h₁ : 2 * L.sum ≤ 2 * L.sum
Tactic: grw [hd x z z' y, max_le hxz (max_le hzz' hz'y)]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
⊢ ∃ (z : X) (z' : X), d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
have hs₀ : 0 ∈ s
Tactic: have hs₀ : 0 ∈ s := by simp [s]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
⊢ ∃ (z : X) (z' : X), d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
have hsne : s.Nonempty
Tactic: have hsne : s.Nonempty := ⟨0, hs₀⟩
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
m : ℕ
hm : m ∈ s
⊢ m ≤ l.length
have rw : ¬L.length ≤ m
Tactic: rw [← not_lt, Nat.lt_iff_add_one_le, ← hL_len]
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
m : ℕ
hm : m ∈ s
hLm : L.length ≤ m
⊢ False
have rw : ∀ (hm : List.IsChain (fun (x y : X) ↦ d x y = 0) (x :: l ++ [y])) (hLm : L.length ≤ m), False
Tactic: rw [mem_setOf_eq, take_of_length_le hLm, two_mul, add_le_iff_nonpos_left, nonpos_iff_eq_zero,
          sum_eq_zero_iff, ← forall_iff_forall_mem, forall_zipWith,
          ← isChain_cons_append_singleton_iff_forall₂]
          at hm
Cleared hypotheses: hm, hLm
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
m : ℕ
hm : m ∈ s
hLm : L.length ≤ m
rw : ∀ (hm : List.IsChain (fun (x y : X) ↦ d x y = 0) (x :: l ++ [y])) (hLm : L.length ≤ m), False
⊢ False
have rw₁ : ∀ (hm : Forall (fun (x : ℝ≥0) ↦ x = 0) L) (hLm : L.length ≤ m), (x :: l).length = (l ++ [y]).length
Tactic: rw [mem_setOf_eq, take_of_length_le hLm, two_mul, add_le_iff_nonpos_left, nonpos_iff_eq_zero,
          sum_eq_zero_iff, ← forall_iff_forall_mem, forall_zipWith,
          ← isChain_cons_append_singleton_iff_forall₂]
          at hm
Cleared hypotheses: hm, hLm
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
m : ℕ
hm : m ∈ s
hLm : L.length ≤ m
⊢ False
have hm₁ : List.IsChain (fun (x y : X) ↦ d x y = 0) (x :: l ++ [y])
Tactic: rw [mem_setOf_eq, take_of_length_le hLm, two_mul, add_le_iff_nonpos_left, nonpos_iff_eq_zero,
          sum_eq_zero_iff, ← forall_iff_forall_mem, forall_zipWith,
          ← isChain_cons_append_singleton_iff_forall₂]
          at hm <;>
        [skip; simp]
Cleared hypotheses: hm, hLm
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
⊢ ∃ M ≤ l.length, IsGreatest s M
have hs_ub : l.length ∈ upperBounds s
Tactic: have hs_ub : length l ∈ upperBounds s := by
      intro m hm
      rw [← not_lt, Nat.lt_iff_add_one_le, ← hL_len]
      intro hLm
      rw [mem_setOf_eq, take_of_length_le hLm, two_mul, add_le_iff_nonpos_left, nonpos_iff_eq_zero,
          sum_eq_zero_iff, ← forall_iff_forall_mem, forall_zipWith,
          ← isChain_cons_append_singleton_iff_forall₂]
          at hm <;>
        [skip; simp]
      exact hd₀ (hm.rel_cons (mem_append.2 <| Or.inr <| mem_singleton_self _))
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (hypothesis)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
hs_ub : l.length ∈ upperBounds s
⊢ ∃ M ≤ l.length, IsGreatest s M
have hs_bdd : BddAbove s
Tactic: have hs_bdd : BddAbove s := ⟨length l, hs_ub⟩
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
⊢ ∃ (z : X) (z' : X), d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
have obtain : ∀ (M : ℕ) (hMl : M ≤ l.length) (hMs : IsGreatest s M),
  ∃ (z : X) (z' : X), d x z ≤ L.sum ∧ d z z' ≤ L.sum ∧ d z' y ≤ L.sum
Tactic: obtain ⟨M, hMl, hMs⟩ : ∃ M ≤ length l, IsGreatest s M := by
    have hs_ub : length l ∈ upperBounds s := by
      intro m hm
      rw [← not_lt, Nat.lt_iff_add_one_le, ← hL_len]
      intro hLm
      rw [mem_setOf_eq, take_of_length_le hLm, two_mul, add_le_iff_nonpos_left, nonpos_iff_eq_zero,
          sum_eq_zero_iff, ← forall_iff_forall_mem, forall_zipWith,
          ← isChain_cons_append_singleton_iff_forall₂]
          at hm <;>
        [skip; simp]
      exact hd₀ (hm.rel_cons (mem_append.2 <| Or.inr <| mem_singleton_self _))
    have hs_bdd : BddAbove s := ⟨length l, hs_ub⟩
    exact ⟨sSup s, csSup_le hsne hs_ub, ⟨Nat.sSup_mem hsne hs_bdd, fun k => le_csSup hs_bdd⟩⟩
-- Lean 4 proof step from Mathlib.Topology.Metrizable.Uniformity (goal)
Goal:
X : Type u_1
d : X → X → ℝ≥0
dist_self : ∀ (x : X), d x x = 0
dist_comm : ∀ (x y : X), d x y = d y x
hd : ∀ (x₁ x₂ x₃ x₄ : X), d x₁ x₄ ≤ 2 * max (d x₁ x₂) (max (d x₂ x₃) (d x₃ x₄))
this : IsTrans X fun (x y : X) ↦ d x y = 0
x y : X
l : List X
ihn : ∀ m < l.length, ∀ (x y : X) (l : List X) (hn : l.length = m), d x y ≤ 2 * (zipWith d (x :: l) (l ++ [y])).sum
L : List ℝ≥0 := zipWith d (x :: l) (l ++ [y])
hL_len : L.length = l.length + 1
hd₀ : d x y ≠ 0
s : Set ℕ := {m : ℕ | 2 * (take m L).sum ≤ L.sum}
hs₀ : 0 ∈ s
hsne : s.Nonempty
M : ℕ
hMl : M ≤ l.length
hMs : IsGreatest s M
⊢ M < L.length
have rwa : M < l.length + 1
Tactic: rwa [hL_len, Nat.lt_succ_iff]