l3lab/ntp-mathlib huggingface dataset:
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
  have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
    (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
simp only [mfld_simps] at B
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
  have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem
  simp only [mfld_simps] at B
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(PartialHomeomorph.symm (chartAt H x))) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (chartAt H x).toPartialEquiv.target ∩
        ↑(ModelWithCorners.symm I) ⁻¹' (↑(PartialHomeomorph.symm (chartAt H x)) ⁻¹' e.source) ∩
      range ↑I)
    (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
rw [inter_comm, differentiableWithinAt_inter] at B
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
  have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem
  simp only [mfld_simps] at B
  rw [inter_comm, differentiableWithinAt_inter] at B
  · 

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(PartialHomeomorph.symm (chartAt H x))) ∘ ↑(ModelWithCorners.symm I)) (range ↑I)
    (↑I (↑(chartAt H x) x))
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑e) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
simpa only [mfld_simps]
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x := by
  refine' ⟨(e.continuousOn x hx).continuousAt (IsOpen.mem_nhds e.open_source hx), _⟩
  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]
  have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible (chart_mem_atlas H x) h
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm)
      (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) :=
    this.1
  have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem
  simp only [mfld_simps] at B
  rw [inter_comm, differentiableWithinAt_inter] at B
  · simpa only [mfld_simps]
  · 

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : M
hx : x ∈ e.source
mem :
  ↑I (↑(chartAt H x) x) ∈
    ↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I
this : PartialHomeomorph.symm (chartAt H x) ≫ₕ e ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(PartialHomeomorph.symm (chartAt H x) ≫ₕ e) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (PartialHomeomorph.symm (chartAt H x) ≫ₕ e).toPartialEquiv.source ∩ range ↑I)
B :
  DifferentiableWithinAt 𝕜 (↑I ∘ (↑e ∘ ↑(PartialHomeomorph.symm (chartAt H x))) ∘ ↑(ModelWithCorners.symm I))
    (range ↑I ∩
      (↑(ModelWithCorners.symm I) ⁻¹' (chartAt H x).toPartialEquiv.target ∩
        ↑(ModelWithCorners.symm I) ⁻¹' (↑(PartialHomeomorph.symm (chartAt H x)) ⁻¹' e.source)))
    (↑I (↑(chartAt H x) x))
⊢ ↑(ModelWithCorners.symm I) ⁻¹' (chartAt H x).toPartialEquiv.target ∩
      ↑(ModelWithCorners.symm I) ⁻¹' (↑(PartialHomeomorph.symm (chartAt H x)) ⁻¹' e.source) ∈
    𝓝 (↑I (↑(chartAt H x) x))

Next tactic:
apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
⊢ MDifferentiableAt I I (↑(PartialHomeomorph.symm e)) x

Next tactic:
refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑(PartialHomeomorph.symm e)) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by
    simp only [hx, mfld_simps]
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
  have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by
    

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
⊢ ↑I x ∈
    ↑(ModelWithCorners.symm I) ⁻¹'
        (PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)).toPartialEquiv.source ∩
      range ↑I

Next tactic:
simp only [hx, mfld_simps]
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
  have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by
    simp only [hx, mfld_simps]
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
mem :
  ↑I x ∈
    ↑(ModelWithCorners.symm I) ⁻¹'
        (PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)).toPartialEquiv.source ∩
      range ↑I
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑(PartialHomeomorph.symm e)) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible h (chart_mem_atlas H _)
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
  have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by
    simp only [hx, mfld_simps]
  have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible h (chart_mem_atlas H _)
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
mem :
  ↑I x ∈
    ↑(ModelWithCorners.symm I) ⁻¹'
        (PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)).toPartialEquiv.source ∩
      range ↑I
this : PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x) ∈ contDiffGroupoid ⊤ I
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑(PartialHomeomorph.symm e)) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have A :
    ContDiffOn 𝕜 ∞ (I ∘ e.symm.trans (chartAt H (e.symm x)) ∘ I.symm)
      (I.symm ⁻¹' (e.symm.trans (chartAt H (e.symm x))).source ∩ range I) :=
    this.1
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) :
    MDifferentiableAt I I e.symm x := by
  refine' ⟨(e.continuousOn_symm x hx).continuousAt (IsOpen.mem_nhds e.open_target hx), _⟩
  have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by
    simp only [hx, mfld_simps]
  have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I :=
    HasGroupoid.compatible h (chart_mem_atlas H _)
  have A :
    ContDiffOn 𝕜 ∞ (I ∘ e.symm.trans (chartAt H (e.symm x)) ∘ I.symm)
      (I.symm ⁻¹' (e.symm.trans (chartAt H (e.symm x))).source ∩ range I) :=
    this.1
  

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✝¹² : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝¹¹ : NormedAddCommGroup E'
inst✝¹⁰ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝⁹ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝⁸ : TopologicalSpace M'
inst✝⁷ : ChartedSpace H' M'
inst✝⁶ : SmoothManifoldWithCorners I' M'
E'' : Type u_8
inst✝⁵ : NormedAddCommGroup E''
inst✝⁴ : NormedSpace 𝕜 E''
H'' : Type u_9
inst✝³ : TopologicalSpace H''
I'' : ModelWithCorners 𝕜 E'' H''
M'' : Type u_10
inst✝² : TopologicalSpace M''
inst✝¹ : ChartedSpace H'' M''
inst✝ : SmoothManifoldWithCorners I'' M''
s : Set M
x✝ : M
e : PartialHomeomorph M H
h : e ∈ atlas H M
x : H
hx : x ∈ e.target
mem :
  ↑I x ∈
    ↑(ModelWithCorners.symm I) ⁻¹'
        (PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)).toPartialEquiv.source ∩
      range ↑I
this : PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x) ∈ contDiffGroupoid ⊤ I
A :
  ContDiffOn 𝕜 ⊤
    (↑I ∘ ↑(PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹'
        (PartialHomeomorph.symm e ≫ₕ chartAt H (↑(PartialHomeomorph.symm e) x)).toPartialEquiv.source ∩
      range ↑I)
⊢ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I x ↑(PartialHomeomorph.symm e)) (range ↑I) (↑(extChartAt I x) x)

Next tactic:
have B := A.differentiableOn le_top (I x) mem