-- Mathlib/Analysis/Analytic/Composition.lean
theorem HasFPowerSeriesWithinAt.comp {g : F → G} {f : E → F} {q : FormalMultilinearSeries 𝕜 F G}
    {p : FormalMultilinearSeries 𝕜 E F} {x : E} {t : Set F} {s : Set E}
    (hg : HasFPowerSeriesWithinAt g q t (f x)) (hf : HasFPowerSeriesWithinAt f p s x)
    (hs : Set.MapsTo f s t) : HasFPowerSeriesWithinAt (g ∘ f) (q.comp p) s x

Proof state:
case intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
δ : ℝ≥0∞
δpos : 0 < δ
hδ : ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg
rf' : ℝ≥0∞ := rf ⊓ δ
⊢ HasFPowerSeriesWithinAt (g ∘ f) (q.comp p) s x

Tactic:
have min_pos : 0 < min rf' r := by
  simp only [rf', r_pos, Hf.r_pos, δpos, lt_min_iff, ENNReal.coe_pos, and_self_iff]

Result:
case intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
δ : ℝ≥0∞
δpos : 0 < δ
hδ : ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg
rf' : ℝ≥0∞ := rf ⊓ δ
min_pos : 0 < rf' ⊓ ↑r
⊢ HasFPowerSeriesWithinAt (g ∘ f) (q.comp p) s x

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
this✝ : insert (f x) t ∩ EMetric.ball (f x) rg ∈ 𝓝[insert (f x) t] f x
this : insert (f x) t ∩ EMetric.ball (f x) rg ∈ Filter.map f (𝓝[insert x s] x)
δ : ℝ≥0∞
δpos : δ > 0
Hδ : EMetric.ball x δ ∩ insert x s ⊆ f ⁻¹' (insert (f x) t ∩ EMetric.ball (f x) rg)
⊢ ∃ δ, 0 < δ ∧ ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg

Tactic:
exact ⟨δ, δpos, fun {z} hz => Hδ (by rwa [Set.inter_comm])⟩

Result:
no goals

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
δ : ℝ≥0∞
δpos : 0 < δ
hδ : ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg
rf' : ℝ≥0∞ := rf ⊓ δ
min_pos : 0 < rf' ⊓ ↑r
y : E
h'y : x + y ∈ insert x s
hy : y ∈ EMetric.ball 0 (rf' ⊓ ↑r)
y_mem : y ∈ EMetric.ball 0 rf
fy_mem : f (x + y) ∈ insert (f x) t ∩ EMetric.ball (f x) rg
A : Tendsto (fun n => (n, ∑ a ∈ Finset.Ico 1 n, (p a) fun x => y)) atTop (atTop ×ˢ 𝓝 (f (x + y) - f x))
B : Tendsto (fun n => q.partialSum n (∑ a ∈ Finset.Ico 1 n, (p a) fun _b => y)) atTop (𝓝 (g (f (x + y))))
C :
  Tendsto (fun n => ∑ i ∈ compPartialSumTarget 0 n n, (q.compAlongComposition p i.snd) fun _j => y) atTop
    (𝓝 (g (f (x + y))))
D : HasSum (fun i => (q.compAlongComposition p i.snd) fun _j => y) (g (f (x + y)))
⊢ ∀ (b : ℕ), HasSum (fun c => (q.compAlongComposition p ⟨b, c⟩.snd) fun _j => y) ((q.comp p b) fun _j => y)

Tactic:
intro n

Result:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
δ : ℝ≥0∞
δpos : 0 < δ
hδ : ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg
rf' : ℝ≥0∞ := rf ⊓ δ
min_pos : 0 < rf' ⊓ ↑r
y : E
h'y : x + y ∈ insert x s
hy : y ∈ EMetric.ball 0 (rf' ⊓ ↑r)
y_mem : y ∈ EMetric.ball 0 rf
fy_mem : f (x + y) ∈ insert (f x) t ∩ EMetric.ball (f x) rg
A : Tendsto (fun n => (n, ∑ a ∈ Finset.Ico 1 n, (p a) fun x => y)) atTop (atTop ×ˢ 𝓝 (f (x + y) - f x))
B : Tendsto (fun n => q.partialSum n (∑ a ∈ Finset.Ico 1 n, (p a) fun _b => y)) atTop (𝓝 (g (f (x + y))))
C :
  Tendsto (fun n => ∑ i ∈ compPartialSumTarget 0 n n, (q.compAlongComposition p i.snd) fun _j => y) atTop
    (𝓝 (g (f (x + y))))
D : HasSum (fun i => (q.compAlongComposition p i.snd) fun _j => y) (g (f (x + y)))
n : ℕ
⊢ HasSum (fun c => (q.compAlongComposition p ⟨n, c⟩.snd) fun _j => y) ((q.comp p n) fun _j => y)

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
g : F → G
f : E → F
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
x : E
t : Set F
s : Set E
hs : Set.MapsTo f s t
rg : ℝ≥0∞
Hg : HasFPowerSeriesWithinOnBall g q t (f x) rg
rf : ℝ≥0∞
Hf : HasFPowerSeriesWithinOnBall f p s x rf
r : ℝ≥0
r_pos : 0 < r
hr : Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst
δ : ℝ≥0∞
δpos : 0 < δ
hδ : ∀ {z : E}, z ∈ insert x s ∩ EMetric.ball x δ → f z ∈ insert (f x) t ∩ EMetric.ball (f x) rg
rf' : ℝ≥0∞ := rf ⊓ δ
min_pos : 0 < rf' ⊓ ↑r
y : E
h'y : x + y ∈ insert x s
hy : y ∈ EMetric.ball 0 (rf' ⊓ ↑r)
y_mem : y ∈ EMetric.ball 0 rf
fy_mem : f (x + y) ∈ insert (f x) t ∩ EMetric.ball (f x) rg
A : Tendsto (fun n => (n, ∑ a ∈ Finset.Ico 1 n, (p a) fun x => y)) atTop (atTop ×ˢ 𝓝 (f (x + y) - f x))
B : Tendsto (fun n => q.partialSum n (∑ a ∈ Finset.Ico 1 n, (p a) fun _b => y)) atTop (𝓝 (g (f (x + y))))
C :
  Tendsto (fun n => ∑ i ∈ compPartialSumTarget 0 n n, (q.compAlongComposition p i.snd) fun _j => y) atTop
    (𝓝 (g (f (x + y))))
D : HasSum (fun i => (q.compAlongComposition p i.snd) fun _j => y) (g (f (x + y)))
n : ℕ
⊢ HasSum (fun c => (q c.length) (p.applyComposition c fun _j => y))
    (∑ c : Composition n, (q c.length) (p.applyComposition c fun _j => y))

Tactic:
exact hasSum_fintype _

Result:
no goals