l3lab/ntp-mathlib huggingface dataset:
/-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`,
then the inverse of `e` is smooth. -/
lemma contMDiffOn_openEmbedding_symm :
    haveI := h.singletonChartedSpace; ContMDiffOn I I
      n (OpenEmbedding.toPartialHomeomorph e h).symm (range e) := by
  haveI := h.singleton_smoothManifoldWithCorners I
  rw [@contMDiffOn_iff _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ h.singletonChartedSpace]
  constructor
  · rw [← h.toPartialHomeomorph_target]
    exact (h.toPartialHomeomorph e).continuousOn_symm
  · intros z hz
    -- show the function is actually the identity on the range of I ∘ e
    apply contDiffOn_id.congr
    intros z hz
    -- factorise into the chart `e` and the model `id`
    simp only [mfld_simps]
    have : I.symm z ∈ range e := by
      rw [ModelWithCorners.symm, ← mem_preimage]
      exact hz.2.1
    

Proof state:
case right
𝕜 : 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
this✝ : SmoothManifoldWithCorners I M
z✝ : H
hz✝ : M
z : E
hz :
  z ∈
    (extChartAt I z✝).target ∩
      ↑(PartialEquiv.symm (extChartAt I z✝)) ⁻¹'
        (range e ∩ ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e h)) ⁻¹' (extChartAt I hz✝).source)
this : ↑(ModelWithCorners.symm I) z ∈ range e
⊢ ↑I (e (↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e h)) (↑(ModelWithCorners.symm I) z))) = z

Next tactic:
rw [h.toPartialHomeomorph_right_inv e this]
/-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`,
then the inverse of `e` is smooth. -/
lemma contMDiffOn_openEmbedding_symm :
    haveI := h.singletonChartedSpace; ContMDiffOn I I
      n (OpenEmbedding.toPartialHomeomorph e h).symm (range e) := by
  haveI := h.singleton_smoothManifoldWithCorners I
  rw [@contMDiffOn_iff _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ h.singletonChartedSpace]
  constructor
  · rw [← h.toPartialHomeomorph_target]
    exact (h.toPartialHomeomorph e).continuousOn_symm
  · intros z hz
    -- show the function is actually the identity on the range of I ∘ e
    apply contDiffOn_id.congr
    intros z hz
    -- factorise into the chart `e` and the model `id`
    simp only [mfld_simps]
    have : I.symm z ∈ range e := by
      rw [ModelWithCorners.symm, ← mem_preimage]
      exact hz.2.1
    rw [h.toPartialHomeomorph_right_inv e this]
    

Proof state:
case right
𝕜 : 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
this✝ : SmoothManifoldWithCorners I M
z✝ : H
hz✝ : M
z : E
hz :
  z ∈
    (extChartAt I z✝).target ∩
      ↑(PartialEquiv.symm (extChartAt I z✝)) ⁻¹'
        (range e ∩ ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e h)) ⁻¹' (extChartAt I hz✝).source)
this : ↑(ModelWithCorners.symm I) z ∈ range e
⊢ ↑I (↑(ModelWithCorners.symm I) z) = z

