awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
H :
  ∀ (ε' : ℝ) (_ : ε' > 0) (x' : X) (_ : ε' ≤ ε) (_ : d x' x ≤ 2 * ε) (_ : ε * ϕ x ≤ ε' * ϕ x'),
    ∃ (y : X), d x' y ≤ ε' ∧ 2 * ϕ x' < ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
k : ℕ
x' : X
⊢ d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' → ∃ (y : X), d x' y ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ y
have this : ∀ (_ : d x' x ≤ 2 * ε) (_ : ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x'),
  ∃ (y : X), d x' y ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ y
Tactic: have := H (ε / 2 ^ k) (by positivity) x' (div_le_self ε_pos.le <| one_le_pow₀ one_le_two)
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
H :
  ∀ (ε' : ℝ) (_ : ε' > 0) (x' : X) (_ : ε' ≤ ε) (_ : d x' x ≤ 2 * ε) (_ : ε * ϕ x ≤ ε' * ϕ x'),
    ∃ (y : X), d x' y ≤ ε' ∧ 2 * ϕ x' < ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
⊢ False
have H₁ : ∀ (k : ℕ) (x' : X),
  d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' → ∃ (y : X), d x' y ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ y
Tactic: replace H : ∀ k : ℕ, ∀ x', d x' x ≤ 2 * ε ∧ 2 ^ k * ϕ x ≤ ϕ x' →
      ∃ y, d x' y ≤ ε / 2 ^ k ∧ 2 * ϕ x' < ϕ y := by
    intro k x'
    have := H (ε / 2 ^ k) (by positivity) x' (div_le_self ε_pos.le <| one_le_pow₀ one_le_two)
    simpa [reformulation] using this
Cleared hypotheses: H
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
H :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      ∃ (y : X), d x' y ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ y
⊢ False
have this : Nonempty X
Tactic: haveI : Nonempty X := ⟨x⟩
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
H :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      ∃ (y : X), d x' y ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ y
this : Nonempty X
⊢ False
have choose! : ∀ (F : (k : ℕ) → (x' : X) → X)
  (hF :
    ∀ (k : ℕ) (x' : X),
      d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
        d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')),
  False
Tactic: choose! F hF using H
Cleared hypotheses: H
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
⊢ False
have hu : ∀ (n : ℕ),
  d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
    d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
Tactic: have hu :
    ∀ n,
      d (u n) x ≤ 2 * ε ∧ 2 ^ n * ϕ x ≤ ϕ (u n) →
        d (u n) (u <| n + 1) ≤ ε / 2 ^ n ∧ 2 * ϕ (u n) < ϕ (u <| n + 1) := by
    exact fun n ↦ hF n (u n)
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
⊢ d (u (n + 1)) x ≤ 2 * ε
have rw : d x (u (n + 1)) ≤ 2 * ε
Tactic: rw [dist_comm]
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
r : Finset ℕ := range (n + 1)
⊢ ∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i = (∑ i ∈ r, (1 / 2) ^ i) * ε
have rw : Eq (α := ℝ) (∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i) (∑ i ∈ r, (1 / 2) ^ i * ε)
Tactic: rw [Finset.sum_mul]
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
r : Finset ℕ := range (n + 1)
⊢ Eq (α := ℝ) (∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i) (∑ i ∈ r, (1 / 2) ^ i * ε)
have simp : Eq (α := ℝ) (∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i) (∑ x ∈ r, (HPow.hPow (α := ℝ) 2 x)⁻¹ * ε)
Tactic: simp
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
r : Finset ℕ := range (n + 1)
⊢ (∑ i ∈ r, (1 / 2) ^ i) * ε ≤ 2 * ε
have hbc : LE.le (α := ℝ) (∑ i ∈ r, (1 / 2) ^ i) 2
Tactic: gcongr
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
r : Finset ℕ := range (n + 1)
⊢ d x (u (n + 1)) ≤ 2 * ε
have d : ∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i = (∑ i ∈ r, (1 / 2) ^ i) * ε
Tactic: calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
r : Finset ℕ := range (n + 1)
d : ∑ i ∈ r, ε / HPow.hPow (α := ℝ) 2 i = (∑ i ∈ r, (1 / 2) ^ i) * ε
⊢ d x (u (n + 1)) ≤ 2 * ε
have d₁ : (∑ i ∈ r, (1 / 2) ^ i) * ε ≤ 2 * ε
Tactic: calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
⊢ d (u (n + 1)) (u (n + 1 + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 (n + 1) ∧ 2 * ϕ (u (n + 1)) < ϕ (u (n + 1 + 1))
have A : d (u (n + 1)) x ≤ 2 * ε
Tactic: have A : d (u (n + 1)) x ≤ 2 * ε := by
        rw [dist_comm]
        let r := range (n + 1) -- range (n+1) = {0, ..., n}
        calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
A : d (u (n + 1)) x ≤ 2 * ε
⊢ HPow.hPow (α := ℝ) 2 (n + 1) * ϕ x ≤ ϕ (u (n + 1))
have refine : ∀ (m : ℕ) (hm : m < n + 1), 2 * (ϕ ∘ u) m ≤ (ϕ ∘ u) (m + 1)
Tactic: refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))
A : d (u (n + 1)) x ≤ 2 * ε
⊢ d (u (n + 1)) (u (n + 1 + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 (n + 1) ∧ 2 * ϕ (u (n + 1)) < ϕ (u (n + 1 + 1))
have B : HPow.hPow (α := ℝ) 2 (n + 1) * ϕ x ≤ ϕ (u (n + 1))
Tactic: have B : 2 ^ (n + 1) * ϕ x ≤ ϕ (u (n + 1)) := by
        refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_
        exact (IH _ <| Nat.lt_add_one_iff.1 hm).2.le
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
⊢ d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
have hz : d (u 0) (u (HAdd.hAdd (α := ℕ) 0 1)) ≤ ε / HPow.hPow (α := ℝ) (β := ℕ) 2 0 ∧
  2 * ϕ (u 0) < ϕ (u (HAdd.hAdd (α := ℕ) 0 1))
Tactic: induction n using Nat.case_strong_induction_on with
    | hz => simpa [u, ε_pos.le] using hu 0
    | hi n IH =>
      have A : d (u (n + 1)) x ≤ 2 * ε := by
        rw [dist_comm]
        let r := range (n + 1) -- range (n+1) = {0, ..., n}
        calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
      have B : 2 ^ (n + 1) * ϕ x ≤ ϕ (u (n + 1)) := by
        refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_
        exact (IH _ <| Nat.lt_add_one_iff.1 hm).2.le
      exact hu (n + 1) ⟨A, B⟩
Cleared hypotheses: n
-- Lean 4 proof step from Mathlib.Analysis.Hofer (goal)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
n : ℕ
hz :
  d (u 0) (u (HAdd.hAdd (α := ℕ) 0 1)) ≤ ε / HPow.hPow (α := ℝ) (β := ℕ) 2 0 ∧
    2 * ϕ (u 0) < ϕ (u (HAdd.hAdd (α := ℕ) 0 1))
⊢ d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
have hi : ∀ (n : ℕ) (IH : ∀ m ≤ n, d (u m) (u (m + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 m ∧ 2 * ϕ (u m) < ϕ (u (m + 1))),
  d (u (n + 1)) (u (n + 1 + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 (n + 1) ∧ 2 * ϕ (u (n + 1)) < ϕ (u (n + 1 + 1))
Tactic: induction n using Nat.case_strong_induction_on with
    | hz => simpa [u, ε_pos.le] using hu 0
    | hi n IH =>
      have A : d (u (n + 1)) x ≤ 2 * ε := by
        rw [dist_comm]
        let r := range (n + 1) -- range (n+1) = {0, ..., n}
        calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
      have B : 2 ^ (n + 1) * ϕ x ≤ ϕ (u (n + 1)) := by
        refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_
        exact (IH _ <| Nat.lt_add_one_iff.1 hm).2.le
      exact hu (n + 1) ⟨A, B⟩
Cleared hypotheses: n
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
⊢ False
have key : ∀ (n : ℕ), d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
Tactic: have key : ∀ n, d (u n) (u (n + 1)) ≤ ε / 2 ^ n ∧ 2 * ϕ (u n) < ϕ (u (n + 1)) := by
    intro n
    induction n using Nat.case_strong_induction_on with
    | hz => simpa [u, ε_pos.le] using hu 0
    | hi n IH =>
      have A : d (u (n + 1)) x ≤ 2 * ε := by
        rw [dist_comm]
        let r := range (n + 1) -- range (n+1) = {0, ..., n}
        calc
          d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1)
          _ ≤ ∑ i ∈ r, ε / 2 ^ i :=
            (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1)
          _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by
            rw [Finset.sum_mul]
            simp
            field_simp
          _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le
      have B : 2 ^ (n + 1) * ϕ x ≤ ϕ (u (n + 1)) := by
        refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_
        exact (IH _ <| Nat.lt_add_one_iff.1 hm).2.le
      exact hu (n + 1) ⟨A, B⟩
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
key : ∀ (n : ℕ), d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
⊢ False
have key₁ : ∀ (x : ℕ), d (u x) (u (x + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 x
Tactic: obtain ⟨key₁, key₂⟩ := forall_and.mp key
-- Lean 4 proof step from Mathlib.Analysis.Hofer (hypothesis)
Goal:
X : Type u_1
inst : MetricSpace X
inst_1 : CompleteSpace X
x : X
ε : ℝ
ε_pos : 0 < ε
ϕ : X → ℝ
cont : Continuous[PseudoMetricSpace.toUniformSpace.toTopologicalSpace, _] ϕ
nonneg : ∀ (y : X), 0 ≤ ϕ y
reformulation : ∀ (x' : X) (k : ℕ), ε * ϕ x ≤ ε / HPow.hPow (α := ℝ) 2 k * ϕ x' ↔ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x'
this : Nonempty X
F : (k : ℕ) → (x' : X) → X
hF :
  ∀ (k : ℕ) (x' : X),
    d x' x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 k * ϕ x ≤ ϕ x' →
      d x' (F k x') ≤ ε / HPow.hPow (α := ℝ) 2 k ∧ 2 * ϕ x' < ϕ (F k x')
u : ℕ → X := fun (n : ℕ) ↦ Nat.recOn (motive := fun (x : ℕ) ↦ X) n x F
hu :
  ∀ (n : ℕ),
    d (u n) x ≤ 2 * ε ∧ HPow.hPow (α := ℝ) 2 n * ϕ x ≤ ϕ (u n) →
      d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
key : ∀ (n : ℕ), d (u n) (u (n + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 n ∧ 2 * ϕ (u n) < ϕ (u (n + 1))
key₁ : ∀ (x : ℕ), d (u x) (u (x + 1)) ≤ ε / HPow.hPow (α := ℝ) 2 x
⊢ False
have key₂ : ∀ (x : ℕ), 2 * ϕ (u x) < ϕ (u (x + 1))
Tactic: obtain ⟨key₁, key₂⟩ := forall_and.mp key