l3lab/ntp-mathlib huggingface dataset:
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => 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
f g : H → H
u v : Set H
hf :
  (fun f s =>
      AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ∧
        ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ⊆
          interior (range ↑I))
    f u
hg :
  (fun f s =>
      AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ∧
        ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ⊆
          interior (range ↑I))
    g v
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
⊢ (fun f s =>
      AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ∧
        ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' s ∩ interior (range ↑I)) ⊆
          interior (range ↑I))
    (g ∘ f) (u ∩ f ⁻¹' v)

Next tactic:
simp only [] at hf hg ⊢
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        

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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
⊢ AnalyticOn 𝕜 (↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I))
      (↑(ModelWithCorners.symm I) ⁻¹' (u ∩ f ⁻¹' v) ∩ interior (range ↑I)) ∧
    ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' (u ∩ f ⁻¹' v) ∩ interior (range ↑I)) ⊆
      interior (range ↑I)

Next tactic:
have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := 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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
⊢ ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)

Next tactic:
ext x
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext 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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
x : E
⊢ (↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I)) x =
    ((↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) x

Next tactic:
simp
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        

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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ AnalyticOn 𝕜 (↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I))
      (↑(ModelWithCorners.symm I) ⁻¹' (u ∩ f ⁻¹' v) ∩ interior (range ↑I)) ∧
    ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' (u ∩ f ⁻¹' v) ∩ interior (range ↑I)) ⊆
      interior (range ↑I)

Next tactic:
apply And.intro
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · 

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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ AnalyticOn 𝕜 (↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' (u ∩ f ⁻¹' v) ∩ interior (range ↑I))

Next tactic:
simp only [comp, preimage_inter]
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          

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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ AnalyticOn 𝕜 ((↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' u ∩ ↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I))

Next tactic:
refine hg.left.comp (hf.left.mono ?_) ?_
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          refine hg.left.comp (hf.left.mono ?_) ?_
          · 

Proof state:
case left.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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ ↑(ModelWithCorners.symm I) ⁻¹' u ∩ ↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I) ⊆
    ↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)

Next tactic:
simp only [subset_inter_iff, inter_subset_right]
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          refine hg.left.comp (hf.left.mono ?_) ?_
          · simp only [subset_inter_iff, inter_subset_right]
            

Proof state:
case left.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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ ↑(ModelWithCorners.symm I) ⁻¹' u ∩ ↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I) ⊆
      ↑(ModelWithCorners.symm I) ⁻¹' u ∧
    True

Next tactic:
rw [inter_assoc]
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          refine hg.left.comp (hf.left.mono ?_) ?_
          · simp only [subset_inter_iff, inter_subset_right]
            rw [inter_assoc]
            

Proof state:
case left.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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ ↑(ModelWithCorners.symm I) ⁻¹' u ∩ (↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I)) ⊆
      ↑(ModelWithCorners.symm I) ⁻¹' u ∧
    True

Next tactic:
simp
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          refine hg.left.comp (hf.left.mono ?_) ?_
          · simp only [subset_inter_iff, inter_subset_right]
            rw [inter_assoc]
            simp
          · 

Proof state:
case left.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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
⊢ MapsTo (↑I ∘ f ∘ ↑(ModelWithCorners.symm I))
    (↑(ModelWithCorners.symm I) ⁻¹' u ∩ ↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I))
    (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I))

Next tactic:
intro x hx
/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
explicitly define that they are `C^∞` on the whole domain, since we are only requiring
analyticity on the interior of the domain. -/
def analyticGroupoid : StructureGroupoid H :=
  (contDiffGroupoid ∞ I) ⊓ Pregroupoid.groupoid
    { property := fun f s => AnalyticOn 𝕜 (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) ⊆ interior (range I)
      comp := fun {f g u v} hf hg _ _ _ => by
        simp only [] at hf hg ⊢
        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
        apply And.intro
        · simp only [comp, preimage_inter]
          refine hg.left.comp (hf.left.mono ?_) ?_
          · simp only [subset_inter_iff, inter_subset_right]
            rw [inter_assoc]
            simp
          · intro x hx
            

Proof state:
case left.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
f g : H → H
u v : Set H
hf :
  AnalyticOn 𝕜 (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ∧
    ↑I ∘ f ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' u ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
hg :
  AnalyticOn 𝕜 (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ∧
    ↑I ∘ g ∘ ↑(ModelWithCorners.symm I) '' (↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)) ⊆
      interior (range ↑I)
x✝² : IsOpen u
x✝¹ : IsOpen v
x✝ : IsOpen (u ∩ f ⁻¹' v)
comp :
  ↑I ∘ (g ∘ f) ∘ ↑(ModelWithCorners.symm I) =
    (↑I ∘ g ∘ ↑(ModelWithCorners.symm I)) ∘ ↑I ∘ f ∘ ↑(ModelWithCorners.symm I)
x : E
hx : x ∈ ↑(ModelWithCorners.symm I) ⁻¹' u ∩ ↑(ModelWithCorners.symm I) ⁻¹' (f ⁻¹' v) ∩ interior (range ↑I)
⊢ (↑I ∘ f ∘ ↑(ModelWithCorners.symm I)) x ∈ ↑(ModelWithCorners.symm I) ⁻¹' v ∩ interior (range ↑I)

Next tactic:
apply And.intro