l3lab/ntp-mathlib huggingface dataset:
/-- Let `e` be a local homeomorphism of `B × F` whose source is `U ×ˢ univ`, for some set `U` in
`B`, and which, at any point `x` in `U`, admits a neighbourhood `u` of `x` such that `e` is equal on
`u ×ˢ univ` to some bi-smooth fiberwise linear local homeomorphism.  Then `e` itself is equal to
some bi-smooth fiberwise linear local homeomorphism.

This is the key mathematical point of the `locality` condition in the construction of the
`StructureGroupoid` of bi-smooth fiberwise linear local homeomorphisms.  The proof is by gluing
together the various bi-smooth fiberwise linear local homeomorphism which exist locally.

The `U` in the conclusion is the same `U` as in the hypothesis. We state it like this, because this
is exactly what we need for `smoothFiberwiseLinear`. -/
theorem SmoothFiberwiseLinear.locality_aux₂ (e : PartialHomeomorph (B × F) (B × F)) (U : Set B)
    (hU : e.source = U ×ˢ univ)
    (h : ∀ x ∈ U,
      ∃ (φ : B → F ≃L[𝕜] F) (u : Set B) (hu : IsOpen u) (_hUu : u ⊆ U) (_hux : x ∈ u)
        (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x : F →L[𝕜] F)) u)
        (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((φ x).symm : F →L[𝕜] F)) u),
          (e.restr (u ×ˢ univ)).EqOnSource
            (FiberwiseLinear.localHomeomorph φ hu hφ.continuousOn h2φ.continuousOn)) :
    ∃ (Φ : B → F ≃L[𝕜] F) (U : Set B) (hU₀ : IsOpen U) (hΦ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (Φ x : F →L[𝕜] F)) U) (h2Φ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((Φ x).symm : F →L[𝕜] F)) U),
      e.EqOnSource (FiberwiseLinear.localHomeomorph Φ hU₀ hΦ.continuousOn h2Φ.continuousOn) := by
  classical
  rw [SetCoe.forall'] at h
  choose! φ u hu hUu hux hφ h2φ heφ using h
  have heuφ : ∀ x : U, EqOn e (fun q => (q.1, φ x q.1 q.2)) (u x ×ˢ univ) := fun x p hp ↦ by
    refine' (heφ x).2 _
    rw [(heφ x).1]
    

Proof state:
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e : PartialHomeomorph (B × F) (B × F)
U : Set B
hU : e.source = U ×ˢ univ
φ : ↑U → B → F ≃L[𝕜] F
u : ↑U → Set B
hu : ∀ (x : ↑U), IsOpen (u x)
hUu : ∀ (x : ↑U), u x ⊆ U
hux : ∀ (x : ↑U), ↑x ∈ u x
hφ : ∀ (x : ↑U), SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x_1 => ↑(φ x x_1)) (u x)
h2φ : ∀ (x : ↑U), SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x_1 => ↑(ContinuousLinearEquiv.symm (φ x x_1))) (u x)
heφ :
  ∀ (x : ↑U),
    PartialHomeomorph.EqOnSource (PartialHomeomorph.restr e (u x ×ˢ univ))
      (FiberwiseLinear.localHomeomorph (φ x) (_ : IsOpen (u x)) (_ : ContinuousOn (fun x_1 => ↑(φ x x_1)) (u x))
        (_ : ContinuousOn (fun x_1 => ↑(ContinuousLinearEquiv.symm (φ x x_1))) (u x)))
x : ↑U
p : B × F
hp : p ∈ u x ×ˢ univ
⊢ p ∈
    (FiberwiseLinear.localHomeomorph (φ x) (_ : IsOpen (u x)) (_ : ContinuousOn (fun x_1 => ↑(φ x x_1)) (u x))
          (_ : ContinuousOn (fun x_1 => ↑(ContinuousLinearEquiv.symm (φ x x_1))) (u x))).toPartialEquiv.source

