l3lab/ntp-mathlib huggingface dataset:
instance localRing : LocalRing (HomogeneousLocalization.AtPrime 𝒜 𝔭) :=
  LocalRing.of_isUnit_or_isUnit_one_sub_self fun a => by
    simp only [← isUnit_iff_isUnit_val, sub_val, one_val]
    induction' a using Quotient.inductionOn' with a
    simp only [HomogeneousLocalization.val_mk'']
    by_cases mem1 : a.num.1 ∈ 𝔭
    · right
      have : a.den.1 - a.num.1 ∈ 𝔭.primeCompl := fun h =>
        a.den_mem (sub_add_cancel a.den.val a.num.val ▸ Ideal.add_mem _ h mem1 : a.den.1 ∈ 𝔭)
      apply isUnit_of_mul_eq_one _ (Localization.mk a.den.1 ⟨a.den.1 - a.num.1, this⟩)
      simp only [sub_mul, Localization.mk_mul, one_mul, Localization.sub_mk, Submonoid.coe_mul]
      convert Localization.mk_self (M := A) _
      simp only [Submonoid.coe_mul]
      ring
    · left
      change _ ∈ 𝔭.primeCompl at mem1
      apply isUnit_of_mul_eq_one _ (Localization.mk a.den.1 ⟨a.num.1, mem1⟩)
      rw [Localization.mk_mul]
      convert Localization.mk_self (M := A) _
      rw [mul_comm]
      

Proof state:
case h.e'_2.h.h.e'_4
ι : Type u_1
R : Type u_2
A : Type u_3
inst✝⁶ : AddCommMonoid ι
inst✝⁵ : DecidableEq ι
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
𝒜 : ι → Submodule R A
inst✝¹ : GradedAlgebra 𝒜
x : Submonoid A
𝔭 : Ideal A
inst✝ : Ideal.IsPrime 𝔭
a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭)
mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭
⊢ ↑a.den * ↑a.num =
    ↑({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.num, property := mem1 })

Next tactic:
rfl
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n 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 : PartialHomeomorph M H
x : M
m n : ℕ∞
⊢ ContMDiff I 𝓘(𝕜, E) n ↑I

Next tactic:
intro x
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by
  intro 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'
e : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : H
⊢ ContMDiffAt I 𝓘(𝕜, E) n (↑I) x

Next tactic:
refine' (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, _⟩
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by
  intro x
  refine' (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, _⟩
  

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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : H
⊢ ContDiffWithinAt 𝕜 n (↑(extChartAt 𝓘(𝕜, E) (↑I x)) ∘ ↑I ∘ ↑(PartialEquiv.symm (extChartAt I x))) (range ↑I)
    (↑(extChartAt I x) x)

Next tactic:
simp only [mfld_simps]
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by
  intro x
  refine' (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, _⟩
  simp 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : H
⊢ ContDiffWithinAt 𝕜 n (↑I ∘ ↑(ModelWithCorners.symm I)) (range ↑I) (↑I x)

Next tactic:
refine' contDiffWithinAt_id.congr_of_eventuallyEq _ _
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by
  intro x
  refine' (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, _⟩
  simp only [mfld_simps]
  refine' contDiffWithinAt_id.congr_of_eventuallyEq _ _
  · 

Proof state:
case refine'_1
𝕜 : 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : H
⊢ ↑I ∘ ↑(ModelWithCorners.symm I) =ᶠ[nhdsWithin (↑I x) (range ↑I)] id

Next tactic:
exact Filter.eventuallyEq_of_mem self_mem_nhdsWithin fun x₂ => I.right_inv
theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by
  intro x
  refine' (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, _⟩
  simp only [mfld_simps]
  refine' contDiffWithinAt_id.congr_of_eventuallyEq _ _
  · exact Filter.eventuallyEq_of_mem self_mem_nhdsWithin fun x₂ => I.right_inv
  

Proof state:
case refine'_2
𝕜 : 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : H
⊢ (↑I ∘ ↑(ModelWithCorners.symm I)) (↑I x) = id (↑I x)

