Download data/lean/OAI/Geometry/CylinderCovering/Radial/Integral.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.34 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/CylinderCovering/Radial/Integral.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/CylinderCovering/Radial/Integral.lean
-
curl -L -o Integral.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/CylinderCovering/Radial/Integral.lean
9.34 kB
| import Mathlib | |
| namespace OAI | |
| open Set MeasureTheory | |
| noncomputable section | |
| namespace CylinderCovering.RadialIntegral | |
| theorem transverse_integral_bound {lam : β β β} {M c t : β} | |
| (_hM : 0 β€ M) (hlam : β x β uIcc c t, |lam x| β€ M) : | |
| |β« x in c..t, lam x * (x - t)| β€ M * (t - c) ^ 2 / 2 := by | |
| by_cases hct : c β€ t | |
| Β· have hbound : βα΅ x : β, x β Ioc c t β | |
| βlam x * (x - t)β β€ M * (t - x) := by | |
| filter_upwards [] with x hx | |
| have hxlam := hlam x (by simpa [uIcc_of_le hct] using | |
| (show x β Icc c t from β¨hx.1.le, hx.2β©)) | |
| rw [Real.norm_eq_abs, abs_mul, abs_of_nonpos (sub_nonpos.mpr hx.2)] | |
| calc | |
| |lam x| * -(x - t) β€ M * -(x - t) := | |
| mul_le_mul_of_nonneg_right hxlam (by linarith [hx.2]) | |
| _ = M * (t - x) := by ring | |
| have hi : IntervalIntegrable (fun x : β => M * (t - x)) volume c t := | |
| (continuous_const.mul (continuous_const.sub continuous_id)).intervalIntegrable _ _ | |
| have hb := intervalIntegral.norm_integral_le_of_norm_le hct hbound hi | |
| have heval : (β« x in c..t, M * (t - x)) = M * (t - c) ^ 2 / 2 := by | |
| rw [intervalIntegral.integral_const_mul, | |
| intervalIntegral.integral_sub (f := fun _ : β => t) (g := fun x : β => x) | |
| intervalIntegrable_const (continuous_id.intervalIntegrable c t)] | |
| simp only [intervalIntegral.integral_const, smul_eq_mul, integral_id] | |
| ring | |
| simpa only [Real.norm_eq_abs, heval] using hb | |
| Β· have htc : t β€ c := le_of_not_ge hct | |
| have hbound : βα΅ x : β, x β Ioc t c β | |
| βlam x * (x - t)β β€ M * (x - t) := by | |
| filter_upwards [] with x hx | |
| have hxlam := hlam x (by simpa [uIcc_of_ge htc] using | |
| (show x β Icc t c from β¨hx.1.le, hx.2β©)) | |
| rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (sub_nonneg.mpr hx.1.le)] | |
| exact mul_le_mul_of_nonneg_right hxlam (sub_nonneg.mpr hx.1.le) | |
| have hi : IntervalIntegrable (fun x : β => M * (x - t)) volume t c := | |
| (continuous_const.mul (continuous_id.sub continuous_const)).intervalIntegrable _ _ | |
| have hb := intervalIntegral.norm_integral_le_of_norm_le htc hbound hi | |
| have heval : (β« x in t..c, M * (x - t)) = M * (t - c) ^ 2 / 2 := by | |
| rw [intervalIntegral.integral_const_mul, | |
| intervalIntegral.integral_sub (f := fun x : β => x) (g := fun _ : β => t) | |
| (continuous_id.intervalIntegrable t c) intervalIntegrable_const] | |
| simp only [intervalIntegral.integral_const, smul_eq_mul, integral_id] | |
| ring | |
| rw [intervalIntegral.integral_symm, abs_neg] | |
| simpa only [Real.norm_eq_abs, heval] using hb | |
| theorem radial_integral_bound {lam : β β β} {M c t : β} | |
| (hlam : β x β uIcc c t, |lam x| β€ M) : | |
| |β« x in c..t, lam x| β€ M * |t - c| := by | |
| have hb := intervalIntegral.norm_integral_le_of_norm_le_const | |
| (a := c) (b := t) (C := M) (f := lam) (fun x hx => by | |
| simpa only [Real.norm_eq_abs] using hlam x (uIoc_subset_uIcc hx)) | |
| simpa only [Real.norm_eq_abs, mul_comm] using hb | |
| theorem integral_eq_sub_of_within_deriv | |
| {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E] | |
| {f f' : β β E} {a b c t : β} | |
| (hf : ContinuousOn f (Icc a b)) (hf' : ContinuousOn f' (Icc a b)) | |
| (hderiv : β x β Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) | |
| (hc : c β Icc a b) (ht : t β Icc a b) : | |
| (β« x in c..t, f' x) = f t - f c := by | |
| have forward : β c t : β, c β Icc a b β t β Icc a b β c β€ t β | |
| (β« x in c..t, f' x) = f t - f c := by | |
| intro c t hc ht hct | |
| have hsub : Icc c t β Icc a b := fun x hx => | |
| β¨hc.1.trans hx.1, hx.2.trans ht.2β© | |
| apply intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hct (hf.mono hsub) | |
| Β· intro x hx | |
| have hax : a < x := hc.1.trans_lt hx.1 | |
| have hxb : x < b := hx.2.trans_le ht.2 | |
| exact (hderiv x β¨hax.le, hxb.leβ©).hasDerivAt (Icc_mem_nhds hax hxb) | |
| Β· exact ContinuousOn.intervalIntegrable_of_Icc hct (hf'.mono hsub) | |
| by_cases hct : c β€ t | |
| Β· exact forward c t hc ht hct | |
| Β· rw [intervalIntegral.integral_symm, forward t c ht hc (le_of_not_ge hct)] | |
| abel | |
| theorem integral_footprint {lam : β β β} {M L d c t m rho R s : β} | |
| (hM : 0 β€ M) (hL : 0 β€ L) (hd : 0 β€ d) | |
| (hlam : β x β uIcc c t, |lam x| β€ M) | |
| (htc : |t - c| β€ d) (htm : |t - m| β€ d / 2) | |
| (hs : |s| β€ L) (hrho : 0 β€ rho) (hR : rho β€ R) : | |
| let u := rho + s * (β« x in c..t, lam x); | |
| let v := t * u + s * (β« x in c..t, lam x * (x - t)); | |
| -(L * M) * d β€ u β§ u β€ R + (L * M) * d β§ | |
| |v - m * u| β€ d / 2 * |u| + (L * M / 2) * d ^ 2 := by | |
| dsimp only | |
| have hI : |β« x in c..t, lam x| β€ M * d := | |
| (radial_integral_bound hlam).trans (mul_le_mul_of_nonneg_left htc hM) | |
| have hsq : (t - c) ^ 2 β€ d ^ 2 := by | |
| have := sq_le_sqβ (abs_nonneg (t - c)) hd |>.mpr htc | |
| simpa only [sq_abs] using this | |
| have hJ : |β« x in c..t, lam x * (x - t)| β€ M * d ^ 2 / 2 := | |
| (transverse_integral_bound hM hlam).trans (by nlinarith [mul_le_mul_of_nonneg_left hsq hM]) | |
| have hrad : |s * (β« x in c..t, lam x)| β€ L * M * d := by | |
| rw [abs_mul] | |
| calc | |
| |s| * |β« x in c..t, lam x| β€ L * (M * d) := | |
| mul_le_mul hs hI (abs_nonneg _) hL | |
| _ = L * M * d := by ring | |
| have htrans : |s * (β« x in c..t, lam x * (x - t))| β€ | |
| (L * M / 2) * d ^ 2 := by | |
| rw [abs_mul] | |
| calc | |
| |s| * |β« x in c..t, lam x * (x - t)| β€ L * (M * d ^ 2 / 2) := | |
| mul_le_mul hs hJ (abs_nonneg _) hL | |
| _ = (L * M / 2) * d ^ 2 := by ring | |
| refine β¨?_, ?_, ?_β© | |
| Β· have := (abs_le.mp hrad).1 | |
| linarith | |
| Β· have := (abs_le.mp hrad).2 | |
| linarith | |
| Β· rw [show t * (rho + s * (β« x in c..t, lam x)) + | |
| s * (β« x in c..t, lam x * (x - t)) - | |
| m * (rho + s * (β« x in c..t, lam x)) = | |
| (t - m) * (rho + s * (β« x in c..t, lam x)) + | |
| s * (β« x in c..t, lam x * (x - t)) by ring] | |
| refine (abs_add_le _ _).trans ?_ | |
| rw [abs_mul] | |
| exact add_le_add (mul_le_mul_of_nonneg_right htm (abs_nonneg _)) htrans | |
| theorem aligned_increment | |
| {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E] | |
| {w : β β E} {lam : β β β} {a b c t : β} {p q : E} | |
| (hw : ContinuousOn w (Icc a b)) (hlam : ContinuousOn lam (Icc a b)) | |
| (hderiv : β x β Icc a b, | |
| HasDerivWithinAt w (lam x β’ (p + x β’ q)) (Icc a b) x) | |
| (hc : c β Icc a b) (ht : t β Icc a b) : | |
| w t - w c = (β« x in c..t, lam x) β’ (p + t β’ q) + | |
| (β« x in c..t, lam x * (x - t)) β’ q := by | |
| have hsub : uIcc c t β Icc a b := uIcc_subset_Icc hc ht | |
| have hvel : ContinuousOn (fun x => lam x β’ (p + x β’ q)) (Icc a b) := | |
| hlam.smul (continuous_const.add (continuous_id.smul continuous_const)).continuousOn | |
| rw [β integral_eq_sub_of_within_deriv hw hvel hderiv hc ht] | |
| have hpoint : (fun x => lam x β’ (p + x β’ q)) = | |
| (fun x => lam x β’ (p + t β’ q) + (lam x * (x - t)) β’ q) := by | |
| funext x | |
| module | |
| rw [hpoint] | |
| have hrad : IntervalIntegrable (fun x => lam x β’ (p + t β’ q)) volume c t := | |
| ((hlam.mono hsub).smul continuousOn_const).intervalIntegrable | |
| have htrans : IntervalIntegrable (fun x => (lam x * (x - t)) β’ q) volume c t := | |
| (((hlam.mono hsub).mul (continuous_id.sub continuous_const).continuousOn).smul | |
| continuousOn_const).intervalIntegrable | |
| rw [intervalIntegral.integral_add hrad htrans] | |
| simp only [intervalIntegral.integral_smul_const] | |
| theorem aligned_frozen_intercept | |
| {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E] | |
| {w : β β E} {lam : β β β} {a b c t rho s : β} {p q p0 : E} | |
| (hw : ContinuousOn w (Icc a b)) (hlam : ContinuousOn lam (Icc a b)) | |
| (hderiv : β x β Icc a b, | |
| HasDerivWithinAt w (lam x β’ (p + x β’ q)) (Icc a b) x) | |
| (hc : c β Icc a b) (ht : t β Icc a b) : | |
| let u := rho + s * (β« x in c..t, lam x); | |
| let v := t * u + s * (β« x in c..t, lam x * (x - t)); | |
| p0 + rho β’ (p + t β’ q) + s β’ (w t - w c) = p0 + u β’ p + v β’ q := by | |
| dsimp only | |
| rw [aligned_increment hw hlam hderiv hc ht] | |
| module | |
| theorem aligned_footprint | |
| {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E] | |
| {w : β β E} {lam : β β β} | |
| {a b c t m rho R s M L d : β} {p q p0 : E} | |
| (hw : ContinuousOn w (Icc a b)) (hlam : ContinuousOn lam (Icc a b)) | |
| (hderiv : β x β Icc a b, | |
| HasDerivWithinAt w (lam x β’ (p + x β’ q)) (Icc a b) x) | |
| (hc : c β Icc a b) (ht : t β Icc a b) | |
| (hM : 0 β€ M) (hL : 0 β€ L) (hd : 0 β€ d) | |
| (hbound : β x β Icc a b, |lam x| β€ M) | |
| (htc : |t - c| β€ d) (htm : |t - m| β€ d / 2) | |
| (hs : |s| β€ L) (hrho : 0 β€ rho) (hR : rho β€ R) : | |
| β u v : β, | |
| p0 + rho β’ (p + t β’ q) + s β’ (w t - w c) = p0 + u β’ p + v β’ q β§ | |
| -(L * M) * d β€ u β§ u β€ R + (L * M) * d β§ | |
| |v - m * u| β€ d / 2 * |u| + (L * M / 2) * d ^ 2 := by | |
| let u := rho + s * (β« x in c..t, lam x) | |
| let v := t * u + s * (β« x in c..t, lam x * (x - t)) | |
| refine β¨u, v, aligned_frozen_intercept hw hlam hderiv hc ht, ?_β© | |
| exact integral_footprint hM hL hd | |
| (fun x hx => hbound x (uIcc_subset_Icc hc ht hx)) htc htm hs hrho hR | |
| end CylinderCovering.RadialIntegral | |
| end | |
| end OAI | |