number_theory.liouville.measureMathlib.NumberTheory.Liouville.Measure

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)

(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
@@ -106,7 +106,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
   have hB : ∀ a b, volume (B a b) = ↑(2 / b ^ r : ℝ≥0) :=
     by
     intro a b
-    rw [Real.volume_ball, mul_one_div, ← NNReal.coe_two, ← NNReal.coe_nat_cast, ← NNReal.coe_rpow, ←
+    rw [Real.volume_ball, mul_one_div, ← NNReal.coe_two, ← NNReal.coe_natCast, ← NNReal.coe_rpow, ←
       NNReal.coe_div, ENNReal.ofReal_coe_nnreal]
   have :
     ∀ b : ℕ, volume (⋃ a ∈ Finset.Icc (0 : ℤ) b, B a b) ≤ (2 * (b ^ (1 - r) + b ^ (-r)) : ℝ≥0) :=
Diff
@@ -117,7 +117,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
         measure_bUnion_finset_le _ _
       _ = ((b + 1) * (2 / b ^ r) : ℝ≥0) := by
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
-          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
+          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_natCast]
       _ = _ := _
     have : 1 - r ≠ 0 := by linarith
     rw [ENNReal.coe_inj]
Diff
@@ -117,7 +117,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
         measure_bUnion_finset_le _ _
       _ = ((b + 1) * (2 / b ^ r) : ℝ≥0) := by
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
-          Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
+          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := _
     have : 1 - r ≠ 0 := by linarith
     rw [ENNReal.coe_inj]
Diff
@@ -47,7 +47,7 @@ theorem setOf_liouvilleWith_subset_aux :
   by
   rintro x ⟨p, hp, hxp⟩
   rcases exists_nat_one_div_lt (sub_pos.2 hp) with ⟨n, hn⟩
-  rw [lt_sub_iff_add_lt'] at hn 
+  rw [lt_sub_iff_add_lt'] at hn
   suffices
     ∀ y : ℝ,
       LiouvilleWith p y →
@@ -63,7 +63,7 @@ theorem setOf_liouvilleWith_subset_aux :
   clear hxp x; intro x hxp hx01
   refine' ((hxp.frequently_lt_rpow_neg hn).and_eventually (eventually_ge_at_top 1)).mono _
   rintro b ⟨⟨a, hne, hlt⟩, hb⟩
-  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt 
+  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt
   refine' ⟨a, _, hlt⟩
   replace hb : (1 : ℝ) ≤ b; exact Nat.one_le_cast.2 hb
   have hb0 : (0 : ℝ) < b := zero_lt_one.trans_le hb
@@ -74,7 +74,7 @@ theorem setOf_liouvilleWith_subset_aux :
       _ ≤ b ^ (2 + 1 / (n + 1 : ℕ) : ℝ) := rpow_le_rpow_of_exponent_le hb (one_le_two.trans _)
     simpa using n.cast_add_one_pos.le
   rw [sub_div' _ _ _ hb0.ne', abs_div, abs_of_pos hb0, div_lt_div_right hb0, abs_sub_lt_iff,
-    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt 
+    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt
   rw [Finset.mem_Icc, ← Int.lt_add_one_iff, ← Int.lt_add_one_iff, ← neg_lt_iff_pos_add, add_comm, ←
     @Int.cast_lt ℝ, ← @Int.cast_lt ℝ]
   push_cast
Diff
@@ -120,7 +120,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
           Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := _
     have : 1 - r ≠ 0 := by linarith
-    rw [ENNReal.coe_eq_coe]
+    rw [ENNReal.coe_inj]
     simp [add_mul, div_eq_mul_inv, NNReal.rpow_neg, NNReal.rpow_sub' _ this, mul_add, mul_left_comm]
   refine' ne_top_of_le_ne_top (ENNReal.tsum_coe_ne_top_iff_summable.2 _) (ENNReal.tsum_le_tsum this)
   refine' (Summable.add _ _).mul_left _ <;> simp only [NNReal.summable_rpow] <;> linarith
Diff
@@ -129,7 +129,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
 
 #print ae_not_liouvilleWith /-
 theorem ae_not_liouvilleWith : ∀ᵐ x, ∀ p > (2 : ℝ), ¬LiouvilleWith p x := by
-  simpa only [ae_iff, not_forall, Classical.not_not, set_of_exists] using
+  simpa only [ae_iff, Classical.not_forall, Classical.not_not, set_of_exists] using
     volume_iUnion_setOf_liouvilleWith
 #align ae_not_liouville_with ae_not_liouvilleWith
 -/
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 -/
-import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
-import Mathbin.NumberTheory.Liouville.Residual
-import Mathbin.NumberTheory.Liouville.LiouvilleWith
-import Mathbin.Analysis.PSeries
+import MeasureTheory.Measure.Lebesgue.Basic
+import NumberTheory.Liouville.Residual
+import NumberTheory.Liouville.LiouvilleWith
+import Analysis.PSeries
 
 #align_import number_theory.liouville.measure from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
-
-! This file was ported from Lean 3 source module number_theory.liouville.measure
-! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
 import Mathbin.NumberTheory.Liouville.Residual
 import Mathbin.NumberTheory.Liouville.LiouvilleWith
 import Mathbin.Analysis.PSeries
 
+#align_import number_theory.liouville.measure from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
+
 /-!
 # Volume of the set of Liouville numbers
 
Diff
@@ -38,6 +38,7 @@ open scoped Filter BigOperators ENNReal Topology NNReal
 
 open Filter Set Metric MeasureTheory Real
 
+#print setOf_liouvilleWith_subset_aux /-
 theorem setOf_liouvilleWith_subset_aux :
     {x : ℝ | ∃ p > 2, LiouvilleWith p x} ⊆
       ⋃ m : ℤ,
@@ -87,7 +88,9 @@ theorem setOf_liouvilleWith_subset_aux :
       x * b ≤ 1 * b := mul_le_mul_of_nonneg_right hx01.2.le hb0.le
       _ = b := one_mul b
 #align set_of_liouville_with_subset_aux setOf_liouvilleWith_subset_aux
+-/
 
+#print volume_iUnion_setOf_liouvilleWith /-
 /-- The set of numbers satisfying the Liouville condition with some exponent `p > 2` has Lebesgue
 measure zero. -/
 @[simp]
@@ -125,11 +128,14 @@ theorem volume_iUnion_setOf_liouvilleWith :
   refine' ne_top_of_le_ne_top (ENNReal.tsum_coe_ne_top_iff_summable.2 _) (ENNReal.tsum_le_tsum this)
   refine' (Summable.add _ _).mul_left _ <;> simp only [NNReal.summable_rpow] <;> linarith
 #align volume_Union_set_of_liouville_with volume_iUnion_setOf_liouvilleWith
+-/
 
+#print ae_not_liouvilleWith /-
 theorem ae_not_liouvilleWith : ∀ᵐ x, ∀ p > (2 : ℝ), ¬LiouvilleWith p x := by
   simpa only [ae_iff, not_forall, Classical.not_not, set_of_exists] using
     volume_iUnion_setOf_liouvilleWith
 #align ae_not_liouville_with ae_not_liouvilleWith
+-/
 
 #print ae_not_liouville /-
 theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x :=
@@ -137,15 +143,19 @@ theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x :=
 #align ae_not_liouville ae_not_liouville
 -/
 
+#print volume_setOf_liouville /-
 /-- The set of Liouville numbers has Lebesgue measure zero. -/
 @[simp]
 theorem volume_setOf_liouville : volume {x : ℝ | Liouville x} = 0 := by
   simpa only [ae_iff, Classical.not_not] using ae_not_liouville
 #align volume_set_of_liouville volume_setOf_liouville
+-/
 
+#print Real.disjoint_residual_ae /-
 /-- The filters `residual ℝ` and `volume.ae` are disjoint. This means that there exists a residual
 set of Lebesgue measure zero (e.g., the set of Liouville numbers). -/
 theorem Real.disjoint_residual_ae : Disjoint (residual ℝ) volume.ae :=
   disjoint_of_disjoint_of_mem disjoint_compl_right eventually_residual_liouville ae_not_liouville
 #align real.disjoint_residual_ae Real.disjoint_residual_ae
+-/
 
Diff
@@ -74,7 +74,6 @@ theorem setOf_liouvilleWith_subset_aux :
     calc
       (b : ℝ) = b ^ (1 : ℝ) := (rpow_one _).symm
       _ ≤ b ^ (2 + 1 / (n + 1 : ℕ) : ℝ) := rpow_le_rpow_of_exponent_le hb (one_le_two.trans _)
-      
     simpa using n.cast_add_one_pos.le
   rw [sub_div' _ _ _ hb0.ne', abs_div, abs_of_pos hb0, div_lt_div_right hb0, abs_sub_lt_iff,
     sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt 
@@ -87,7 +86,6 @@ theorem setOf_liouvilleWith_subset_aux :
     calc
       x * b ≤ 1 * b := mul_le_mul_of_nonneg_right hx01.2.le hb0.le
       _ = b := one_mul b
-      
 #align set_of_liouville_with_subset_aux setOf_liouvilleWith_subset_aux
 
 /-- The set of numbers satisfying the Liouville condition with some exponent `p > 2` has Lebesgue
@@ -121,7 +119,6 @@ theorem volume_iUnion_setOf_liouvilleWith :
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
           Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := _
-      
     have : 1 - r ≠ 0 := by linarith
     rw [ENNReal.coe_eq_coe]
     simp [add_mul, div_eq_mul_inv, NNReal.rpow_neg, NNReal.rpow_sub' _ this, mul_add, mul_left_comm]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 
 ! This file was ported from Lean 3 source module number_theory.liouville.measure
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
+! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.Analysis.PSeries
 /-!
 # Volume of the set of Liouville numbers
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we prove that the set of Liouville numbers with exponent (irrationality measure)
 strictly greater than two is a set of Lebesuge measure zero, see
 `volume_Union_set_of_liouville_with`.
Diff
@@ -131,9 +131,11 @@ theorem ae_not_liouvilleWith : ∀ᵐ x, ∀ p > (2 : ℝ), ¬LiouvilleWith p x
     volume_iUnion_setOf_liouvilleWith
 #align ae_not_liouville_with ae_not_liouvilleWith
 
+#print ae_not_liouville /-
 theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x :=
   ae_not_liouvilleWith.mono fun x h₁ h₂ => h₁ 3 (by norm_num) (h₂.LiouvilleWith 3)
 #align ae_not_liouville ae_not_liouville
+-/
 
 /-- The set of Liouville numbers has Lebesgue measure zero. -/
 @[simp]
Diff
@@ -36,13 +36,13 @@ open scoped Filter BigOperators ENNReal Topology NNReal
 open Filter Set Metric MeasureTheory Real
 
 theorem setOf_liouvilleWith_subset_aux :
-    { x : ℝ | ∃ p > 2, LiouvilleWith p x } ⊆
+    {x : ℝ | ∃ p > 2, LiouvilleWith p x} ⊆
       ⋃ m : ℤ,
         (fun x : ℝ => x + m) ⁻¹'
           ⋃ n > (0 : ℕ),
-            { x : ℝ |
+            {x : ℝ |
               ∃ᶠ b : ℕ in atTop,
-                ∃ a ∈ Finset.Icc (0 : ℤ) b, |x - (a : ℤ) / b| < 1 / b ^ (2 + 1 / n : ℝ) } :=
+                ∃ a ∈ Finset.Icc (0 : ℤ) b, |x - (a : ℤ) / b| < 1 / b ^ (2 + 1 / n : ℝ)} :=
   by
   rintro x ⟨p, hp, hxp⟩
   rcases exists_nat_one_div_lt (sub_pos.2 hp) with ⟨n, hn⟩
@@ -91,7 +91,7 @@ theorem setOf_liouvilleWith_subset_aux :
 measure zero. -/
 @[simp]
 theorem volume_iUnion_setOf_liouvilleWith :
-    volume (⋃ (p : ℝ) (hp : 2 < p), { x : ℝ | LiouvilleWith p x }) = 0 :=
+    volume (⋃ (p : ℝ) (hp : 2 < p), {x : ℝ | LiouvilleWith p x}) = 0 :=
   by
   simp only [← set_of_exists]
   refine' measure_mono_null setOf_liouvilleWith_subset_aux _
@@ -137,7 +137,7 @@ theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x :=
 
 /-- The set of Liouville numbers has Lebesgue measure zero. -/
 @[simp]
-theorem volume_setOf_liouville : volume { x : ℝ | Liouville x } = 0 := by
+theorem volume_setOf_liouville : volume {x : ℝ | Liouville x} = 0 := by
   simpa only [ae_iff, Classical.not_not] using ae_not_liouville
 #align volume_set_of_liouville volume_setOf_liouville
 
Diff
@@ -46,7 +46,7 @@ theorem setOf_liouvilleWith_subset_aux :
   by
   rintro x ⟨p, hp, hxp⟩
   rcases exists_nat_one_div_lt (sub_pos.2 hp) with ⟨n, hn⟩
-  rw [lt_sub_iff_add_lt'] at hn
+  rw [lt_sub_iff_add_lt'] at hn 
   suffices
     ∀ y : ℝ,
       LiouvilleWith p y →
@@ -62,7 +62,7 @@ theorem setOf_liouvilleWith_subset_aux :
   clear hxp x; intro x hxp hx01
   refine' ((hxp.frequently_lt_rpow_neg hn).and_eventually (eventually_ge_at_top 1)).mono _
   rintro b ⟨⟨a, hne, hlt⟩, hb⟩
-  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt
+  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt 
   refine' ⟨a, _, hlt⟩
   replace hb : (1 : ℝ) ≤ b; exact Nat.one_le_cast.2 hb
   have hb0 : (0 : ℝ) < b := zero_lt_one.trans_le hb
@@ -74,7 +74,7 @@ theorem setOf_liouvilleWith_subset_aux :
       
     simpa using n.cast_add_one_pos.le
   rw [sub_div' _ _ _ hb0.ne', abs_div, abs_of_pos hb0, div_lt_div_right hb0, abs_sub_lt_iff,
-    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt
+    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt 
   rw [Finset.mem_Icc, ← Int.lt_add_one_iff, ← Int.lt_add_one_iff, ← neg_lt_iff_pos_add, add_comm, ←
     @Int.cast_lt ℝ, ← @Int.cast_lt ℝ]
   push_cast
Diff
@@ -31,7 +31,7 @@ Liouville number, Lebesgue measure, residual, generic property
 -/
 
 
-open Filter BigOperators ENNReal Topology NNReal
+open scoped Filter BigOperators ENNReal Topology NNReal
 
 open Filter Set Metric MeasureTheory Real
 
Diff
@@ -59,14 +59,12 @@ theorem setOf_liouvilleWith_subset_aux :
       simp only [Int.floor_le, Int.lt_floor_add_one, add_neg_lt_iff_le_add', zero_add, and_self_iff,
         mem_Ico, Int.cast_neg, le_add_neg_iff_add_le]
     refine' ⟨-⌊x⌋, n + 1, n.succ_pos, this _ (hxp.add_int _) hx⟩
-  clear hxp x
-  intro x hxp hx01
+  clear hxp x; intro x hxp hx01
   refine' ((hxp.frequently_lt_rpow_neg hn).and_eventually (eventually_ge_at_top 1)).mono _
   rintro b ⟨⟨a, hne, hlt⟩, hb⟩
   rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt
   refine' ⟨a, _, hlt⟩
-  replace hb : (1 : ℝ) ≤ b
-  exact Nat.one_le_cast.2 hb
+  replace hb : (1 : ℝ) ≤ b; exact Nat.one_le_cast.2 hb
   have hb0 : (0 : ℝ) < b := zero_lt_one.trans_le hb
   replace hlt : |x - a / b| < 1 / b
   · refine' hlt.trans_le (one_div_le_one_div_of_le hb0 _)
@@ -97,15 +95,10 @@ theorem volume_iUnion_setOf_liouvilleWith :
   by
   simp only [← set_of_exists]
   refine' measure_mono_null setOf_liouvilleWith_subset_aux _
-  rw [measure_Union_null_iff]
-  intro m
-  rw [measure_preimage_add_right]
-  clear m
+  rw [measure_Union_null_iff]; intro m; rw [measure_preimage_add_right]; clear m
   refine' (measure_bUnion_null_iff <| to_countable _).2 fun n (hn : 1 ≤ n) => _
   generalize hr : (2 + 1 / n : ℝ) = r
-  replace hr : 2 < r
-  · simp [← hr, zero_lt_one.trans_le hn]
-  clear hn n
+  replace hr : 2 < r; · simp [← hr, zero_lt_one.trans_le hn]; clear hn n
   refine' measure_set_of_frequently_eq_zero _
   simp only [set_of_exists, ← Real.dist_eq, ← mem_ball, set_of_mem_eq]
   set B : ℤ → ℕ → Set ℝ := fun a b => ball (a / b) (1 / b ^ r)
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 
 ! This file was ported from Lean 3 source module number_theory.liouville.measure
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
 ! 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.MeasureTheory.Measure.Lebesgue.Basic
 import Mathbin.NumberTheory.Liouville.Residual
 import Mathbin.NumberTheory.Liouville.LiouvilleWith
 import Mathbin.Analysis.PSeries
Diff
@@ -92,7 +92,7 @@ theorem setOf_liouvilleWith_subset_aux :
 /-- The set of numbers satisfying the Liouville condition with some exponent `p > 2` has Lebesgue
 measure zero. -/
 @[simp]
-theorem volume_unionᵢ_setOf_liouvilleWith :
+theorem volume_iUnion_setOf_liouvilleWith :
     volume (⋃ (p : ℝ) (hp : 2 < p), { x : ℝ | LiouvilleWith p x }) = 0 :=
   by
   simp only [← set_of_exists]
@@ -131,11 +131,11 @@ theorem volume_unionᵢ_setOf_liouvilleWith :
     simp [add_mul, div_eq_mul_inv, NNReal.rpow_neg, NNReal.rpow_sub' _ this, mul_add, mul_left_comm]
   refine' ne_top_of_le_ne_top (ENNReal.tsum_coe_ne_top_iff_summable.2 _) (ENNReal.tsum_le_tsum this)
   refine' (Summable.add _ _).mul_left _ <;> simp only [NNReal.summable_rpow] <;> linarith
-#align volume_Union_set_of_liouville_with volume_unionᵢ_setOf_liouvilleWith
+#align volume_Union_set_of_liouville_with volume_iUnion_setOf_liouvilleWith
 
 theorem ae_not_liouvilleWith : ∀ᵐ x, ∀ p > (2 : ℝ), ¬LiouvilleWith p x := by
   simpa only [ae_iff, not_forall, Classical.not_not, set_of_exists] using
-    volume_unionᵢ_setOf_liouvilleWith
+    volume_iUnion_setOf_liouvilleWith
 #align ae_not_liouville_with ae_not_liouvilleWith
 
 theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x :=
Diff
@@ -31,7 +31,7 @@ Liouville number, Lebesgue measure, residual, generic property
 -/
 
 
-open Filter BigOperators Ennreal Topology NNReal
+open Filter BigOperators ENNReal Topology NNReal
 
 open Filter Set Metric MeasureTheory Real
 
@@ -113,7 +113,7 @@ theorem volume_unionᵢ_setOf_liouvilleWith :
     by
     intro a b
     rw [Real.volume_ball, mul_one_div, ← NNReal.coe_two, ← NNReal.coe_nat_cast, ← NNReal.coe_rpow, ←
-      NNReal.coe_div, Ennreal.ofReal_coe_nNReal]
+      NNReal.coe_div, ENNReal.ofReal_coe_nnreal]
   have :
     ∀ b : ℕ, volume (⋃ a ∈ Finset.Icc (0 : ℤ) b, B a b) ≤ (2 * (b ^ (1 - r) + b ^ (-r)) : ℝ≥0) :=
     by
@@ -123,13 +123,13 @@ theorem volume_unionᵢ_setOf_liouvilleWith :
         measure_bUnion_finset_le _ _
       _ = ((b + 1) * (2 / b ^ r) : ℝ≥0) := by
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
-          Int.toNat_coe_nat, ← Nat.cast_succ, Ennreal.coe_mul, Ennreal.coe_nat]
+          Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := _
       
     have : 1 - r ≠ 0 := by linarith
-    rw [Ennreal.coe_eq_coe]
+    rw [ENNReal.coe_eq_coe]
     simp [add_mul, div_eq_mul_inv, NNReal.rpow_neg, NNReal.rpow_sub' _ this, mul_add, mul_left_comm]
-  refine' ne_top_of_le_ne_top (Ennreal.tsum_coe_ne_top_iff_summable.2 _) (Ennreal.tsum_le_tsum this)
+  refine' ne_top_of_le_ne_top (ENNReal.tsum_coe_ne_top_iff_summable.2 _) (ENNReal.tsum_le_tsum this)
   refine' (Summable.add _ _).mul_left _ <;> simp only [NNReal.summable_rpow] <;> linarith
 #align volume_Union_set_of_liouville_with volume_unionᵢ_setOf_liouvilleWith
 

Changes in mathlib4

mathlib3
mathlib4
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -87,7 +87,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
   simp only [setOf_exists, ← exists_prop, ← Real.dist_eq, ← mem_ball, setOf_mem_eq]
   set B : ℤ → ℕ → Set ℝ := fun a b => ball (a / b) (1 / (b : ℝ) ^ r)
   have hB : ∀ a b, volume (B a b) = ↑((2 : ℝ≥0) / (b : ℝ≥0) ^ r) := fun a b ↦ by
-    rw [Real.volume_ball, mul_one_div, ← NNReal.coe_two, ← NNReal.coe_nat_cast, ← NNReal.coe_rpow,
+    rw [Real.volume_ball, mul_one_div, ← NNReal.coe_two, ← NNReal.coe_natCast, ← NNReal.coe_rpow,
       ← NNReal.coe_div, ENNReal.ofReal_coe_nnreal]
   have : ∀ b : ℕ, volume (⋃ a ∈ Finset.Icc (0 : ℤ) b, B a b) ≤
       ↑(2 * ((b : ℝ≥0) ^ (1 - r) + (b : ℝ≥0) ^ (-r))) := fun b ↦
chore: Rename coe_nat/coe_int/coe_rat to natCast/intCast/ratCast (#11499)

This is less exhaustive than its sibling #11486 because edge cases are harder to classify. No fundamental difficulty, just me being a bit fast and lazy.

Reduce the diff of #11203

Diff
@@ -96,7 +96,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
         measure_biUnion_finset_le _ _
       _ = ↑((b + 1) * (2 / (b : ℝ≥0) ^ r)) := by
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
-          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
+          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_natCast]
       _ = _ := by
         have : 1 - r ≠ 0 := by linarith
         rw [ENNReal.coe_inj]
chore(Data/Int): Rename coe_nat to natCast (#11637)

Reduce the diff of #11499

Renames

All in the Int namespace:

  • ofNat_eq_castofNat_eq_natCast
  • cast_eq_cast_iff_NatnatCast_inj
  • natCast_eq_ofNatofNat_eq_natCast
  • coe_nat_subnatCast_sub
  • coe_nat_nonnegnatCast_nonneg
  • sign_coe_add_onesign_natCast_add_one
  • nat_succ_eq_int_succnatCast_succ
  • succ_neg_nat_succsucc_neg_natCast_succ
  • coe_pred_of_posnatCast_pred_of_pos
  • coe_nat_divnatCast_div
  • coe_nat_edivnatCast_ediv
  • sign_coe_nat_of_nonzerosign_natCast_of_ne_zero
  • toNat_coe_nattoNat_natCast
  • toNat_coe_nat_add_onetoNat_natCast_add_one
  • coe_nat_dvdnatCast_dvd_natCast
  • coe_nat_dvd_leftnatCast_dvd
  • coe_nat_dvd_rightdvd_natCast
  • le_coe_nat_suble_natCast_sub
  • succ_coe_nat_possucc_natCast_pos
  • coe_nat_modEq_iffnatCast_modEq_iff
  • coe_natAbsnatCast_natAbs
  • coe_nat_eq_zeronatCast_eq_zero
  • coe_nat_ne_zeronatCast_ne_zero
  • coe_nat_ne_zero_iff_posnatCast_ne_zero_iff_pos
  • abs_coe_natabs_natCast
  • coe_nat_nonpos_iffnatCast_nonpos_iff

Also rename Nat.coe_nat_dvd to Nat.cast_dvd_cast

Diff
@@ -96,7 +96,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
         measure_biUnion_finset_le _ _
       _ = ↑((b + 1) * (2 / (b : ℝ≥0) ^ r)) := by
         simp only [hB, Int.card_Icc, Finset.sum_const, nsmul_eq_mul, sub_zero, ← Int.ofNat_succ,
-          Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
+          Int.toNat_natCast, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := by
         have : 1 - r ≠ 0 := by linarith
         rw [ENNReal.coe_inj]
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -45,7 +45,7 @@ theorem setOf_liouvilleWith_subset_aux :
     have hx : x + ↑(-⌊x⌋) ∈ Ico (0 : ℝ) 1 := by
       simp only [Int.floor_le, Int.lt_floor_add_one, add_neg_lt_iff_le_add', zero_add, and_self_iff,
         mem_Ico, Int.cast_neg, le_add_neg_iff_add_le]
-    refine' ⟨-⌊x⌋, n + 1, n.succ_pos, this _ (hxp.add_int _) hx⟩
+    exact ⟨-⌊x⌋, n + 1, n.succ_pos, this _ (hxp.add_int _) hx⟩
   clear hxp x; intro x hxp hx01
   refine' ((hxp.frequently_lt_rpow_neg hn).and_eventually (eventually_ge_atTop 1)).mono _
   rintro b ⟨⟨a, -, hlt⟩, hb⟩
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -51,10 +51,10 @@ theorem setOf_liouvilleWith_subset_aux :
   rintro b ⟨⟨a, -, hlt⟩, hb⟩
   rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt
   refine' ⟨a, _, hlt⟩
-  replace hb : (1 : ℝ) ≤ b; exact Nat.one_le_cast.2 hb
+  replace hb : (1 : ℝ) ≤ b := Nat.one_le_cast.2 hb
   have hb0 : (0 : ℝ) < b := zero_lt_one.trans_le hb
-  replace hlt : |x - a / b| < 1 / b
-  · refine' hlt.trans_le (one_div_le_one_div_of_le hb0 _)
+  replace hlt : |x - a / b| < 1 / b := by
+    refine' hlt.trans_le (one_div_le_one_div_of_le hb0 _)
     calc
       (b : ℝ) = (b : ℝ) ^ (1 : ℝ) := (rpow_one _).symm
       _ ≤ (b : ℝ) ^ (2 + 1 / (n + 1 : ℕ) : ℝ) :=
@@ -81,7 +81,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
   rw [measure_iUnion_null_iff]; intro m; rw [measure_preimage_add_right]; clear m
   refine' (measure_biUnion_null_iff <| to_countable _).2 fun n (hn : 1 ≤ n) => _
   generalize hr : (2 + 1 / n : ℝ) = r
-  replace hr : 2 < r; · simp [← hr, zero_lt_one.trans_le hn]
+  replace hr : 2 < r := by simp [← hr, zero_lt_one.trans_le hn]
   clear hn n
   refine' measure_setOf_frequently_eq_zero _
   simp only [setOf_exists, ← exists_prop, ← Real.dist_eq, ← mem_ball, setOf_mem_eq]
feat: Make the coercion ℝ≥0 → ℝ≥0∞ commute defeqly with nsmul and pow (#10225)

by tweaking the definition of the AddMonoid and MonoidWithZero instances for WithTop. Also unprotect ENNReal.coe_injective and rename ENNReal.coe_eq_coe → ENNReal.coe_inj.

From LeanAPAP

Diff
@@ -99,7 +99,7 @@ theorem volume_iUnion_setOf_liouvilleWith :
           Int.toNat_coe_nat, ← Nat.cast_succ, ENNReal.coe_mul, ENNReal.coe_nat]
       _ = _ := by
         have : 1 - r ≠ 0 := by linarith
-        rw [ENNReal.coe_eq_coe]
+        rw [ENNReal.coe_inj]
         simp [add_mul, div_eq_mul_inv, NNReal.rpow_neg, NNReal.rpow_sub' _ this, mul_add,
           mul_left_comm]
   refine' ne_top_of_le_ne_top (ENNReal.tsum_coe_ne_top_iff_summable.2 _) (ENNReal.tsum_le_tsum this)
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
@@ -31,8 +31,6 @@ open scoped Filter BigOperators ENNReal Topology NNReal
 
 open Filter Set Metric MeasureTheory Real
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 theorem setOf_liouvilleWith_subset_aux :
     { x : ℝ | ∃ p > 2, LiouvilleWith p x } ⊆
       ⋃ m : ℤ, (· + (m : ℝ)) ⁻¹' ⋃ n > (0 : ℕ),
style: remove trailing whitespace and modify the linter to detect it (#6519)
Diff
@@ -40,7 +40,7 @@ theorem setOf_liouvilleWith_subset_aux :
           |x - (a : ℤ) / b| < 1 / (b : ℝ) ^ (2 + 1 / n : ℝ) } := by
   rintro x ⟨p, hp, hxp⟩
   rcases exists_nat_one_div_lt (sub_pos.2 hp) with ⟨n, hn⟩
-  rw [lt_sub_iff_add_lt'] at hn 
+  rw [lt_sub_iff_add_lt'] at hn
   suffices ∀ y : ℝ, LiouvilleWith p y → y ∈ Ico (0 : ℝ) 1 → ∃ᶠ b : ℕ in atTop,
       ∃ a ∈ Finset.Icc (0 : ℤ) b, |y - a / b| < 1 / (b : ℝ) ^ (2 + 1 / (n + 1 : ℕ) : ℝ) by
     simp only [mem_iUnion, mem_preimage]
@@ -51,7 +51,7 @@ theorem setOf_liouvilleWith_subset_aux :
   clear hxp x; intro x hxp hx01
   refine' ((hxp.frequently_lt_rpow_neg hn).and_eventually (eventually_ge_atTop 1)).mono _
   rintro b ⟨⟨a, -, hlt⟩, hb⟩
-  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt 
+  rw [rpow_neg b.cast_nonneg, ← one_div, ← Nat.cast_succ] at hlt
   refine' ⟨a, _, hlt⟩
   replace hb : (1 : ℝ) ≤ b; exact Nat.one_le_cast.2 hb
   have hb0 : (0 : ℝ) < b := zero_lt_one.trans_le hb
@@ -63,7 +63,7 @@ theorem setOf_liouvilleWith_subset_aux :
         rpow_le_rpow_of_exponent_le hb (one_le_two.trans ?_)
     simpa using n.cast_add_one_pos.le
   rw [sub_div' _ _ _ hb0.ne', abs_div, abs_of_pos hb0, div_lt_div_right hb0, abs_sub_lt_iff,
-    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt 
+    sub_lt_iff_lt_add, sub_lt_iff_lt_add, ← sub_lt_iff_lt_add'] at hlt
   rw [Finset.mem_Icc, ← Int.lt_add_one_iff, ← Int.lt_add_one_iff, ← neg_lt_iff_pos_add, add_comm, ←
     @Int.cast_lt ℝ, ← @Int.cast_lt ℝ]
   push_cast
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -31,7 +31,7 @@ open scoped Filter BigOperators ENNReal Topology NNReal
 
 open Filter Set Metric MeasureTheory Real
 
-local macro_rules | `($x ^ $y)   => `(HPow.hPow $x $y) -- Porting note: See Lean4 issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 theorem setOf_liouvilleWith_subset_aux :
     { x : ℝ | ∃ p > 2, LiouvilleWith p x } ⊆
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,17 +2,14 @@
 Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
-
-! This file was ported from Lean 3 source module number_theory.liouville.measure
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
 import Mathlib.NumberTheory.Liouville.Residual
 import Mathlib.NumberTheory.Liouville.LiouvilleWith
 import Mathlib.Analysis.PSeries
 
+#align_import number_theory.liouville.measure from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
+
 /-!
 # Volume of the set of Liouville numbers
 
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -17,7 +17,7 @@ import Mathlib.Analysis.PSeries
 # Volume of the set of Liouville numbers
 
 In this file we prove that the set of Liouville numbers with exponent (irrationality measure)
-strictly greater than two is a set of Lebesuge measure zero, see
+strictly greater than two is a set of Lebesgue measure zero, see
 `volume_iUnion_setOf_liouvilleWith`.
 
 Since this set is a residual set, we show that the filters `residual` and `volume.ae` are disjoint.
feat: port NumberTheory.Liouville.Measure (#4613)

Dependencies 12 + 1011

1012 files ported (98.8%)
449388 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