l3lab/ntp-mathlib huggingface dataset:
theorem isClosed_image_of_isClosed {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    IsClosed (extChartAt I c '' s) := by
  rw [f.image_eq_inter_preimage_of_subset_support hs]
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ support ↑f
⊢ IsClosed (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I ∩ ↑(PartialEquiv.symm (extChartAt I c)) ⁻¹' s)

Next tactic:
refine' ContinuousOn.preimage_isClosed_of_isClosed
    ((continuousOn_extChartAt_symm _ _).mono f.closedBall_subset) _ hsc
theorem isClosed_image_of_isClosed {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    IsClosed (extChartAt I c '' s) := by
  rw [f.image_eq_inter_preimage_of_subset_support hs]
  refine' ContinuousOn.preimage_isClosed_of_isClosed
    ((continuousOn_extChartAt_symm _ _).mono f.closedBall_subset) _ hsc
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ support ↑f
⊢ IsClosed (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
exact IsClosed.inter isClosed_ball I.closed_range
/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ support ↑f
⊢ ∃ r ∈ Ioo 0 f.rOut, s ⊆ (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) r

Next tactic:
set e := extChartAt I c
/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r := by
  set e := extChartAt I c
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ support ↑f
e : PartialEquiv M E := extChartAt I c
⊢ ∃ r ∈ Ioo 0 f.rOut, s ⊆ (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) r

Next tactic:
have : IsClosed (e '' s) := f.isClosed_image_of_isClosed hsc hs
/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r := by
  set e := extChartAt I c
  have : IsClosed (e '' s) := f.isClosed_image_of_isClosed hsc hs
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ support ↑f
e : PartialEquiv M E := extChartAt I c
this : IsClosed (↑e '' s)
⊢ ∃ r ∈ Ioo 0 f.rOut, s ⊆ (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) r

Next tactic:
rw [support_eq_inter_preimage, subset_inter_iff, ← image_subset_iff] at hs
/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r := by
  set e := extChartAt I c
  have : IsClosed (e '' s) := f.isClosed_image_of_isClosed hsc hs
  rw [support_eq_inter_preimage, subset_inter_iff, ← image_subset_iff] at hs
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ (chartAt H c).toPartialEquiv.source ∧ ↑(extChartAt I c) '' s ⊆ ball (↑(extChartAt I c) c) f.rOut
e : PartialEquiv M E := extChartAt I c
this : IsClosed (↑e '' s)
⊢ ∃ r ∈ Ioo 0 f.rOut, s ⊆ (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) r

Next tactic:
rcases exists_pos_lt_subset_ball f.rOut_pos this hs.2 with ⟨r, hrR, hr⟩
/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r := by
  set e := extChartAt I c
  have : IsClosed (e '' s) := f.isClosed_image_of_isClosed hsc hs
  rw [support_eq_inter_preimage, subset_inter_iff, ← image_subset_iff] at hs
  rcases exists_pos_lt_subset_ball f.rOut_pos this hs.2 with ⟨r, hrR, hr⟩
  

Proof state:
case intro.intro
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
s : Set M
hsc : IsClosed s
hs : s ⊆ (chartAt H c).toPartialEquiv.source ∧ ↑(extChartAt I c) '' s ⊆ ball (↑(extChartAt I c) c) f.rOut
e : PartialEquiv M E := extChartAt I c
this : IsClosed (↑e '' s)
r : ℝ
hrR : r ∈ Ioo 0 f.rOut
hr : ↑e '' s ⊆ ball (↑(extChartAt I c) c) r
⊢ ∃ r ∈ Ioo 0 f.rOut, s ⊆ (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) r

Next tactic:
exact ⟨r, hrR, subset_inter hs.1 (image_subset_iff.1 hr)⟩
@[simp]
theorem support_updateRIn {r : ℝ} (hr : r ∈ Ioo 0 f.rOut) :
    support (f.updateRIn r hr) = support f := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
r : ℝ
hr : r ∈ Ioo 0 f.rOut
⊢ support ↑(updateRIn f r hr) = support ↑f

Next tactic:
simp only [support_eq_inter_preimage, updateRIn_rOut]
theorem tsupport_subset_symm_image_closedBall :
    tsupport f ⊆ (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
  

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ tsupport ↑f ⊆ ↑(PartialEquiv.symm (extChartAt I c)) '' (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
rw [tsupport, support_eq_symm_image]
theorem tsupport_subset_symm_image_closedBall :
    tsupport f ⊆ (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
  rw [tsupport, support_eq_symm_image]
  

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ closure (↑(PartialEquiv.symm (extChartAt I c)) '' (ball (↑(extChartAt I c) c) f.rOut ∩ range ↑I)) ⊆
    ↑(PartialEquiv.symm (extChartAt I c)) '' (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
exact closure_minimal (image_subset _ <| inter_subset_inter_left _ ball_subset_closedBall)
    f.isClosed_symm_image_closedBall
theorem tsupport_subset_chartAt_source : tsupport f ⊆ (chartAt H c).source := by
  

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ tsupport ↑f ⊆ (chartAt H c).toPartialEquiv.source

Next tactic:
simpa only [extChartAt_source] using f.tsupport_subset_extChartAt_source
/-- The closures of supports of smooth bump functions centered at `c` form a basis of `𝓝 c`.
In other words, each of these closures is a neighborhood of `c` and each neighborhood of `c`
includes `tsupport f` for some `f : SmoothBumpFunction I c`. -/
theorem nhds_basis_tsupport :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f => tsupport f := by
  

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ HasBasis (𝓝 c) (fun x => True) fun f => tsupport ↑f

Next tactic:
have :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f =>
      (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
    rw [← map_extChartAt_symm_nhdsWithin_range I c]
    exact nhdsWithin_range_basis.map _
/-- The closures of supports of smooth bump functions centered at `c` form a basis of `𝓝 c`.
In other words, each of these closures is a neighborhood of `c` and each neighborhood of `c`
includes `tsupport f` for some `f : SmoothBumpFunction I c`. -/
theorem nhds_basis_tsupport :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f => tsupport f := by
  have :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f =>
      (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
    

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ HasBasis (𝓝 c) (fun x => True) fun f =>
    ↑(PartialEquiv.symm (extChartAt I c)) '' (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
rw [← map_extChartAt_symm_nhdsWithin_range I c]
/-- The closures of supports of smooth bump functions centered at `c` form a basis of `𝓝 c`.
In other words, each of these closures is a neighborhood of `c` and each neighborhood of `c`
includes `tsupport f` for some `f : SmoothBumpFunction I c`. -/
theorem nhds_basis_tsupport :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f => tsupport f := by
  have :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f =>
      (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
    rw [← map_extChartAt_symm_nhdsWithin_range I c]
    

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
⊢ HasBasis (map (↑(PartialEquiv.symm (extChartAt I c))) (𝓝[range ↑I] ↑(extChartAt I c) c)) (fun x => True) fun f =>
    ↑(PartialEquiv.symm (extChartAt I c)) '' (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
exact nhdsWithin_range_basis.map _
/-- The closures of supports of smooth bump functions centered at `c` form a basis of `𝓝 c`.
In other words, each of these closures is a neighborhood of `c` and each neighborhood of `c`
includes `tsupport f` for some `f : SmoothBumpFunction I c`. -/
theorem nhds_basis_tsupport :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f => tsupport f := by
  have :
    (𝓝 c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f =>
      (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I) := by
    rw [← map_extChartAt_symm_nhdsWithin_range I c]
    exact nhdsWithin_range_basis.map _
  

Proof state:
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
H : Type uH
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝ : T2Space M
this :
  HasBasis (𝓝 c) (fun x => True) fun f =>
    ↑(PartialEquiv.symm (extChartAt I c)) '' (closedBall (↑(extChartAt I c) c) f.rOut ∩ range ↑I)
⊢ HasBasis (𝓝 c) (fun x => True) fun f => tsupport ↑f

Next tactic:
refine' this.to_hasBasis' (fun f _ => ⟨f, trivial, f.tsupport_subset_symm_image_closedBall⟩)
    fun f _ => f.tsupport_mem_nhds
/-- A smooth bump function is infinitely smooth. -/
protected theorem smooth : Smooth I 𝓘(ℝ) f := by
  

Proof state:
E : Type uE
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
H : Type uH
inst✝⁵ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝¹ : T2Space M
inst✝ : SmoothManifoldWithCorners I M
⊢ Smooth I 𝓘(ℝ, ℝ) ↑f

Next tactic:
refine' contMDiff_of_support fun x hx => _
/-- A smooth bump function is infinitely smooth. -/
protected theorem smooth : Smooth I 𝓘(ℝ) f := by
  refine' contMDiff_of_support fun x hx => _
  

Proof state:
E : Type uE
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
H : Type uH
inst✝⁵ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝¹ : T2Space M
inst✝ : SmoothManifoldWithCorners I M
x : M
hx : x ∈ tsupport ↑f
⊢ ContMDiffAt I 𝓘(ℝ, ℝ) ⊤ (↑f) x

Next tactic:
have : x ∈ (chartAt H c).source := f.tsupport_subset_chartAt_source hx
/-- A smooth bump function is infinitely smooth. -/
protected theorem smooth : Smooth I 𝓘(ℝ) f := by
  refine' contMDiff_of_support fun x hx => _
  have : x ∈ (chartAt H c).source := f.tsupport_subset_chartAt_source hx
  

Proof state:
E : Type uE
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
H : Type uH
inst✝⁵ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝¹ : T2Space M
inst✝ : SmoothManifoldWithCorners I M
x : M
hx : x ∈ tsupport ↑f
this : x ∈ (chartAt H c).toPartialEquiv.source
⊢ ContMDiffAt I 𝓘(ℝ, ℝ) ⊤ (↑f) x

Next tactic:
refine' ContMDiffAt.congr_of_eventuallyEq _ <| f.eqOn_source.eventuallyEq_of_mem <|
    IsOpen.mem_nhds (chartAt H c).open_source this
/-- A smooth bump function is infinitely smooth. -/
protected theorem smooth : Smooth I 𝓘(ℝ) f := by
  refine' contMDiff_of_support fun x hx => _
  have : x ∈ (chartAt H c).source := f.tsupport_subset_chartAt_source hx
  refine' ContMDiffAt.congr_of_eventuallyEq _ <| f.eqOn_source.eventuallyEq_of_mem <|
    IsOpen.mem_nhds (chartAt H c).open_source this
  

Proof state:
E : Type uE
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
H : Type uH
inst✝⁵ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝¹ : T2Space M
inst✝ : SmoothManifoldWithCorners I M
x : M
hx : x ∈ tsupport ↑f
this : x ∈ (chartAt H c).toPartialEquiv.source
⊢ ContMDiffAt I 𝓘(ℝ, ℝ) ⊤ (↑f.toContDiffBump ∘ ↑(extChartAt I c)) x

Next tactic:
exact f.contDiffAt.contMDiffAt.comp _ (contMDiffAt_extChartAt' this)
/-- If `f : SmoothBumpFunction I c` is a smooth bump function and `g : M → G` is a function smooth
on the source of the chart at `c`, then `f • g` is smooth on the whole manifold. -/
theorem smooth_smul {G} [NormedAddCommGroup G] [NormedSpace ℝ G] {g : M → G}
    (hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).source) : Smooth I 𝓘(ℝ, G) fun x => f x • g x := by
  

Proof state:
E : Type uE
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace ℝ E
inst✝⁸ : FiniteDimensional ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
inst✝³ : T2Space M
inst✝² : SmoothManifoldWithCorners I M
G : Type u_1
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
g : M → G
hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).toPartialEquiv.source
⊢ Smooth I 𝓘(ℝ, G) fun x => ↑f x • g x

Next tactic:
refine contMDiff_of_support fun x hx => ?_
/-- If `f : SmoothBumpFunction I c` is a smooth bump function and `g : M → G` is a function smooth
on the source of the chart at `c`, then `f • g` is smooth on the whole manifold. -/
theorem smooth_smul {G} [NormedAddCommGroup G] [NormedSpace ℝ G] {g : M → G}
    (hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).source) : Smooth I 𝓘(ℝ, G) fun x => f x • g x := by
  refine contMDiff_of_support fun x hx => ?_
  

Proof state:
E : Type uE
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace ℝ E
inst✝⁸ : FiniteDimensional ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝³ : T2Space M
inst✝² : SmoothManifoldWithCorners I M
G : Type u_1
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
g : M → G
hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).toPartialEquiv.source
x : M
hx : x ∈ tsupport fun x => ↑f x • g x
⊢ ContMDiffAt I 𝓘(ℝ, G) ⊤ (fun x => ↑f x • g x) x

Next tactic:
have : x ∈ (chartAt H c).source
/-- If `f : SmoothBumpFunction I c` is a smooth bump function and `g : M → G` is a function smooth
on the source of the chart at `c`, then `f • g` is smooth on the whole manifold. -/
theorem smooth_smul {G} [NormedAddCommGroup G] [NormedSpace ℝ G] {g : M → G}
    (hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).source) : Smooth I 𝓘(ℝ, G) fun x => f x • g x := by
  refine contMDiff_of_support fun x hx => ?_
  have : x ∈ (chartAt H c).source
  -- porting note: was a more readable `calc`
  -- calc
  --   x ∈ tsupport fun x => f x • g x := hx
  --   _ ⊆ tsupport f := (tsupport_smul_subset_left _ _)
  --   _ ⊆ (chart_at _ c).source := f.tsupport_subset_chartAt_source
  · 

Proof state:
case this
E : Type uE
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace ℝ E
inst✝⁸ : FiniteDimensional ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝³ : T2Space M
inst✝² : SmoothManifoldWithCorners I M
G : Type u_1
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
g : M → G
hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).toPartialEquiv.source
x : M
hx : x ∈ tsupport fun x => ↑f x • g x
⊢ x ∈ (chartAt H c).toPartialEquiv.source

Next tactic:
exact f.tsupport_subset_chartAt_source <| tsupport_smul_subset_left _ _ hx
/-- If `f : SmoothBumpFunction I c` is a smooth bump function and `g : M → G` is a function smooth
on the source of the chart at `c`, then `f • g` is smooth on the whole manifold. -/
theorem smooth_smul {G} [NormedAddCommGroup G] [NormedSpace ℝ G] {g : M → G}
    (hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).source) : Smooth I 𝓘(ℝ, G) fun x => f x • g x := by
  refine contMDiff_of_support fun x hx => ?_
  have : x ∈ (chartAt H c).source
  -- porting note: was a more readable `calc`
  -- calc
  --   x ∈ tsupport fun x => f x • g x := hx
  --   _ ⊆ tsupport f := (tsupport_smul_subset_left _ _)
  --   _ ⊆ (chart_at _ c).source := f.tsupport_subset_chartAt_source
  · exact f.tsupport_subset_chartAt_source <| tsupport_smul_subset_left _ _ hx
  

Proof state:
E : Type uE
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace ℝ E
inst✝⁸ : FiniteDimensional ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x✝ : M
inst✝³ : T2Space M
inst✝² : SmoothManifoldWithCorners I M
G : Type u_1
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace ℝ G
g : M → G
hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).toPartialEquiv.source
x : M
hx : x ∈ tsupport fun x => ↑f x • g x
this : x ∈ (chartAt H c).toPartialEquiv.source
⊢ ContMDiffAt I 𝓘(ℝ, G) ⊤ (fun x => ↑f x • g x) x

Next tactic:
exact f.smoothAt.smul ((hg _ this).contMDiffAt <| IsOpen.mem_nhds (chartAt _ _).open_source this)
theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f μ)
    {A : ℝ} : AEStronglyMeasurable (truncation f A) μ := by
  

Proof state:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : AEStronglyMeasurable f μ
A : ℝ
⊢ AEStronglyMeasurable (ProbabilityTheory.truncation f A) μ

Next tactic:
apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable
theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f μ)
    {A : ℝ} : AEStronglyMeasurable (truncation f A) μ := by
  apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable
  

Proof state:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : AEStronglyMeasurable f μ
A : ℝ
⊢ AEStronglyMeasurable (indicator (Set.Ioc (-A) A) id) (Measure.map f μ)

Next tactic:
exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable
theorem abs_truncation_le_bound (f : α → ℝ) (A : ℝ) (x : α) : |truncation f A x| ≤ |A| := by
  

Proof state:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
f✝ f : α → ℝ
A : ℝ
x : α
⊢ |truncation f A x| ≤ |A|

Next tactic:
simp only [truncation, Set.indicator, Set.mem_Icc, id.def, Function.comp_apply]