Theorem: MeasureTheory.integral_image_eq_integral_abs_det_fderiv_smul
File: Mathlib/MeasureTheory/Function/Jacobian.lean

tactic: rw [← restrict_map_withDensity_abs_det_fderiv_eq_addHaar μ hs hf' hf,
  (measurableEmbedding_of_fderivWithin hs hf' hf).integral_map]
state_before: E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
⊢ (∫ (x : E) in f '' s, g x ∂μ) = ∫ (x : E) in s, abs (ContinuousLinearMap.det (f' x)) • g (f x) ∂μ

tactic: have : ∀ x : s, g (s.restrict f x) = (g ∘ f) x := fun x => rfl
state_before: E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
⊢ (∫ (x : ↑s),
      g
        (Set.restrict s f
          x) ∂Measure.comap Subtype.val
        (withDensity μ fun x => ENNReal.ofReal (abs (ContinuousLinearMap.det (f' x))))) =
    ∫ (x : E) in s, abs (ContinuousLinearMap.det (f' x)) • g (f x) ∂μ

tactic: simp only [this, ENNReal.ofReal]
state_before: E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
this : ∀ (x : ↑s), g (Set.restrict s f x) = (g ∘ f) ↑x
⊢ (∫ (x : ↑s),
      g
        (Set.restrict s f
          x) ∂Measure.comap Subtype.val
        (withDensity μ fun x => ENNReal.ofReal (abs (ContinuousLinearMap.det (f' x))))) =
    ∫ (x : E) in s, abs (ContinuousLinearMap.det (f' x)) • g (f x) ∂μ

tactic: rw [← (MeasurableEmbedding.subtype_coe hs).integral_map, map_comap_subtype_coe hs,
  set_integral_withDensity_eq_set_integral_smul₀
    (aemeasurable_toNNReal_abs_det_fderivWithin μ hs hf') _ hs]
state_before: E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
this : ∀ (x : ↑s), g (Set.restrict s f x) = (g ∘ f) ↑x
⊢ (∫ (x : ↑s),
      (g ∘ f)
        ↑x ∂Measure.comap Subtype.val
        (withDensity μ fun x => ↑(Real.toNNReal (abs (ContinuousLinearMap.det (f' x)))))) =
    ∫ (x : E) in s, abs (ContinuousLinearMap.det (f' x)) • g (f x) ∂μ

tactic: congr with x
state_before: E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
this : ∀ (x : ↑s), g (Set.restrict s f x) = (g ∘ f) ↑x
⊢ (∫ (a : E) in s, Real.toNNReal (abs (ContinuousLinearMap.det (f' a))) • (g ∘ f) a ∂μ) =
    ∫ (x : E) in s, abs (ContinuousLinearMap.det (f' x)) • g (f x) ∂μ

tactic: conv_rhs => rw [← Real.coe_toNNReal _ (abs_nonneg (f' x).det)]
state_before: case e_f.h
E : Type u_2
F : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : FiniteDimensional ℝ E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
s : Set E
f : E → E
f' : E → E →L[ℝ] E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
μ : Measure E
inst✝¹ : IsAddHaarMeasure μ
inst✝ : CompleteSpace F
hs : MeasurableSet s
hf' : ∀ (x : E), x ∈ s → HasFDerivWithinAt f (f' x) s x
hf : InjOn f s
g : E → F
this : ∀ (x : ↑s), g (Set.restrict s f x) = (g ∘ f) ↑x
x : E
⊢ Real.toNNReal (abs (ContinuousLinearMap.det (f' x))) • (g ∘ f) x = abs (ContinuousLinearMap.det (f' x)) • g (f x)