l3lab/ntp-mathlib huggingface dataset:
/-- The derivative of a differentiable local homeomorphism, as a continuous linear equivalence
between the tangent spaces at `x` and `e x`. -/
protected def mfderiv {x : M} (hx : x ∈ e.source) : TangentSpace I x ≃L[𝕜] TangentSpace I' (e x) :=
  { mfderiv I I' e x with
    invFun := mfderiv I' I e.symm (e x)
    continuous_toFun := (mfderiv I I' e x).cont
    continuous_invFun := (mfderiv I' I e.symm (e x)).cont
    left_inv := fun y => by
      have : (ContinuousLinearMap.id _ _ : TangentSpace I x →L[𝕜] TangentSpace I x) y = y := rfl
      conv_rhs => rw [← this, ← he.symm_comp_deriv hx]
    right_inv := fun y => by
      have :
        (ContinuousLinearMap.id 𝕜 _ : TangentSpace I' (e x) →L[𝕜] TangentSpace I' (e x)) y = y :=
        rfl
      

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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
x : M
hx : x ∈ e.source
src✝ : TangentSpace I x →L[𝕜] TangentSpace I' (↑e x) := mfderiv I I' (↑e) x
y : TangentSpace I' (↑e x)
this : (ContinuousLinearMap.id 𝕜 (TangentSpace I' (↑e x))) y = y
⊢ AddHom.toFun src✝.toAddHom ((mfderiv I' I (↑(PartialHomeomorph.symm e)) (↑e x)) y) = y

Next tactic:
conv_rhs => rw [← this, ← he.comp_symm_deriv (e.map_source hx)]
/-- The derivative of a differentiable local homeomorphism, as a continuous linear equivalence
between the tangent spaces at `x` and `e x`. -/
protected def mfderiv {x : M} (hx : x ∈ e.source) : TangentSpace I x ≃L[𝕜] TangentSpace I' (e x) :=
  { mfderiv I I' e x with
    invFun := mfderiv I' I e.symm (e x)
    continuous_toFun := (mfderiv I I' e x).cont
    continuous_invFun := (mfderiv I' I e.symm (e x)).cont
    left_inv := fun y => by
      have : (ContinuousLinearMap.id _ _ : TangentSpace I x →L[𝕜] TangentSpace I x) y = y := rfl
      conv_rhs => rw [← this, ← he.symm_comp_deriv hx]
    right_inv := fun y => by
      have :
        (ContinuousLinearMap.id 𝕜 _ : TangentSpace I' (e x) →L[𝕜] TangentSpace I' (e x)) y = y :=
        rfl
      conv_rhs => 

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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
x : M
hx : x ∈ e.source
src✝ : TangentSpace I x →L[𝕜] TangentSpace I' (↑e x) := mfderiv I I' (↑e) x
y : TangentSpace I' (↑e x)
this : (ContinuousLinearMap.id 𝕜 (TangentSpace I' (↑e x))) y = y
| y

Next tactic:
rw [← this, ← he.comp_symm_deriv (e.map_source hx)]
/-- The derivative of a differentiable local homeomorphism, as a continuous linear equivalence
between the tangent spaces at `x` and `e x`. -/
protected def mfderiv {x : M} (hx : x ∈ e.source) : TangentSpace I x ≃L[𝕜] TangentSpace I' (e x) :=
  { mfderiv I I' e x with
    invFun := mfderiv I' I e.symm (e x)
    continuous_toFun := (mfderiv I I' e x).cont
    continuous_invFun := (mfderiv I' I e.symm (e x)).cont
    left_inv := fun y => by
      have : (ContinuousLinearMap.id _ _ : TangentSpace I x →L[𝕜] TangentSpace I x) y = y := rfl
      conv_rhs => rw [← this, ← he.symm_comp_deriv hx]
    right_inv := fun y => by
      have :
        (ContinuousLinearMap.id 𝕜 _ : TangentSpace I' (e x) →L[𝕜] TangentSpace I' (e x)) y = y :=
        rfl
      conv_rhs => rw [← this, ← he.comp_symm_deriv (e.map_source 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
x : M
hx : x ∈ e.source
src✝ : TangentSpace I x →L[𝕜] TangentSpace I' (↑e x) := mfderiv I I' (↑e) x
y : TangentSpace I' (↑e x)
this : (ContinuousLinearMap.id 𝕜 (TangentSpace I' (↑e x))) y = y
⊢ AddHom.toFun src✝.toAddHom ((mfderiv I' I (↑(PartialHomeomorph.symm e)) (↑e x)) y) =
    (ContinuousLinearMap.comp (mfderiv I I' (↑e) (↑(PartialHomeomorph.symm e) (↑e x)))
        (mfderiv I' I (↑(PartialHomeomorph.symm e)) (↑e x)))
      y

Next tactic:
rw [e.left_inv hx]
/-- The derivative of a differentiable local homeomorphism, as a continuous linear equivalence
between the tangent spaces at `x` and `e x`. -/
protected def mfderiv {x : M} (hx : x ∈ e.source) : TangentSpace I x ≃L[𝕜] TangentSpace I' (e x) :=
  { mfderiv I I' e x with
    invFun := mfderiv I' I e.symm (e x)
    continuous_toFun := (mfderiv I I' e x).cont
    continuous_invFun := (mfderiv I' I e.symm (e x)).cont
    left_inv := fun y => by
      have : (ContinuousLinearMap.id _ _ : TangentSpace I x →L[𝕜] TangentSpace I x) y = y := rfl
      conv_rhs => rw [← this, ← he.symm_comp_deriv hx]
    right_inv := fun y => by
      have :
        (ContinuousLinearMap.id 𝕜 _ : TangentSpace I' (e x) →L[𝕜] TangentSpace I' (e x)) y = y :=
        rfl
      conv_rhs => rw [← this, ← he.comp_symm_deriv (e.map_source hx)]
      rw [e.left_inv 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
x : M
hx : x ∈ e.source
src✝ : TangentSpace I x →L[𝕜] TangentSpace I' (↑e x) := mfderiv I I' (↑e) x
y : TangentSpace I' (↑e x)
this : (ContinuousLinearMap.id 𝕜 (TangentSpace I' (↑e x))) y = y
⊢ AddHom.toFun src✝.toAddHom ((mfderiv I' I (↑(PartialHomeomorph.symm e)) (↑e x)) y) =
    (ContinuousLinearMap.comp (mfderiv I I' (↑e) x) (mfderiv I' I (↑(PartialHomeomorph.symm e)) (↑e x))) y

Next tactic:
rfl
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
⊢ MDifferentiable I I'' (e ≫ₕ e')

Next tactic:
constructor
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · 

Proof state:
case left
𝕜 : 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
⊢ MDifferentiableOn I I'' (↑(e ≫ₕ e')) (e ≫ₕ e').toPartialEquiv.source

Next tactic:
intro x hx
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · intro x hx
    

Proof state:
case left
𝕜 : 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
x : M
hx : x ∈ (e ≫ₕ e').toPartialEquiv.source
⊢ MDifferentiableWithinAt I I'' (↑(e ≫ₕ e')) (e ≫ₕ e').toPartialEquiv.source x

Next tactic:
simp only [mfld_simps] at hx
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · intro x hx
    simp only [mfld_simps] at hx
    

Proof state:
case left
𝕜 : 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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
x : M
hx : x ∈ e.source ∧ ↑e x ∈ e'.source
⊢ MDifferentiableWithinAt I I'' (↑(e ≫ₕ e')) (e ≫ₕ e').toPartialEquiv.source x

Next tactic:
exact
      ((he'.mdifferentiableAt hx.2).comp _ (he.mdifferentiableAt hx.1)).mdifferentiableWithinAt
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · intro x hx
    simp only [mfld_simps] at hx
    exact
      ((he'.mdifferentiableAt hx.2).comp _ (he.mdifferentiableAt hx.1)).mdifferentiableWithinAt
  · 

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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
⊢ MDifferentiableOn I'' I (↑(PartialHomeomorph.symm (e ≫ₕ e'))) (e ≫ₕ e').toPartialEquiv.target

Next tactic:
intro x hx
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · intro x hx
    simp only [mfld_simps] at hx
    exact
      ((he'.mdifferentiableAt hx.2).comp _ (he.mdifferentiableAt hx.1)).mdifferentiableWithinAt
  · intro x hx
    

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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
x : M''
hx : x ∈ (e ≫ₕ e').toPartialEquiv.target
⊢ MDifferentiableWithinAt I'' I (↑(PartialHomeomorph.symm (e ≫ₕ e'))) (e ≫ₕ e').toPartialEquiv.target x

Next tactic:
simp only [mfld_simps] at hx
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
  constructor
  · intro x hx
    simp only [mfld_simps] at hx
    exact
      ((he'.mdifferentiableAt hx.2).comp _ (he.mdifferentiableAt hx.1)).mdifferentiableWithinAt
  · intro x hx
    simp only [mfld_simps] at hx
    

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
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'
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''
e : PartialHomeomorph M M'
he : MDifferentiable I I' e
e' : PartialHomeomorph M' M''
inst✝² : SmoothManifoldWithCorners I M
inst✝¹ : SmoothManifoldWithCorners I' M'
inst✝ : SmoothManifoldWithCorners I'' M''
he' : MDifferentiable I' I'' e'
x : M''
hx : x ∈ e'.target ∧ ↑(PartialHomeomorph.symm e') x ∈ e.target
⊢ MDifferentiableWithinAt I'' I (↑(PartialHomeomorph.symm (e ≫ₕ e'))) (e ≫ₕ e').toPartialEquiv.target x

Next tactic:
exact
      ((he.symm.mdifferentiableAt hx.2).comp _
          (he'.symm.mdifferentiableAt hx.1)).mdifferentiableWithinAt
/-- If `s` has the unique differential property at `x`, `f` is differentiable within `s` at x` and
its derivative has Dense range, then `f '' s` has the Unique differential property at `f x`. -/
theorem UniqueMDiffWithinAt.image_denseRange (hs : UniqueMDiffWithinAt I s x)
    {f : M → M'} {f' : E →L[𝕜] E'} (hf : HasMFDerivWithinAt I I' f s x f')
    (hd : DenseRange f') : UniqueMDiffWithinAt I' (f '' s) (f x) := by
  /- Rewrite in coordinates, apply `HasFDerivWithinAt.uniqueDiffWithinAt`. -/
  

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'
s : Set M
x : M
hs : UniqueMDiffWithinAt I s x
f : M → M'
f' : E →L[𝕜] E'
hf : HasMFDerivWithinAt I I' f s x f'
hd : DenseRange ⇑f'
⊢ UniqueMDiffWithinAt I' (f '' s) (f x)

Next tactic:
have := hs.inter' <| hf.1 (extChartAt_source_mem_nhds I' (f x))
/-- If `s` has the unique differential property at `x`, `f` is differentiable within `s` at x` and
its derivative has Dense range, then `f '' s` has the Unique differential property at `f x`. -/
theorem UniqueMDiffWithinAt.image_denseRange (hs : UniqueMDiffWithinAt I s x)
    {f : M → M'} {f' : E →L[𝕜] E'} (hf : HasMFDerivWithinAt I I' f s x f')
    (hd : DenseRange f') : UniqueMDiffWithinAt I' (f '' s) (f x) := by
  /- Rewrite in coordinates, apply `HasFDerivWithinAt.uniqueDiffWithinAt`. -/
  have := hs.inter' <| hf.1 (extChartAt_source_mem_nhds I' (f 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✝⁶ : 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'
s : Set M
x : M
hs : UniqueMDiffWithinAt I s x
f : M → M'
f' : E →L[𝕜] E'
hf : HasMFDerivWithinAt I I' f s x f'
hd : DenseRange ⇑f'
this : UniqueMDiffWithinAt I (s ∩ f ⁻¹' (extChartAt I' (f x)).source) x
⊢ UniqueMDiffWithinAt I' (f '' s) (f x)

Next tactic:
refine (((hf.2.mono ?sub1).uniqueDiffWithinAt this hd).mono ?sub2).congr_pt ?pt
/-- If `s` has the unique differential property at `x`, `f` is differentiable within `s` at x` and
its derivative has Dense range, then `f '' s` has the Unique differential property at `f x`. -/
theorem UniqueMDiffWithinAt.image_denseRange (hs : UniqueMDiffWithinAt I s x)
    {f : M → M'} {f' : E →L[𝕜] E'} (hf : HasMFDerivWithinAt I I' f s x f')
    (hd : DenseRange f') : UniqueMDiffWithinAt I' (f '' s) (f x) := by
  /- Rewrite in coordinates, apply `HasFDerivWithinAt.uniqueDiffWithinAt`. -/
  have := hs.inter' <| hf.1 (extChartAt_source_mem_nhds I' (f x))
  refine (((hf.2.mono ?sub1).uniqueDiffWithinAt this hd).mono ?sub2).congr_pt ?pt
  

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'
s : Set M
x : M
hs : UniqueMDiffWithinAt I s x
f : M → M'
f' : E →L[𝕜] E'
hf : HasMFDerivWithinAt I I' f s x f'
hd : DenseRange ⇑f'
this : UniqueMDiffWithinAt I (s ∩ f ⁻¹' (extChartAt I' (f x)).source) x
⊢ writtenInExtChartAt I I' x f (↑(extChartAt I x) x) = ↑(extChartAt I' (f x)) (f x)

Next tactic:
case pt => simp only [mfld_simps]
/-- If `s` has the unique differential property at `x`, `f` is differentiable within `s` at x` and
its derivative has Dense range, then `f '' s` has the Unique differential property at `f x`. -/
theorem UniqueMDiffWithinAt.image_denseRange (hs : UniqueMDiffWithinAt I s x)
    {f : M → M'} {f' : E →L[𝕜] E'} (hf : HasMFDerivWithinAt I I' f s x f')
    (hd : DenseRange f') : UniqueMDiffWithinAt I' (f '' s) (f x) := by
  /- Rewrite in coordinates, apply `HasFDerivWithinAt.uniqueDiffWithinAt`. -/
  have := hs.inter' <| hf.1 (extChartAt_source_mem_nhds I' (f x))
  refine (((hf.2.mono ?sub1).uniqueDiffWithinAt this hd).mono ?sub2).congr_pt ?pt
  case pt => 

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'
s : Set M
x : M
hs : UniqueMDiffWithinAt I s x
f : M → M'
f' : E →L[𝕜] E'
hf : HasMFDerivWithinAt I I' f s x f'
hd : DenseRange ⇑f'
this : UniqueMDiffWithinAt I (s ∩ f ⁻¹' (extChartAt I' (f x)).source) x
⊢ writtenInExtChartAt I I' x f (↑(extChartAt I x) x) = ↑(extChartAt I' (f x)) (f x)

Next tactic:
simp only [mfld_simps]