l3lab/ntp-mathlib huggingface dataset:
/-- When considering functions between manifolds, this statement shows up often. It entails
the unique differential of the pullback in extended charts of the set where the function can
be read in the charts. -/
theorem UniqueMDiffOn.uniqueDiffOn_inter_preimage (hs : UniqueMDiffOn I s) (x : M) (y : M')
    {f : M → M'} (hf : ContinuousOn f s) :
    UniqueDiffOn 𝕜
      ((extChartAt I x).target ∩ (extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' y).source)) :=
  haveI : UniqueMDiffOn I (s ∩ f ⁻¹' (extChartAt I' y).source) := by
    intro z hz
    apply (hs z hz.1).inter'
    apply (hf z hz.1).preimage_mem_nhdsWithin
    

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
hs : UniqueMDiffOn I s
x : M
y : M'
f : M → M'
hf : ContinuousOn f s
z : M
hz : z ∈ s ∩ f ⁻¹' (extChartAt I' y).source
⊢ (extChartAt I' y).source ∈ 𝓝 (f z)

Next tactic:
exact (isOpen_extChartAt_source I' y).mem_nhds hz.2
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := 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'
s : Set M
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (TotalSpace.proj ⁻¹' s) p

Next tactic:
set e := trivializationAt F Z p.proj
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  

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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (TotalSpace.proj ⁻¹' s) p

Next tactic:
have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  

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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (TotalSpace.proj ⁻¹' s) p

Next tactic:
have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · 

Proof state:
case this
𝕜 : 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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (↑e p)

Next tactic:
rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
    

Proof state:
case this
𝕜 : 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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (p.proj, (↑e p).2)

Next tactic:
exact hs.prod (uniqueMDiffWithinAt_univ _)
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
    exact hs.prod (uniqueMDiffWithinAt_univ _)
  

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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
this : UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (↑e p)
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (TotalSpace.proj ⁻¹' s) p

Next tactic:
rw [← e.left_inv hp]
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
    exact hs.prod (uniqueMDiffWithinAt_univ _)
  rw [← e.left_inv hp]
  

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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
this : UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (↑e p)
⊢ UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (TotalSpace.proj ⁻¹' s)
    (↑(PartialHomeomorph.symm e.toPartialHomeomorph) (↑e.toPartialHomeomorph p))

Next tactic:
refine (this.preimage_localHomeomorph e.mdifferentiable.symm (e.map_source hp)).mono ?_
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
    exact hs.prod (uniqueMDiffWithinAt_univ _)
  rw [← e.left_inv hp]
  refine (this.preimage_localHomeomorph e.mdifferentiable.symm (e.map_source hp)).mono ?_
  

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
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
this : UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (↑e p)
⊢ (PartialHomeomorph.symm e.toPartialHomeomorph).toPartialEquiv.target ∩
      ↑(PartialHomeomorph.symm (PartialHomeomorph.symm e.toPartialHomeomorph)) ⁻¹' s ×ˢ univ ⊆
    TotalSpace.proj ⁻¹' s

Next tactic:
rintro y ⟨hy, hys, -⟩
theorem UniqueMDiffWithinAt.smooth_bundle_preimage {p : TotalSpace F Z}
    (hs : UniqueMDiffWithinAt I s p.proj) :
    UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s) p := by
  set e := trivializationAt F Z p.proj
  have hp : p ∈ e.source := FiberBundle.mem_trivializationAt_proj_source
  have : UniqueMDiffWithinAt (I.prod 𝓘(𝕜, F)) (s ×ˢ univ) (e p)
  · rw [← Prod.mk.eta (p := e p), FiberBundle.trivializationAt_proj_fst]
    exact hs.prod (uniqueMDiffWithinAt_univ _)
  rw [← e.left_inv hp]
  refine (this.preimage_localHomeomorph e.mdifferentiable.symm (e.map_source hp)).mono ?_
  rintro y ⟨hy, hys, -⟩
  

Proof state:
case intro.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'
s : Set M
F : Type u_8
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace 𝕜 F
Z : M → Type u_9
inst✝⁶ : TopologicalSpace (TotalSpace F Z)
inst✝⁵ : (b : M) → TopologicalSpace (Z b)
inst✝⁴ : (b : M) → AddCommMonoid (Z b)
inst✝³ : (b : M) → Module 𝕜 (Z b)
inst✝² : FiberBundle F Z
inst✝¹ : VectorBundle 𝕜 F Z
inst✝ : SmoothVectorBundle F Z I
p : TotalSpace F Z
hs : UniqueMDiffWithinAt I s p.proj
e : Trivialization F TotalSpace.proj := trivializationAt F Z p.proj
hp : p ∈ e.source
this : UniqueMDiffWithinAt (ModelWithCorners.prod I 𝓘(𝕜, F)) (s ×ˢ univ) (↑e p)
y : TotalSpace F Z
hy : y ∈ (PartialHomeomorph.symm e.toPartialHomeomorph).toPartialEquiv.target
hys : (↑(PartialHomeomorph.symm (PartialHomeomorph.symm e.toPartialHomeomorph)) y).1 ∈ s
⊢ y ∈ TotalSpace.proj ⁻¹' s

Next tactic:
rwa [PartialHomeomorph.symm_symm, e.coe_coe, e.coe_fst hy] at hys
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  

Proof state:
α : Type u_1
β : Type u_2
l : List α
f : α → β
⊢ range (map f) = {l | ∀ x ∈ l, x ∈ range f}

Next tactic:
refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
  

Proof state:
α : Type u_1
β : Type u_2
l✝ : List α
f : α → β
l : List β
hl : l ∈ {l | ∀ x ∈ l, x ∈ range f}
⊢ l ∈ range (map f)

Next tactic:
induction' l with a l ihl
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
  induction' l with a l ihl; · 

Proof state:
case nil
α : Type u_1
β : Type u_2
l : List α
f : α → β
hl : [] ∈ {l | ∀ x ∈ l, x ∈ range f}
⊢ [] ∈ range (map f)

Next tactic:
exact ⟨[], rfl⟩
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
  induction' l with a l ihl; · exact ⟨[], rfl⟩
  

Proof state:
case cons
α : Type u_1
β : Type u_2
l✝ : List α
f : α → β
a : β
l : List β
ihl : l ∈ {l | ∀ x ∈ l, x ∈ range f} → l ∈ range (map f)
hl : a :: l ∈ {l | ∀ x ∈ l, x ∈ range f}
⊢ a :: l ∈ range (map f)

Next tactic:
rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
  induction' l with a l ihl; · exact ⟨[], rfl⟩
  rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩
  

Proof state:
case cons.intro
α : Type u_1
β : Type u_2
l✝ : List α
f : α → β
a : β
l : List α
ihl : map f l ∈ {l | ∀ x ∈ l, x ∈ range f} → map f l ∈ range (map f)
hl : a :: map f l ∈ {l | ∀ x ∈ l, x ∈ range f}
⊢ a :: map f l ∈ range (map f)

Next tactic:
rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
  refine'
    antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
      fun l hl => _
  induction' l with a l ihl; · exact ⟨[], rfl⟩
  rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩
  rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩
  

Proof state:
case cons.intro.intro
α : Type u_1
β : Type u_2
l✝ : List α
f : α → β
l : List α
ihl : map f l ∈ {l | ∀ x ∈ l, x ∈ range f} → map f l ∈ range (map f)
a : α
hl : f a :: map f l ∈ {l | ∀ x ∈ l, x ∈ range f}
⊢ f a :: map f l ∈ range (map f)

Next tactic:
exact ⟨a :: l, map_cons _ _ _⟩
theorem range_list_map_coe (s : Set α) : range (map ((↑) : s → α)) = { l | ∀ x ∈ l, x ∈ s } := by
  

Proof state:
α : Type u_1
β : Type u_2
l : List α
s : Set α
⊢ range (map Subtype.val) = {l | ∀ x ∈ l, x ∈ s}

Next tactic:
rw [range_list_map, Subtype.range_coe]
@[simp]
theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } := by
  

Proof state:
α : Type u_1
β : Type u_2
l : List α
⊢ (range fun k => nthLe l ↑k (_ : ↑k < length l)) = {x | x ∈ l}

Next tactic:
ext x
@[simp]
theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } := by
  ext x
  

Proof state:
case h
α : Type u_1
β : Type u_2
l : List α
x : α
⊢ (x ∈ range fun k => nthLe l ↑k (_ : ↑k < length l)) ↔ x ∈ {x | x ∈ l}

Next tactic:
rw [mem_setOf_eq, mem_iff_get]
@[simp]
theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } := by
  ext x
  rw [mem_setOf_eq, mem_iff_get]
  

Proof state:
case h
α : Type u_1
β : Type u_2
l : List α
x : α
⊢ (x ∈ range fun k => nthLe l ↑k (_ : ↑k < length l)) ↔ ∃ n, List.get l n = x

Next tactic:
exact ⟨fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩, fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩⟩
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
  

Proof state:
α : Type u_1
β : Type u_2
l : List α
⊢ range (get? l) = insert none (some '' {x | x ∈ l})

Next tactic:
rw [← range_list_nthLe, ← range_comp]
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
  rw [← range_list_nthLe, ← range_comp]
  

Proof state:
α : Type u_1
β : Type u_2
l : List α
⊢ range (get? l) = insert none (range (some ∘ fun k => nthLe l ↑k (_ : ↑k < length l)))

Next tactic:
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
  rw [← range_list_nthLe, ← range_comp]
  refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
  

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
l : List α
n : ℕ
⊢ get? l n ∈ insert none (range (some ∘ fun k => nthLe l ↑k (_ : ↑k < length l)))
case refine'_2
α : Type u_1
β : Type u_2
l : List α
⊢ none ∈ range (get? l)
case refine'_3
α : Type u_1
β : Type u_2
l : List α
⊢ range (some ∘ fun k => nthLe l ↑k (_ : ↑k < length l)) ⊆ range (get? l)

Next tactic:
exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩),
    ⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 <| fun k => ⟨_, get?_eq_get _⟩]
@[simp]
theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x | x ∈ l } :=
  calc
    (range fun n => l.getD n d) = (fun o : Option α => o.getD d) '' range l.get? := by
      

Proof state:
α : Type u_1
β : Type u_2
l : List α
d : α
⊢ (range fun n => getD l n d) = (fun o => Option.getD o d) '' range (get? l)

Next tactic:
simp only [← range_comp, (· ∘ ·), getD_eq_getD_get?]
@[simp]
theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x | x ∈ l } :=
  calc
    (range fun n => l.getD n d) = (fun o : Option α => o.getD d) '' range l.get? := by
      simp only [← range_comp, (· ∘ ·), getD_eq_getD_get?]
    _ = insert d { x | x ∈ l } := by
      

Proof state:
α : Type u_1
β : Type u_2
l : List α
d : α
⊢ (fun o => Option.getD o d) '' range (get? l) = insert d {x | x ∈ l}

Next tactic:
simp only [range_list_get?, image_insert_eq, Option.getD, image_image, image_id']
/-- If each element of a list can be lifted to some type, then the whole list can be
lifted to this type. -/
instance List.canLift (c) (p) [CanLift α β c p] :
    CanLift (List α) (List β) (List.map c) fun l => ∀ x ∈ l, p x where
  prf l H := by
    

Proof state:
α : Type u_1
β : Type u_2
l✝ : List α
c : β → α
p : α → Prop
inst✝ : CanLift α β c p
l : List α
H : ∀ x ∈ l, p x
⊢ ∃ y, map c y = l

Next tactic:
rw [← Set.mem_range, Set.range_list_map]
/-- If each element of a list can be lifted to some type, then the whole list can be
lifted to this type. -/
instance List.canLift (c) (p) [CanLift α β c p] :
    CanLift (List α) (List β) (List.map c) fun l => ∀ x ∈ l, p x where
  prf l H := by
    rw [← Set.mem_range, Set.range_list_map]
    

Proof state:
α : Type u_1
β : Type u_2
l✝ : List α
c : β → α
p : α → Prop
inst✝ : CanLift α β c p
l : List α
H : ∀ x ∈ l, p x
⊢ l ∈ {l | ∀ x ∈ l, x ∈ Set.range c}

Next tactic:
exact fun a ha => CanLift.prf a (H a ha)
theorem coe_injective : Injective ((↑) : Ultrafilter α → Filter α)
  | ⟨f, h₁, h₂⟩, ⟨g, _, _⟩, _ => by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g✝ : Ultrafilter α
s t : Set α
p q : α → Prop
f : Filter α
h₁ : NeBot f
h₂ : ∀ (g : Filter α), NeBot g → g ≤ f → f ≤ g
g : Filter α
neBot'✝ : NeBot g
le_of_le✝ : ∀ (g_1 : Filter α), NeBot g_1 → g_1 ≤ g → g ≤ g_1
x✝ : ↑{ toFilter := f, neBot' := h₁, le_of_le := h₂ } = ↑{ toFilter := g, neBot' := neBot'✝, le_of_le := le_of_le✝ }
⊢ { toFilter := f, neBot' := h₁, le_of_le := h₂ } = { toFilter := g, neBot' := neBot'✝, le_of_le := le_of_le✝ }

Next tactic:
congr