File size: 2,974 Bytes
b37e936
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Mathlib.MeasureTheory.Integral.Bochner.Basic

namespace OAI

/-! # A common density gives a strict oscillation bound for weighted means

This is the scalar estimate for the derivative of two positive-kernel
log transforms. All densities and products are integrated explicitly.
-/

open Set Filter MeasureTheory
noncomputable section
namespace RegularPointCoordinates
variable {Y : Type*} [MeasurableSpace Y] (μ : Measure Y)

theorem weighted_mean_minorization {r w f : Y → ℝ} {q l u : ℝ}
    (hr : Integrable r μ) (hw : Integrable w μ)
    (hfr : Integrable (fun x => f x*r x) μ) (hfw : Integrable (fun x => f x*w x) μ)
    (hr1 : (∫ x, r x ∂μ)=1) (hw1 : (∫ x, w x ∂μ)=1)
    (hmin : ∀ᵐ x ∂μ, q*r x ≤ w x) (hf : ∀ᵐ x ∂μ, l ≤ f x ∧ f x ≤ u) :
    q*(∫ x, f x*r x ∂μ)+(1-q)*l ≤ ∫ x, f x*w x ∂μ ∧
      (∫ x, f x*w x ∂μ) ≤ q*(∫ x, f x*r x ∂μ)+(1-q)*u := by
  let d := fun x => w x-q*r x
  have hd : Integrable d μ := hw.sub (hr.const_mul q)
  have hfd : Integrable (fun x => f x*d x) μ := by
    convert hfw.sub (hfr.const_mul q) using 1
    funext x
    change f x * (w x - q * r x) = f x * w x - q * (f x * r x)
    ring
  have hdint : (∫ x, d x ∂μ)=1-q := by
    rw [integral_sub hw (hr.const_mul q),integral_const_mul,hr1,hw1,mul_one]
  have hfdint : (∫ x, f x*d x ∂μ) = (∫ x, f x*w x ∂μ)-q*(∫ x, f x*r x ∂μ) := by
    have he : (fun x => f x*d x) = (fun x => f x*w x - q*(f x*r x)) := by
      funext x
      dsimp only [d]
      ring
    rw [he,integral_sub hfw (hfr.const_mul q),integral_const_mul]
  have hlo : (∫ x, l*d x ∂μ) ≤ ∫ x, f x*d x ∂μ := by
    apply integral_mono_ae (hd.const_mul l) hfd
    filter_upwards [hmin,hf] with x hx hf
    exact mul_le_mul_of_nonneg_right hf.1 (sub_nonneg.mpr hx)
  have hhi : (∫ x, f x*d x ∂μ) ≤ ∫ x, u*d x ∂μ := by
    apply integral_mono_ae hfd (hd.const_mul u)
    filter_upwards [hmin,hf] with x hx hf
    exact mul_le_mul_of_nonneg_right hf.2 (sub_nonneg.mpr hx)
  rw [integral_const_mul,hdint,hfdint] at hlo hhi
  constructor <;> linarith only [hlo,hhi]

theorem common_density_mean_difference {r w v f : Y → ℝ} {q l u : ℝ}
    (hr : Integrable r μ) (hw : Integrable w μ) (hv : Integrable v μ)
    (hfr : Integrable (fun x => f x*r x) μ) (hfw : Integrable (fun x => f x*w x) μ)
    (hfv : Integrable (fun x => f x*v x) μ)
    (hr1 : (∫ x, r x ∂μ)=1) (hw1 : (∫ x, w x ∂μ)=1) (hv1 : (∫ x, v x ∂μ)=1)
    (hwmin : ∀ᵐ x ∂μ, q*r x ≤ w x) (hvmin : ∀ᵐ x ∂μ, q*r x ≤ v x)
    (hf : ∀ᵐ x ∂μ, l ≤ f x ∧ f x ≤ u) :
    |(∫ x, f x*w x ∂μ)-(∫ x, f x*v x ∂μ)| ≤ (1-q)*(u-l) := by
  have hW := weighted_mean_minorization μ hr hw hfr hfw hr1 hw1 hwmin hf
  have hV := weighted_mean_minorization μ hr hv hfr hfv hr1 hv1 hvmin hf
  apply abs_le.mpr
  constructor <;> nlinarith only [hW.1,hW.2,hV.1,hV.2]

end RegularPointCoordinates

end

end OAI