analysis.calculus.monotoneMathlib.Analysis.Calculus.Monotone

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -56,13 +56,13 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
       by
       apply tendsto.mono_left _ (hl.trans nhdsWithin_le_nhds)
       exact ((tendsto_id.sub_const x).const_mul c).const_add 1
-    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this 
+    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this
     apply tendsto.congr' (eventually.filter_mono hl _) this
     filter_upwards [self_mem_nhdsWithin] with y hy
     field_simp [sub_ne_zero.2 hy]
     ring
   have Z := (hf.comp h').mul L
-  rw [mul_one] at Z 
+  rw [mul_one] at Z
   apply tendsto.congr' _ Z
   have : ∀ᶠ y in l, y + c * (y - x) ^ 2 ≠ x := by apply tendsto.mono_right h' hl self_mem_nhdsWithin
   filter_upwards [this] with y hy
@@ -164,12 +164,12 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     hf.countable_not_continuous_at.ae_not_mem volume] with x hx h'x
   have A : hf.stieltjes_function x = f x :=
     by
-    rw [Classical.not_not, hf.continuous_at_iff_left_lim_eq_right_lim] at h'x 
+    rw [Classical.not_not, hf.continuous_at_iff_left_lim_eq_right_lim] at h'x
     apply le_antisymm _ (hf.le_right_lim (le_refl _))
     rw [← h'x]
     exact hf.left_lim_le (le_refl _)
   rw [hasDerivAt_iff_tendsto_slope, (nhds_left'_sup_nhds_right' x).symm, tendsto_sup,
-    slope_fun_def_field, A] at hx 
+    slope_fun_def_field, A] at hx
   -- prove differentiability on the right, by sandwiching with values of `g`
   have L1 :
     tendsto (fun y => (f y - f x) / (y - x)) (𝓝[>] x)
@@ -197,11 +197,11 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     · filter_upwards [self_mem_nhdsWithin]
       rintro y (hy : x < y)
       have : 0 < (y - x) ^ 2 := sq_pos_of_pos (sub_pos.2 hy)
-      apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
+      apply div_le_div_of_nonneg_right _ (sub_pos.2 hy).le
       exact (sub_le_sub_iff_right _).2 (hf.right_lim_le (by linarith))
     · filter_upwards [self_mem_nhdsWithin]
       rintro y (hy : x < y)
-      apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
+      apply div_le_div_of_nonneg_right _ (sub_pos.2 hy).le
       exact (sub_le_sub_iff_right _).2 (hf.le_right_lim (le_refl y))
   -- prove differentiability on the left, by sandwiching with values of `g`
   have L2 :
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 -/
-import Mathbin.Analysis.Calculus.Deriv.Slope
-import Mathbin.MeasureTheory.Covering.OneDim
-import Mathbin.Order.Monotone.Extension
+import Analysis.Calculus.Deriv.Slope
+import MeasureTheory.Covering.OneDim
+import Order.Monotone.Extension
 
 #align_import analysis.calculus.monotone from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.Deriv.Slope
 import Mathbin.MeasureTheory.Covering.OneDim
 import Mathbin.Order.Monotone.Extension
 
+#align_import analysis.calculus.monotone from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
+
 /-!
 # Differentiability of monotone functions
 
Diff
@@ -42,6 +42,7 @@ open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDou
 
 open scoped Topology
 