Next tactic:
apply I.right_inv
/-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`,
then the inverse of `e` is smooth. -/
lemma contMDiffOn_openEmbedding_symm :
    haveI := h.singletonChartedSpace; ContMDiffOn I I
      n (OpenEmbedding.toPartialHomeomorph e h).symm (range e) := by
  haveI := h.singleton_smoothManifoldWithCorners I
  rw [@contMDiffOn_iff _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ h.singletonChartedSpace]
  constructor
  · rw [← h.toPartialHomeomorph_target]
    exact (h.toPartialHomeomorph e).continuousOn_symm
  · intros z hz
    -- show the function is actually the identity on the range of I ∘ e
    apply contDiffOn_id.congr
    intros z hz
    -- factorise into the chart `e` and the model `id`
    simp only [mfld_simps]
    have : I.symm z ∈ range e := by
      rw [ModelWithCorners.symm, ← mem_preimage]
      exact hz.2.1
    rw [h.toPartialHomeomorph_right_inv e this]
    apply I.right_inv
    

Proof state:
case right
𝕜 : 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
this✝ : SmoothManifoldWithCorners I M
z✝ : H
hz✝ : M
z : E
hz :
  z ∈
    (extChartAt I z✝).target ∩
      ↑(PartialEquiv.symm (extChartAt I z✝)) ⁻¹'
        (range e ∩ ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e h)) ⁻¹' (extChartAt I hz✝).source)
this : ↑(ModelWithCorners.symm I) z ∈ range e
⊢ z ∈ range ↑I

Next tactic:
exact mem_of_subset_of_mem (extChartAt_target_subset_range _ _) hz.1
/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f := 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f✝ f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
f : M → M'
hf : ContMDiff I I' n (e' ∘ f)
⊢ ContMDiff I I' n f

Next tactic:
have : f = (h'.toPartialHomeomorph e').symm ∘ e' ∘ f := by
    ext
    rw [Function.comp_apply, Function.comp_apply, OpenEmbedding.toPartialHomeomorph_left_inv]
/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f := by
  have : f = (h'.toPartialHomeomorph e').symm ∘ e' ∘ f := 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f✝ f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
f : M → M'
hf : ContMDiff I I' n (e' ∘ f)
⊢ f = ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e' h')) ∘ e' ∘ f

Next tactic:
ext
/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f := by
  have : f = (h'.toPartialHomeomorph e').symm ∘ e' ∘ f := by
    ext
    

Proof state:
case h
𝕜 : 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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f✝ f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
f : M → M'
hf : ContMDiff I I' n (e' ∘ f)
x✝ : M
⊢ f x✝ = (↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e' h')) ∘ e' ∘ f) x✝

Next tactic:
rw [Function.comp_apply, Function.comp_apply, OpenEmbedding.toPartialHomeomorph_left_inv]
/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f := by
  have : f = (h'.toPartialHomeomorph e').symm ∘ e' ∘ f := by
    ext
    rw [Function.comp_apply, Function.comp_apply, OpenEmbedding.toPartialHomeomorph_left_inv]
  

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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f✝ f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
f : M → M'
hf : ContMDiff I I' n (e' ∘ f)
this : f = ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e' h')) ∘ e' ∘ f
⊢ ContMDiff I I' n f

Next tactic:
rw [this]
/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f := by
  have : f = (h'.toPartialHomeomorph e').symm ∘ e' ∘ f := by
    ext
    rw [Function.comp_apply, Function.comp_apply, OpenEmbedding.toPartialHomeomorph_left_inv]
  rw [this]
  

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''
F : Type u_11
inst✝²¹ : NormedAddCommGroup F
inst✝²⁰ : NormedSpace 𝕜 F
G : Type u_12
inst✝¹⁹ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_13
inst✝¹⁸ : TopologicalSpace N
inst✝¹⁷ : ChartedSpace G N
inst✝¹⁶ : SmoothManifoldWithCorners J N
F' : Type u_14
inst✝¹⁵ : NormedAddCommGroup F'
inst✝¹⁴ : NormedSpace 𝕜 F'
G' : Type u_15
inst✝¹³ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_16
inst✝¹² : TopologicalSpace N'
inst✝¹¹ : ChartedSpace G' N'
inst✝¹⁰ : SmoothManifoldWithCorners J' N'
F₁ : Type u_17
inst✝⁹ : NormedAddCommGroup F₁
inst✝⁸ : NormedSpace 𝕜 F₁
F₂ : Type u_18
inst✝⁷ : NormedAddCommGroup F₂
inst✝⁶ : NormedSpace 𝕜 F₂
F₃ : Type u_19
inst✝⁵ : NormedAddCommGroup F₃
inst✝⁴ : NormedSpace 𝕜 F₃
F₄ : Type u_20
inst✝³ : NormedAddCommGroup F₄
inst✝² : NormedSpace 𝕜 F₄
e✝ : PartialHomeomorph M H
e'✝ : PartialHomeomorph M' H'
f✝ f₁ : M → M'
s s₁ t : Set M
x : M
m n✝ : ℕ∞
inst✝¹ : Nonempty M
e : M → H
h : OpenEmbedding e
inst✝ : Nonempty M'
e' : M' → H'
h' : OpenEmbedding e'
n : WithTop ℕ
f : M → M'
hf : ContMDiff I I' n (e' ∘ f)
this : f = ↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e' h')) ∘ e' ∘ f
⊢ ContMDiff I I' n (↑(PartialHomeomorph.symm (OpenEmbedding.toPartialHomeomorph e' h')) ∘ e' ∘ f)

Next tactic:
apply @ContMDiffOn.comp_contMDiff _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    h'.singletonChartedSpace _ _ (range e') _ (contMDiffOn_openEmbedding_symm h') hf