Next tactic:
simp_rw [Function.comp_apply, I.left_inv, Function.id_def]
theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (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 : PartialHomeomorph M H
x : M
m n : ℕ∞
⊢ ContMDiffOn 𝓘(𝕜, E) I n (↑(ModelWithCorners.symm I)) (range ↑I)

Next tactic:
rw [contMDiffOn_iff]
theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (range I) := by
  rw [contMDiffOn_iff]
  

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 : PartialHomeomorph M H
x : M
m n : ℕ∞
⊢ ContinuousOn (↑(ModelWithCorners.symm I)) (range ↑I) ∧
    ∀ (x : E) (y : H),
      ContDiffOn 𝕜 n (↑(extChartAt I y) ∘ ↑(ModelWithCorners.symm I) ∘ ↑(PartialEquiv.symm (extChartAt 𝓘(𝕜, E) x)))
        ((extChartAt 𝓘(𝕜, E) x).target ∩
          ↑(PartialEquiv.symm (extChartAt 𝓘(𝕜, E) x)) ⁻¹'
            (range ↑I ∩ ↑(ModelWithCorners.symm I) ⁻¹' (extChartAt I y).source))

Next tactic:
refine' ⟨I.continuousOn_symm, fun x y => _⟩
theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (range I) := by
  rw [contMDiffOn_iff]
  refine' ⟨I.continuousOn_symm, fun x y => _⟩
  

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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : E
y : H
⊢ ContDiffOn 𝕜 n (↑(extChartAt I y) ∘ ↑(ModelWithCorners.symm I) ∘ ↑(PartialEquiv.symm (extChartAt 𝓘(𝕜, E) x)))
    ((extChartAt 𝓘(𝕜, E) x).target ∩
      ↑(PartialEquiv.symm (extChartAt 𝓘(𝕜, E) x)) ⁻¹'
        (range ↑I ∩ ↑(ModelWithCorners.symm I) ⁻¹' (extChartAt I y).source))

Next tactic:
simp only [mfld_simps]
theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (range I) := by
  rw [contMDiffOn_iff]
  refine' ⟨I.continuousOn_symm, fun x y => _⟩
  simp 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : E
y : H
⊢ ContDiffOn 𝕜 n (↑I ∘ ↑(ModelWithCorners.symm I)) (range ↑I)

Next tactic:
exact contDiffOn_id.congr fun x' => I.right_inv
theorem contMDiffOn_extend_symm (he : e ∈ maximalAtlas I M) :
    ContMDiffOn 𝓘(𝕜, E) I n (e.extend I).symm (I '' e.target) := 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 : PartialHomeomorph M H
x : M
m n : ℕ∞
he : e ∈ maximalAtlas I M
⊢ ContMDiffOn 𝓘(𝕜, E) I n (↑(PartialEquiv.symm (PartialHomeomorph.extend e I))) (↑I '' e.target)

Next tactic:
refine (contMDiffOn_symm_of_mem_maximalAtlas he).comp
    (contMDiffOn_model_symm.mono <| image_subset_range _ _) ?_
theorem contMDiffOn_extend_symm (he : e ∈ maximalAtlas I M) :
    ContMDiffOn 𝓘(𝕜, E) I n (e.extend I).symm (I '' e.target) := by
  refine (contMDiffOn_symm_of_mem_maximalAtlas he).comp
    (contMDiffOn_model_symm.mono <| image_subset_range _ _) ?_
  

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 : PartialHomeomorph M H
x : M
m n : ℕ∞
he : e ∈ maximalAtlas I M
⊢ ↑I '' e.target ⊆ (fun x => ↑(PartialEquiv.symm (PartialEquiv.restr I.toPartialEquiv e.target)) x) ⁻¹' e.target

Next tactic:
simp_rw [image_subset_iff, PartialEquiv.restr_coe_symm, I.toPartialEquiv_coe_symm,
    preimage_preimage, I.left_inv, preimage_id']
theorem contMDiffOn_extend_symm (he : e ∈ maximalAtlas I M) :
    ContMDiffOn 𝓘(𝕜, E) I n (e.extend I).symm (I '' e.target) := by
  refine (contMDiffOn_symm_of_mem_maximalAtlas he).comp
    (contMDiffOn_model_symm.mono <| image_subset_range _ _) ?_
  simp_rw [image_subset_iff, PartialEquiv.restr_coe_symm, I.toPartialEquiv_coe_symm,
    preimage_preimage, I.left_inv, preimage_id']; 

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 : PartialHomeomorph M H
x : M
m n : ℕ∞
he : e ∈ maximalAtlas I M
⊢ e.target ⊆ e.target

Next tactic:
rfl
theorem contMDiffOn_extChartAt_symm (x : M) :
    ContMDiffOn 𝓘(𝕜, E) I n (extChartAt I x).symm (extChartAt I x).target := 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : M
⊢ ContMDiffOn 𝓘(𝕜, E) I n (↑(PartialEquiv.symm (extChartAt I x))) (extChartAt I x).target

Next tactic:
convert contMDiffOn_extend_symm (chart_mem_maximalAtlas I x)
theorem contMDiffOn_extChartAt_symm (x : M) :
    ContMDiffOn 𝓘(𝕜, E) I n (extChartAt I x).symm (extChartAt I x).target := by
  convert contMDiffOn_extend_symm (chart_mem_maximalAtlas I x)
  

Proof state:
case h.e'_23
𝕜 : 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
x : M
⊢ (extChartAt I x).target = ↑I '' (chartAt H x).toPartialEquiv.target

Next tactic:
rw [extChartAt_target, I.image_eq]
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `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'
e : PartialHomeomorph M H
x : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
⊢ SmoothOn I I (↑f) f.source

Next tactic:
apply contMDiffOn_of_locally_contMDiffOn
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `x`
  apply contMDiffOn_of_locally_contMDiffOn
  

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 : PartialHomeomorph M H
x : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
⊢ ∀ x ∈ f.source, ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I ⊤ (↑f) (f.source ∩ u)

Next tactic:
intro x hx
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `x`
  apply contMDiffOn_of_locally_contMDiffOn
  intro x hx
  

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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
x : M
hx : x ∈ f.source
⊢ ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I ⊤ (↑f) (f.source ∩ u)

Next tactic:
let c := chartAt H x
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `x`
  apply contMDiffOn_of_locally_contMDiffOn
  intro x hx
  let c := chartAt H x
  

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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
x : M
hx : x ∈ f.source
c : PartialHomeomorph M H := chartAt H x
⊢ ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I ⊤ (↑f) (f.source ∩ u)

Next tactic:
let c' := chartAt H (f x)
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `x`
  apply contMDiffOn_of_locally_contMDiffOn
  intro x hx
  let c := chartAt H x
  let c' := chartAt H (f x)
  

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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
x : M
hx : x ∈ f.source
c : PartialHomeomorph M H := chartAt H x
c' : PartialHomeomorph M' H := chartAt H (↑f x)
⊢ ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I ⊤ (↑f) (f.source ∩ u)

Next tactic:
obtain ⟨-, hxf⟩ := hf x hx
theorem isLocalStructomorphOn_contDiffGroupoid_iff_aux {f : PartialHomeomorph M M'}
    (hf : LiftPropOn (contDiffGroupoid ⊤ I).IsLocalStructomorphWithinAt f f.source) :
    SmoothOn I I f f.source := by
  -- It suffices to show smoothness near each `x`
  apply contMDiffOn_of_locally_contMDiffOn
  intro x hx
  let c := chartAt H x
  let c' := chartAt H (f x)
  obtain ⟨-, hxf⟩ := hf x hx
  -- Since `f` is a local structomorph, it is locally equal to some transferred element `e` of
  -- the `contDiffGroupoid`.
  

Proof state:
case h.intro
𝕜 : 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 : PartialHomeomorph M H
x✝ : M
m n : ℕ∞
inst✝ : ChartedSpace H M'
IsM' : SmoothManifoldWithCorners I M'
f : PartialHomeomorph M M'
hf : LiftPropOn (StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)) (↑f) f.source
x : M
hx : x ∈ f.source
c : PartialHomeomorph M H := chartAt H x
c' : PartialHomeomorph M' H := chartAt H (↑f x)
hxf :
  StructureGroupoid.IsLocalStructomorphWithinAt (contDiffGroupoid ⊤ I)
    (↑(chartAt H (↑f x)) ∘ ↑f ∘ ↑(PartialHomeomorph.symm (chartAt H x)))
    (↑(PartialHomeomorph.symm (chartAt H x)) ⁻¹' f.source) (↑(chartAt H x) x)
⊢ ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I ⊤ (↑f) (f.source ∩ u)

Next tactic:
obtain
    ⟨e, he, he' : EqOn (c' ∘ f ∘ c.symm) e (c.symm ⁻¹' f.source ∩ e.source), hex :
      c x ∈ e.source⟩ :=
    hxf (by simp only [hx, mfld_simps])