Download data/lean/OAI/Analysis/Brenier/HalfspaceKernel.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 20.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Brenier/HalfspaceKernel.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Brenier/HalfspaceKernel.lean
-
curl -L -o HalfspaceKernel.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Brenier/HalfspaceKernel.lean
20.3 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Filter | |
| open scoped Topology | |
| namespace Problem358 | |
| /-- Joint measurability is preserved by integrating between measurable endpoints. -/ | |
| theorem stronglyMeasurable_intervalIntegral_endpoints | |
| {X : Type*} [MeasurableSpace X] {f : X β β β β} {a b : X β β} | |
| (hf : Measurable (Function.uncurry f)) (ha : Measurable a) (hb : Measurable b) : | |
| StronglyMeasurable (fun x => β« t in a x..b x, f x t) := by | |
| let S : Set (X Γ β) := {p | a p.1 < p.2 β§ p.2 β€ b p.1} | |
| let T : Set (X Γ β) := {p | b p.1 < p.2 β§ p.2 β€ a p.1} | |
| have hS : MeasurableSet S := | |
| (measurableSet_lt (ha.comp measurable_fst) measurable_snd).inter | |
| (measurableSet_le measurable_snd (hb.comp measurable_fst)) | |
| have hT : MeasurableSet T := | |
| (measurableSet_lt (hb.comp measurable_fst) measurable_snd).inter | |
| (measurableSet_le measurable_snd (ha.comp measurable_fst)) | |
| have hleft : StronglyMeasurable (fun x => β« t : β, | |
| S.indicator (Function.uncurry f) (x, t)) := | |
| StronglyMeasurable.integral_prod_right (f := fun x t => | |
| S.indicator (Function.uncurry f) (x, t)) (by | |
| convert (hf.indicator hS).stronglyMeasurable using 1 | |
| funext p | |
| rcases p with β¨x, tβ© | |
| rfl) | |
| have hright : StronglyMeasurable (fun x => β« t : β, | |
| T.indicator (Function.uncurry f) (x, t)) := | |
| StronglyMeasurable.integral_prod_right (f := fun x t => | |
| T.indicator (Function.uncurry f) (x, t)) (by | |
| convert (hf.indicator hT).stronglyMeasurable using 1 | |
| funext p | |
| rcases p with β¨x, tβ© | |
| rfl) | |
| convert hleft.sub hright using 1 | |
| ext x | |
| change (β« t in a x..b x, f x t) = | |
| (β« t, (Set.Ioc (a x) (b x)).indicator (f x) t) - | |
| (β« t, (Set.Ioc (b x) (a x)).indicator (f x) t) | |
| rw [integral_indicator measurableSet_Ioc, integral_indicator measurableSet_Ioc] | |
| rfl | |
| /-- Differentiate a moving one-dimensional boundary, then integrate over the | |
| transverse variables. Continuity is required only at the unperturbed boundary; | |
| the integrand may be discontinuous away from that boundary. -/ | |
| theorem hasDerivAt_integral_moving_boundary | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : X β β β β} {b B : X β β} | |
| (hmeas : β h : β, AEStronglyMeasurable | |
| (fun x => β« t in (0 : β)..h * b x, f x t) ΞΌ) | |
| (htrace : AEStronglyMeasurable (fun x => f x 0 * b x) ΞΌ) | |
| (hslice : βα΅ x βΞΌ, StronglyMeasurableAtFilter (f x) (nhds 0)) | |
| (hcont : βα΅ x βΞΌ, ContinuousAt (f x) 0) | |
| (hbound : βα΅ x βΞΌ, β t : β, βf x tβ β€ B x) | |
| (hdom : Integrable (fun x => |b x| * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t in (0 : β)..h * b x, f x t) βΞΌ) | |
| (β« x, f x 0 * b x βΞΌ) 0 := by | |
| let F : β β X β β := fun h x => β« t in (0 : β)..h * b x, f x t | |
| let D : X β β βL[β] β := fun x => | |
| (1 : β βL[β] β).smulRight (f x 0 * b x) | |
| have hDmeas : AEStronglyMeasurable D ΞΌ := | |
| (ContinuousLinearMap.smulRightL β β β 1).continuous.comp_aestronglyMeasurable htrace | |
| have hdiff : βα΅ x βΞΌ, HasFDerivAt (fun h => F h x) (D x) 0 := by | |
| filter_upwards [hslice, hcont] with x hx hc | |
| have hf := intervalIntegral.integral_hasDerivAt_right | |
| (IntervalIntegrable.refl (f := f x) (a := (0 : β))) hx hc | |
| have hmul := (hasDerivAt_id (0 : β)).mul_const (b x) | |
| have hf' : HasDerivAt (fun u => β« t in (0 : β)..u, f x t) | |
| (f x 0) ((fun h : β => id h * b x) 0) := by | |
| simpa using hf | |
| have hd : HasDerivAt (fun h => F h x) (f x 0 * b x) 0 := by | |
| simpa [F, Function.comp_def] using hf'.comp 0 hmul | |
| exact hd.hasFDerivAt | |
| have hbase : Integrable (F 0) ΞΌ := by | |
| simp [F] | |
| have hlip : βα΅ x βΞΌ, β h β (Set.univ : Set β), | |
| βF h x - F 0 xβ β€ (|b x| * B x) * βh - 0β := by | |
| filter_upwards [hbound] with x hx | |
| intro h _ | |
| have hi := intervalIntegral.norm_integral_le_of_norm_le_const | |
| (a := (0 : β)) (b := h * b x) (fun t _ => hx t) | |
| simpa [F, abs_mul, Real.norm_eq_abs, mul_assoc, mul_left_comm, mul_comm] using hi | |
| obtain β¨hDint, hDβ© := hasFDerivAt_integral_of_dominated_loc_of_lip' | |
| (F := F) (F' := D) (s := Set.univ) (xβ := (0 : β)) | |
| (bound := fun x => |b x| * B x) Filter.univ_mem | |
| (fun h _ => hmeas h) hbase hDmeas hlip hdom hdiff | |
| have hd := hD.hasDerivAt | |
| rw [ContinuousLinearMap.integral_apply hDint] at hd | |
| simpa [D, F] using hd | |
| /-- A moving-boundary derivative with all measurability discharged from a jointly | |
| measurable integrand and a measurable boundary velocity. -/ | |
| theorem hasDerivAt_integral_moving_boundary_of_measurable | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : X β β β β} {b B : X β β} | |
| (hf : Measurable (Function.uncurry f)) (hb : Measurable b) | |
| (hcont : βα΅ x βΞΌ, ContinuousAt (f x) 0) | |
| (hbound : βα΅ x βΞΌ, β t : β, βf x tβ β€ B x) | |
| (hdom : Integrable (fun x => |b x| * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t in (0 : β)..h * b x, f x t) βΞΌ) | |
| (β« x, f x 0 * b x βΞΌ) 0 := by | |
| apply hasDerivAt_integral_moving_boundary _ _ _ hcont hbound hdom | |
| Β· intro h | |
| exact (stronglyMeasurable_intervalIntegral_endpoints hf measurable_const | |
| (measurable_const.mul hb)).aestronglyMeasurable | |
| Β· exact ((hf.comp (measurable_id.prodMk measurable_const)).mul hb).aestronglyMeasurable | |
| Β· exact Eventually.of_forall fun x => | |
| (hf.comp (measurable_const.prodMk measurable_id)).stronglyMeasurable.stronglyMeasurableAtFilter | |
| /-- A moving-boundary derivative remains valid for a changing integrand. The | |
| scaled pointwise limit is exactly what remains after removing the principal | |
| moving halfspace in a telescoping product of cell indicators. -/ | |
| theorem hasDerivAt_integral_moving_boundary_varying | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : β β X β β β β} {b B : X β β} {trace : X β β} | |
| (hf : β h, Measurable (Function.uncurry (f h))) (hb : Measurable b) | |
| (hlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => f h x (h * u)) (nhds 0) (nhds (trace x))) | |
| (hbound : βα΅ x βΞΌ, β h t : β, βf h x tβ β€ B x) | |
| (hdom : Integrable (fun x => |b x| * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t in (0 : β)..h * b x, f h x t) βΞΌ) | |
| (β« x, b x * trace x βΞΌ) 0 := by | |
| let G : β β X β β := fun h x => β« u in (0 : β)..b x, f h x (h * u) | |
| have hGmeas : β h, StronglyMeasurable (G h) := by | |
| intro h | |
| apply stronglyMeasurable_intervalIntegral_endpoints _ measurable_const hb | |
| exact (hf h).comp (measurable_fst.prodMk (measurable_const.mul measurable_snd)) | |
| have hGbound : β h, βα΅ x βΞΌ, βG h xβ β€ |b x| * B x := by | |
| intro h | |
| filter_upwards [hbound] with x hx | |
| have hi := intervalIntegral.norm_integral_le_of_norm_le_const | |
| (a := (0 : β)) (b := b x) (fun u _ => hx h (h * u)) | |
| simpa [G, mul_comm] using hi | |
| have hGlim : βα΅ x βΞΌ, Tendsto (fun h => G h x) (nhds 0) | |
| (nhds (b x * trace x)) := by | |
| filter_upwards [hlim, hbound] with x hx hxbound | |
| have hi := intervalIntegral.tendsto_integral_filter_of_dominated_convergence | |
| (a := (0 : β)) (b := b x) (ΞΌ := volume) (l := nhds (0 : β)) | |
| (F := fun h u => f h x (h * u)) (f := fun _ => trace x) | |
| (fun _ => B x) | |
| (Eventually.of_forall fun h => | |
| ((hf h).comp (measurable_const.prodMk | |
| (measurable_const.mul measurable_id))).aestronglyMeasurable) | |
| (Eventually.of_forall fun h => Eventually.of_forall fun u _ => hxbound h (h * u)) | |
| intervalIntegrable_const | |
| (Eventually.of_forall fun u _ => hx u) | |
| simpa [G] using hi | |
| have hHlim : Tendsto (fun h => β« x, G h x βΞΌ) (nhds 0) | |
| (nhds (β« x, b x * trace x βΞΌ)) := | |
| tendsto_integral_filter_of_dominated_convergence (fun x => |b x| * B x) | |
| (Eventually.of_forall fun h => (hGmeas h).aestronglyMeasurable) | |
| (Eventually.of_forall hGbound) hdom hGlim | |
| have hscale : β h : β, | |
| (β« x, (β« t in (0 : β)..h * b x, f h x t) βΞΌ) = | |
| h * β« x, G h x βΞΌ := by | |
| intro h | |
| rw [β integral_const_mul] | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun x => by | |
| simpa only [G, smul_eq_mul, mul_zero] using | |
| (intervalIntegral.smul_integral_comp_mul_left (f h x) (a := (0 : β)) | |
| (b := b x) h).symm | |
| rw [hasDerivAt_iff_tendsto_slope_zero] | |
| apply (hHlim.mono_left nhdsWithin_le_nhds).congr' | |
| filter_upwards [self_mem_nhdsWithin] with h hh | |
| have hh0 : h β 0 := by simpa using hh | |
| simp [hscale, hh0, smul_eq_mul] | |
| /-- A varying boundary velocity is allowed as well. In moving-plane coordinates, | |
| this covers the denominator introduced when the normal direction is perturbed. -/ | |
| theorem hasDerivAt_integral_moving_boundary_varying_speed | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : β β X β β β β} {speed : β β X β β} {A B slope trace : X β β} | |
| (hf : β h, Measurable (Function.uncurry (f h))) | |
| (hspeed : β h, Measurable (speed h)) | |
| (hspeedlim : βα΅ x βΞΌ, Tendsto (fun h => speed h x) (nhds 0) (nhds (slope x))) | |
| (hlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => f h x (h * speed h x * u)) (nhds 0) (nhds (trace x))) | |
| (hspeedbound : βα΅ x βΞΌ, β h : β, |speed h x| β€ A x) | |
| (hbound : βα΅ x βΞΌ, β h t : β, βf h x tβ β€ B x) | |
| (hdom : Integrable (fun x => A x * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t in (0 : β)..h * speed h x, f h x t) βΞΌ) | |
| (β« x, slope x * trace x βΞΌ) 0 := by | |
| let G : β β X β β β β := fun h x t => speed h x * f h x (speed h x * t) | |
| have hGmeas : β h, Measurable (Function.uncurry (G h)) := by | |
| intro h | |
| exact ((hspeed h).comp measurable_fst).mul | |
| ((hf h).comp (measurable_fst.prodMk | |
| (((hspeed h).comp measurable_fst).mul measurable_snd))) | |
| have hGlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => G h x (h * u)) (nhds 0) | |
| (nhds (slope x * trace x)) := by | |
| filter_upwards [hspeedlim, hlim] with x hx hy | |
| intro u | |
| simpa [G, mul_assoc, mul_comm, mul_left_comm] using hx.mul (hy u) | |
| have hGbound : βα΅ x βΞΌ, β h t : β, βG h x tβ β€ A x * B x := by | |
| filter_upwards [hspeedbound, hbound] with x hx hy | |
| intro h t | |
| have hB : 0 β€ B x := (norm_nonneg _).trans (hy 0 0) | |
| calc | |
| βG h x tβ = |speed h x| * βf h x (speed h x * t)β := by | |
| simp [G, norm_mul, Real.norm_eq_abs] | |
| _ β€ A x * B x := mul_le_mul (hx h) (hy h (speed h x * t)) | |
| (norm_nonneg _) ((abs_nonneg _).trans (hx h)) | |
| have hg := hasDerivAt_integral_moving_boundary_varying | |
| (f := G) (b := fun _ => (1 : β)) (B := fun x => A x * B x) | |
| hGmeas measurable_const hGlim hGbound (by simpa using hdom) | |
| simp only [mul_one, one_mul] at hg | |
| convert hg using 1 | |
| funext h | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun x => by | |
| change (β« t in (0 : β)..h * speed h x, f h x t) = | |
| (β« t in (0 : β)..h, G h x t) | |
| rw [show (β« t in (0 : β)..h, G h x t) = | |
| speed h x * β« t in (0 : β)..h, f h x (speed h x * t) by | |
| exact intervalIntegral.integral_const_mul _ _] | |
| simpa only [smul_eq_mul, mul_zero, mul_comm] using | |
| (intervalIntegral.smul_integral_comp_mul_left (f h x) | |
| (a := (0 : β)) (b := h) (speed h x)).symm | |
| end Problem358 | |
| namespace Problem358 | |
| /-- The signed change of a threshold halfline is exactly its boundary strip. -/ | |
| theorem integral_threshold_difference (f : β β β) (c : β) : | |
| (β« t : β, f t * ((if c β€ t then (1 : β) else 0) - | |
| (if 0 β€ t then (1 : β) else 0))) = β« t in c..0, f t := by | |
| classical | |
| by_cases hc : c β€ 0 | |
| Β· have hid : (fun t : β => f t * ((if c β€ t then (1 : β) else 0) - | |
| (if 0 β€ t then (1 : β) else 0))) = (Set.Ico c 0).indicator f := by | |
| funext t | |
| simp only [Set.indicator, Set.mem_Ico] | |
| split_ifs <;> simp_all <;> linarith | |
| rw [hid, integral_indicator measurableSet_Ico, integral_Ico_eq_integral_Ioc, | |
| intervalIntegral.integral_of_le hc] | |
| Β· have hc' : 0 β€ c := le_of_lt (lt_of_not_ge hc) | |
| have hid : (fun t : β => f t * ((if c β€ t then (1 : β) else 0) - | |
| (if 0 β€ t then (1 : β) else 0))) = | |
| fun t => -((Set.Ico 0 c).indicator f t) := by | |
| funext t | |
| simp only [Set.indicator, Set.mem_Ico] | |
| split_ifs <;> simp_all <;> linarith | |
| rw [hid, integral_neg, integral_indicator measurableSet_Ico, | |
| integral_Ico_eq_integral_Ioc, intervalIntegral.integral_of_ge hc'] | |
| /-- The derivative of one varying halfspace factor, with all other varying | |
| factors included in `f`. This is stated as an iterated integral so that an | |
| orthogonal-coordinate/Fubini argument can apply it directly. -/ | |
| theorem hasDerivAt_integral_halfspace_difference | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : β β X β β β β} {speed : β β X β β} {A B slope trace : X β β} | |
| (hf : β h, Measurable (Function.uncurry (f h))) | |
| (hspeed : β h, Measurable (speed h)) | |
| (hspeedlim : βα΅ x βΞΌ, Tendsto (fun h => speed h x) (nhds 0) (nhds (slope x))) | |
| (hlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => f h x (-(h * speed h x * u))) (nhds 0) (nhds (trace x))) | |
| (hspeedbound : βα΅ x βΞΌ, β h : β, |speed h x| β€ A x) | |
| (hbound : βα΅ x βΞΌ, β h t : β, βf h x tβ β€ B x) | |
| (hdom : Integrable (fun x => A x * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t : β, | |
| f h x t * ((if -(h * speed h x) β€ t then (1 : β) else 0) - | |
| (if 0 β€ t then (1 : β) else 0))) βΞΌ) | |
| (β« x, slope x * trace x βΞΌ) 0 := by | |
| have hg := hasDerivAt_integral_moving_boundary_varying_speed | |
| (f := fun h x t => f h x (-t)) (speed := speed) | |
| (A := A) (B := B) (slope := slope) (trace := trace) | |
| (fun h => (hf h).comp (measurable_fst.prodMk measurable_snd.neg)) | |
| hspeed hspeedlim hlim hspeedbound | |
| (hbound.mono fun x hx h t => hx h (-t)) hdom | |
| convert hg using 1 | |
| funext h | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun x => by | |
| dsimp only | |
| rw [integral_threshold_difference, intervalIntegral.integral_comp_neg] | |
| simp | |
| /-- Local-in-parameter version of the halfspace derivative. In particular, | |
| velocity denominators need only stay away from zero near the base configuration. -/ | |
| theorem hasDerivAt_integral_halfspace_difference_local | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : β β X β β β β} {speed : β β X β β} {A B slope trace : X β β} | |
| {s : Set β} (hs : s β nhds 0) | |
| (hf : β h, Measurable (Function.uncurry (f h))) | |
| (hspeed : β h, Measurable (speed h)) | |
| (hspeedlim : βα΅ x βΞΌ, Tendsto (fun h => speed h x) (nhds 0) (nhds (slope x))) | |
| (hlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => f h x (-(h * speed h x * u))) (nhds 0) (nhds (trace x))) | |
| (hspeedbound : βα΅ x βΞΌ, β h β s, |speed h x| β€ A x) | |
| (hbound : βα΅ x βΞΌ, β h β s, β t : β, βf h x tβ β€ B x) | |
| (hdom : Integrable (fun x => A x * B x) ΞΌ) : | |
| HasDerivAt (fun h : β => β« x, (β« t : β, | |
| f h x t * ((if -(h * speed h x) β€ t then (1 : β) else 0) - | |
| (if 0 β€ t then (1 : β) else 0))) βΞΌ) | |
| (β« x, slope x * trace x βΞΌ) 0 := by | |
| classical | |
| let ff : β β X β β β β := fun h x t => if h β s then f h x t else 0 | |
| let vv : β β X β β := fun h x => if h β s then speed h x else 0 | |
| have hzero : (0 : β) β s := mem_of_mem_nhds hs | |
| have hff : β h, Measurable (Function.uncurry (ff h)) := by | |
| intro h | |
| by_cases hh : h β s | |
| Β· simpa [ff, hh, Function.uncurry] using hf h | |
| Β· convert (measurable_const : Measurable (fun _ : X Γ β => (0 : β))) using 1 | |
| funext p | |
| rcases p with β¨x, tβ© | |
| simp [ff, hh] | |
| have hvv : β h, Measurable (vv h) := by | |
| intro h | |
| by_cases hh : h β s | |
| Β· simpa [vv, hh] using hspeed h | |
| Β· simp [vv, hh] | |
| have hvlim : βα΅ x βΞΌ, Tendsto (fun h => vv h x) (nhds 0) (nhds (slope x)) := by | |
| filter_upwards [hspeedlim] with x hx | |
| apply hx.congr' | |
| filter_upwards [hs] with h hh | |
| simp [vv, hh] | |
| have hflim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => ff h x (-(h * vv h x * u))) (nhds 0) (nhds (trace x)) := by | |
| filter_upwards [hlim] with x hx | |
| intro u | |
| apply (hx u).congr' | |
| filter_upwards [hs] with h hh | |
| simp [ff, vv, hh] | |
| have hvbound : βα΅ x βΞΌ, β h : β, |vv h x| β€ A x := by | |
| filter_upwards [hspeedbound] with x hx | |
| have hA : 0 β€ A x := (abs_nonneg _).trans (hx 0 hzero) | |
| intro h | |
| by_cases hh : h β s | |
| Β· simpa [vv, hh] using hx h hh | |
| Β· simpa [vv, hh] using hA | |
| have hfbound : βα΅ x βΞΌ, β h t : β, βff h x tβ β€ B x := by | |
| filter_upwards [hbound] with x hx | |
| have hB : 0 β€ B x := (norm_nonneg _).trans (hx 0 hzero 0) | |
| intro h t | |
| by_cases hh : h β s | |
| Β· simpa [ff, hh] using hx h hh t | |
| Β· simpa [ff, hh] using hB | |
| have hd := hasDerivAt_integral_halfspace_difference hff hvv hvlim hflim hvbound hfbound hdom | |
| apply hd.congr_of_eventuallyEq | |
| filter_upwards [hs] with h hh | |
| simp [ff, vv, hh] | |
| /-- Multiplication by the signed difference of two threshold indicators | |
| preserves ambient integrability. -/ | |
| theorem integrable_threshold_difference | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} | |
| {f : X Γ β β β} {c : X β β} | |
| (hf : Integrable f (ΞΌ.prod volume)) (hc : Measurable c) : | |
| Integrable (fun p : X Γ β => f p * | |
| ((if c p.1 β€ p.2 then (1 : β) else 0) - | |
| (if 0 β€ p.2 then (1 : β) else 0))) (ΞΌ.prod volume) := by | |
| have hfirst : Measurable (fun p : X Γ β => | |
| if c p.1 β€ p.2 then (1 : β) else 0) := | |
| Measurable.ite (measurableSet_le (hc.comp measurable_fst) measurable_snd) | |
| measurable_const measurable_const | |
| have hsecond : Measurable (fun p : X Γ β => | |
| if 0 β€ p.2 then (1 : β) else 0) := | |
| Measurable.ite (measurableSet_le measurable_const measurable_snd) | |
| measurable_const measurable_const | |
| apply hf.norm.mono' (hf.aestronglyMeasurable.mul | |
| (hfirst.sub hsecond).aestronglyMeasurable) | |
| exact Eventually.of_forall fun p => by | |
| have hcut : β(if c p.1 β€ p.2 then (1 : β) else 0) - | |
| (if 0 β€ p.2 then (1 : β) else 0)β β€ 1 := by | |
| split_ifs <;> norm_num | |
| simp only [Pi.mul_apply, Pi.sub_apply] | |
| rw [norm_mul] | |
| exact (mul_le_mul_of_nonneg_left hcut (norm_nonneg _)).trans_eq (mul_one _) | |
| /-- Product-measure version of the local moving-face derivative. Ambient | |
| integrability is enough to discharge the Fubini step, while slice domination | |
| controls the derivative independently of the parameter. -/ | |
| theorem hasDerivAt_prod_integral_halfspace_difference_local | |
| {X : Type*} [MeasurableSpace X] {ΞΌ : Measure X} [SFinite ΞΌ] | |
| {f : β β X β β β β} {speed : β β X β β} {A B slope trace : X β β} | |
| {s : Set β} (hs : s β nhds 0) | |
| (hf : β h, Measurable (Function.uncurry (f h))) | |
| (hspeed : β h, Measurable (speed h)) | |
| (hspeedlim : βα΅ x βΞΌ, Tendsto (fun h => speed h x) (nhds 0) (nhds (slope x))) | |
| (hlim : βα΅ x βΞΌ, β u : β, | |
| Tendsto (fun h : β => f h x (-(h * speed h x * u))) (nhds 0) (nhds (trace x))) | |
| (hspeedbound : βα΅ x βΞΌ, β h β s, |speed h x| β€ A x) | |
| (hbound : βα΅ x βΞΌ, β h β s, β t : β, βf h x tβ β€ B x) | |
| (hdom : Integrable (fun x => A x * B x) ΞΌ) | |
| (hInt : βαΆ h in nhds 0, Integrable (Function.uncurry (f h)) (ΞΌ.prod volume)) : | |
| HasDerivAt (fun h : β => β« p : X Γ β, | |
| f h p.1 p.2 * ((if -(h * speed h p.1) β€ p.2 then (1 : β) else 0) - | |
| (if 0 β€ p.2 then (1 : β) else 0)) βΞΌ.prod volume) | |
| (β« x, slope x * trace x βΞΌ) 0 := by | |
| have hd := hasDerivAt_integral_halfspace_difference_local hs hf hspeed | |
| hspeedlim hlim hspeedbound hbound hdom | |
| apply hd.congr_of_eventuallyEq | |
| filter_upwards [hInt] with h hh | |
| exact integral_prod _ (integrable_threshold_difference hh | |
| (measurable_const.mul (hspeed h)).neg) | |
| end Problem358 | |
| end | |
| end OAI | |