-- Mathlib/Analysis/Complex/RemovableSingularity.lean
theorem analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt {f : ℂ → E} {c : ℂ}
    (hd : ∀ᶠ z in 𝓝[≠] c, DifferentiableAt ℂ f z) (hc : ContinuousAt f c) : AnalyticAt ℂ f c

Proof state:
case inl
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
R : ℝ≥0
hR0 : 0 < ↑R
z : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] z, DifferentiableAt ℂ f z
hc : ContinuousAt f z
hRs : closedBall z ↑R ∩ {z}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
hz : z ∈ closedBall z ↑R
⊢ ContinuousAt f z

case inr
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
z : ℂ
hz : z ∈ closedBall c ↑R
hne : z ≠ c
⊢ ContinuousAt f z

Tactic:
exacts [hc, (hRs ⟨hz, hne⟩).continuousAt]

Result:
no goals

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
⊢ ContinuousOn f (closedBall c ↑R)

Tactic:
refine fun z hz => ContinuousAt.continuousWithinAt ?_

Result:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
z : ℂ
hz : z ∈ closedBall c ↑R
⊢ ContinuousAt f z

Proof state:
case intro.intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
⊢ AnalyticAt ℂ f c

Tactic:
replace hc : ContinuousOn f (closedBall c R) := by
  refine fun z hz => ContinuousAt.continuousWithinAt ?_
  rcases eq_or_ne z c with (rfl | hne)
  exacts [hc, (hRs ⟨hz, hne⟩).continuousAt]

Result:
case intro.intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
hc : ContinuousOn f (closedBall c ↑R)
⊢ AnalyticAt ℂ f c

Proof state:
case intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ
hR0 : 0 < R
hRs : closedBall c R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
⊢ AnalyticAt ℂ f c

Tactic:
lift R to ℝ≥0 using hR0.le

Result:
case intro.intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
⊢ AnalyticAt ℂ f c

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
⊢ AnalyticAt ℂ f c

Tactic:
rcases (nhdsWithin_hasBasis nhds_basis_closedBall _).mem_iff.1 hd with ⟨R, hR0, hRs⟩

Result:
case intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ
hR0 : 0 < R
hRs : closedBall c R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
⊢ AnalyticAt ℂ f c

Proof state:
case intro.intro.intro
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
hc : ContinuousOn f (closedBall c ↑R)
⊢ AnalyticAt ℂ f c

Tactic:
exact (hasFPowerSeriesOnBall_of_differentiable_off_countable (countable_singleton c) hc
  (fun z hz => hRs (diff_subset_diff_left ball_subset_closedBall hz)) hR0).analyticAt

Result:
no goals

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
z : ℂ
hz : z ∈ closedBall c ↑R
⊢ ContinuousAt f z

Tactic:
rcases eq_or_ne z c with (rfl | hne)

Result:
case inl
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
R : ℝ≥0
hR0 : 0 < ↑R
z : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] z, DifferentiableAt ℂ f z
hc : ContinuousAt f z
hRs : closedBall z ↑R ∩ {z}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
hz : z ∈ closedBall z ↑R
⊢ ContinuousAt f z

case inr
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z
hc : ContinuousAt f c
R : ℝ≥0
hR0 : 0 < ↑R
hRs : closedBall c ↑R ∩ {c}ᶜ ⊆ {x | (fun z => DifferentiableAt ℂ f z) x}
z : ℂ
hz : z ∈ closedBall c ↑R
hne : z ≠ c
⊢ ContinuousAt f z