+#print tendsto_apply_add_mul_sq_div_sub /-
 /-- If `(f y - f x) / (y - x)` converges to a limit as `y` tends to `x`, then the same goes if
 `y` is shifted a little bit, i.e., `f (y + (y-x)^2) - f x) / (y - x)` converges to the same limit.
 This lemma contains a slightly more general version of this statement (where one considers
@@ -70,6 +71,7 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
   filter_upwards [this] with y hy
   field_simp [sub_ne_zero.2 hy]
 #align tendsto_apply_add_mul_sq_div_sub tendsto_apply_add_mul_sq_div_sub
+-/
 
 #print StieltjesFunction.ae_hasDerivAt /-
 /-- A Stieltjes function is almost everywhere differentiable, with derivative equal to the
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Order.Monotone.Extension
 /-!
 # Differentiability of monotone functions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We show that a monotone function `f : ℝ → ℝ` is differentiable almost everywhere, in
 `monotone.ae_differentiable_at`. (We also give a version for a function monotone on a set, in
 `monotone_on.ae_differentiable_within_at`.)
Diff
@@ -68,6 +68,7 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
   field_simp [sub_ne_zero.2 hy]
 #align tendsto_apply_add_mul_sq_div_sub tendsto_apply_add_mul_sq_div_sub
 
+#print StieltjesFunction.ae_hasDerivAt /-
 /-- A Stieltjes function is almost everywhere differentiable, with derivative equal to the
 Radon-Nikodym derivative of the associated Stieltjes measure with respect to Lebesgue. -/
 theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
@@ -145,7 +146,9 @@ theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
   rw [hasDerivAt_iff_tendsto_slope, slope_fun_def_field, ← nhds_left'_sup_nhds_right', tendsto_sup]
   exact ⟨L4, L1⟩
 #align stieltjes_function.ae_has_deriv_at StieltjesFunction.ae_hasDerivAt
+-/
 
+#print Monotone.ae_hasDerivAt /-
 /-- A monotone function is almost everywhere differentiable, with derivative equal to the
 Radon-Nikodym derivative of the associated Stieltjes measure with respect to Lebesgue. -/
 theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
@@ -236,12 +239,16 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     tendsto_sup]
   exact ⟨L2, L1⟩
 #align monotone.ae_has_deriv_at Monotone.ae_hasDerivAt
+-/
 
+#print Monotone.ae_differentiableAt /-
 /-- A monotone real function is differentiable Lebesgue-almost everywhere. -/
 theorem Monotone.ae_differentiableAt {f : ℝ → ℝ} (hf : Monotone f) : ∀ᵐ x, DifferentiableAt ℝ f x :=
   by filter_upwards [hf.ae_has_deriv_at] with x hx using hx.differentiable_at
 #align monotone.ae_differentiable_at Monotone.ae_differentiableAt
+-/
 
+#print MonotoneOn.ae_differentiableWithinAt_of_mem /-
 /-- A real function which is monotone on a set is differentiable Lebesgue-almost everywhere on
 this set. This version does not assume that `s` is measurable. For a formulation with
 `volume.restrict s` assuming that `s` is measurable, see `monotone_on.ae_differentiable_within_at`.