Next tactic:
exact hp
/-- Let `e` be a local homeomorphism of `B × F` whose source is `U ×ˢ univ`, for some set `U` in
`B`, and which, at any point `x` in `U`, admits a neighbourhood `u` of `x` such that `e` is equal on
`u ×ˢ univ` to some bi-smooth fiberwise linear local homeomorphism.  Then `e` itself is equal to
some bi-smooth fiberwise linear local homeomorphism.

This is the key mathematical point of the `locality` condition in the construction of the
`StructureGroupoid` of bi-smooth fiberwise linear local homeomorphisms.  The proof is by gluing
together the various bi-smooth fiberwise linear local homeomorphism which exist locally.

The `U` in the conclusion is the same `U` as in the hypothesis. We state it like this, because this
is exactly what we need for `smoothFiberwiseLinear`. -/
theorem SmoothFiberwiseLinear.locality_aux₂ (e : PartialHomeomorph (B × F) (B × F)) (U : Set B)
    (hU : e.source = U ×ˢ univ)
    (h : ∀ x ∈ U,
      ∃ (φ : B → F ≃L[𝕜] F) (u : Set B) (hu : IsOpen u) (_hUu : u ⊆ U) (_hux : x ∈ u)
        (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x : F →L[𝕜] F)) u)
        (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((φ x).symm : F →L[𝕜] F)) u),
          (e.restr (u ×ˢ univ)).EqOnSource
            (FiberwiseLinear.localHomeomorph φ hu hφ.continuousOn h2φ.continuousOn)) :
    ∃ (Φ : B → F ≃L[𝕜] F) (U : Set B) (hU₀ : IsOpen U) (hΦ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (Φ x : F →L[𝕜] F)) U) (h2Φ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((Φ x).symm : F →L[𝕜] F)) U),
      e.EqOnSource (FiberwiseLinear.localHomeomorph Φ hU₀ hΦ.continuousOn h2Φ.continuousOn) := by
  classical
  rw [SetCoe.forall'] at h
  choose! φ u hu hUu hux hφ h2φ heφ using h
  have heuφ : ∀ x : U, EqOn e (fun q => (q.1, φ x q.1 q.2)) (u x ×ˢ univ) := fun x p hp ↦ by
    refine' (heφ x).2 _
    rw [(heφ x).1]
    exact hp
  have huφ : ∀ (x x' : U) (y : B), y ∈ u x → y ∈ u x' → φ x y = φ x' y := fun p p' y hyp hyp' ↦ by
    

Proof state:
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e : PartialHomeomorph (B × F) (B × F)
U : Set B
hU : e.source = U ×ˢ univ
φ : ↑U → B → F ≃L[𝕜] F
u : ↑U → Set B
hu : ∀ (x : ↑U), IsOpen (u x)
hUu : ∀ (x : ↑U), u x ⊆ U
hux : ∀ (x : ↑U), ↑x ∈ u x
hφ : ∀ (x : ↑U), SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x_1 => ↑(φ x x_1)) (u x)
h2φ : ∀ (x : ↑U), SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x_1 => ↑(ContinuousLinearEquiv.symm (φ x x_1))) (u x)
heφ :
  ∀ (x : ↑U),
    PartialHomeomorph.EqOnSource (PartialHomeomorph.restr e (u x ×ˢ univ))
      (FiberwiseLinear.localHomeomorph (φ x) (_ : IsOpen (u x)) (_ : ContinuousOn (fun x_1 => ↑(φ x x_1)) (u x))
        (_ : ContinuousOn (fun x_1 => ↑(ContinuousLinearEquiv.symm (φ x x_1))) (u x)))
heuφ : ∀ (x : ↑U), EqOn (↑e) (fun q => (q.1, (φ x q.1) q.2)) (u x ×ˢ univ)
p p' : ↑U
y : B
hyp : y ∈ u p
hyp' : y ∈ u p'
⊢ φ p y = φ p' y

