letH : MeasureE:=Measure.hausdorffMeasure (Module.finrank ℝE)
haveha : H ≪ μ :=Measure.absolutelyContinuous_isAddHaarMeasure H μ
havehb : μ ≪ H:=Measure.absolutelyContinuous_isAddHaarMeasure μ H
apply hb
apply le_antisymm _ zero_le
have hi := hf.hausdorffMeasure_image_le (d := (Module.finrank ℝE : ℝ)) (by positivity)
change H (f '' s) ≤ (K : ℝ≥0∞) ^ (Module.finrank ℝE : ℝ) * H s at hi
simpa only [ha hs,mul_zero] using hi
lemmalipschitzOn_image_ae_congr_subset {s t : SetE} {f : E→E} {K : ℝ≥0}
(hf : LipschitzOnWithK f s) (hts : t ⊆ s) (heq : s =ᵐ[μ] t) :
f '' s =ᵐ[μ] f '' t :=by
proof · 8
lines
apply ae_eq_set.mpr
constructor
· havehsub : f '' s \ f '' t ⊆ f '' (s \ t) :=by
rintro y ⟨⟨x,hx,rfl⟩,hy⟩
exact ⟨x,⟨hx,fun h => hy ⟨x,h,rfl⟩⟩,rfl⟩
exact measure_mono_null hsub
(lipschitzOn_image_null μ (hf.mono sdiff_subset) (ae_eq_set.mp heq).1)
· rw [sdiff_eq_empty.mpr (image_mono hts),measure_empty]
lemmaexists_measurable_full_derivative_domain {s : SetE} (hs : MeasurableSet s)
{f : E→E} {K : ℝ≥0} (hf : LipschitzOnWithK f s) :
∃ t, t ⊆ s ∧MeasurableSet t ∧ t =ᵐ[μ] s ∧∀ x ∈ t, HasFDerivWithinAt f (fderivWithin ℝ f s x) t x :=by
proof · 8
lines
letd : SetE:= {x | x ∈ s ∧DifferentiableWithinAtℝ f s x}
havehd : d =ᵐ[μ] s :=by
filter_upwards [(ae_restrict_iff' hs).mp (hf.ae_differentiableWithinAt hs (μ := μ))] with x hx
change (x ∈ s ∧DifferentiableWithinAtℝ f s x) = (x ∈ s)
exact propext ⟨And.left,fun h => ⟨h,hx h⟩⟩
obtain ⟨t,htd,htm,hteq⟩ := (hs.nullMeasurableSet.congr hd.symm).exists_measurable_subset_ae_eq
havehts : t ⊆ s :=fun x hx => (htd hx).1
exact ⟨t,hts,htm,hteq.trans hd,fun x hx => (htd hx).2.hasFDerivWithinAt.mono hts⟩
lemmaintegral_image_eq_integral_abs_det_within {s : SetE} (hs : MeasurableSet s)
{f : E→E} {K : ℝ≥0} (hf : LipschitzOnWithK f s) (hinj : InjOn f s)
{V : Type*} [NormedAddCommGroupV] [NormedSpaceℝV] (g : E→V) :
∫ y in f '' s, g y ∂μ =
∫ x in s, |(fderivWithin ℝ f s x).det| • g (f x) ∂μ :=by
proof · 7
lines
obtain ⟨t,hts,htm,hteq,htd⟩ := exists_measurable_full_derivative_domain μ hs hf
calc
_ = ∫ y in f '' t, g y ∂μ :=
setIntegral_congr_set (lipschitzOn_image_ae_congr_subset μ hf hts hteq.symm)
_ = ∫ x in t, |(fderivWithin ℝ f s x).det| • g (f x) ∂μ :=
integral_image_eq_integral_abs_det_fderiv_smul μ htm htd (hinj.mono hts) g
_ = _ := setIntegral_congr_set hteq
lemmalipschitzOn_invFunOn {s : SetE} {f : E→E} {L : ℝ≥0}
(ha : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ (L : ℝ) * dist (f x) (f y)) :
LipschitzOnWithL (Function.invFunOn f s) (f '' s) :=by
proof · 4
lines
rw [lipschitzOnWith_iff_dist_le_mul]
intro x hx y hy
have h := ha _ (Function.invFunOn_mem hx) _ (Function.invFunOn_mem hy)
simpa only [Function.invFunOn_eq hx,Function.invFunOn_eq hy] using h
lemmaae_fderivWithin_comp_bilipschitzOn {s : SetE} (hs : MeasurableSet s)
{f : E→E} {KL : ℝ≥0} (hf : LipschitzOnWithK f s)
(ha : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ (L : ℝ) * dist (f x) (f y))
{V : Type*} [NormedAddCommGroupV] [NormedSpaceℝV] [FiniteDimensionalℝV]
{g : E→V} {J : ℝ≥0} (hg : LipschitzOnWithJ g (f '' s)) :
∀ᵐ x ∂μ.restrict s, fderivWithin ℝ (g ∘ f) s x =
(fderivWithin ℝ g (f '' s) (f x)).comp (fderivWithin ℝ f s x) :=by
proof · 6
lines
have hinj := antilipschitzOn_injOn ha
have him := hs.image_of_continuousOn_injOn hf.continuousOn hinj
filter_upwards [ae_uniqueDiffWithinAt μ s,hf.ae_differentiableWithinAt hs (μ := μ),
bilipschitzOn_ae_pullback μ hs hf ha (hg.ae_differentiableWithinAt him (μ := μ))]
with x hx hfx hgx
exact fderivWithin_comp x hgx hfx (mapsTo_image f s) hx
lemmaae_det_fderivWithin_ne_zero_bilipschitzOn {s : SetE} (hs : MeasurableSet s)
{f : E→E} {KL : ℝ≥0} (hf : LipschitzOnWithK f s)
(ha : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ (L : ℝ) * dist (f x) (f y)) :
∀ᵐ x ∂μ.restrict s, (fderivWithin ℝ f s x).det ≠0:=by
proof · 13
lines
have hinj := antilipschitzOn_injOn ha
filter_upwards [ae_fderivWithin_comp_bilipschitzOn μ hs hf ha (lipschitzOn_invFunOn ha),
ae_uniqueDiffWithinAt μ s,ae_restrict_mem hs] with x hx hu hxs
haveheq : EqOn (Function.invFunOn f s ∘ f) id s :=fun x hxs => hinj.leftInvOn_invFunOn hxs
rw [fderivWithin_congr' heq hxs,fderivWithin_id hu] at hx
have hd := congrArg (funa : E→L[ℝ] E=> a.det) hx
simp only [ContinuousLinearMap.det, ContinuousLinearMap.toLinearMap_comp,
LinearMap.det_comp, ContinuousLinearMap.coe_id, LinearMap.det_id] at hd
intro hz
change LinearMap.det _ = 0 at hz
rw [hz,mul_zero] at hd
exact one_ne_zero hd
obtain ⟨t,hts,htm,hteq,htd⟩ := exists_measurable_full_derivative_domain μ hs hf
have h := aemeasurable_fderivWithin μ htm htd
rwa [Measure.restrict_congr_set hteq] at h
lemmaae_norm_fderivWithin_lipschitzOn {s : SetE} (hs : MeasurableSet s)
{f : E→E} {K : ℝ≥0} (hf : LipschitzOnWithK f s) :
∀ᵐ x ∂μ.restrict s, ‖fderivWithin ℝ f s x‖ ≤K:=by
proof · 9
lines
obtain ⟨t,hts,htm,hteq,htd⟩ := exists_measurable_full_derivative_domain μ hs hf
havehlin : ApproximatesLinearOn f (0 : E→L[ℝ] E) t K:=by
intro x hx y hy
simpa only [_root_.zero_apply,sub_zero,←dist_eq_norm] using
hf.dist_le_mul x (hts hx) y (hts hy)
have h := hlin.norm_fderiv_sub_le μ htm (fderivWithin ℝ f s) htd
rw [Measure.restrict_congr_set hteq] at h
filter_upwards [h] with x hx
exact_mod_cast (by simpa only [sub_zero] usinghx : ‖fderivWithin ℝ f s x‖₊ ≤K)
lemmaintegrable_mul_det_fderivWithin_lipschitzOn {s : SetE} (hs : MeasurableSet s)
{f : E→E} {K : ℝ≥0} (hf : LipschitzOnWithK f s)
{g : E→ℝ} (hg : IntegrableOn g s μ) :
IntegrableOn (fun x => g x * (fderivWithin ℝ f s x).det) s μ :=by