|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Yizheng Zhu. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Yizheng Zhu |
| 5 | +-/ |
| 6 | +import Mathlib.Analysis.Normed.Group.Bounded |
| 7 | +import Mathlib.Analysis.Normed.Group.Uniform |
| 8 | +import Mathlib.Analysis.Normed.MulAction |
| 9 | +import Mathlib.Order.SuccPred.IntervalSucc |
| 10 | +import Mathlib.Topology.EMetricSpace.BoundedVariation |
| 11 | + |
| 12 | +/-! |
| 13 | +# Absolutely Continuous Functions |
| 14 | +
|
| 15 | +This file defines absolutely continuous functions on a closed interval `uIcc a b` and proves some |
| 16 | +basic properties about absolutely continuous functions. |
| 17 | +
|
| 18 | +A function `f` is *absolutely continuous* on `uIcc a b` if for any `ε > 0`, there is `δ > 0` such |
| 19 | +that for any finite disjoint collection of intervals `uIoc (a i) (b i)` for `i < n` where `a i`, |
| 20 | +`b i` are all in `uIcc a b` for `i < n`, if `∑ i ∈ range n, dist (a i) (b i) < δ`, then |
| 21 | +`∑ i ∈ range n, dist (f (a i)) (f (b i)) < ε`. |
| 22 | +
|
| 23 | +We give a filter version of the definition of absolutely continuous functions in |
| 24 | +`AbsolutelyContinuousOnInterval` based on `AbsolutelyContinuousOnInterval.totalLengthFilter` |
| 25 | +and `AbsolutelyContinuousOnInterval.disjWithin` and prove its equivalence with the `ε`-`δ` |
| 26 | +definition in `absolutelyContinuousOnInterval_iff`. |
| 27 | +
|
| 28 | +We use the filter version to prove that absolutely continuous functions are closed under |
| 29 | +* addition - `AbsolutelyContinuousOnInterval.fun_add`, `AbsolutelyContinuousOnInterval.add`; |
| 30 | +* negation - `AbsolutelyContinuousOnInterval.fun_neg`, `AbsolutelyContinuousOnInterval.neg`; |
| 31 | +* subtraction - `AbsolutelyContinuousOnInterval.fun_sub`, `AbsolutelyContinuousOnInterval.sub`; |
| 32 | +* scalar multiplication - `AbsolutelyContinuousOnInterval.const_smul`, |
| 33 | +`AbsolutelyContinuousOnInterval.const_mul`; |
| 34 | +* multiplication - `AbsolutelyContinuousOnInterval.fun_smul`, `AbsolutelyContinuousOnInterval.smul`, |
| 35 | +`AbsolutelyContinuousOnInterval.fun_mul`, `AbsolutelyContinuousOnInterval.mul`; |
| 36 | +and that absolutely continuous implies uniform continuous in |
| 37 | +`AbsolutelyContinuousOnInterval.uniformlyContinuousOn` |
| 38 | +
|
| 39 | +We use the the `ε`-`δ` definition to prove that |
| 40 | +* Lipschitz continuous functions are absolutely continuous - |
| 41 | +`LipschitzOnWith.absolutelyContinuousOnInterval`; |
| 42 | +* absolutely continuous functions have bounded variation - |
| 43 | +`AbsolutelyContinuousOnInterval.boundedVariationOn`. |
| 44 | +
|
| 45 | +## Tags |
| 46 | +absolutely continuous |
| 47 | +-/ |
| 48 | + |
| 49 | +variable {X F : Type*} [PseudoMetricSpace X] [SeminormedAddCommGroup F] |
| 50 | + |
| 51 | +open Set Filter Function |
| 52 | + |
| 53 | +open scoped Topology NNReal |
| 54 | + |
| 55 | +namespace AbsolutelyContinuousOnInterval |
| 56 | + |
| 57 | +/-- The filter on the collection of all the finite sequences of `uIoc` intervals induced by the |
| 58 | +function that maps the finite sequence of the intervals to the total length of the intervals. |
| 59 | +Details: |
| 60 | +1. Technically the filter is on `ℕ × (ℕ → X × X)`. A finite sequence `uIoc (a i) (b i)`, `i < n` |
| 61 | +is represented by any `E : ℕ × (ℕ → X × X)` which satisfies `E.1 = n` and `E.2 i = (a i, b i)` for |
| 62 | +`i < n`. Its total length is `∑ i ∈ Finset.range n, dist (a i) (b i)`. |
| 63 | +2. For a sequence `G : ℕ → ℕ × (ℕ → X × X)`, `G` convergence along `totalLengthFilter` means that |
| 64 | +the total length of `G j`, i.e., `∑ i ∈ Finset.range (G j).1, dist ((G j).2 i).1 ((G j).2 i).2)`, |
| 65 | +tends to `0` as `j` tends to infinity. |
| 66 | +-/ |
| 67 | +def totalLengthFilter : Filter (ℕ × (ℕ → X × X)) := Filter.comap |
| 68 | + (fun E ↦ ∑ i ∈ Finset.range E.1, dist (E.2 i).1 (E.2 i).2) (𝓝 0) |
| 69 | + |
| 70 | +lemma hasBasis_totalLengthFilter : totalLengthFilter.HasBasis (fun (ε : ℝ) => 0 < ε) |
| 71 | + (fun (ε : ℝ) => |
| 72 | + {E : ℕ × (ℕ → X × X) | ∑ i ∈ Finset.range E.1, dist (E.2 i).1 (E.2 i).2 < ε}) := by |
| 73 | + convert Filter.HasBasis.comap (α := ℝ) _ (nhds_basis_Ioo_pos _) using 1 |
| 74 | + ext ε E |
| 75 | + simp only [mem_setOf_eq, zero_sub, zero_add, mem_preimage, mem_Ioo, iff_and_self] |
| 76 | + suffices 0 ≤ ∑ i ∈ Finset.range E.1, dist (E.2 i).1 (E.2 i).2 by grind |
| 77 | + exact Finset.sum_nonneg (fun _ _ ↦ dist_nonneg) |
| 78 | + |
| 79 | +/-- The subcollection of all the finite sequences of `uIoc` intervals consisting of |
| 80 | +`uIoc (a i) (b i)`, `i < n` where `a i`, `b i` are all in `uIcc a b` for `i < n` and |
| 81 | +`uIoc (a i) (b i)` are mutually disjoint for `i < n`. Technically the finite sequence |
| 82 | +`uIoc (a i) (b i)`, `i < n` is represented by any `E : ℕ × (ℕ → ℝ × ℝ)` which satisfies |
| 83 | +`E.1 = n` and `E.2 i = (a i, b i)` for `i < n`. -/ |
| 84 | +def disjWithin (a b : ℝ) := {E : ℕ × (ℕ → ℝ × ℝ) | |
| 85 | + (∀ i ∈ Finset.range E.1, (E.2 i).1 ∈ uIcc a b ∧ (E.2 i).2 ∈ uIcc a b) ∧ |
| 86 | + Set.PairwiseDisjoint (Finset.range E.1) (fun i ↦ uIoc (E.2 i).1 (E.2 i).2)} |
| 87 | + |
| 88 | +lemma disjWithin_comm (a b : ℝ) : disjWithin a b = disjWithin b a := by |
| 89 | + rw [disjWithin, disjWithin, uIcc_comm] |
| 90 | + |
| 91 | +lemma disjWithin_mono {a b c d : ℝ} (habcd : uIcc c d ⊆ uIcc a b) : |
| 92 | + disjWithin c d ⊆ disjWithin a b := by |
| 93 | + simp +contextual only [disjWithin, Finset.mem_range, setOf_subset_setOf, and_true, |
| 94 | + and_imp, Prod.forall] |
| 95 | + exact fun (n I h _ i hi) ↦ ⟨habcd (h i hi).left, habcd (h i hi).right⟩ |
| 96 | + |
| 97 | +/-- `AbsolutelyContinuousOnInterval f a b`: A function `f` is *absolutely continuous* on `uIcc a b` |
| 98 | +if the function which (intuitively) maps `uIoc (a i) (b i)`, `i < n` to |
| 99 | +`∑ i ∈ Finset.range n, dist (f (a i)) (f (b i))` tendsto `𝓝 0` wrt `totalLengthFilter` restricted |
| 100 | +to `disjWithin a b`. This is equivalent to the traditional `ε`-`δ` definition: for any `ε > 0`, |
| 101 | +there is `δ > 0` such that for any finite disjoint collection of intervals `uIoc (a i) (b i)` for |
| 102 | +`i < n` where `a i`, `b i` are all in `uIcc a b` for `i < n`, if |
| 103 | +`∑ i ∈ range n, dist (a i) (b i) < δ`, then `∑ i ∈ range n, dist (f (a i)) (f (b i)) < ε`. -/ |
| 104 | +def _root_.AbsolutelyContinuousOnInterval (f : ℝ → X) (a b : ℝ) := |
| 105 | + Tendsto (fun E ↦ ∑ i ∈ Finset.range E.1, dist (f (E.2 i).1) (f (E.2 i).2)) |
| 106 | + (totalLengthFilter ⊓ 𝓟 (disjWithin a b)) (𝓝 0) |
| 107 | + |
| 108 | +/-- The traditional `ε`-`δ` definition of absolutely continuous: A function `f` is |
| 109 | +*absolutely continuous* on `uIcc a b` if for any `ε > 0`, there is `δ > 0` such that for |
| 110 | +any finite disjoint collection of intervals `uIoc (a i) (b i)` for `i < n` where `a i`, `b i` are |
| 111 | +all in `uIcc a b` for `i < n`, if `∑ i ∈ range n, dist (a i) (b i) < δ`, then |
| 112 | +`∑ i ∈ range n, dist (f (a i)) (f (b i)) < ε`. -/ |
| 113 | +theorem _root_.absolutelyContinuousOnInterval_iff (f : ℝ → X) (a b : ℝ) : |
| 114 | + AbsolutelyContinuousOnInterval f a b ↔ |
| 115 | + ∀ ε > (0 : ℝ), ∃ δ > (0 : ℝ), ∀ E, E ∈ disjWithin a b → |
| 116 | + ∑ i ∈ Finset.range E.1, dist (E.2 i).1 (E.2 i).2 < δ → |
| 117 | + ∑ i ∈ Finset.range E.1, dist (f (E.2 i).1) (f (E.2 i).2) < ε := by |
| 118 | + simp [AbsolutelyContinuousOnInterval, Metric.tendsto_nhds, |
| 119 | + Filter.HasBasis.eventually_iff (hasBasis_totalLengthFilter.inf_principal _), |
| 120 | + imp.swap, abs_of_nonneg (Finset.sum_nonneg (fun _ _ ↦ dist_nonneg))] |
| 121 | + |
| 122 | +variable {f g : ℝ → X} {a b c d : ℝ} |
| 123 | + |
| 124 | +theorem symm (hf : AbsolutelyContinuousOnInterval f a b) : |
| 125 | + AbsolutelyContinuousOnInterval f b a := by |
| 126 | + simp_all [AbsolutelyContinuousOnInterval, disjWithin_comm] |
| 127 | + |
| 128 | +theorem mono (hf : AbsolutelyContinuousOnInterval f a b) (habcd : uIcc c d ⊆ uIcc a b) : |
| 129 | + AbsolutelyContinuousOnInterval f c d := by |
| 130 | + simp only [AbsolutelyContinuousOnInterval, Tendsto] at * |
| 131 | + refine le_trans (Filter.map_mono ?_) hf |
| 132 | + gcongr; exact disjWithin_mono habcd |
| 133 | + |
| 134 | +variable {f g : ℝ → F} |
| 135 | + |
| 136 | +theorem fun_add (hf : AbsolutelyContinuousOnInterval f a b) |
| 137 | + (hg : AbsolutelyContinuousOnInterval g a b) : |
| 138 | + AbsolutelyContinuousOnInterval (fun x ↦ f x + g x) a b := by |
| 139 | + apply squeeze_zero (fun t ↦ ?_) (fun t ↦ ?_) (by simpa using hf.add hg) |
| 140 | + · exact Finset.sum_nonneg (fun i hi ↦ by positivity) |
| 141 | + · rw [← Finset.sum_add_distrib] |
| 142 | + gcongr |
| 143 | + exact dist_add_add_le _ _ _ _ |
| 144 | + |
| 145 | +theorem add (hf : AbsolutelyContinuousOnInterval f a b) |
| 146 | + (hg : AbsolutelyContinuousOnInterval g a b) : |
| 147 | + AbsolutelyContinuousOnInterval (f + g) a b := |
| 148 | + hf.fun_add hg |
| 149 | + |
| 150 | +theorem fun_neg (hf : AbsolutelyContinuousOnInterval f a b) : |
| 151 | + AbsolutelyContinuousOnInterval (fun x ↦ -(f x)) a b := by |
| 152 | + apply squeeze_zero (fun t ↦ ?_) (fun t ↦ ?_) (by simpa using hf) |
| 153 | + · exact Finset.sum_nonneg (fun i hi ↦ by positivity) |
| 154 | + · simp |
| 155 | + |
| 156 | +theorem neg (hf : AbsolutelyContinuousOnInterval f a b) : |
| 157 | + AbsolutelyContinuousOnInterval (-f) a b := |
| 158 | + hf.fun_neg |
| 159 | + |
| 160 | +theorem fun_sub (hf : AbsolutelyContinuousOnInterval f a b) |
| 161 | + (hg : AbsolutelyContinuousOnInterval g a b) : |
| 162 | + AbsolutelyContinuousOnInterval (fun x ↦ f x - g x) a b := by |
| 163 | + simp_rw [fun x ↦ show f x - g x = f x + (-(g x)) by abel] |
| 164 | + exact hf.fun_add (hg.fun_neg) |
| 165 | + |
| 166 | +theorem sub (hf : AbsolutelyContinuousOnInterval f a b) |
| 167 | + (hg : AbsolutelyContinuousOnInterval g a b) : |
| 168 | + AbsolutelyContinuousOnInterval (f - g) a b := |
| 169 | + hf.fun_sub hg |
| 170 | + |
| 171 | +theorem const_smul {M : Type*} [SeminormedRing M] [Module M F] [NormSMulClass M F] |
| 172 | + (α : M) (hf : AbsolutelyContinuousOnInterval f a b) : |
| 173 | + AbsolutelyContinuousOnInterval (fun x ↦ α • f x) a b := by |
| 174 | + apply squeeze_zero (fun t ↦ ?_) (fun t ↦ ?_) (by simpa using hf.const_mul ‖α‖) |
| 175 | + · exact Finset.sum_nonneg (fun i hi ↦ by positivity) |
| 176 | + · rw [Finset.mul_sum] |
| 177 | + gcongr |
| 178 | + simp only [dist_smul₀] |
| 179 | + rfl |
| 180 | + |
| 181 | +theorem const_mul {f : ℝ → ℝ} (α : ℝ) (hf : AbsolutelyContinuousOnInterval f a b) : |
| 182 | + AbsolutelyContinuousOnInterval (fun x ↦ α * f x) a b := |
| 183 | + hf.const_smul α |
| 184 | + |
| 185 | +lemma uniformity_eq_comap_totalLengthFilter : |
| 186 | + uniformity X = comap (fun x ↦ (1, fun _ ↦ x)) totalLengthFilter := by |
| 187 | + refine Filter.HasBasis.eq_of_same_basis Metric.uniformity_basis_dist ?_ |
| 188 | + convert hasBasis_totalLengthFilter.comap _ |
| 189 | + simp |
| 190 | + |
| 191 | +/-- If `f` is absolutely continuous on `uIcc a b`, then `f` is uniformly continuous on `uIcc a b`. |
| 192 | +-/ |
| 193 | +theorem uniformlyContinuousOn (hf : AbsolutelyContinuousOnInterval f a b) : |
| 194 | + UniformContinuousOn f (uIcc a b) := by |
| 195 | + simp only [UniformContinuousOn, Filter.tendsto_iff_comap, uniformity_eq_comap_totalLengthFilter] |
| 196 | + simp only [AbsolutelyContinuousOnInterval, Filter.tendsto_iff_comap] at hf |
| 197 | + convert Filter.comap_mono hf |
| 198 | + · simp only [comap_inf, comap_principal] |
| 199 | + congr |
| 200 | + ext p |
| 201 | + simp only [disjWithin, Finset.mem_range, preimage_setOf_eq, Nat.lt_one_iff, |
| 202 | + forall_eq, mem_setOf_eq, mem_prod] |
| 203 | + simp |
| 204 | + · simp only [totalLengthFilter, comap_comap] |
| 205 | + congr 1 |
| 206 | + |
| 207 | +/-- If `f` is absolutely continuous on `uIcc a b`, then `f` is continuous on `uIcc a b`. -/ |
| 208 | +theorem continuousOn (hf : AbsolutelyContinuousOnInterval f a b) : |
| 209 | + ContinuousOn f (uIcc a b) := |
| 210 | + hf.uniformlyContinuousOn.continuousOn |
| 211 | + |
| 212 | +/-- If `f` is absolutely continuous on `uIcc a b`, then `f` is bounded on `uIcc a b`. -/ |
| 213 | +theorem exists_bound (hf : AbsolutelyContinuousOnInterval f a b) : |
| 214 | + ∃ (C : ℝ), ∀ x ∈ uIcc a b, ‖f x‖ ≤ C := |
| 215 | + isCompact_Icc.exists_bound_of_continuousOn (hf.continuousOn) |
| 216 | + |
| 217 | +/-- If `f` and `g` are absolutely continuous on `uIcc a b`, then `f • g` is absolutely continuous |
| 218 | +on `uIcc a b`. -/ |
| 219 | +theorem fun_smul {M : Type*} [SeminormedRing M] [Module M F] [NormSMulClass M F] |
| 220 | + {f : ℝ → M} {g : ℝ → F} |
| 221 | + (hf : AbsolutelyContinuousOnInterval f a b) (hg : AbsolutelyContinuousOnInterval g a b) : |
| 222 | + AbsolutelyContinuousOnInterval (fun x ↦ f x • g x) a b := by |
| 223 | + obtain ⟨C, hC⟩ := hf.exists_bound |
| 224 | + obtain ⟨D, hD⟩ := hg.exists_bound |
| 225 | + unfold AbsolutelyContinuousOnInterval at hf hg |
| 226 | + apply squeeze_zero' ?_ ?_ |
| 227 | + (by simpa using (hg.const_mul C).add (hf.const_mul D)) |
| 228 | + · exact Filter.Eventually.of_forall <| fun _ ↦ Finset.sum_nonneg (fun i hi ↦ by exact dist_nonneg) |
| 229 | + rw [eventually_inf_principal] |
| 230 | + filter_upwards with (n, I) hnI |
| 231 | + simp only [Finset.mul_sum, ← Finset.sum_add_distrib] |
| 232 | + gcongr with i hi |
| 233 | + trans dist (f (I i).1 • g (I i).1) (f (I i).1 • g (I i).2) + |
| 234 | + dist (f (I i).1 • g (I i).2) (f (I i).2 • g (I i).2) |
| 235 | + · exact dist_triangle _ _ _ |
| 236 | + · simp only [disjWithin, mem_setOf_eq] at hnI |
| 237 | + gcongr |
| 238 | + · rw [dist_smul₀] |
| 239 | + gcongr |
| 240 | + exact hC _ (hnI.left i hi |>.left) |
| 241 | + · rw [mul_comm] |
| 242 | + grw [dist_pair_smul] |
| 243 | + gcongr |
| 244 | + rw [dist_zero_right] |
| 245 | + exact hD _ (hnI.left i hi |>.right) |
| 246 | + |
| 247 | +/-- If `f` and `g` are absolutely continuous on `uIcc a b`, then `f • g` is absolutely continuous |
| 248 | +on `uIcc a b`. -/ |
| 249 | +theorem smul {M : Type*} [SeminormedRing M] [Module M F] [NormSMulClass M F] |
| 250 | + {f : ℝ → M} {g : ℝ → F} |
| 251 | + (hf : AbsolutelyContinuousOnInterval f a b) (hg : AbsolutelyContinuousOnInterval g a b) : |
| 252 | + AbsolutelyContinuousOnInterval (f • g) a b := |
| 253 | + hf.fun_smul hg |
| 254 | + |
| 255 | +/-- If `f` and `g` are absolutely continuous on `uIcc a b`, then `f * g` is absolutely continuous |
| 256 | +on `uIcc a b`. -/ |
| 257 | +theorem fun_mul {f g : ℝ → ℝ} |
| 258 | + (hf : AbsolutelyContinuousOnInterval f a b) (hg : AbsolutelyContinuousOnInterval g a b) : |
| 259 | + AbsolutelyContinuousOnInterval (fun x ↦ f x * g x) a b := |
| 260 | + hf.fun_smul hg |
| 261 | + |
| 262 | +/-- If `f` and `g` are absolutely continuous on `uIcc a b`, then `f * g` is absolutely continuous |
| 263 | +on `uIcc a b`. -/ |
| 264 | +theorem mul {f g : ℝ → ℝ} |
| 265 | + (hf : AbsolutelyContinuousOnInterval f a b) (hg : AbsolutelyContinuousOnInterval g a b) : |
| 266 | + AbsolutelyContinuousOnInterval (fun x ↦ f x * g x) a b := |
| 267 | + hf.fun_mul hg |
| 268 | + |
| 269 | +/-- If `f` is Lipschitz on `uIcc a b`, then `f` is absolutely continuous on `uIcc a b`. -/ |
| 270 | +theorem _root_.LipschitzOnWith.absolutelyContinuousOnInterval {f : ℝ → X} {K : ℝ≥0} |
| 271 | + (hfK : LipschitzOnWith K f (uIcc a b)) : AbsolutelyContinuousOnInterval f a b := by |
| 272 | + rw [absolutelyContinuousOnInterval_iff] |
| 273 | + intro ε hε |
| 274 | + refine ⟨ε / (K + 1), by positivity, fun (n, I) hnI₁ hnI₂ ↦ ?_⟩ |
| 275 | + calc |
| 276 | + _ ≤ ∑ i ∈ Finset.range n, K * dist (I i).1 (I i).2 := by |
| 277 | + apply Finset.sum_le_sum |
| 278 | + intro i hi |
| 279 | + have := hfK (hnI₁.left i hi).left (hnI₁.left i hi).right |
| 280 | + apply ENNReal.toReal_mono (Ne.symm (not_eq_of_beq_eq_false rfl)) at this |
| 281 | + rwa [ENNReal.toReal_mul, ← dist_edist, ← dist_edist] at this |
| 282 | + _ = K * ∑ i ∈ Finset.range n, dist (I i).1 (I i).2 := by symm; exact Finset.mul_sum _ _ _ |
| 283 | + _ ≤ K * (ε / (K + 1)) := by gcongr |
| 284 | + _ < (K + 1) * (ε / (K + 1)) := by gcongr; linarith |
| 285 | + _ = ε := by field_simp |
| 286 | + |
| 287 | +/-- If `f` is absolutely continuous on `uIcc a b`, then `f` has bounded variation on `uIcc a b`. -/ |
| 288 | +theorem boundedVariationOn (hf : AbsolutelyContinuousOnInterval f a b) : |
| 289 | + BoundedVariationOn f (uIcc a b) := by |
| 290 | + -- We may assume wlog that `a ≤ b`. |
| 291 | + wlog hab₀ : a ≤ b generalizing a b |
| 292 | + · specialize @this b a hf.symm (by linarith) |
| 293 | + rwa [uIcc_comm] |
| 294 | + rw [uIcc_of_le hab₀] |
| 295 | + -- Split the cases `a = b` (which is trivial) and `a < b`. |
| 296 | + rcases hab₀.eq_or_lt with rfl | hab |
| 297 | + · simp [BoundedVariationOn] |
| 298 | + -- Now remains the case `a < b`. |
| 299 | + -- Use the `ε`-`δ` definition of AC to get a `δ > 0` such that whenever a finite set of disjoint |
| 300 | + -- intervals `uIoc (a i) (b i)`, `i < n` have total length `< δ` and `a i, b i` are all in |
| 301 | + -- `[a, b]`, we have `∑ i ∈ range n, dist (f (a i)) (f (b i)) < 1`. |
| 302 | + rw [absolutelyContinuousOnInterval_iff] at hf |
| 303 | + obtain ⟨δ, hδ₁, hδ₂⟩ := hf 1 (by linarith) |
| 304 | + have hab₁ : 0 < b - a := by linarith |
| 305 | + -- Split `[a, b]` into subintervals `[a + i * δ', a + (i + 1) * δ']` for `i = 0, ..., n`, where |
| 306 | + -- `a + (n + 1) * δ' = b` and `δ' < δ`. |
| 307 | + obtain ⟨n, hn⟩ := exists_nat_one_div_lt (div_pos hδ₁ hab₁) |
| 308 | + set δ' := (b - a) / (n + 1) |
| 309 | + have hδ₃ : δ' < δ := by |
| 310 | + dsimp only [δ'] |
| 311 | + convert mul_lt_mul_of_pos_right hn hab₁ using 1 <;> field_simp |
| 312 | + have h_mono : Monotone fun (i : ℕ) ↦ a + ↑i * δ' := by |
| 313 | + apply Monotone.const_add |
| 314 | + apply Monotone.mul_const Nat.mono_cast |
| 315 | + simp only [δ'] |
| 316 | + refine div_nonneg ?_ ?_ <;> linarith |
| 317 | + -- The variation of `f` on `[a, b]` is the sum of the variations on these subintervals. |
| 318 | + have v_sum : eVariationOn f (Icc a b) = |
| 319 | + ∑ i ∈ Finset.range (n + 1), eVariationOn f (Icc (a + i * δ') (a + (i + 1) * δ')) := by |
| 320 | + convert eVariationOn.sum' f (I := fun i ↦ a + i * δ') h_mono |>.symm |
| 321 | + · simp |
| 322 | + · simp only [Nat.cast_add, Nat.cast_one, δ']; field_simp; abel |
| 323 | + · norm_cast |
| 324 | + -- The variation of `f` on any subinterval `[x, y]` of `[a, b]` of length `< δ` is `≤ 1`. |
| 325 | + have v_each (x y : ℝ) (_ : a ≤ x) (_ : x ≤ y) (_ : y < x + δ) (_ : y ≤ b) : |
| 326 | + eVariationOn f (Icc x y) ≤ 1 := by |
| 327 | + simp only [eVariationOn, iSup_le_iff] |
| 328 | + intro p |
| 329 | + obtain ⟨hp₁, hp₂⟩ := p.2.property |
| 330 | + -- Focus on a partition `p` of `[x, y]` and show its variation with `f` is `≤ 1`. |
| 331 | + have vf : ∑ i ∈ Finset.range p.1, dist (f (p.2.val i)) (f (p.2.val (i + 1))) < 1 := by |
| 332 | + apply hδ₂ (p.1, (fun i ↦ (p.2.val i, p.2.val (i + 1)))) |
| 333 | + · constructor |
| 334 | + · have : Icc x y ⊆ uIcc a b := by rw [uIcc_of_le hab₀]; gcongr |
| 335 | + intro i hi |
| 336 | + constructor <;> exact this (hp₂ _) |
| 337 | + · rw [PairwiseDisjoint] |
| 338 | + convert hp₁.pairwise_disjoint_on_Ioc_succ.set_pairwise (Finset.range p.1) using 3 |
| 339 | + rw [uIoc_of_le (hp₁ (by omega))] |
| 340 | + rfl |
| 341 | + · suffices p.2.val p.1 - p.2.val 0 < δ by |
| 342 | + convert this |
| 343 | + rw [← Finset.sum_range_sub] |
| 344 | + congr; ext i |
| 345 | + rw [dist_comm, Real.dist_eq, abs_eq_self.mpr] |
| 346 | + linarith [@hp₁ i (i + 1) (by omega)] |
| 347 | + linarith [mem_Icc.mp (hp₂ p.1), mem_Icc.mp (hp₂ 0)] |
| 348 | + -- Reduce edist in the goal to dist and clear up |
| 349 | + have veq: (∑ i ∈ Finset.range p.1, edist (f (p.2.val (i + 1))) (f (p.2.val i))).toReal = |
| 350 | + ∑ i ∈ Finset.range p.1, dist (f (p.2.val i)) (f (p.2.val (i + 1))) := by |
| 351 | + rw [ENNReal.toReal_sum (by simp [edist_ne_top])] |
| 352 | + simp_rw [← dist_edist]; congr; ext i; nth_rw 1 [dist_comm] |
| 353 | + have not_top : ∑ i ∈ Finset.range p.1, edist (f (p.2.val (i + 1))) (f (p.2.val i)) ≠ ⊤ := by |
| 354 | + simp [edist_ne_top] |
| 355 | + rw [← ENNReal.ofReal_toReal not_top] |
| 356 | + convert ENNReal.ofReal_le_ofReal (veq.symm ▸ vf.le) |
| 357 | + simp |
| 358 | + -- Reduce to goal that the variation of `f` on each of these subintervals is finite. |
| 359 | + simp only [BoundedVariationOn, v_sum, ne_eq, ENNReal.sum_eq_top, Finset.mem_range, not_exists, |
| 360 | + not_and] |
| 361 | + intro i hi |
| 362 | + -- Reduce finiteness to `≤ 1`. |
| 363 | + suffices eVariationOn f (Icc (a + i * δ') (a + (i + 1) * δ')) ≤ 1 from |
| 364 | + fun hC ↦ by simp [hC] at this |
| 365 | + -- Verify that `[a + i * δ', a + (i + 1) * δ']` is indeed a subinterval of `[a, b]` |
| 366 | + apply v_each |
| 367 | + · convert h_mono (show 0 ≤ i by omega); simp |
| 368 | + · convert h_mono (show i ≤ i + 1 by omega); norm_cast |
| 369 | + · rw [add_mul, ← add_assoc]; simpa |
| 370 | + · convert h_mono (show i + 1 ≤ n + 1 by omega) |
| 371 | + · norm_cast |
| 372 | + · simp only [Nat.cast_add, Nat.cast_one, δ']; field_simp; abel |
| 373 | + |
| 374 | +end AbsolutelyContinuousOnInterval |
0 commit comments