Next tactic:
ext v
private theorem mem_aux {e : PartialHomeomorph (B × F) (B × F)} :
    (e ∈ ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn
          h2φ.continuousOn)}) ↔
      ∃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
        (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
        (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
          e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn) := by
  

Proof state:
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e : PartialHomeomorph (B × F) (B × F)
⊢ e ∈
      ⋃ φ,
        ⋃ U,
          ⋃ (hU : IsOpen U),
            ⋃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U),
              ⋃ (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
                {e |
                  PartialHomeomorph.EqOnSource e
                    (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))} ↔
    ∃ φ U,
      ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
        PartialHomeomorph.EqOnSource e
          (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
            (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))

Next tactic:
simp only [mem_iUnion, mem_setOf_eq]
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    

Proof state:
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
⊢ ∀ (e e' : PartialHomeomorph (B × F) (B × F)),
    e ∈
        ⋃ φ,
          ⋃ U,
            ⋃ (hU : IsOpen U),
              ⋃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U),
                ⋃ (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
                  {e |
                    PartialHomeomorph.EqOnSource e
                      (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                        (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))} →
      e' ∈
          ⋃ φ,
            ⋃ U,
              ⋃ (hU : IsOpen U),
                ⋃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U),
                  ⋃ (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
                    {e |
                      PartialHomeomorph.EqOnSource e
                        (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                          (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))} →
        e ≫ₕ e' ∈
          ⋃ φ,
            ⋃ U,
              ⋃ (hU : IsOpen U),
                ⋃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U),
                  ⋃ (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
                    {e |
                      PartialHomeomorph.EqOnSource e
                        (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                          (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))}

Next tactic:
simp only [mem_aux]
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    simp only [mem_aux]
    

Proof state:
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
⊢ ∀ (e e' : PartialHomeomorph (B × F) (B × F)),
    (∃ φ U,
        ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
          SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
          PartialHomeomorph.EqOnSource e
            (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
              (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))) →
      (∃ φ U,
          ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
            SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
            PartialHomeomorph.EqOnSource e'
              (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))) →
        ∃ φ U,
          ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
            SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
            PartialHomeomorph.EqOnSource (e ≫ₕ e')
              (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
                (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))

Next tactic:
rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    simp only [mem_aux]
    rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
    

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e e' : PartialHomeomorph (B × F) (B × F)
φ : B → F ≃L[𝕜] F
U : Set B
hU : IsOpen U
hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U
h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U
heφ :
  PartialHomeomorph.EqOnSource e
    (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))
φ' : B → F ≃L[𝕜] F
U' : Set B
hU' : IsOpen U'
hφ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ' x)) U'
h2φ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'
heφ' :
  PartialHomeomorph.EqOnSource e'
    (FiberwiseLinear.localHomeomorph φ' hU' (_ : ContinuousOn (fun x => ↑(φ' x)) U')
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'))
⊢ ∃ φ U,
    ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U),
      PartialHomeomorph.EqOnSource (e ≫ₕ e')
        (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
          (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))

Next tactic:
refine' ⟨fun b => (φ b).trans (φ' b), _, hU.inter hU', _, _,
      Setoid.trans (PartialHomeomorph.EqOnSource.trans' heφ heφ') ⟨_, _⟩⟩
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    simp only [mem_aux]
    rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
    refine' ⟨fun b => (φ b).trans (φ' b), _, hU.inter hU', _, _,
      Setoid.trans (PartialHomeomorph.EqOnSource.trans' heφ heφ') ⟨_, _⟩⟩
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e e' : PartialHomeomorph (B × F) (B × F)
φ : B → F ≃L[𝕜] F
U : Set B
hU : IsOpen U
hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U
h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U
heφ :
  PartialHomeomorph.EqOnSource e
    (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))
φ' : B → F ≃L[𝕜] F
U' : Set B
hU' : IsOpen U'
hφ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ' x)) U'
h2φ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'
heφ' :
  PartialHomeomorph.EqOnSource e'
    (FiberwiseLinear.localHomeomorph φ' hU' (_ : ContinuousOn (fun x => ↑(φ' x)) U')
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'))
⊢ SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑((fun b => ContinuousLinearEquiv.trans (φ b) (φ' b)) x)) (U ∩ U')

Next tactic:
show
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F)
          (fun x : B => (φ' x).toContinuousLinearMap ∘L (φ x).toContinuousLinearMap) (U ∩ U')
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    simp only [mem_aux]
    rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
    refine' ⟨fun b => (φ b).trans (φ' b), _, hU.inter hU', _, _,
      Setoid.trans (PartialHomeomorph.EqOnSource.trans' heφ heφ') ⟨_, _⟩⟩
    · show
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F)
          (fun x : B => (φ' x).toContinuousLinearMap ∘L (φ x).toContinuousLinearMap) (U ∩ U')
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e e' : PartialHomeomorph (B × F) (B × F)
φ : B → F ≃L[𝕜] F
U : Set B
hU : IsOpen U
hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U
h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U
heφ :
  PartialHomeomorph.EqOnSource e
    (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))
φ' : B → F ≃L[𝕜] F
U' : Set B
hU' : IsOpen U'
hφ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ' x)) U'
h2φ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'
heφ' :
  PartialHomeomorph.EqOnSource e'
    (FiberwiseLinear.localHomeomorph φ' hU' (_ : ContinuousOn (fun x => ↑(φ' x)) U')
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'))
⊢ SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ContinuousLinearMap.comp ↑(φ' x) ↑(φ x)) (U ∩ U')

Next tactic:
exact (hφ'.mono <| inter_subset_right _ _).clm_comp (hφ.mono <| inter_subset_left _ _)
/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
homeomorphisms which are bi-smooth and fiberwise linear, and induce the identity on `B`.
When a (topological) vector bundle is smooth, then the composition of charts associated
to the vector bundle belong to this groupoid. -/
def smoothFiberwiseLinear : StructureGroupoid (B × F) where
  members :=
    ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.localHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
  trans' := by
    simp only [mem_aux]
    rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
    refine' ⟨fun b => (φ b).trans (φ' b), _, hU.inter hU', _, _,
      Setoid.trans (PartialHomeomorph.EqOnSource.trans' heφ heφ') ⟨_, _⟩⟩
    · show
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F)
          (fun x : B => (φ' x).toContinuousLinearMap ∘L (φ x).toContinuousLinearMap) (U ∩ U')
      exact (hφ'.mono <| inter_subset_right _ _).clm_comp (hφ.mono <| inter_subset_left _ _)
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
𝕜 : Type u_1
B : Type u_2
F : Type u_3
inst✝⁷ : TopologicalSpace B
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
EB : Type u_4
inst✝³ : NormedAddCommGroup EB
inst✝² : NormedSpace 𝕜 EB
HB : Type u_5
inst✝¹ : TopologicalSpace HB
inst✝ : ChartedSpace HB B
IB : ModelWithCorners 𝕜 EB HB
e e' : PartialHomeomorph (B × F) (B × F)
φ : B → F ≃L[𝕜] F
U : Set B
hU : IsOpen U
hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U
h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U
heφ :
  PartialHomeomorph.EqOnSource e
    (FiberwiseLinear.localHomeomorph φ hU (_ : ContinuousOn (fun x => ↑(φ x)) U)
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ x))) U))
φ' : B → F ≃L[𝕜] F
U' : Set B
hU' : IsOpen U'
hφ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ' x)) U'
h2φ' : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'
heφ' :
  PartialHomeomorph.EqOnSource e'
    (FiberwiseLinear.localHomeomorph φ' hU' (_ : ContinuousOn (fun x => ↑(φ' x)) U')
      (_ : ContinuousOn (fun x => ↑(ContinuousLinearEquiv.symm (φ' x))) U'))
⊢ SmoothOn IB 𝓘(𝕜, F →L[𝕜] F)
    (fun x => ↑(ContinuousLinearEquiv.symm ((fun b => ContinuousLinearEquiv.trans (φ b) (φ' b)) x))) (U ∩ U')

Next tactic:
show
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F)
          (fun x : B => (φ x).symm.toContinuousLinearMap ∘L (φ' x).symm.toContinuousLinearMap)
          (U ∩ U')