Theorem: exists_closed_cover_approximatesLinearOn_of_hasFDerivWithinAt
File: Mathlib/MeasureTheory/Function/Jacobian.lean

tactic: rcases eq_empty_or_nonempty s with (rfl | hs)
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: obtain ⟨T, T_count, hT⟩ :
  ∃ T : Set s,
    T.Countable ∧ (⋃ x ∈ T, ball (f' (x : E)) (r (f' x))) = ⋃ x : s, ball (f' x) (r (f' x)) :=
  TopologicalSpace.isOpen_iUnion_countable _ fun x => isOpen_ball
state_before: case inr
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: obtain ⟨u, _, u_pos, u_lim⟩ :
  ∃ u : ℕ → ℝ, StrictAnti u ∧ (∀ n : ℕ, 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
  exists_seq_strictAnti_tendsto (0 : ℝ)
state_before: case inr.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: let M : ℕ → T → Set E := fun n z =>
  {x | x ∈ s ∧ ∀ y ∈ s ∩ ball x (u n), ‖f y - f x - f' z (y - x)‖ ≤ r (f' z) * ‖y - x‖}
state_before: case inr.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: have s_subset : ∀ x ∈ s, ∃ (n : ℕ) (z : T), x ∈ M n z := by
  intro x xs
  obtain ⟨z, zT, hz⟩ : ∃ z ∈ T, f' x ∈ ball (f' (z : E)) (r (f' z)) := by
    have : f' x ∈ ⋃ z ∈ T, ball (f' (z : E)) (r (f' z)) := by
      rw [hT]
      refine' mem_iUnion.2 ⟨⟨x, xs⟩, _⟩
      simpa only [mem_ball, Subtype.coe_mk, dist_self] using (rpos (f' x)).bot_lt
    rwa [mem_iUnion₂, bex_def] at this
  obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ ‖f' x - f' z‖ + ε ≤ r (f' z) := by
    refine' ⟨r (f' z) - ‖f' x - f' z‖, _, le_of_eq (by abel)⟩
    simpa only [sub_pos] using mem_ball_iff_norm.mp hz
  obtain ⟨δ, δpos, hδ⟩ :
    ∃ (δ : ℝ), 0 < δ ∧ ball x δ ∩ s ⊆ {y | ‖f y - f x - (f' x) (y - x)‖ ≤ ε * ‖y - x‖} :=
    Metric.mem_nhdsWithin_iff.1 (IsLittleO.def (hf' x xs) εpos)
  obtain ⟨n, hn⟩ : ∃ n, u n < δ := ((tendsto_order.1 u_lim).2 _ δpos).exists
  refine' ⟨n, ⟨z, zT⟩, ⟨xs, _⟩⟩
  intro y hy
  calc
    ‖f y - f x - (f' z) (y - x)‖ = ‖f y - f x - (f' x) (y - x) + (f' x - f' z) (y - x)‖ := by
      congr 1
      simp only [ContinuousLinearMap.coe_sub', map_sub, Pi.sub_apply]
      abel
    _ ≤ ‖f y - f x - (f' x) (y - x)‖ + ‖(f' x - f' z) (y - x)‖ := (norm_add_le _ _)
    _ ≤ ε * ‖y - x‖ + ‖f' x - f' z‖ * ‖y - x‖ := by
      refine' add_le_add (hδ _) (ContinuousLinearMap.le_op_norm _ _)
      rw [inter_comm]
      exact inter_subset_inter_right _ (ball_subset_ball hn.le) hy
    _ ≤ r (f' z) * ‖y - x‖ := by
      rw [← add_mul, add_comm]
      exact mul_le_mul_of_nonneg_right hε (norm_nonneg _)
state_before: case inr.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: have closure_M_subset : ∀ n z, s ∩ closure (M n z) ⊆ M n z := by
  rintro n z x ⟨xs, hx⟩
  refine' ⟨xs, fun y hy => _⟩
  obtain ⟨a, aM, a_lim⟩ : ∃ a : ℕ → E, (∀ k, a k ∈ M n z) ∧ Tendsto a atTop (𝓝 x) :=
    mem_closure_iff_seq_limit.1 hx
  have L1 :
    Tendsto (fun k : ℕ => ‖f y - f (a k) - (f' z) (y - a k)‖) atTop
      (𝓝 ‖f y - f x - (f' z) (y - x)‖) := by
    apply Tendsto.norm
    have L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x)) := by
      apply (hf' x xs).continuousWithinAt.tendsto.comp
      apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ a_lim
      exact eventually_of_forall fun k => (aM k).1
    apply Tendsto.sub (tendsto_const_nhds.sub L)
    exact ((f' z).continuous.tendsto _).comp (tendsto_const_nhds.sub a_lim)
  have L2 : Tendsto (fun k : ℕ => (r (f' z) : ℝ) * ‖y - a k‖) atTop (𝓝 (r (f' z) * ‖y - x‖)) :=
    (tendsto_const_nhds.sub a_lim).norm.const_mul _
  have I : ∀ᶠ k in atTop, ‖f y - f (a k) - (f' z) (y - a k)‖ ≤ r (f' z) * ‖y - a k‖ := by
    have L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x)) :=
      tendsto_const_nhds.dist a_lim
    filter_upwards [(tendsto_order.1 L).2 _ hy.2]
    intro k hk
    exact (aM k).2 y ⟨hy.1, hk⟩
  exact le_of_tendsto_of_tendsto L1 L2 I
state_before: case inr.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: rcases TopologicalSpace.exists_dense_seq E with ⟨d, hd⟩
state_before: case inr.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: let K : ℕ → T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
state_before: case inr.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: have K_approx : ∀ (n) (z : T) (p), ApproximatesLinearOn f (f' z) (s ∩ K n z p) (r (f' z)) := by
  intro n z p x hx y hy
  have yM : y ∈ M n z := closure_M_subset _ _ ⟨hy.1, hy.2.1⟩
  refine' yM.2 _ ⟨hx.1, _⟩
  calc
    dist x y ≤ dist x (d p) + dist y (d p) := dist_triangle_right _ _ _
    _ ≤ u n / 3 + u n / 3 := (add_le_add hx.2.2 hy.2.2)
    _ < u n := by linarith [u_pos n]
state_before: case inr.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: have K_closed : ∀ (n) (z : T) (p), IsClosed (K n z p) := fun n z p =>
  isClosed_closure.inter isClosed_ball
state_before: case inr.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: refine'
  ⟨fun q => K (F q).1 (F q).2.1 (F q).2.2, fun q => f' (F q).2.1, fun n => K_closed _ _ _,
    fun x xs => _, fun q => K_approx _ _ _, fun _ q => ⟨(F q).2.1, (F q).2.1.1.2, rfl⟩⟩
state_before: case inr.intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (s ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
          (Set.Nonempty s → ∀ (n : ℕ), ∃ y, y ∈ s ∧ A n = f' y)

tactic: obtain ⟨n, z, hnz⟩ : ∃ (n : ℕ) (z : T), x ∈ M n z := s_subset x xs
state_before: case inr.intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
⊢ x ∈ ⋃ (n : ℕ), (fun q => K (F q).fst (F q).snd.fst (F q).snd.snd) n

tactic: obtain ⟨p, hp⟩ : ∃ p : ℕ, x ∈ closedBall (d p) (u n / 3) := by
  have : Set.Nonempty (ball x (u n / 3)) := by simp only [nonempty_ball]; linarith [u_pos n]
  obtain ⟨p, hp⟩ : ∃ p : ℕ, d p ∈ ball x (u n / 3) := hd.exists_mem_open isOpen_ball this
  exact ⟨p, (mem_ball'.1 hp).le⟩
state_before: case inr.intro.intro.intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
⊢ x ∈ ⋃ (n : ℕ), (fun q => K (F q).fst (F q).snd.fst (F q).snd.snd) n

tactic: obtain ⟨q, hq⟩ : ∃ q, F q = (n, z, p) := hF _
state_before: case inr.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
p : ℕ
hp : x ∈ closedBall (d p) (u n / 3)
⊢ x ∈ ⋃ (n : ℕ), (fun q => K (F q).fst (F q).snd.fst (F q).snd.snd) n

tactic: apply mem_iUnion.2 ⟨q, _⟩
state_before: case inr.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
p : ℕ
hp : x ∈ closedBall (d p) (u n / 3)
q : ℕ
hq : F q = (n, z, p)
⊢ x ∈ ⋃ (n : ℕ), (fun q => K (F q).fst (F q).snd.fst (F q).snd.snd) n

tactic: simp (config := { zeta := false }) only [hq, subset_closure hnz, hp, mem_inter_iff, and_true, hnz]
state_before: E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
p : ℕ
hp : x ∈ closedBall (d p) (u n / 3)
q : ℕ
hq : F q = (n, z, p)
⊢ x ∈ (fun q => K (F q).fst (F q).snd.fst (F q).snd.snd) q

tactic: refine' ⟨fun _ => ∅, fun _ => 0, _, _, _, _⟩ <;> simp
state_before: case inl
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
f' : E → E →L[ℝ] F
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hf' : ∀ (x : E), x ∈ ∅ → HasFDerivWithinAt f (f' x) ∅ x
⊢ ∃ t A,
    (∀ (n : ℕ), IsClosed (t n)) ∧
      (∅ ⊆ ⋃ (n : ℕ), t n) ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (∅ ∩ t n) (r (A n))) ∧
          (Set.Nonempty ∅ → ∀ (n : ℕ), ∃ y, y ∈ ∅ ∧ A n = f' y)

tactic: intro x xs
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
⊢ ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z

tactic: obtain ⟨z, zT, hz⟩ : ∃ z ∈ T, f' x ∈ ball (f' (z : E)) (r (f' z)) := by
  have : f' x ∈ ⋃ z ∈ T, ball (f' (z : E)) (r (f' z)) := by
    rw [hT]
    refine' mem_iUnion.2 ⟨⟨x, xs⟩, _⟩
    simpa only [mem_ball, Subtype.coe_mk, dist_self] using (rpos (f' x)).bot_lt
  rwa [mem_iUnion₂, bex_def] at this
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
⊢ ∃ n z, x ∈ M n z

tactic: obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ ‖f' x - f' z‖ + ε ≤ r (f' z) := by
  refine' ⟨r (f' z) - ‖f' x - f' z‖, _, le_of_eq (by abel)⟩
  simpa only [sub_pos] using mem_ball_iff_norm.mp hz
state_before: case intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
⊢ ∃ n z, x ∈ M n z

tactic: obtain ⟨δ, δpos, hδ⟩ :
  ∃ (δ : ℝ), 0 < δ ∧ ball x δ ∩ s ⊆ {y | ‖f y - f x - (f' x) (y - x)‖ ≤ ε * ‖y - x‖} :=
  Metric.mem_nhdsWithin_iff.1 (IsLittleO.def (hf' x xs) εpos)
state_before: case intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
⊢ ∃ n z, x ∈ M n z

tactic: obtain ⟨n, hn⟩ : ∃ n, u n < δ := ((tendsto_order.1 u_lim).2 _ δpos).exists
state_before: case intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
⊢ ∃ n z, x ∈ M n z

tactic: refine' ⟨n, ⟨z, zT⟩, ⟨xs, _⟩⟩
state_before: case intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
⊢ ∃ n z, x ∈ M n z

tactic: intro y hy
state_before: case intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
⊢ ∀ (y : E),
    y ∈ s ∩ ball x (u n) →
      ‖f y - f x - ↑(f' ↑↑{ val := z, property := zT }) (y - x)‖ ≤ ↑(r (f' ↑↑{ val := z, property := zT })) * ‖y - x‖

tactic: calc
  ‖f y - f x - (f' z) (y - x)‖ = ‖f y - f x - (f' x) (y - x) + (f' x - f' z) (y - x)‖ := by
    congr 1
    simp only [ContinuousLinearMap.coe_sub', map_sub, Pi.sub_apply]
    abel
  _ ≤ ‖f y - f x - (f' x) (y - x)‖ + ‖(f' x - f' z) (y - x)‖ := (norm_add_le _ _)
  _ ≤ ε * ‖y - x‖ + ‖f' x - f' z‖ * ‖y - x‖ := by
    refine' add_le_add (hδ _) (ContinuousLinearMap.le_op_norm _ _)
    rw [inter_comm]
    exact inter_subset_inter_right _ (ball_subset_ball hn.le) hy
  _ ≤ r (f' z) * ‖y - x‖ := by
    rw [← add_mul, add_comm]
    exact mul_le_mul_of_nonneg_right hε (norm_nonneg _)
state_before: case intro.intro.intro.intro.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ ‖f y - f x - ↑(f' ↑↑{ val := z, property := zT }) (y - x)‖ ≤ ↑(r (f' ↑↑{ val := z, property := zT })) * ‖y - x‖

tactic: have : f' x ∈ ⋃ z ∈ T, ball (f' (z : E)) (r (f' z)) := by
  rw [hT]
  refine' mem_iUnion.2 ⟨⟨x, xs⟩, _⟩
  simpa only [mem_ball, Subtype.coe_mk, dist_self] using (rpos (f' x)).bot_lt
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
⊢ ∃ z, z ∈ T ∧ f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))

tactic: rwa [mem_iUnion₂, bex_def] at this
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
this : f' x ∈ ⋃ (z : ↑s) (_ : z ∈ T), ball (f' ↑z) ↑(r (f' ↑z))
⊢ ∃ z, z ∈ T ∧ f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))

tactic: rw [hT]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
⊢ f' x ∈ ⋃ (z : ↑s) (_ : z ∈ T), ball (f' ↑z) ↑(r (f' ↑z))

tactic: refine' mem_iUnion.2 ⟨⟨x, xs⟩, _⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
⊢ f' x ∈ ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))

tactic: simpa only [mem_ball, Subtype.coe_mk, dist_self] using (rpos (f' x)).bot_lt
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
⊢ f' x ∈ ball (f' ↑{ val := x, property := xs }) ↑(r (f' ↑{ val := x, property := xs }))

tactic: refine' ⟨r (f' z) - ‖f' x - f' z‖, _, le_of_eq (by abel)⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
⊢ ∃ ε, 0 < ε ∧ ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))

tactic: simpa only [sub_pos] using mem_ball_iff_norm.mp hz
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
⊢ 0 < ↑(r (f' ↑z)) - ‖f' x - f' ↑z‖

tactic: abel
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
⊢ ‖f' x - f' ↑z‖ + (↑(r (f' ↑z)) - ‖f' x - f' ↑z‖) = ↑(r (f' ↑z))

tactic: congr 1
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ ‖f y - f x - ↑(f' ↑z) (y - x)‖ = ‖f y - f x - ↑(f' x) (y - x) + ↑(f' x - f' ↑z) (y - x)‖

tactic: simp only [ContinuousLinearMap.coe_sub', map_sub, Pi.sub_apply]
state_before: case e_a
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ f y - f x - ↑(f' ↑z) (y - x) = f y - f x - ↑(f' x) (y - x) + ↑(f' x - f' ↑z) (y - x)

tactic: abel
state_before: case e_a
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ f y - f x - (↑(f' ↑z) y - ↑(f' ↑z) x) =
    f y - f x - (↑(f' x) y - ↑(f' x) x) + (↑(f' x) y - ↑(f' ↑z) y - (↑(f' x) x - ↑(f' ↑z) x))

tactic: refine' add_le_add (hδ _) (ContinuousLinearMap.le_op_norm _ _)
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ ‖f y - f x - ↑(f' x) (y - x)‖ + ‖↑(f' x - f' ↑z) (y - x)‖ ≤ ε * ‖y - x‖ + ‖f' x - f' ↑z‖ * ‖y - x‖

tactic: rw [inter_comm]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ y ∈ ball x δ ∩ s

tactic: exact inter_subset_inter_right _ (ball_subset_ball hn.le) hy
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ y ∈ s ∩ ball x δ

tactic: rw [← add_mul, add_comm]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ ε * ‖y - x‖ + ‖f' x - f' ↑z‖ * ‖y - x‖ ≤ ↑(r (f' ↑z)) * ‖y - x‖

tactic: exact mul_le_mul_of_nonneg_right hε (norm_nonneg _)
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
x : E
xs : x ∈ s
z : ↑s
zT : z ∈ T
hz : f' x ∈ ball (f' ↑z) ↑(r (f' ↑z))
ε : ℝ
εpos : 0 < ε
hε : ‖f' x - f' ↑z‖ + ε ≤ ↑(r (f' ↑z))
δ : ℝ
δpos : 0 < δ
hδ : ball x δ ∩ s ⊆ {y | ‖f y - f x - ↑(f' x) (y - x)‖ ≤ ε * ‖y - x‖}
n : ℕ
hn : u n < δ
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ (‖f' x - f' ↑z‖ + ε) * ‖y - x‖ ≤ ↑(r (f' ↑z)) * ‖y - x‖

tactic: rintro n z x ⟨xs, hx⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
⊢ ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z

tactic: refine' ⟨xs, fun y hy => _⟩
state_before: case intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
⊢ x ∈ M n z

tactic: obtain ⟨a, aM, a_lim⟩ : ∃ a : ℕ → E, (∀ k, a k ∈ M n z) ∧ Tendsto a atTop (𝓝 x) :=
  mem_closure_iff_seq_limit.1 hx
state_before: case intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
⊢ ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖

tactic: have L1 :
  Tendsto (fun k : ℕ => ‖f y - f (a k) - (f' z) (y - a k)‖) atTop
    (𝓝 ‖f y - f x - (f' z) (y - x)‖) := by
  apply Tendsto.norm
  have L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x)) := by
    apply (hf' x xs).continuousWithinAt.tendsto.comp
    apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ a_lim
    exact eventually_of_forall fun k => (aM k).1
  apply Tendsto.sub (tendsto_const_nhds.sub L)
  exact ((f' z).continuous.tendsto _).comp (tendsto_const_nhds.sub a_lim)
state_before: case intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖

tactic: have L2 : Tendsto (fun k : ℕ => (r (f' z) : ℝ) * ‖y - a k‖) atTop (𝓝 (r (f' z) * ‖y - x‖)) :=
  (tendsto_const_nhds.sub a_lim).norm.const_mul _
state_before: case intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
⊢ ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖

tactic: have I : ∀ᶠ k in atTop, ‖f y - f (a k) - (f' z) (y - a k)‖ ≤ r (f' z) * ‖y - a k‖ := by
  have L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x)) :=
    tendsto_const_nhds.dist a_lim
  filter_upwards [(tendsto_order.1 L).2 _ hy.2]
  intro k hk
  exact (aM k).2 y ⟨hy.1, hk⟩
state_before: case intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
⊢ ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖

tactic: exact le_of_tendsto_of_tendsto L1 L2 I
state_before: case intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
I : ∀ᶠ (k : ℕ) in atTop, ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - a k‖
⊢ ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖

tactic: apply Tendsto.norm
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)

tactic: have L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x)) := by
  apply (hf' x xs).continuousWithinAt.tendsto.comp
  apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ a_lim
  exact eventually_of_forall fun k => (aM k).1
state_before: case h
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ Tendsto (fun x => f y - f (a x) - ↑(f' ↑↑z) (y - a x)) atTop (𝓝 (f y - f x - ↑(f' ↑↑z) (y - x)))

tactic: apply Tendsto.sub (tendsto_const_nhds.sub L)
state_before: case h
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x))
⊢ Tendsto (fun x => f y - f (a x) - ↑(f' ↑↑z) (y - a x)) atTop (𝓝 (f y - f x - ↑(f' ↑↑z) (y - x)))

tactic: exact ((f' z).continuous.tendsto _).comp (tendsto_const_nhds.sub a_lim)
state_before: case h
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x))
⊢ Tendsto (fun x => ↑(f' ↑↑z) (y - a x)) atTop (𝓝 (↑(f' ↑↑z) (y - x)))

tactic: apply (hf' x xs).continuousWithinAt.tendsto.comp
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ Tendsto (fun k => f (a k)) atTop (𝓝 (f x))

tactic: apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ a_lim
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ Tendsto (fun k => a k) atTop (𝓝[s] x)

tactic: exact eventually_of_forall fun k => (aM k).1
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
⊢ ∀ᶠ (x : ℕ) in atTop, a x ∈ s

tactic: have L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x)) :=
  tendsto_const_nhds.dist a_lim
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
⊢ ∀ᶠ (k : ℕ) in atTop, ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - a k‖

tactic: filter_upwards [(tendsto_order.1 L).2 _ hy.2]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x))
⊢ ∀ᶠ (k : ℕ) in atTop, ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - a k‖

tactic: intro k hk
state_before: case h
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x))
⊢ ∀ (a_1 : ℕ), dist y (a a_1) < u n → ‖f y - f (a a_1) - ↑(f' ↑↑z) (y - a a_1)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - a a_1‖

tactic: exact (aM k).2 y ⟨hy.1, hk⟩
state_before: case h
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
n : ℕ
z : ↑T
x : E
xs : x ∈ s
hx : x ∈ closure (M n z)
y : E
hy : y ∈ s ∩ ball x (u n)
a : ℕ → E
aM : ∀ (k : ℕ), a k ∈ M n z
a_lim : Tendsto a atTop (𝓝 x)
L1 : Tendsto (fun k => ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖) atTop (𝓝 ‖f y - f x - ↑(f' ↑↑z) (y - x)‖)
L2 : Tendsto (fun k => ↑(r (f' ↑↑z)) * ‖y - a k‖) atTop (𝓝 (↑(r (f' ↑↑z)) * ‖y - x‖))
L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x))
k : ℕ
hk : dist y (a k) < u n
⊢ ‖f y - f (a k) - ↑(f' ↑↑z) (y - a k)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - a k‖

tactic: intro n z p x hx y hy
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
⊢ ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))

tactic: have yM : y ∈ M n z := closure_M_subset _ _ ⟨hy.1, hy.2.1⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
n : ℕ
z : ↑T
p : ℕ
x : E
hx : x ∈ s ∩ K n z p
y : E
hy : y ∈ s ∩ K n z p
⊢ ‖f x - f y - ↑(f' ↑↑z) (x - y)‖ ≤ ↑(r (f' ↑↑z)) * ‖x - y‖

tactic: refine' yM.2 _ ⟨hx.1, _⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
n : ℕ
z : ↑T
p : ℕ
x : E
hx : x ∈ s ∩ K n z p
y : E
hy : y ∈ s ∩ K n z p
yM : y ∈ M n z
⊢ ‖f x - f y - ↑(f' ↑↑z) (x - y)‖ ≤ ↑(r (f' ↑↑z)) * ‖x - y‖

tactic: calc
  dist x y ≤ dist x (d p) + dist y (d p) := dist_triangle_right _ _ _
  _ ≤ u n / 3 + u n / 3 := (add_le_add hx.2.2 hy.2.2)
  _ < u n := by linarith [u_pos n]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
n : ℕ
z : ↑T
p : ℕ
x : E
hx : x ∈ s ∩ K n z p
y : E
hy : y ∈ s ∩ K n z p
yM : y ∈ M n z
⊢ x ∈ ball y (u n)

tactic: linarith [u_pos n]
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
n : ℕ
z : ↑T
p : ℕ
x : E
hx : x ∈ s ∩ K n z p
y : E
hy : y ∈ s ∩ K n z p
yM : y ∈ M n z
⊢ u n / 3 + u n / 3 < u n

tactic: haveI : Encodable T := T_count.toEncodable
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
⊢ ∃ F, Function.Surjective F

tactic: inhabit ↥T
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
this✝ : Encodable ↑T
this : Nonempty ↑T
⊢ ∃ F, Function.Surjective F

tactic: exact ⟨_, Encodable.surjective_decode_iget (ℕ × T × ℕ)⟩
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
this✝ : Encodable ↑T
this : Nonempty ↑T
inhabited_h : Inhabited ↑T
⊢ ∃ F, Function.Surjective F

tactic: rcases eq_empty_or_nonempty T with (rfl | hT)
state_before: E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
this : Encodable ↑T
⊢ Nonempty ↑T

tactic: rcases hs with ⟨x, xs⟩
state_before: case inl
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
d : ℕ → E
hd : DenseRange d
T_count : Set.Countable ∅
hT : (⋃ (x : ↑s) (_ : x ∈ ∅), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
M : ℕ → ↑∅ → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑∅), s ∩ closure (M n z) ⊆ M n z
K : ℕ → ↑∅ → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), IsClosed (K n z p)
this : Encodable ↑∅
⊢ Nonempty ↑∅

tactic: rcases s_subset x xs with ⟨n, z, _⟩
state_before: case inl.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
d : ℕ → E
hd : DenseRange d
T_count : Set.Countable ∅
hT : (⋃ (x : ↑s) (_ : x ∈ ∅), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
M : ℕ → ↑∅ → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑∅), s ∩ closure (M n z) ⊆ M n z
K : ℕ → ↑∅ → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), IsClosed (K n z p)
this : Encodable ↑∅
x : E
xs : x ∈ s
⊢ Nonempty ↑∅

tactic: exact False.elim z.2
state_before: case inl.intro.intro.intro
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
d : ℕ → E
hd : DenseRange d
T_count : Set.Countable ∅
hT : (⋃ (x : ↑s) (_ : x ∈ ∅), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
M : ℕ → ↑∅ → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑∅), s ∩ closure (M n z) ⊆ M n z
K : ℕ → ↑∅ → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑∅) (p : ℕ), IsClosed (K n z p)
this : Encodable ↑∅
x : E
xs : x ∈ s
n : ℕ
z : ↑∅
h✝ : x ∈ M n z
⊢ Nonempty ↑∅

tactic: exact hT.coe_sort
state_before: case inr
E : Type u_2
F : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F
f : E → F
s : Set E
f' : E → E →L[ℝ] F
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT✝ : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
this : Encodable ↑T
hT : Set.Nonempty T
⊢ Nonempty ↑T

tactic: have : Set.Nonempty (ball x (u n / 3)) := by simp only [nonempty_ball]; linarith [u_pos n]
state_before: E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
⊢ ∃ p, x ∈ closedBall (d p) (u n / 3)

tactic: obtain ⟨p, hp⟩ : ∃ p : ℕ, d p ∈ ball x (u n / 3) := hd.exists_mem_open isOpen_ball this
state_before: E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
this : Set.Nonempty (ball x (u n / 3))
⊢ ∃ p, x ∈ closedBall (d p) (u n / 3)

tactic: exact ⟨p, (mem_ball'.1 hp).le⟩
state_before: case intro
E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
this : Set.Nonempty (ball x (u n / 3))
p : ℕ
hp : d p ∈ ball x (u n / 3)
⊢ ∃ p, x ∈ closedBall (d p) (u n / 3)

tactic: simp only [nonempty_ball]
state_before: E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
⊢ Set.Nonempty (ball x (u n / 3))

tactic: linarith [u_pos n]
state_before: E : Type u_2
F✝ : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : FiniteDimensional ℝ E
inst✝² : NormedAddCommGroup F✝
inst✝¹ : NormedSpace ℝ F✝
s✝ : Set E
f✝ : E → E
f'✝ : E → E →L[ℝ] E
inst✝ : SecondCountableTopology F✝
f : E → F✝
s : Set E
f' : E → E →L[ℝ] F✝
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
r : (E →L[ℝ] F✝) → ℝ≥0
rpos : ∀ (A : E →L[ℝ] F✝), r A ≠ 0
hs : Set.Nonempty s
T : Set ↑s
T_count : Set.Countable T
hT : (⋃ (x : ↑s) (_ : x ∈ T), ball (f' ↑x) ↑(r (f' ↑x))) = ⋃ (x : ↑s), ball (f' ↑x) ↑(r (f' ↑x))
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
M : ℕ → ↑T → Set E :=
  fun n z => {x | x ∈ s ∧ ∀ (y : E), y ∈ s ∩ ball x (u n) → ‖f y - f x - ↑(f' ↑↑z) (y - x)‖ ≤ ↑(r (f' ↑↑z)) * ‖y - x‖}
s_subset : ∀ (x : E), x ∈ s → ∃ n z, x ∈ M n z
closure_M_subset : ∀ (n : ℕ) (z : ↑T), s ∩ closure (M n z) ⊆ M n z
d : ℕ → E
hd : DenseRange d
K : ℕ → ↑T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
K_approx : ∀ (n : ℕ) (z : ↑T) (p : ℕ), ApproximatesLinearOn f (f' ↑↑z) (s ∩ K n z p) (r (f' ↑↑z))
K_closed : ∀ (n : ℕ) (z : ↑T) (p : ℕ), IsClosed (K n z p)
F : ℕ → ℕ × ↑T × ℕ
hF : Function.Surjective F
x : E
xs : x ∈ s
n : ℕ
z : ↑T
hnz : x ∈ M n z
⊢ 0 < u n / 3