-- Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Tactic:
have A :
  ContDiffOn 𝕜 1 (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
    (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
  this.1

Result:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
A : ContDiffOn 𝕜 1 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm) (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I)
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
⊢ ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I

Tactic:
simp only [hx, mfld_simps]

Result:
no goals

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
A : ContDiffOn 𝕜 1 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm) (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I)
B : DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(chartAt H x).symm) ∘ ↑I.symm) (range ↑I) (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Tactic:
simpa only [mfld_simps]

Result:
no goals

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
A : ContDiffOn 𝕜 1 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm) (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(chartAt H x).symm) ∘ ↑I.symm)
    (range ↑I ∩ (↑I.symm ⁻¹' (chartAt H x).target ∩ ↑I.symm ⁻¹' (↑(chartAt H x).symm ⁻¹' e.source)))
    (↑I (↑(chartAt H x) x))
⊢ ↑I.symm ⁻¹' (chartAt H x).target ∩ ↑I.symm ⁻¹' (↑(chartAt H x).symm ⁻¹' e.source) ∈ 𝓝 (↑I (↑(chartAt H x) x))

Tactic:
apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1

Result:
no goals

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
A : ContDiffOn 𝕜 1 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm) (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm)
    (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I) (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Tactic:
simp only [mfld_simps] at B

Result:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
this : (chartAt H x).symm ≫ₕ e ∈ contDiffGroupoid 1 I
A : ContDiffOn 𝕜 1 (↑I ∘ ↑((chartAt H x).symm ≫ₕ e) ∘ ↑I.symm) (↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(chartAt H x).symm) ∘ ↑I.symm)
    (↑I.symm ⁻¹' (chartAt H x).target ∩ ↑I.symm ⁻¹' (↑(chartAt H x).symm ⁻¹' e.source) ∩ range ↑I)
    (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Tactic:
have mem :
  I ((chartAt H x : M → H) x) ∈ I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range I := by
  simp only [hx, mfld_simps]

Result:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem : ↑I (↑(chartAt H x) x) ∈ ↑I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range ↑I
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Proof state:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
⊢ ContinuousAt (↑e) x ∧ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Tactic:
refine ⟨(e.continuousOn x hx).continuousAt (e.open_source.mem_nhds hx), ?_⟩

Result:
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
H : Type u_3
inst✝³ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : IsManifold I 1 M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)