l3lab/ntp-mathlib huggingface dataset:
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · 

Proof state:
case intro.intro.intro.intro.refine'_1
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝¹ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
n : ℕ
hn : x i + d n ∈ s i
j : ι
x✝ : j ∈ univ
⊢ (x + (fun n => Function.update (d' n) i (d n)) n) j ∈ s j

Next tactic:
rcases em (j = i) with (rfl | hj)
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> 

Proof state:
case intro.intro.intro.intro.refine'_1.inl
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝¹ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
c : ℕ → 𝕜
hc : Tendsto (fun n => ‖c n‖) atTop atTop
d' : ℕ → (j : ι) → E j
n : ℕ
j : ι
x✝ : j ∈ univ
hi : ∀ (j_1 : ι), j_1 ≠ j → x j_1 ∈ closure (s j_1)
w : E j
d : ℕ → E j
hd : ∀ᶠ (n : ℕ) in atTop, x j + d n ∈ s j
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
hd's : ∀ (n : ℕ) (j_1 : ι), j_1 ≠ j → x j_1 + d' n j_1 ∈ s j_1
hcd' : ∀ (n : ℕ) (j_1 : ι), j_1 ≠ j → ‖c n • d' n j_1‖ < (1 / 2) ^ n
hn : x j + d n ∈ s j
⊢ (x + (fun n => Function.update (d' n) j (d n)) n) j ∈ s j

Next tactic:
simp [*]
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> 

Proof state:
case intro.intro.intro.intro.refine'_1.inr
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝¹ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
n : ℕ
hn : x i + d n ∈ s i
j : ι
x✝ : j ∈ univ
hj : ¬j = i
⊢ (x + (fun n => Function.update (d' n) i (d n)) n) j ∈ s j

Next tactic:
simp [*]
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · 

Proof state:
case intro.intro.intro.intro.refine'_2
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
j : ι
⊢ Tendsto (fun i_1 => (c i_1 • (fun n => Function.update (d' n) i (d n)) i_1) j) atTop (𝓝 ((LinearMap.single i) w j))

Next tactic:
rcases em (j = i) with (rfl | hj)
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · rcases em (j = i) with (rfl | hj)
    · 

Proof state:
case intro.intro.intro.intro.refine'_2.inl
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
c : ℕ → 𝕜
hc : Tendsto (fun n => ‖c n‖) atTop atTop
d' : ℕ → (j : ι) → E j
j : ι
hi : ∀ (j_1 : ι), j_1 ≠ j → x j_1 ∈ closure (s j_1)
w : E j
d : ℕ → E j
hd : ∀ᶠ (n : ℕ) in atTop, x j + d n ∈ s j
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
hd's : ∀ (n : ℕ) (j_1 : ι), j_1 ≠ j → x j_1 + d' n j_1 ∈ s j_1
hcd' : ∀ (n : ℕ) (j_1 : ι), j_1 ≠ j → ‖c n • d' n j_1‖ < (1 / 2) ^ n
⊢ Tendsto (fun i => (c i • (fun n => Function.update (d' n) j (d n)) i) j) atTop (𝓝 ((LinearMap.single j) w j))

Next tactic:
simp [hy]
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · rcases em (j = i) with (rfl | hj)
    · simp [hy]
    · 

Proof state:
case intro.intro.intro.intro.refine'_2.inr
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
j : ι
hj : ¬j = i
⊢ Tendsto (fun i_1 => (c i_1 • (fun n => Function.update (d' n) i (d n)) i_1) j) atTop (𝓝 ((LinearMap.single i) w j))

Next tactic:
suffices Tendsto (fun n => c n • d' n j) atTop (𝓝 0) by simpa [hj]
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · rcases em (j = i) with (rfl | hj)
    · simp [hy]
    · suffices Tendsto (fun n => c n • d' n j) atTop (𝓝 0) by 

Proof state:
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
j : ι
hj : ¬j = i
this : Tendsto (fun n => c n • d' n j) atTop (𝓝 0)
⊢ Tendsto (fun i_1 => (c i_1 • (fun n => Function.update (d' n) i (d n)) i_1) j) atTop (𝓝 ((LinearMap.single i) w j))

Next tactic:
simpa [hj]
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · rcases em (j = i) with (rfl | hj)
    · simp [hy]
    · suffices Tendsto (fun n => c n • d' n j) atTop (𝓝 0) by simpa [hj]
      

Proof state:
case intro.intro.intro.intro.refine'_2.inr
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
j : ι
hj : ¬j = i
⊢ Tendsto (fun n => c n • d' n j) atTop (𝓝 0)

Next tactic:
refine' squeeze_zero_norm (fun n => (hcd' n j hj).le) _
/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ (j) (_ : j ≠ i), x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x) := by
  rintro w ⟨c, d, hd, hc, hy⟩
  have : ∀ (n) (j) (_ : j ≠ i), ∃ d', x j + d' ∈ s j ∧ ‖c n • d'‖ < (1 / 2 : ℝ) ^ n := by
    intro n j hj
    rcases mem_closure_iff_nhds.1 (hi j hj) _
        (eventually_nhds_norm_smul_sub_lt (c n) (x j) (pow_pos one_half_pos n)) with
      ⟨z, hz, hzs⟩
    exact ⟨z - x j, by simpa using hzs, by simpa using hz⟩
  choose! d' hd's hcd' using this
  refine' ⟨c, fun n => Function.update (d' n) i (d n), hd.mono fun n hn j _ => _, hc,
      tendsto_pi_nhds.2 fun j => _⟩
  · rcases em (j = i) with (rfl | hj) <;> simp [*]
  · rcases em (j = i) with (rfl | hj)
    · simp [hy]
    · suffices Tendsto (fun n => c n • d' n j) atTop (𝓝 0) by simpa [hj]
      refine' squeeze_zero_norm (fun n => (hcd' n j hj).le) _
      

Proof state:
case intro.intro.intro.intro.refine'_2.inr
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E✝ : Type u_2
inst✝⁸ : NormedAddCommGroup E✝
inst✝⁷ : NormedSpace 𝕜 E✝
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace ℝ G
x✝ y : E✝
s✝ t : Set E✝
ι : Type u_5
inst✝² : DecidableEq ι
E : ι → Type u_6
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace 𝕜 (E i)
s : (i : ι) → Set (E i)
x : (i : ι) → E i
i : ι
hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j)
w : E i
c : ℕ → 𝕜
d : ℕ → E i
hd : ∀ᶠ (n : ℕ) in atTop, x i + d n ∈ s i
hc : Tendsto (fun n => ‖c n‖) atTop atTop
hy : Tendsto (fun n => c n • d n) atTop (𝓝 w)
d' : ℕ → (j : ι) → E j
hd's : ∀ (n : ℕ) (j : ι), j ≠ i → x j + d' n j ∈ s j
hcd' : ∀ (n : ℕ) (j : ι), j ≠ i → ‖c n • d' n j‖ < (1 / 2) ^ n
j : ι
hj : ¬j = i
⊢ Tendsto (fun n => (1 / 2) ^ n) atTop (𝓝 0)

Next tactic:
exact tendsto_pow_atTop_nhds_0_of_lt_1 one_half_pos.le one_half_lt_one
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
⊢ y - x ∈ tangentConeAt ℝ s x

Next tactic:
refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by norm_num) ?_
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by 

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
⊢ ‖1 / 2‖ < 1

Next tactic:
norm_num
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by norm_num) ?_
  

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
⊢ ∀ᶠ (n : ℕ) in atTop, x + (1 / 2) ^ n • (y - x) ∈ s

Next tactic:
refine (eventually_ne_atTop 0).mono fun n hn ↦ (h ?_)
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by norm_num) ?_
  refine (eventually_ne_atTop 0).mono fun n hn ↦ (h ?_)
  

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
n : ℕ
hn : n ≠ 0
⊢ x + (1 / 2) ^ n • (y - x) ∈ openSegment ℝ x y

Next tactic:
rw [openSegment_eq_image]
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by norm_num) ?_
  refine (eventually_ne_atTop 0).mono fun n hn ↦ (h ?_)
  rw [openSegment_eq_image]
  

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
n : ℕ
hn : n ≠ 0
⊢ x + (1 / 2) ^ n • (y - x) ∈ (fun θ => (1 - θ) • x + θ • y) '' Ioo 0 1

Next tactic:
refine ⟨(1 / 2) ^ n, ⟨?_, ?_⟩, ?_⟩
/-- If a subset of a real vector space contains an open segment, then the direction of this
segment belongs to the tangent cone at its endpoints. -/
theorem mem_tangentCone_of_openSegment_subset {s : Set G} {x y : G} (h : openSegment ℝ x y ⊆ s) :
    y - x ∈ tangentConeAt ℝ s x := by
  refine mem_tangentConeAt_of_pow_smul one_half_pos.ne' (by norm_num) ?_
  refine (eventually_ne_atTop 0).mono fun n hn ↦ (h ?_)
  rw [openSegment_eq_image]
  refine ⟨(1 / 2) ^ n, ⟨?_, ?_⟩, ?_⟩
  · 

Proof state:
case refine_1
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
x✝ y✝ : E
s✝ t : Set E
s : Set G
x y : G
h : openSegment ℝ x y ⊆ s
n : ℕ
hn : n ≠ 0
⊢ 0 < (1 / 2) ^ n

Next tactic:
exact pow_pos one_half_pos _