Theorem: KuratowskiEmbedding.embeddingOfSubset_isometry
File: Mathlib/Topology/MetricSpace/Kuratowski.lean

Proof steps:
state_before: α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a b : α
H : DenseRange x
⊢ Isometry (embeddingOfSubset x)
state_after: α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
⊢ dist (embeddingOfSubset x a) (embeddingOfSubset x b) = dist a b
tactic: refine Isometry.of_dist_eq fun a b => ?_
state_before: α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
⊢ dist (embeddingOfSubset x a) (embeddingOfSubset x b) = dist a b
state_after: α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
tactic: refine (embeddingOfSubset_dist_le x a b).antisymm (le_of_forall_pos_le_add fun e epos => ?_)
state_before: α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
state_after: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
tactic: rcases Metric.mem_closure_range_iff.1 (H a) (e / 2) (half_pos epos) with ⟨n, hn⟩
state_before: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
state_after: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C✝ : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
C : dist b (x n) - dist a (x n) = ↑(embeddingOfSubset x b) n - ↑(embeddingOfSubset x a) n
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
tactic: have C : dist b (x n) - dist a (x n) = embeddingOfSubset x b n - embeddingOfSubset x a n := by
    simp only [embeddingOfSubset_coe, sub_sub_sub_cancel_right]
state_before: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C✝ : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
C : dist b (x n) - dist a (x n) = ↑(embeddingOfSubset x b) n - ↑(embeddingOfSubset x a) n
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
state_after: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C✝ : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
C : dist b (x n) - dist a (x n) = ↑(embeddingOfSubset x b) n - ↑(embeddingOfSubset x a) n
this : dist a b ≤ dist (embeddingOfSubset x b) (embeddingOfSubset x a) + e
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
tactic: have :=
    calc
      dist a b ≤ dist a (x n) + dist (x n) b := dist_triangle _ _ _
      _ = 2 * dist a (x n) + (dist b (x n) - dist a (x n)) := by simp [dist_comm]; ring
      _ ≤ 2 * dist a (x n) + |dist b (x n) - dist a (x n)| := by
        apply_rules [add_le_add_left, le_abs_self]
      _ ≤ 2 * (e / 2) + |embeddingOfSubset x b n - embeddingOfSubset x a n| := by
        rw [C]
        apply_rules [add_le_add, mul_le_mul_of_nonneg_left, hn.le, le_refl]
        norm_num
      _ ≤ 2 * (e / 2) + dist (embeddingOfSubset x b) (embeddingOfSubset x a) := by
        have : |embeddingOfSubset x b n - embeddingOfSubset x a n| ≤
            dist (embeddingOfSubset x b) (embeddingOfSubset x a) := by
          simp only [dist_eq_norm]
          exact lp.norm_apply_le_norm ENNReal.top_ne_zero
            (embeddingOfSubset x b - embeddingOfSubset x a) n
        nlinarith
      _ = dist (embeddingOfSubset x b) (embeddingOfSubset x a) + e := by ring
state_before: case intro
α : Type u
β : Type v
γ : Type w
f g : ↥(lp (fun i => ℝ) ⊤)
n✝ : ℕ
C✝ : ℝ
inst✝ : MetricSpace α
x : ℕ → α
a✝ b✝ : α
H : DenseRange x
a b : α
e : ℝ
epos : 0 < e
n : ℕ
hn : dist a (x n) < e / 2
C : dist b (x n) - dist a (x n) = ↑(embeddingOfSubset x b) n - ↑(embeddingOfSubset x a) n
this : dist a b ≤ dist (embeddingOfSubset x b) (embeddingOfSubset x a) + e
⊢ dist a b ≤ dist (embeddingOfSubset x a) (embeddingOfSubset x b) + e
state_after: no goals
tactic: simpa [dist_comm] using this