@@ -265,7 +272,9 @@ theorem MonotoneOn.ae_differentiableWithinAt_of_mem {f : ℝ → ℝ} {s : Set 
   filter_upwards [self_mem_nhdsWithin, this] with y hy h'y
   exact gf ⟨hy, h'y.1.le, h'y.2.le⟩
 #align monotone_on.ae_differentiable_within_at_of_mem MonotoneOn.ae_differentiableWithinAt_of_mem
+-/
 
+#print MonotoneOn.ae_differentiableWithinAt /-
 /-- A real function which is monotone on a set is differentiable Lebesgue-almost everywhere on
 this set. This version assumes that `s` is measurable and uses `volume.restrict s`.
 For a formulation without measurability assumption,
@@ -276,4 +285,5 @@ theorem MonotoneOn.ae_differentiableWithinAt {f : ℝ → ℝ} {s : Set ℝ} (hf
   rw [ae_restrict_iff' hs]
   exact hf.ae_differentiable_within_at_of_mem
 #align monotone_on.ae_differentiable_within_at MonotoneOn.ae_differentiableWithinAt
+-/
 
Diff
@@ -57,14 +57,14 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
       exact ((tendsto_id.sub_const x).const_mul c).const_add 1
     simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this 
     apply tendsto.congr' (eventually.filter_mono hl _) this
-    filter_upwards [self_mem_nhdsWithin]with y hy
+    filter_upwards [self_mem_nhdsWithin] with y hy
     field_simp [sub_ne_zero.2 hy]
     ring
   have Z := (hf.comp h').mul L
   rw [mul_one] at Z 
   apply tendsto.congr' _ Z
   have : ∀ᶠ y in l, y + c * (y - x) ^ 2 ≠ x := by apply tendsto.mono_right h' hl self_mem_nhdsWithin
-  filter_upwards [this]with y hy
+  filter_upwards [this] with y hy
   field_simp [sub_ne_zero.2 hy]
 #align tendsto_apply_add_mul_sq_div_sub tendsto_apply_add_mul_sq_div_sub
 
@@ -81,7 +81,7 @@ theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
     As `μ [y, x] = f x - f (y^-)`, this is not exactly the right result, so one uses a sandwiching
     argument to deduce the convergence for `(f x - f y) / (x - y)`. -/
   filter_upwards [VitaliFamily.ae_tendsto_rnDeriv (VitaliFamily (volume : Measure ℝ) 1) f.measure,
-    rn_deriv_lt_top f.measure volume, f.countable_left_lim_ne.ae_not_mem volume]with x hx h'x h''x
+    rn_deriv_lt_top f.measure volume, f.countable_left_lim_ne.ae_not_mem volume] with x hx h'x h''x
   -- Limit on the right, following from differentiation of measures
   have L1 :
     tendsto (fun y => (f y - f x) / (y - x)) (𝓝[>] x) (𝓝 (rn_deriv f.measure volume x).toReal) :=
@@ -156,7 +156,7 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     values of `g`, by shifting with `(y - x)^2` (which has no influence on the relevant
     scale `y - x`.)-/
   filter_upwards [hf.stieltjes_function.ae_has_deriv_at,
-    hf.countable_not_continuous_at.ae_not_mem volume]with x hx h'x
+    hf.countable_not_continuous_at.ae_not_mem volume] with x hx h'x
   have A : hf.stieltjes_function x = f x :=
     by
     rw [Classical.not_not, hf.continuous_at_iff_left_lim_eq_right_lim] at h'x 
@@ -239,7 +239,7 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
 
 /-- A monotone real function is differentiable Lebesgue-almost everywhere. -/
 theorem Monotone.ae_differentiableAt {f : ℝ → ℝ} (hf : Monotone f) : ∀ᵐ x, DifferentiableAt ℝ f x :=
-  by filter_upwards [hf.ae_has_deriv_at]with x hx using hx.differentiable_at
+  by filter_upwards [hf.ae_has_deriv_at] with x hx using hx.differentiable_at
 #align monotone.ae_differentiable_at Monotone.ae_differentiableAt
 
 /-- A real function which is monotone on a set is differentiable Lebesgue-almost everywhere on
@@ -258,11 +258,11 @@ theorem MonotoneOn.ae_differentiableWithinAt_of_mem {f : ℝ → ℝ} {s : Set 
     (hf.mono (inter_subset_left s (Icc a b))).exists_monotone_extension
       (hf.map_bdd_below (inter_subset_left _ _) ⟨a, fun x hx => hx.2.1, as⟩)
       (hf.map_bdd_above (inter_subset_left _ _) ⟨b, fun x hx => hx.2.2, bs⟩)
-  filter_upwards [hg.ae_differentiable_at]with x hx
+  filter_upwards [hg.ae_differentiable_at] with x hx
   intro h'x
   apply hx.differentiable_within_at.congr_of_eventually_eq _ (gf ⟨h'x.1, h'x.2.1.le, h'x.2.2.le⟩)
   have : Ioo a b ∈ 𝓝[s] x := nhdsWithin_le_nhds (Ioo_mem_nhds h'x.2.1 h'x.2.2)
-  filter_upwards [self_mem_nhdsWithin, this]with y hy h'y
+  filter_upwards [self_mem_nhdsWithin, this] with y hy h'y
   exact gf ⟨hy, h'y.1.le, h'y.2.le⟩
 #align monotone_on.ae_differentiable_within_at_of_mem MonotoneOn.ae_differentiableWithinAt_of_mem
 
Diff
@@ -55,13 +55,13 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
       by
       apply tendsto.mono_left _ (hl.trans nhdsWithin_le_nhds)
       exact ((tendsto_id.sub_const x).const_mul c).const_add 1
-    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this
+    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this 
     apply tendsto.congr' (eventually.filter_mono hl _) this
     filter_upwards [self_mem_nhdsWithin]with y hy
     field_simp [sub_ne_zero.2 hy]
     ring
   have Z := (hf.comp h').mul L
-  rw [mul_one] at Z
+  rw [mul_one] at Z 
   apply tendsto.congr' _ Z
   have : ∀ᶠ y in l, y + c * (y - x) ^ 2 ≠ x := by apply tendsto.mono_right h' hl self_mem_nhdsWithin
   filter_upwards [this]with y hy
@@ -159,12 +159,12 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     hf.countable_not_continuous_at.ae_not_mem volume]with x hx h'x
   have A : hf.stieltjes_function x = f x :=
     by
-    rw [Classical.not_not, hf.continuous_at_iff_left_lim_eq_right_lim] at h'x
+    rw [Classical.not_not, hf.continuous_at_iff_left_lim_eq_right_lim] at h'x 
     apply le_antisymm _ (hf.le_right_lim (le_refl _))
     rw [← h'x]
     exact hf.left_lim_le (le_refl _)
   rw [hasDerivAt_iff_tendsto_slope, (nhds_left'_sup_nhds_right' x).symm, tendsto_sup,
-    slope_fun_def_field, A] at hx
+    slope_fun_def_field, A] at hx 
   -- prove differentiability on the right, by sandwiching with values of `g`
   have L1 :
     tendsto (fun y => (f y - f x) / (y - x)) (𝓝[>] x)
Diff
@@ -37,7 +37,7 @@ behavior of `μ [x, y]`.
 
 open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDoublingMeasure
 
-open Topology
+open scoped Topology
 
 /-- If `(f y - f x) / (y - x)` converges to a limit as `y` tends to `x`, then the same goes if
 `y` is shifted a little bit, i.e., `f (y + (y-x)^2) - f x) / (y - x)` converges to the same limit.
Diff
@@ -120,9 +120,7 @@ theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
       have : tendsto (fun y : ℝ => y + 1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + 1 * (x - x) ^ 2)) :=
         tendsto_id.add (((tendsto_id.sub_const x).pow 2).const_mul 1)
       simpa using this
-    · have : Ioo (x - 1) x ∈ 𝓝[<] x :=
-        by
-        apply Ioo_mem_nhdsWithin_Iio
+    · have : Ioo (x - 1) x ∈ 𝓝[<] x := by apply Ioo_mem_nhdsWithin_Iio;
         exact ⟨by linarith, le_refl _⟩
       filter_upwards [this]
       rintro y ⟨hy : x - 1 < y, h'y : y < x⟩
@@ -183,9 +181,7 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
         have : tendsto (fun y : ℝ => y + -1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -1 * (x - x) ^ 2)) :=
           tendsto_id.add (((tendsto_id.sub_const x).pow 2).const_mul (-1))
         simpa using this
-      · have : Ioo x (x + 1) ∈ 𝓝[>] x :=
-          by
-          apply Ioo_mem_nhdsWithin_Ioi
+      · have : Ioo x (x + 1) ∈ 𝓝[>] x := by apply Ioo_mem_nhdsWithin_Ioi;
           exact ⟨le_refl _, by linarith⟩
         filter_upwards [this]
         rintro y ⟨hy : x < y, h'y : y < x + 1⟩
@@ -218,9 +214,7 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
         have : tendsto (fun y : ℝ => y + -1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -1 * (x - x) ^ 2)) :=
           tendsto_id.add (((tendsto_id.sub_const x).pow 2).const_mul (-1))
         simpa using this
-      · have : Ioo (x - 1) x ∈ 𝓝[<] x :=
-          by
-          apply Ioo_mem_nhdsWithin_Iio
+      · have : Ioo (x - 1) x ∈ 𝓝[<] x := by apply Ioo_mem_nhdsWithin_Iio;
           exact ⟨by linarith, le_refl _⟩
         filter_upwards [this]
         rintro y ⟨hy : x - 1 < y, h'y : y < x⟩
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 8f9fea08977f7e450770933ee6abb20733b47c92
+! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.Calculus.Deriv
+import Mathbin.Analysis.Calculus.Deriv.Slope
 import Mathbin.MeasureTheory.Covering.OneDim
 import Mathbin.Order.Monotone.Extension
 
Diff
@@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
+! leanprover-community/mathlib commit 8f9fea08977f7e450770933ee6abb20733b47c92
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
+import Mathbin.Analysis.Calculus.Deriv
 import Mathbin.MeasureTheory.Covering.OneDim
 import Mathbin.Order.Monotone.Extension
 
Diff
@@ -4,12 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 5f6e827d81dfbeb6151d7016586ceeb0099b9655
+! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.MeasureTheory.Measure.Lebesgue
-import Mathbin.Analysis.Calculus.Deriv
 import Mathbin.MeasureTheory.Covering.OneDim
 import Mathbin.Order.Monotone.Extension
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 5f6e827d81dfbeb6151d7016586ceeb0099b9655
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -36,7 +36,7 @@ behavior of `μ [x, y]`.
 -/
 
 
-open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsDoublingMeasure
+open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDoublingMeasure
 
 open Topology
 
Diff
@@ -56,7 +56,7 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
       by
       apply tendsto.mono_left _ (hl.trans nhdsWithin_le_nhds)
       exact ((tendsto_id.sub_const x).const_mul c).const_add 1
-    simp only [_root_.sub_self, add_zero, mul_zero] at this
+    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this
     apply tendsto.congr' (eventually.filter_mono hl _) this
     filter_upwards [self_mem_nhdsWithin]with y hy
     field_simp [sub_ne_zero.2 hy]
Diff
@@ -89,11 +89,11 @@ theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
     by
     apply
       tendsto.congr' _
-        ((Ennreal.tendsto_toReal h'x.ne).comp (hx.comp (Real.tendsto_Icc_vitaliFamily_right x)))
+        ((ENNReal.tendsto_toReal h'x.ne).comp (hx.comp (Real.tendsto_Icc_vitaliFamily_right x)))
     filter_upwards [self_mem_nhdsWithin]
     rintro y (hxy : x < y)
     simp only [comp_app, StieltjesFunction.measure_Icc, Real.volume_Icc, Classical.not_not.1 h''x]
-    rw [← Ennreal.ofReal_div_of_pos (sub_pos.2 hxy), Ennreal.toReal_ofReal]
+    rw [← ENNReal.ofReal_div_of_pos (sub_pos.2 hxy), ENNReal.toReal_ofReal]
     exact div_nonneg (sub_nonneg.2 (f.mono hxy.le)) (sub_pos.2 hxy).le
   -- Limit on the left, following from differentiation of measures. Its form is not exactly the one
   -- we need, due to the appearance of a left limit.
@@ -103,11 +103,11 @@ theorem StieltjesFunction.ae_hasDerivAt (f : StieltjesFunction) :
     by
     apply
       tendsto.congr' _
-        ((Ennreal.tendsto_toReal h'x.ne).comp (hx.comp (Real.tendsto_Icc_vitaliFamily_left x)))
+        ((ENNReal.tendsto_toReal h'x.ne).comp (hx.comp (Real.tendsto_Icc_vitaliFamily_left x)))
     filter_upwards [self_mem_nhdsWithin]
     rintro y (hxy : y < x)
     simp only [comp_app, StieltjesFunction.measure_Icc, Real.volume_Icc]
-    rw [← Ennreal.ofReal_div_of_pos (sub_pos.2 hxy), Ennreal.toReal_ofReal, ← neg_neg (y - x),
+    rw [← ENNReal.ofReal_div_of_pos (sub_pos.2 hxy), ENNReal.toReal_ofReal, ← neg_neg (y - x),
       div_neg, neg_div', neg_sub, neg_sub]
     exact div_nonneg (sub_nonneg.2 (f.mono.left_lim_le hxy.le)) (sub_pos.2 hxy).le
   -- Shifting a little bit the limit on the left, by `(y - x)^2`.

Changes in mathlib4

mathlib3
mathlib4
chore: tidy various files (#9728)
Diff
@@ -168,12 +168,12 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
         norm_num; nlinarith
     -- apply the sandwiching argument, with the helper function and `g`
     apply tendsto_of_tendsto_of_tendsto_of_le_of_le' this hx.2
-    · filter_upwards [self_mem_nhdsWithin] with y (hy : x < y)
-      rw [← sub_pos] at hy
+    · filter_upwards [self_mem_nhdsWithin] with y hy
+      rw [mem_Ioi, ← sub_pos] at hy
       gcongr
       exact hf.rightLim_le (by nlinarith)
-    · filter_upwards [self_mem_nhdsWithin] with y (hy : x < y)
-      rw [← sub_pos] at hy
+    · filter_upwards [self_mem_nhdsWithin] with y hy
+      rw [mem_Ioi, ← sub_pos] at hy
       gcongr
       exact hf.le_rightLim le_rfl
   -- prove differentiability on the left, by sandwiching with values of `g`
@@ -191,19 +191,22 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
       · have : Ioo (x - 1) x ∈ 𝓝[<] x := by
           apply Ioo_mem_nhdsWithin_Iio; exact ⟨by linarith, le_refl _⟩
         filter_upwards [this]
-        rintro y ⟨hy : x - 1 < y, h'y : y < x⟩
+        rintro y hy
+        rw [mem_Ioo] at hy
         rw [mem_Iio]
         norm_num; nlinarith
     -- apply the sandwiching argument, with `g` and the helper function
     apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hx.1 this
     · filter_upwards [self_mem_nhdsWithin]
-      rintro y (hy : y < x)
-      apply div_le_div_of_nonpos_of_le (sub_neg.2 hy).le
+      rintro y hy
+      rw [mem_Iio, ← sub_neg] at hy
+      apply div_le_div_of_nonpos_of_le hy.le
       exact (sub_le_sub_iff_right _).2 (hf.le_rightLim (le_refl _))
     · filter_upwards [self_mem_nhdsWithin]
-      rintro y (hy : y < x)
-      have : ↑0 < (y - x) ^ 2 := sq_pos_of_neg (sub_neg.2 hy)
-      apply div_le_div_of_nonpos_of_le (sub_neg.2 hy).le
+      rintro y hy
+      rw [mem_Iio, ← sub_neg] at hy
+      have : 0 < (y - x) ^ 2 := sq_pos_of_neg hy
+      apply div_le_div_of_nonpos_of_le hy.le
       exact (sub_le_sub_iff_right _).2 (hf.rightLim_le (by norm_num; linarith))
   -- conclude global differentiability
   rw [hasDerivAt_iff_tendsto_slope, slope_fun_def_field, (nhds_left'_sup_nhds_right' x).symm,
chore(*): minor golfs, mostly using gcongr (#9577)
Diff
@@ -168,15 +168,14 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
         norm_num; nlinarith
     -- apply the sandwiching argument, with the helper function and `g`
     apply tendsto_of_tendsto_of_tendsto_of_le_of_le' this hx.2
-    · filter_upwards [self_mem_nhdsWithin]
-      rintro y (hy : x < y)
-      have : ↑0 < (y - x) ^ 2 := sq_pos_of_pos (sub_pos.2 hy)
-      apply div_le_div_of_le (sub_pos.2 hy).le
-      exact (sub_le_sub_iff_right _).2 (hf.rightLim_le (by norm_num; linarith))
-    · filter_upwards [self_mem_nhdsWithin]
-      rintro y (hy : x < y)
-      apply div_le_div_of_le (sub_pos.2 hy).le
-      exact (sub_le_sub_iff_right _).2 (hf.le_rightLim (le_refl y))
+    · filter_upwards [self_mem_nhdsWithin] with y (hy : x < y)
+      rw [← sub_pos] at hy
+      gcongr
+      exact hf.rightLim_le (by nlinarith)
+    · filter_upwards [self_mem_nhdsWithin] with y (hy : x < y)
+      rw [← sub_pos] at hy
+      gcongr
+      exact hf.le_rightLim le_rfl
   -- prove differentiability on the left, by sandwiching with values of `g`
   have L2 : Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[<] x)
       (𝓝 (rnDeriv hf.stieltjesFunction.measure volume x).toReal) := by
feat: deprecate div_le_div_of_le_of_nonneg (#9399)

This was noticed in the discussion around #9393.

Diff
@@ -171,11 +171,11 @@ theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
     · filter_upwards [self_mem_nhdsWithin]
       rintro y (hy : x < y)
       have : ↑0 < (y - x) ^ 2 := sq_pos_of_pos (sub_pos.2 hy)
-      apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
+      apply div_le_div_of_le (sub_pos.2 hy).le
       exact (sub_le_sub_iff_right _).2 (hf.rightLim_le (by norm_num; linarith))
     · filter_upwards [self_mem_nhdsWithin]
       rintro y (hy : x < y)
-      apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
+      apply div_le_div_of_le (sub_pos.2 hy).le
       exact (sub_le_sub_iff_right _).2 (hf.le_rightLim (le_refl y))
   -- prove differentiability on the left, by sandwiching with values of `g`
   have L2 : Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[<] x)
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -36,8 +36,6 @@ open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDou
 
 open scoped Topology
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 /-- If `(f y - f x) / (y - x)` converges to a limit as `y` tends to `x`, then the same goes if
 `y` is shifted a little bit, i.e., `f (y + (y-x)^2) - f x) / (y - x)` converges to the same limit.
 This lemma contains a slightly more general version of this statement (where one considers
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -51,7 +51,7 @@ theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l :
     have : Tendsto (fun y => 1 + c * (y - x)) l (𝓝 (1 + c * (x - x))) := by
       apply Tendsto.mono_left _ (hl.trans nhdsWithin_le_nhds)
       exact ((tendsto_id.sub_const x).const_mul c).const_add 1
-    simp only [_root_.sub_self, add_zero, MulZeroClass.mul_zero] at this
+    simp only [_root_.sub_self, add_zero, mul_zero] at this
     apply Tendsto.congr' (Eventually.filter_mono hl _) this
     filter_upwards [self_mem_nhdsWithin] with y hy
     field_simp [sub_ne_zero.2 hy]
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -36,7 +36,7 @@ open Set Filter Function Metric MeasureTheory MeasureTheory.Measure IsUnifLocDou
 
 open scoped Topology
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 /-- If `(f y - f x) / (y - x)` converges to a limit as `y` tends to `x`, then the same goes if
 `y` is shifted a little bit, i.e., `f (y + (y-x)^2) - f x) / (y - x)` converges to the same limit.
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module analysis.calculus.monotone
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.Deriv.Slope
 import Mathlib.MeasureTheory.Covering.OneDim
 import Mathlib.Order.Monotone.Extension
 
+#align_import analysis.calculus.monotone from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 # Differentiability of monotone functions
 
feat: port Analysis.Calculus.Monotone (#4792)

Dependencies 12 + 1026

1027 files ported (98.8%)
468399 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file