Theorem: hasDerivAt_integral_of_dominated_loc_of_deriv_le
File: Mathlib/Analysis/Calculus/ParametricIntegral.lean

tactic: have x₀_in : x₀ ∈ ball x₀ ε := mem_ball_self ε_pos
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
⊢ Integrable (F' x₀) ∧ HasDerivAt (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀

tactic: have diff_x₀ : ∀ᵐ a ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀ :=
  h_diff.mono fun a ha => ha x₀ x₀_in
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
⊢ Integrable (F' x₀) ∧ HasDerivAt (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀

tactic: have : ∀ᵐ a ∂μ, LipschitzOnWith (Real.nnabs (bound a)) (fun x : 𝕜 => F x a) (ball x₀ ε) := by
  apply (h_diff.and h_bound).mono
  rintro a ⟨ha_deriv, ha_bound⟩
  refine' (convex_ball _ _).lipschitzOnWith_of_nnnorm_hasDerivWithin_le
    (fun x x_in => (ha_deriv x x_in).hasDerivWithinAt) fun x x_in => _
  rw [← NNReal.coe_le_coe, coe_nnnorm, Real.coe_nnabs]
  exact (ha_bound x x_in).trans (le_abs_self _)
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
⊢ Integrable (F' x₀) ∧ HasDerivAt (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀

tactic: exact
  hasDerivAt_integral_of_dominated_loc_of_lip ε_pos hF_meas hF_int hF'_meas this bound_integrable
    diff_x₀
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
this : ∀ᵐ (a : α) ∂μ, LipschitzOnWith (↑Real.nnabs (bound a)) (fun x => F x a) (ball x₀ ε)
⊢ Integrable (F' x₀) ∧ HasDerivAt (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀

tactic: apply (h_diff.and h_bound).mono
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
⊢ ∀ᵐ (a : α) ∂μ, LipschitzOnWith (↑Real.nnabs (bound a)) (fun x => F x a) (ball x₀ ε)

tactic: rintro a ⟨ha_deriv, ha_bound⟩
state_before: α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
⊢ ∀ (x : α),
    ((∀ (x_1 : 𝕜), x_1 ∈ ball x₀ ε → HasDerivAt (fun x_2 => F x_2 x) (F' x_1 x) x_1) ∧
        ∀ (x_1 : 𝕜), x_1 ∈ ball x₀ ε → ‖F' x_1 x‖ ≤ bound x) →
      LipschitzOnWith (↑Real.nnabs (bound x)) (fun x_1 => F x_1 x) (ball x₀ ε)

tactic: refine' (convex_ball _ _).lipschitzOnWith_of_nnnorm_hasDerivWithin_le
  (fun x x_in => (ha_deriv x x_in).hasDerivWithinAt) fun x x_in => _
state_before: case intro
α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
a : α
ha_deriv : ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
ha_bound : ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
⊢ LipschitzOnWith (↑Real.nnabs (bound a)) (fun x => F x a) (ball x₀ ε)

tactic: rw [← NNReal.coe_le_coe, coe_nnnorm, Real.coe_nnabs]
state_before: case intro
α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
a : α
ha_deriv : ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
ha_bound : ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
x : 𝕜
x_in : x ∈ ball x₀ ε
⊢ ‖F' x a‖₊ ≤ ↑Real.nnabs (bound a)

tactic: exact (ha_bound x x_in).trans (le_abs_self _)
state_before: case intro
α : Type u_2
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
𝕜 : Type u_1
inst✝⁶ : IsROrC 𝕜
E : Type u_3
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace 𝕜 E
inst✝² : CompleteSpace E
H : Type ?u.972511
inst✝¹ : NormedAddCommGroup H
inst✝ : NormedSpace 𝕜 H
F F' : 𝕜 → α → E
x₀ : 𝕜
ε : ℝ
ε_pos : 0 < ε
hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, AEStronglyMeasurable (F x) μ
hF_int : Integrable (F x₀)
hF'_meas : AEStronglyMeasurable (F' x₀) μ
bound : α → ℝ
h_bound : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
bound_integrable : Integrable bound
h_diff : ∀ᵐ (a : α) ∂μ, ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
x₀_in : x₀ ∈ ball x₀ ε
diff_x₀ : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' x₀ a) x₀
a : α
ha_deriv : ∀ (x : 𝕜), x ∈ ball x₀ ε → HasDerivAt (fun x => F x a) (F' x a) x
ha_bound : ∀ (x : 𝕜), x ∈ ball x₀ ε → ‖F' x a‖ ≤ bound a
x : 𝕜
x_in : x ∈ ball x₀ ε
⊢ ‖F' x a‖ ≤ abs (bound a)