number_theory.liouville.liouville_withMathlib.NumberTheory.Liouville.LiouvilleWith

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -113,7 +113,7 @@ theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
   rcases h.exists_pos with ⟨C, hC₀, hC⟩
   have : ∀ᶠ n : ℕ in at_top, C < n ^ (p - q) := by
     simpa only [(· ∘ ·), neg_sub, one_div] using
-      ((tendsto_rpow_atTop (sub_pos.2 hlt)).comp tendsto_nat_cast_atTop_atTop).Eventually
+      ((tendsto_rpow_atTop (sub_pos.2 hlt)).comp tendsto_natCast_atTop_atTop).Eventually
         (eventually_gt_at_top C)
   refine' (this.and_frequently hC).mono _
   rintro n ⟨hnC, hn, m, hne, hlt⟩
Diff
@@ -169,7 +169,7 @@ theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x)
 
 #print LiouvilleWith.mul_int_iff /-
 theorem mul_int_iff (hm : m ≠ 0) : LiouvilleWith p (x * m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int, mul_rat_iff (Int.cast_ne_zero.2 hm)]
+  rw [← Rat.cast_intCast, mul_rat_iff (Int.cast_ne_zero.2 hm)]
 #align liouville_with.mul_int_iff LiouvilleWith.mul_int_iff
 -/
 
@@ -193,7 +193,7 @@ theorem int_mul (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (m * x)
 
 #print LiouvilleWith.mul_nat_iff /-
 theorem mul_nat_iff (hn : n ≠ 0) : LiouvilleWith p (x * n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat, mul_rat_iff (Nat.cast_ne_zero.2 hn)]
+  rw [← Rat.cast_natCast, mul_rat_iff (Nat.cast_ne_zero.2 hn)]
 #align liouville_with.mul_nat_iff LiouvilleWith.mul_nat_iff
 -/
 
@@ -254,7 +254,7 @@ theorem rat_add (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r + x) :=
 #print LiouvilleWith.add_int_iff /-
 @[simp]
 theorem add_int_iff : LiouvilleWith p (x + m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int m, add_rat_iff]
+  rw [← Rat.cast_intCast m, add_rat_iff]
 #align liouville_with.add_int_iff LiouvilleWith.add_int_iff
 -/
 
@@ -267,7 +267,7 @@ theorem int_add_iff : LiouvilleWith p (m + x) ↔ LiouvilleWith p x := by rw [ad
 #print LiouvilleWith.add_nat_iff /-
 @[simp]
 theorem add_nat_iff : LiouvilleWith p (x + n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat n, add_rat_iff]
+  rw [← Rat.cast_natCast n, add_rat_iff]
 #align liouville_with.add_nat_iff LiouvilleWith.add_nat_iff
 -/
 
@@ -334,7 +334,7 @@ theorem sub_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x - r) :=
 #print LiouvilleWith.sub_int_iff /-
 @[simp]
 theorem sub_int_iff : LiouvilleWith p (x - m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int, sub_rat_iff]
+  rw [← Rat.cast_intCast, sub_rat_iff]
 #align liouville_with.sub_int_iff LiouvilleWith.sub_int_iff
 -/
 
@@ -347,7 +347,7 @@ theorem sub_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x - m) :=
 #print LiouvilleWith.sub_nat_iff /-
 @[simp]
 theorem sub_nat_iff : LiouvilleWith p (x - n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat, sub_rat_iff]
+  rw [← Rat.cast_natCast, sub_rat_iff]
 #align liouville_with.sub_nat_iff LiouvilleWith.sub_nat_iff
 -/
 
Diff
@@ -98,7 +98,7 @@ theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x :=
   by
   rcases h.exists_pos with ⟨C, hC₀, hC⟩
   refine' ⟨C, hC.mono _⟩; rintro n ⟨hn, m, hne, hlt⟩
-  refine' ⟨m, hne, hlt.trans_le <| div_le_div_of_le_left hC₀.le _ _⟩
+  refine' ⟨m, hne, hlt.trans_le <| div_le_div_of_nonneg_left hC₀.le _ _⟩
   exacts [rpow_pos_of_pos (Nat.cast_pos.2 hn) _,
     rpow_le_rpow_of_exponent_le (Nat.one_le_cast.2 hn) hle]
 #align liouville_with.mono LiouvilleWith.mono
@@ -404,7 +404,7 @@ theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   rw [rpow_neg_one, ← one_div, sub_div' _ _ _ hn'.ne', abs_div, Nat.abs_cast, div_le_div_right hn']
   norm_cast
   rw [← zero_add (1 : ℤ), Int.add_one_le_iff, abs_pos, sub_ne_zero]
-  rw [Ne.def, eq_div_iff hn'.ne'] at hne 
+  rw [Ne.def, eq_div_iff hn'.ne'] at hne
   exact_mod_cast hne
 #align liouville_with.ne_cast_int LiouvilleWith.ne_cast_int
 -/
@@ -435,7 +435,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   by
   refine' Classical.not_not.1 fun H => _
   simp only [Liouville, Classical.not_forall, not_exists, not_frequently, not_and, not_lt,
-    eventually_at_top] at H 
+    eventually_at_top] at H
   rcases H with ⟨N, hN⟩
   have : ∀ b > (1 : ℕ), ∀ᶠ m : ℕ in at_top, ∀ a : ℤ, (1 / b ^ m : ℝ) ≤ |x - a / b| :=
     by
@@ -451,7 +451,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_at_top n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb ; push_cast at hne hlt 
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb; push_cast at hne hlt
   cases le_or_lt N b
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
Diff
@@ -456,7 +456,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
     have hb0 : (0 : ℝ) < b := zero_lt_one.trans hb
-    exact one_div_le_one_div_of_le (pow_pos hb0 _) (pow_le_pow hb.le hnm)
+    exact one_div_le_one_div_of_le (pow_pos hb0 _) (pow_le_pow_right hb.le hnm)
   · exact (hm b h hb _).not_lt hlt
 #align liouville.frequently_exists_num Liouville.frequently_exists_num
 -/
Diff
@@ -434,7 +434,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     ∃ᶠ b : ℕ in atTop, ∃ a : ℤ, x ≠ a / b ∧ |x - a / b| < 1 / b ^ n :=
   by
   refine' Classical.not_not.1 fun H => _
-  simp only [Liouville, not_forall, not_exists, not_frequently, not_and, not_lt,
+  simp only [Liouville, Classical.not_forall, not_exists, not_frequently, not_and, not_lt,
     eventually_at_top] at H 
   rcases H with ⟨N, hN⟩
   have : ∀ b > (1 : ℕ), ∀ᶠ m : ℕ in at_top, ∀ a : ℤ, (1 / b ^ m : ℝ) ≤ |x - a / b| :=
Diff
@@ -3,9 +3,9 @@ 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.Analysis.SpecialFunctions.Pow.Asymptotics
-import Mathbin.NumberTheory.Liouville.Basic
-import Mathbin.Topology.Instances.Irrational
+import Analysis.SpecialFunctions.Pow.Asymptotics
+import NumberTheory.Liouville.Basic
+import Topology.Instances.Irrational
 
 #align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
 
Diff
@@ -307,7 +307,7 @@ protected theorem neg (h : LiouvilleWith p x) : LiouvilleWith p (-x) :=
   rcases h with ⟨C, hC⟩
   refine' ⟨C, hC.mono _⟩
   rintro n ⟨m, hne, hlt⟩
-  use -m; simp [neg_div, abs_sub_comm _ x, *]
+  use-m; simp [neg_div, abs_sub_comm _ x, *]
 #align liouville_with.neg LiouvilleWith.neg
 -/
 
Diff
@@ -2,16 +2,13 @@
 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.liouville_with
-! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Pow.Asymptotics
 import Mathbin.NumberTheory.Liouville.Basic
 import Mathbin.Topology.Instances.Irrational
 
+#align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
+
 /-!
 # Liouville numbers with a given exponent
 
Diff
@@ -78,6 +78,7 @@ namespace LiouvilleWith
 
 variable {p q x y : ℝ} {r : ℚ} {m : ℤ} {n : ℕ}
 
+#print LiouvilleWith.exists_pos /-
 /-- The constant `C` provided by the definition of `liouville_with` can be made positive.
 We also add `1 ≤ n` to the list of assumptions about the denominator. While it is equivalent to
 the original statement, the case `n = 0` breaks many arguments. -/
@@ -92,7 +93,9 @@ theorem exists_pos (h : LiouvilleWith p x) :
   refine' ⟨hle, m, hne, hlt.trans_le _⟩
   exact div_le_div_of_le (rpow_nonneg_of_nonneg n.cast_nonneg _) (le_max_left _ _)
 #align liouville_with.exists_pos LiouvilleWith.exists_pos
+-/
 
+#print LiouvilleWith.mono /-
 /-- If a number is Liouville with exponent `p`, then it is Liouville with any smaller exponent. -/
 theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x :=
   by
@@ -102,7 +105,9 @@ theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x :=
   exacts [rpow_pos_of_pos (Nat.cast_pos.2 hn) _,
     rpow_le_rpow_of_exponent_le (Nat.one_le_cast.2 hn) hle]
 #align liouville_with.mono LiouvilleWith.mono
+-/
 
+#print LiouvilleWith.frequently_lt_rpow_neg /-
 /-- If `x` satisfies Liouville condition with exponent `p` and `q < p`, then `x`
 satisfies Liouville condition with exponent `q` and constant `1`. -/
 theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
@@ -119,7 +124,9 @@ theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
   refine' ⟨m, hne, hlt.trans <| (div_lt_iff <| rpow_pos_of_pos hn _).2 _⟩
   rwa [mul_comm, ← rpow_add hn, ← sub_eq_add_neg]
 #align liouville_with.frequently_lt_rpow_neg LiouvilleWith.frequently_lt_rpow_neg
+-/
 
+#print LiouvilleWith.mul_rat /-
 /-- The product of a Liouville number and a nonzero rational number is again a Liouville number.  -/
 theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r) :=
   by
@@ -136,7 +143,9 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
     rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
     exacts [(rpow_pos_of_pos (Nat.cast_pos.2 r.pos) _).ne', Nat.cast_nonneg _, Nat.cast_nonneg _]
 #align liouville_with.mul_rat LiouvilleWith.mul_rat
+-/
 
+#print LiouvilleWith.mul_rat_iff /-
 /-- The product `x * r`, `r : ℚ`, `r ≠ 0`, is a Liouville number with exponent `p` if and only if
 `x` satisfies the same condition. -/
 theorem mul_rat_iff (hr : r ≠ 0) : LiouvilleWith p (x * r) ↔ LiouvilleWith p x :=
@@ -145,49 +154,71 @@ theorem mul_rat_iff (hr : r ≠ 0) : LiouvilleWith p (x * r) ↔ LiouvilleWith p
       h.mul_rat (inv_ne_zero hr),
     fun h => h.mul_rat hr⟩
 #align liouville_with.mul_rat_iff LiouvilleWith.mul_rat_iff
+-/
 
+#print LiouvilleWith.rat_mul_iff /-
 /-- The product `r * x`, `r : ℚ`, `r ≠ 0`, is a Liouville number with exponent `p` if and only if
 `x` satisfies the same condition. -/
 theorem rat_mul_iff (hr : r ≠ 0) : LiouvilleWith p (r * x) ↔ LiouvilleWith p x := by
   rw [mul_comm, mul_rat_iff hr]
 #align liouville_with.rat_mul_iff LiouvilleWith.rat_mul_iff
+-/
 
+#print LiouvilleWith.rat_mul /-
 theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x) :=
   (rat_mul_iff hr).2 h
 #align liouville_with.rat_mul LiouvilleWith.rat_mul
+-/
 
+#print LiouvilleWith.mul_int_iff /-
 theorem mul_int_iff (hm : m ≠ 0) : LiouvilleWith p (x * m) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_int, mul_rat_iff (Int.cast_ne_zero.2 hm)]
 #align liouville_with.mul_int_iff LiouvilleWith.mul_int_iff
+-/
 
+#print LiouvilleWith.mul_int /-
 theorem mul_int (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (x * m) :=
   (mul_int_iff hm).2 h
 #align liouville_with.mul_int LiouvilleWith.mul_int
+-/
 
+#print LiouvilleWith.int_mul_iff /-
 theorem int_mul_iff (hm : m ≠ 0) : LiouvilleWith p (m * x) ↔ LiouvilleWith p x := by
   rw [mul_comm, mul_int_iff hm]
 #align liouville_with.int_mul_iff LiouvilleWith.int_mul_iff
+-/
 
+#print LiouvilleWith.int_mul /-
 theorem int_mul (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (m * x) :=
   (int_mul_iff hm).2 h
 #align liouville_with.int_mul LiouvilleWith.int_mul
+-/
 
+#print LiouvilleWith.mul_nat_iff /-
 theorem mul_nat_iff (hn : n ≠ 0) : LiouvilleWith p (x * n) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_nat, mul_rat_iff (Nat.cast_ne_zero.2 hn)]
 #align liouville_with.mul_nat_iff LiouvilleWith.mul_nat_iff
+-/
 
+#print LiouvilleWith.mul_nat /-
 theorem mul_nat (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (x * n) :=
   (mul_nat_iff hn).2 h
 #align liouville_with.mul_nat LiouvilleWith.mul_nat
+-/
 
+#print LiouvilleWith.nat_mul_iff /-
 theorem nat_mul_iff (hn : n ≠ 0) : LiouvilleWith p (n * x) ↔ LiouvilleWith p x := by
   rw [mul_comm, mul_nat_iff hn]
 #align liouville_with.nat_mul_iff LiouvilleWith.nat_mul_iff
+-/
 
+#print LiouvilleWith.nat_mul /-
 theorem nat_mul (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (n * x) := by rw [mul_comm];
   exact h.mul_nat hn
 #align liouville_with.nat_mul LiouvilleWith.nat_mul
+-/
 
+#print LiouvilleWith.add_rat /-
 theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) :=
   by
   rcases h.exists_pos with ⟨C, hC₀, hC⟩
@@ -202,54 +233,78 @@ theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) :=
   have : (r.denom ^ p : ℝ) ≠ 0 := (rpow_pos_of_pos hr _).ne'
   simp [mul_rpow, Nat.cast_nonneg, mul_div_mul_left, this]
 #align liouville_with.add_rat LiouvilleWith.add_rat
+-/
 
+#print LiouvilleWith.add_rat_iff /-
 @[simp]
 theorem add_rat_iff : LiouvilleWith p (x + r) ↔ LiouvilleWith p x :=
   ⟨fun h => by simpa using h.add_rat (-r), fun h => h.add_rat r⟩
 #align liouville_with.add_rat_iff LiouvilleWith.add_rat_iff
+-/
 
+#print LiouvilleWith.rat_add_iff /-
 @[simp]
 theorem rat_add_iff : LiouvilleWith p (r + x) ↔ LiouvilleWith p x := by rw [add_comm, add_rat_iff]
 #align liouville_with.rat_add_iff LiouvilleWith.rat_add_iff
+-/
 
+#print LiouvilleWith.rat_add /-
 theorem rat_add (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r + x) :=
   add_comm x r ▸ h.add_rat r
 #align liouville_with.rat_add LiouvilleWith.rat_add
+-/
 
+#print LiouvilleWith.add_int_iff /-
 @[simp]
 theorem add_int_iff : LiouvilleWith p (x + m) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_int m, add_rat_iff]
 #align liouville_with.add_int_iff LiouvilleWith.add_int_iff
+-/
 
+#print LiouvilleWith.int_add_iff /-
 @[simp]
 theorem int_add_iff : LiouvilleWith p (m + x) ↔ LiouvilleWith p x := by rw [add_comm, add_int_iff]
 #align liouville_with.int_add_iff LiouvilleWith.int_add_iff
+-/
 
+#print LiouvilleWith.add_nat_iff /-
 @[simp]
 theorem add_nat_iff : LiouvilleWith p (x + n) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_nat n, add_rat_iff]
 #align liouville_with.add_nat_iff LiouvilleWith.add_nat_iff
+-/
 
+#print LiouvilleWith.nat_add_iff /-
 @[simp]
 theorem nat_add_iff : LiouvilleWith p (n + x) ↔ LiouvilleWith p x := by rw [add_comm, add_nat_iff]
 #align liouville_with.nat_add_iff LiouvilleWith.nat_add_iff
+-/
 
+#print LiouvilleWith.add_int /-
 theorem add_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x + m) :=
   add_int_iff.2 h
 #align liouville_with.add_int LiouvilleWith.add_int
+-/
 
+#print LiouvilleWith.int_add /-
 theorem int_add (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (m + x) :=
   int_add_iff.2 h
 #align liouville_with.int_add LiouvilleWith.int_add
+-/
 
+#print LiouvilleWith.add_nat /-
 theorem add_nat (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (x + n) :=
   h.add_int n
 #align liouville_with.add_nat LiouvilleWith.add_nat
+-/
 
+#print LiouvilleWith.nat_add /-
 theorem nat_add (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (n + x) :=
   h.int_add n
 #align liouville_with.nat_add LiouvilleWith.nat_add
+-/
 
+#print LiouvilleWith.neg /-
 protected theorem neg (h : LiouvilleWith p x) : LiouvilleWith p (-x) :=
   by
   rcases h with ⟨C, hC⟩
@@ -257,63 +312,91 @@ protected theorem neg (h : LiouvilleWith p x) : LiouvilleWith p (-x) :=
   rintro n ⟨m, hne, hlt⟩
   use -m; simp [neg_div, abs_sub_comm _ x, *]
 #align liouville_with.neg LiouvilleWith.neg
+-/
 
+#print LiouvilleWith.neg_iff /-
 @[simp]
 theorem neg_iff : LiouvilleWith p (-x) ↔ LiouvilleWith p x :=
   ⟨fun h => neg_neg x ▸ h.neg, LiouvilleWith.neg⟩
 #align liouville_with.neg_iff LiouvilleWith.neg_iff
+-/
 
+#print LiouvilleWith.sub_rat_iff /-
 @[simp]
 theorem sub_rat_iff : LiouvilleWith p (x - r) ↔ LiouvilleWith p x := by
   rw [sub_eq_add_neg, ← Rat.cast_neg, add_rat_iff]
 #align liouville_with.sub_rat_iff LiouvilleWith.sub_rat_iff
+-/
 
+#print LiouvilleWith.sub_rat /-
 theorem sub_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x - r) :=
   sub_rat_iff.2 h
 #align liouville_with.sub_rat LiouvilleWith.sub_rat
+-/
 
+#print LiouvilleWith.sub_int_iff /-
 @[simp]
 theorem sub_int_iff : LiouvilleWith p (x - m) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_int, sub_rat_iff]
 #align liouville_with.sub_int_iff LiouvilleWith.sub_int_iff
+-/
 
+#print LiouvilleWith.sub_int /-
 theorem sub_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x - m) :=
   sub_int_iff.2 h
 #align liouville_with.sub_int LiouvilleWith.sub_int
+-/
 
+#print LiouvilleWith.sub_nat_iff /-
 @[simp]
 theorem sub_nat_iff : LiouvilleWith p (x - n) ↔ LiouvilleWith p x := by
   rw [← Rat.cast_coe_nat, sub_rat_iff]
 #align liouville_with.sub_nat_iff LiouvilleWith.sub_nat_iff
+-/
 
+#print LiouvilleWith.sub_nat /-
 theorem sub_nat (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (x - n) :=
   sub_nat_iff.2 h
 #align liouville_with.sub_nat LiouvilleWith.sub_nat
+-/
 
+#print LiouvilleWith.rat_sub_iff /-
 @[simp]
 theorem rat_sub_iff : LiouvilleWith p (r - x) ↔ LiouvilleWith p x := by simp [sub_eq_add_neg]
 #align liouville_with.rat_sub_iff LiouvilleWith.rat_sub_iff
+-/
 
+#print LiouvilleWith.rat_sub /-
 theorem rat_sub (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r - x) :=
   rat_sub_iff.2 h
 #align liouville_with.rat_sub LiouvilleWith.rat_sub
+-/
 
+#print LiouvilleWith.int_sub_iff /-
 @[simp]
 theorem int_sub_iff : LiouvilleWith p (m - x) ↔ LiouvilleWith p x := by simp [sub_eq_add_neg]
 #align liouville_with.int_sub_iff LiouvilleWith.int_sub_iff
+-/
 
+#print LiouvilleWith.int_sub /-
 theorem int_sub (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (m - x) :=
   int_sub_iff.2 h
 #align liouville_with.int_sub LiouvilleWith.int_sub
+-/
 
+#print LiouvilleWith.nat_sub_iff /-
 @[simp]
 theorem nat_sub_iff : LiouvilleWith p (n - x) ↔ LiouvilleWith p x := by simp [sub_eq_add_neg]
 #align liouville_with.nat_sub_iff LiouvilleWith.nat_sub_iff
+-/
 
+#print LiouvilleWith.nat_sub /-
 theorem nat_sub (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (n - x) :=
   nat_sub_iff.2 h
 #align liouville_with.nat_sub LiouvilleWith.nat_sub
+-/
 
+#print LiouvilleWith.ne_cast_int /-
 theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   by
   rintro rfl; rename' m => M
@@ -327,7 +410,9 @@ theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   rw [Ne.def, eq_div_iff hn'.ne'] at hne 
   exact_mod_cast hne
 #align liouville_with.ne_cast_int LiouvilleWith.ne_cast_int
+-/
 
+#print LiouvilleWith.irrational /-
 /-- A number satisfying the Liouville condition with exponent `p > 1` is an irrational number. -/
 protected theorem irrational (h : LiouvilleWith p x) (hp : 1 < p) : Irrational x :=
   by
@@ -337,6 +422,7 @@ protected theorem irrational (h : LiouvilleWith p x) (hp : 1 < p) : Irrational x
   · refine' (h.mul_rat (inv_ne_zero h0)).ne_cast_int hp 1 _
     simp [Rat.cast_ne_zero.2 h0]
 #align liouville_with.irrational LiouvilleWith.irrational
+-/
 
 end LiouvilleWith
 
@@ -344,6 +430,7 @@ namespace Liouville
 
 variable {x : ℝ}
 
+#print Liouville.frequently_exists_num /-
 /-- If `x` is a Liouville number, then for any `n`, for infinitely many denominators `b` there
 exists a numerator `a` such that `x ≠ a / b` and `|x - a / b| < 1 / b ^ n`. -/
 theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
@@ -375,6 +462,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     exact one_div_le_one_div_of_le (pow_pos hb0 _) (pow_le_pow hb.le hnm)
   · exact (hm b h hb _).not_lt hlt
 #align liouville.frequently_exists_num Liouville.frequently_exists_num
+-/
 
 #print Liouville.liouvilleWith /-
 /-- A Liouville number is a Liouville number with any real exponent. -/
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.liouville_with
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
+! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Topology.Instances.Irrational
 /-!
 # Liouville numbers with a given exponent
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We say that a real number `x` is a Liouville number with exponent `p : ℝ` if there exists a real
 number `C` such that for infinitely many denominators `n` there exists a numerator `m` such that
 `x ≠ m / n` and `|x - m / n| < C / n ^ p`. A number is a Liouville number in the sense of
@@ -43,6 +46,7 @@ open Filter Metric Real Set
 
 open scoped Filter Topology
 
+#print LiouvilleWith /-
 /-- We say that a real number `x` is a Liouville number with exponent `p : ℝ` if there exists a real
 number `C` such that for infinitely many denominators `n` there exists a numerator `m` such that
 `x ≠ m / n` and `|x - m / n| < C / n ^ p`.
@@ -52,7 +56,9 @@ exponent. -/
 def LiouvilleWith (p x : ℝ) : Prop :=
   ∃ C, ∃ᶠ n : ℕ in atTop, ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < C / n ^ p
 #align liouville_with LiouvilleWith
+-/
 
+#print liouvilleWith_one /-
 /-- For `p = 1` (hence, for any `p ≤ 1`), the condition `liouville_with p x` is trivial. -/
 theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x :=
   by
@@ -66,6 +72,7 @@ theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x :=
     add_div_eq_mul_add_div _ _ hn'.ne', div_lt_div_right hn']
   simpa [bit0, ← add_assoc] using (Int.floor_le (x * n)).trans_lt (lt_add_one _)
 #align liouville_with_one liouvilleWith_one
+-/
 
 namespace LiouvilleWith
 
@@ -360,7 +367,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_at_top n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le; norm_cast  at hb ; push_cast at hne hlt 
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb ; push_cast at hne hlt 
   cases le_or_lt N b
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
@@ -369,6 +376,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   · exact (hm b h hb _).not_lt hlt
 #align liouville.frequently_exists_num Liouville.frequently_exists_num
 
+#print Liouville.liouvilleWith /-
 /-- A Liouville number is a Liouville number with any real exponent. -/
 protected theorem liouvilleWith (hx : Liouville x) (p : ℝ) : LiouvilleWith p x :=
   by
@@ -378,9 +386,11 @@ protected theorem liouvilleWith (hx : Liouville x) (p : ℝ) : LiouvilleWith p x
   refine' ⟨a, hne, _⟩
   rwa [rpow_nat_cast]
 #align liouville.liouville_with Liouville.liouvilleWith
+-/
 
 end Liouville
 
+#print forall_liouvilleWith_iff /-
 /-- A number satisfies the Liouville condition with any exponent if and only if it is a Liouville
 number. -/
 theorem forall_liouvilleWith_iff {x : ℝ} : (∀ p, LiouvilleWith p x) ↔ Liouville x :=
@@ -391,4 +401,5 @@ theorem forall_liouvilleWith_iff {x : ℝ} : (∀ p, LiouvilleWith p x) ↔ Liou
     ⟨b, hb, a, hne, hlt⟩
   exact ⟨a, b, by exact_mod_cast hb, hne, by simpa [rpow_neg] using hlt⟩
 #align forall_liouville_with_iff forall_liouvilleWith_iff
+-/
 
Diff
@@ -75,7 +75,7 @@ variable {p q x y : ℝ} {r : ℚ} {m : ℤ} {n : ℕ}
 We also add `1 ≤ n` to the list of assumptions about the denominator. While it is equivalent to
 the original statement, the case `n = 0` breaks many arguments. -/
 theorem exists_pos (h : LiouvilleWith p x) :
-    ∃ (C : ℝ)(h₀ : 0 < C),
+    ∃ (C : ℝ) (h₀ : 0 < C),
       ∃ᶠ n : ℕ in atTop, 1 ≤ n ∧ ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < C / n ^ p :=
   by
   rcases h with ⟨C, hC⟩
@@ -92,7 +92,7 @@ theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x :=
   rcases h.exists_pos with ⟨C, hC₀, hC⟩
   refine' ⟨C, hC.mono _⟩; rintro n ⟨hn, m, hne, hlt⟩
   refine' ⟨m, hne, hlt.trans_le <| div_le_div_of_le_left hC₀.le _ _⟩
-  exacts[rpow_pos_of_pos (Nat.cast_pos.2 hn) _,
+  exacts [rpow_pos_of_pos (Nat.cast_pos.2 hn) _,
     rpow_le_rpow_of_exponent_le (Nat.one_le_cast.2 hn) hle]
 #align liouville_with.mono LiouvilleWith.mono
 
@@ -127,7 +127,7 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
     simp only [smul_eq_mul, id.def, Nat.cast_mul]
     refine' (mul_lt_mul_of_pos_right hlt <| abs_pos.2 <| Rat.cast_ne_zero.2 hr).trans_le _
     rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
-    exacts[(rpow_pos_of_pos (Nat.cast_pos.2 r.pos) _).ne', Nat.cast_nonneg _, Nat.cast_nonneg _]
+    exacts [(rpow_pos_of_pos (Nat.cast_pos.2 r.pos) _).ne', Nat.cast_nonneg _, Nat.cast_nonneg _]
 #align liouville_with.mul_rat LiouvilleWith.mul_rat
 
 /-- The product `x * r`, `r : ℚ`, `r ≠ 0`, is a Liouville number with exponent `p` if and only if
@@ -317,7 +317,7 @@ theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   rw [rpow_neg_one, ← one_div, sub_div' _ _ _ hn'.ne', abs_div, Nat.abs_cast, div_le_div_right hn']
   norm_cast
   rw [← zero_add (1 : ℤ), Int.add_one_le_iff, abs_pos, sub_ne_zero]
-  rw [Ne.def, eq_div_iff hn'.ne'] at hne
+  rw [Ne.def, eq_div_iff hn'.ne'] at hne 
   exact_mod_cast hne
 #align liouville_with.ne_cast_int LiouvilleWith.ne_cast_int
 
@@ -344,7 +344,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   by
   refine' Classical.not_not.1 fun H => _
   simp only [Liouville, not_forall, not_exists, not_frequently, not_and, not_lt,
-    eventually_at_top] at H
+    eventually_at_top] at H 
   rcases H with ⟨N, hN⟩
   have : ∀ b > (1 : ℕ), ∀ᶠ m : ℕ in at_top, ∀ a : ℤ, (1 / b ^ m : ℝ) ≤ |x - a / b| :=
     by
@@ -360,7 +360,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_at_top n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le; norm_cast  at hb; push_cast at hne hlt
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast  at hb ; push_cast at hne hlt 
   cases le_or_lt N b
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
Diff
@@ -41,7 +41,7 @@ Liouville number, irrational, irrationality exponent
 
 open Filter Metric Real Set
 
-open Filter Topology
+open scoped Filter Topology
 
 /-- We say that a real number `x` is a Liouville number with exponent `p : ℝ` if there exists a real
 number `C` such that for infinitely many denominators `n` there exists a numerator `m` such that
Diff
@@ -59,9 +59,7 @@ theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x :=
   use 2
   refine' ((eventually_gt_at_top 0).mono fun n hn => _).Frequently
   have hn' : (0 : ℝ) < n := by simpa
-  have : x < ↑(⌊x * ↑n⌋ + 1) / ↑n :=
-    by
-    rw [lt_div_iff hn', Int.cast_add, Int.cast_one]
+  have : x < ↑(⌊x * ↑n⌋ + 1) / ↑n := by rw [lt_div_iff hn', Int.cast_add, Int.cast_one];
     exact Int.lt_floor_add_one _
   refine' ⟨⌊x * n⌋ + 1, this.ne, _⟩
   rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
@@ -124,8 +122,7 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
   have A : (↑(r.num * m) : ℝ) / ↑(r.denom • id n) = m / n * r := by
     simp [← div_mul_div_comm, ← r.cast_def, mul_comm]
   refine' ⟨r.num * m, _, _⟩
-  · rw [A]
-    simp [hne, hr]
+  · rw [A]; simp [hne, hr]
   · rw [A, ← sub_mul, abs_mul]
     simp only [smul_eq_mul, id.def, Nat.cast_mul]
     refine' (mul_lt_mul_of_pos_right hlt <| abs_pos.2 <| Rat.cast_ne_zero.2 hr).trans_le _
@@ -180,9 +177,7 @@ theorem nat_mul_iff (hn : n ≠ 0) : LiouvilleWith p (n * x) ↔ LiouvilleWith p
   rw [mul_comm, mul_nat_iff hn]
 #align liouville_with.nat_mul_iff LiouvilleWith.nat_mul_iff
 
-theorem nat_mul (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (n * x) :=
-  by
-  rw [mul_comm]
+theorem nat_mul (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (n * x) := by rw [mul_comm];
   exact h.mul_nat hn
 #align liouville_with.nat_mul LiouvilleWith.nat_mul
 
@@ -195,8 +190,7 @@ theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) :=
   have hn' : (n : ℝ) ≠ 0 := Nat.cast_ne_zero.2 (zero_lt_one.trans_le hn).ne'
   have : (↑(r.denom * m + r.num * n : ℤ) / ↑(r.denom • id n) : ℝ) = m / n + r := by
     simp [add_div, hr.ne', mul_div_mul_left, mul_div_mul_right, hn', ← Rat.cast_def]
-  refine' ⟨r.denom * m + r.num * n, _⟩
-  rw [this, add_sub_add_right_eq_sub]
+  refine' ⟨r.denom * m + r.num * n, _⟩; rw [this, add_sub_add_right_eq_sub]
   refine' ⟨by simpa, hlt.trans_le (le_of_eq _)⟩
   have : (r.denom ^ p : ℝ) ≠ 0 := (rpow_pos_of_pos hr _).ne'
   simp [mul_rpow, Nat.cast_nonneg, mul_div_mul_left, this]
@@ -315,8 +309,7 @@ theorem nat_sub (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (n - x) :=
 
 theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   by
-  rintro rfl
-  rename' m => M
+  rintro rfl; rename' m => M
   rcases((eventually_gt_at_top 0).and_frequently (h.frequently_lt_rpow_neg hp)).exists with
     ⟨n : ℕ, hn : 0 < n, m : ℤ, hne : (M : ℝ) ≠ m / n, hlt : |(M - m / n : ℝ)| < n ^ (-1 : ℝ)⟩
   refine' hlt.not_le _
@@ -333,8 +326,7 @@ protected theorem irrational (h : LiouvilleWith p x) (hp : 1 < p) : Irrational x
   by
   rintro ⟨r, rfl⟩
   rcases eq_or_ne r 0 with (rfl | h0)
-  · refine' h.ne_cast_int hp 0 _
-    rw [Rat.cast_zero, Int.cast_zero]
+  · refine' h.ne_cast_int hp 0 _; rw [Rat.cast_zero, Int.cast_zero]
   · refine' (h.mul_rat (inv_ne_zero h0)).ne_cast_int hp 1 _
     simp [Rat.cast_ne_zero.2 h0]
 #align liouville_with.irrational LiouvilleWith.irrational
@@ -368,9 +360,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_at_top n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le
-  norm_cast  at hb
-  push_cast at hne hlt
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast  at hb; push_cast at hne hlt
   cases le_or_lt N b
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
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.liouville_with
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.SpecialFunctions.Pow
+import Mathbin.Analysis.SpecialFunctions.Pow.Asymptotics
 import Mathbin.NumberTheory.Liouville.Basic
 import Mathbin.Topology.Instances.Irrational
 

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
@@ -101,7 +101,7 @@ theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
   rcases h.exists_pos with ⟨C, _hC₀, hC⟩
   have : ∀ᶠ n : ℕ in atTop, C < n ^ (p - q) := by
     simpa only [(· ∘ ·), neg_sub, one_div] using
-      ((tendsto_rpow_atTop (sub_pos.2 hlt)).comp tendsto_nat_cast_atTop_atTop).eventually
+      ((tendsto_rpow_atTop (sub_pos.2 hlt)).comp tendsto_natCast_atTop_atTop).eventually
         (eventually_gt_atTop C)
   refine (this.and_frequently hC).mono ?_
   rintro n ⟨hnC, hn, m, hne, hlt⟩
@@ -370,7 +370,7 @@ protected theorem liouvilleWith (hx : Liouville x) (p : ℝ) : LiouvilleWith p x
   refine ⟨1, ((eventually_gt_atTop 1).and_frequently (hx.frequently_exists_num ⌈p⌉₊)).mono ?_⟩
   rintro b ⟨_hb, a, hne, hlt⟩
   refine ⟨a, hne, ?_⟩
-  rwa [rpow_nat_cast]
+  rwa [rpow_natCast]
 #align liouville.liouville_with Liouville.liouvilleWith
 
 end Liouville
chore: avoid id.def (adaptation for nightly-2024-03-27) (#11829)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -120,7 +120,7 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
   refine ⟨r.num * m, ?_, ?_⟩
   · rw [A]; simp [hne, hr]
   · rw [A, ← sub_mul, abs_mul]
-    simp only [smul_eq_mul, id.def, Nat.cast_mul]
+    simp only [smul_eq_mul, id, Nat.cast_mul]
     calc _ < C / ↑n ^ p * |↑r| := by gcongr
       _ = ↑r.den ^ p * (↑|r| * C) / (↑r.den * ↑n) ^ p := ?_
     rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
@@ -184,7 +184,7 @@ theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) := b
   refine ⟨r.den ^ p * C, (tendsto_id.nsmul_atTop r.pos).frequently (hC.mono ?_)⟩
   rintro n ⟨hn, m, hne, hlt⟩
   have : (↑(r.den * m + r.num * n : ℤ) / ↑(r.den • id n) : ℝ) = m / n + r := by
-    rw [Algebra.id.smul_eq_mul, id.def]
+    rw [Algebra.id.smul_eq_mul, id]
     nth_rewrite 4 [← Rat.num_div_den r]
     push_cast
     rw [add_div, mul_div_mul_left _ _ (by positivity), mul_div_mul_right _ _ (by positivity)]
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -316,7 +316,7 @@ theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   rw [rpow_neg_one, ← one_div, sub_div' _ _ _ hn'.ne', abs_div, Nat.abs_cast, div_le_div_right hn']
   norm_cast
   rw [← zero_add (1 : ℤ), Int.add_one_le_iff, abs_pos, sub_ne_zero]
-  rw [Ne.def, eq_div_iff hn'.ne'] at hne
+  rw [Ne, eq_div_iff hn'.ne'] at hne
   exact mod_cast hne
 #align liouville_with.ne_cast_int LiouvilleWith.ne_cast_int
 
chore: Rename cat_coe_nat/cast_coe_int to cast_natCast/cast_intCast (#11552)

Reduce the diff of #11499

Diff
@@ -148,7 +148,7 @@ theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x)
 #align liouville_with.rat_mul LiouvilleWith.rat_mul
 
 theorem mul_int_iff (hm : m ≠ 0) : LiouvilleWith p (x * m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int, mul_rat_iff (Int.cast_ne_zero.2 hm)]
+  rw [← Rat.cast_intCast, mul_rat_iff (Int.cast_ne_zero.2 hm)]
 #align liouville_with.mul_int_iff LiouvilleWith.mul_int_iff
 
 theorem mul_int (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (x * m) :=
@@ -164,7 +164,7 @@ theorem int_mul (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (m * x)
 #align liouville_with.int_mul LiouvilleWith.int_mul
 
 theorem mul_nat_iff (hn : n ≠ 0) : LiouvilleWith p (x * n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat, mul_rat_iff (Nat.cast_ne_zero.2 hn)]
+  rw [← Rat.cast_natCast, mul_rat_iff (Nat.cast_ne_zero.2 hn)]
 #align liouville_with.mul_nat_iff LiouvilleWith.mul_nat_iff
 
 theorem mul_nat (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (x * n) :=
@@ -209,7 +209,7 @@ theorem rat_add (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r + x) :=
 
 @[simp]
 theorem add_int_iff : LiouvilleWith p (x + m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int m, add_rat_iff]
+  rw [← Rat.cast_intCast m, add_rat_iff]
 #align liouville_with.add_int_iff LiouvilleWith.add_int_iff
 
 @[simp]
@@ -218,7 +218,7 @@ theorem int_add_iff : LiouvilleWith p (m + x) ↔ LiouvilleWith p x := by rw [ad
 
 @[simp]
 theorem add_nat_iff : LiouvilleWith p (x + n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat n, add_rat_iff]
+  rw [← Rat.cast_natCast n, add_rat_iff]
 #align liouville_with.add_nat_iff LiouvilleWith.add_nat_iff
 
 @[simp]
@@ -267,7 +267,7 @@ theorem sub_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x - r) :=
 
 @[simp]
 theorem sub_int_iff : LiouvilleWith p (x - m) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_int, sub_rat_iff]
+  rw [← Rat.cast_intCast, sub_rat_iff]
 #align liouville_with.sub_int_iff LiouvilleWith.sub_int_iff
 
 theorem sub_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x - m) :=
@@ -276,7 +276,7 @@ theorem sub_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x - m) :=
 
 @[simp]
 theorem sub_nat_iff : LiouvilleWith p (x - n) ↔ LiouvilleWith p x := by
-  rw [← Rat.cast_coe_nat, sub_rat_iff]
+  rw [← Rat.cast_natCast, sub_rat_iff]
 #align liouville_with.sub_nat_iff LiouvilleWith.sub_nat_iff
 
 theorem sub_nat (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (x - n) :=
feat: positivity extension for Rat.num, Rat.den (#10218)

and rename num_nonneg_iff_zero_le to num_nonneg, num_pos_iff_pos to num_pos

From LeanAPAP

Diff
@@ -125,7 +125,6 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
       _ = ↑r.den ^ p * (↑|r| * C) / (↑r.den * ↑n) ^ p := ?_
     rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
     · simp only [Rat.cast_abs, le_refl]
-    have := r.pos
     all_goals positivity
 #align liouville_with.mul_rat LiouvilleWith.mul_rat
 
@@ -184,16 +183,14 @@ theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) := b
   rcases h.exists_pos with ⟨C, _hC₀, hC⟩
   refine ⟨r.den ^ p * C, (tendsto_id.nsmul_atTop r.pos).frequently (hC.mono ?_)⟩
   rintro n ⟨hn, m, hne, hlt⟩
-  have hr : (0 : ℝ) < r.den := Nat.cast_pos.2 r.pos
-  have hn' : (n : ℝ) ≠ 0 := by positivity
   have : (↑(r.den * m + r.num * n : ℤ) / ↑(r.den • id n) : ℝ) = m / n + r := by
     rw [Algebra.id.smul_eq_mul, id.def]
     nth_rewrite 4 [← Rat.num_div_den r]
     push_cast
-    rw [add_div, mul_div_mul_left _ _ (ne_of_gt hr), mul_div_mul_right _ _ hn']
+    rw [add_div, mul_div_mul_left _ _ (by positivity), mul_div_mul_right _ _ (by positivity)]
   refine ⟨r.den * m + r.num * n, ?_⟩; rw [this, add_sub_add_right_eq_sub]
   refine ⟨by simpa, hlt.trans_le (le_of_eq ?_)⟩
-  have : (r.den ^ p : ℝ) ≠ 0 := (rpow_pos_of_pos hr _).ne'
+  have : (r.den ^ p : ℝ) ≠ 0 := by positivity
   simp [mul_rpow, Nat.cast_nonneg, mul_div_mul_left, this]
 #align liouville_with.add_rat LiouvilleWith.add_rat
 
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
@@ -369,7 +369,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
 
 /-- A Liouville number is a Liouville number with any real exponent. -/
 protected theorem liouvilleWith (hx : Liouville x) (p : ℝ) : LiouvilleWith p x := by
-  suffices : LiouvilleWith ⌈p⌉₊ x; exact this.mono (Nat.le_ceil p)
+  suffices LiouvilleWith ⌈p⌉₊ x from this.mono (Nat.le_ceil p)
   refine ⟨1, ((eventually_gt_atTop 1).and_frequently (hx.frequently_exists_num ⌈p⌉₊)).mono ?_⟩
   rintro b ⟨_hb, a, hne, hlt⟩
   refine ⟨a, hne, ?_⟩
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -360,7 +360,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   rcases (this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
   lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb; push_cast at hne hlt
-  cases' le_or_lt N b with h h
+  rcases le_or_lt N b with h | h
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     gcongr
     exact_mod_cast hb.le
feat: golf using gcongr throughout the library (#8752)

Following on from previous gcongr golfing PRs #4702 and #4784.

This is a replacement for #7901: this round of golfs, first introduced there, there exposed some performance issues in gcongr, hopefully fixed by #8731, and I am opening a new PR so that the performance can be checked against current master rather than master at the time of #7901.

Diff
@@ -60,9 +60,10 @@ theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x := by
     exact Int.lt_floor_add_one _
   refine ⟨⌊x * n⌋ + 1, this.ne, ?_⟩
   rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
-    add_div_eq_mul_add_div _ _ hn'.ne', div_lt_div_right hn']
-  convert add_lt_add_right ((Int.floor_le (x * n)).trans_lt (lt_add_one _)) 1 using 1 <;>
-    (try push_cast) <;> ring
+    add_div_eq_mul_add_div _ _ hn'.ne']
+  gcongr
+  calc _ ≤ x * n + 1 := by push_cast; gcongr; apply Int.floor_le
+    _ < x * n + 2 := by linarith
 #align liouville_with_one liouvilleWith_one
 
 namespace LiouvilleWith
@@ -80,16 +81,17 @@ theorem exists_pos (h : LiouvilleWith p x) :
   refine ((eventually_ge_atTop 1).and_frequently hC).mono ?_
   rintro n ⟨hle, m, hne, hlt⟩
   refine ⟨hle, m, hne, hlt.trans_le ?_⟩
-  exact div_le_div_of_le (rpow_nonneg_of_nonneg n.cast_nonneg _) (le_max_left _ _)
+  gcongr
+  apply le_max_left
 #align liouville_with.exists_pos LiouvilleWith.exists_pos
 
 /-- If a number is Liouville with exponent `p`, then it is Liouville with any smaller exponent. -/
 theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x := by
   rcases h.exists_pos with ⟨C, hC₀, hC⟩
   refine ⟨C, hC.mono ?_⟩; rintro n ⟨hn, m, hne, hlt⟩
-  refine ⟨m, hne, hlt.trans_le <| div_le_div_of_le_left hC₀.le ?_ ?_⟩
-  exacts [rpow_pos_of_pos (Nat.cast_pos.2 hn) _,
-    rpow_le_rpow_of_exponent_le (Nat.one_le_cast.2 hn) hle]
+  refine ⟨m, hne, hlt.trans_le <| ?_⟩
+  gcongr
+  exact_mod_cast hn
 #align liouville_with.mono LiouvilleWith.mono
 
 /-- If `x` satisfies Liouville condition with exponent `p` and `q < p`, then `x`
@@ -119,12 +121,12 @@ theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r)
   · rw [A]; simp [hne, hr]
   · rw [A, ← sub_mul, abs_mul]
     simp only [smul_eq_mul, id.def, Nat.cast_mul]
-    refine (mul_lt_mul_of_pos_right hlt <| abs_pos.2 <| Rat.cast_ne_zero.2 hr).trans_le ?_
+    calc _ < C / ↑n ^ p * |↑r| := by gcongr
+      _ = ↑r.den ^ p * (↑|r| * C) / (↑r.den * ↑n) ^ p := ?_
     rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
     · simp only [Rat.cast_abs, le_refl]
-    · exact (rpow_pos_of_pos (Nat.cast_pos.2 r.pos) _).ne'
-    · exact Nat.cast_nonneg _
-    · exact Nat.cast_nonneg _
+    have := r.pos
+    all_goals positivity
 #align liouville_with.mul_rat LiouvilleWith.mul_rat
 
 /-- The product `x * r`, `r : ℚ`, `r ≠ 0`, is a Liouville number with exponent `p` if and only if
@@ -183,7 +185,7 @@ theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r) := b
   refine ⟨r.den ^ p * C, (tendsto_id.nsmul_atTop r.pos).frequently (hC.mono ?_)⟩
   rintro n ⟨hn, m, hne, hlt⟩
   have hr : (0 : ℝ) < r.den := Nat.cast_pos.2 r.pos
-  have hn' : (n : ℝ) ≠ 0 := Nat.cast_ne_zero.2 (zero_lt_one.trans_le hn).ne'
+  have hn' : (n : ℝ) ≠ 0 := by positivity
   have : (↑(r.den * m + r.num * n : ℤ) / ↑(r.den • id n) : ℝ) = m / n + r := by
     rw [Algebra.id.smul_eq_mul, id.def]
     nth_rewrite 4 [← Rat.num_div_den r]
@@ -360,9 +362,8 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
   lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb; push_cast at hne hlt
   cases' le_or_lt N b with h h
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
-    replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
-    have hb0 : (0 : ℝ) < b := zero_lt_one.trans hb
-    exact one_div_le_one_div_of_le (pow_pos hb0 _) (pow_le_pow hb.le hnm)
+    gcongr
+    exact_mod_cast hb.le
   · exact (hm b h hb _).not_lt hlt
 #align liouville.frequently_exists_num Liouville.frequently_exists_num
 
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -318,7 +318,7 @@ theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m :=
   norm_cast
   rw [← zero_add (1 : ℤ), Int.add_one_le_iff, abs_pos, sub_ne_zero]
   rw [Ne.def, eq_div_iff hn'.ne'] at hne
-  exact_mod_cast hne
+  exact mod_cast hne
 #align liouville_with.ne_cast_int LiouvilleWith.ne_cast_int
 
 /-- A number satisfying the Liouville condition with exponent `p > 1` is an irrational number. -/
@@ -384,5 +384,5 @@ theorem forall_liouvilleWith_iff {x : ℝ} : (∀ p, LiouvilleWith p x) ↔ Liou
   rcases ((eventually_gt_atTop 1).and_frequently
     ((H (n + 1)).frequently_lt_rpow_neg (lt_add_one (n : ℝ)))).exists
     with ⟨b, hb, a, hne, hlt⟩
-  exact ⟨a, b, by exact_mod_cast hb, hne, by simpa [rpow_neg] using hlt⟩
+  exact ⟨a, b, mod_cast hb, hne, by simpa [rpow_neg] using hlt⟩
 #align forall_liouville_with_iff forall_liouvilleWith_iff
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
@@ -337,8 +337,6 @@ namespace Liouville
 
 variable {x : ℝ}
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 /-- If `x` is a Liouville number, then for any `n`, for infinitely many denominators `b` there
 exists a numerator `a` such that `x ≠ a / b` and `|x - a / b| < 1 / b ^ n`. -/
 theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
chore: missing spaces after rcases, convert and congrm (#7725)

Replace rcases( with rcases (. Same thing for convert( and congrm(. No other change.

Diff
@@ -310,7 +310,7 @@ theorem nat_sub (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (n - x) :=
 
 theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m := by
   rintro rfl; rename' m => M
-  rcases((eventually_gt_atTop 0).and_frequently (h.frequently_lt_rpow_neg hp)).exists with
+  rcases ((eventually_gt_atTop 0).and_frequently (h.frequently_lt_rpow_neg hp)).exists with
     ⟨n : ℕ, hn : 0 < n, m : ℤ, hne : (M : ℝ) ≠ m / n, hlt : |(M - m / n : ℝ)| < n ^ (-1 : ℝ)⟩
   refine hlt.not_le ?_
   have hn' : (0 : ℝ) < n := by simpa
@@ -357,7 +357,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     exact fun m hm a => hm a
   have : ∀ᶠ m : ℕ in atTop, ∀ b < N, 1 < b → ∀ a : ℤ, 1 / (b : ℝ) ^ m ≤ |x - a / b| :=
     (finite_lt_nat N).eventually_all.2 fun b _hb => eventually_imp_distrib_left.2 (this b)
-  rcases(this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
+  rcases (this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
   lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb; push_cast at hne hlt
   cases' le_or_lt N b with h h
chore: bump to nightly-2023-08-17 (#6019)

The major change here is adapting to simp failing if it makes no progress. The vast majority of the redundant simps found due to this change were extracted to #6632.

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

Diff
@@ -62,7 +62,7 @@ theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x := by
   rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
     add_div_eq_mul_add_div _ _ hn'.ne', div_lt_div_right hn']
   convert add_lt_add_right ((Int.floor_le (x * n)).trans_lt (lt_add_one _)) 1 using 1 <;>
-  push_cast <;> ring
+    (try push_cast) <;> ring
 #align liouville_with_one liouvilleWith_one
 
 namespace LiouvilleWith
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -337,7 +337,7 @@ namespace Liouville
 
 variable {x : ℝ}
 
-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 `x` is a Liouville number, then for any `n`, for infinitely many denominators `b` there
 exists a numerator `a` such that `x ≠ a / b` and `|x - a / b| < 1 / b ^ n`. -/
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) 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.liouville_with
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics
 import Mathlib.NumberTheory.Liouville.Basic
 import Mathlib.Topology.Instances.Irrational
 
+#align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
+
 /-!
 # Liouville numbers with a given exponent
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -388,6 +388,6 @@ theorem forall_liouvilleWith_iff {x : ℝ} : (∀ p, LiouvilleWith p x) ↔ Liou
   refine ⟨fun H n => ?_, Liouville.liouvilleWith⟩
   rcases ((eventually_gt_atTop 1).and_frequently
     ((H (n + 1)).frequently_lt_rpow_neg (lt_add_one (n : ℝ)))).exists
-    with  ⟨b, hb, a, hne, hlt⟩
+    with ⟨b, hb, a, hne, hlt⟩
   exact ⟨a, b, by exact_mod_cast hb, hne, by simpa [rpow_neg] using hlt⟩
 #align forall_liouville_with_iff forall_liouvilleWith_iff
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -362,7 +362,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b _hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb ; push_cast at hne hlt
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb; push_cast at hne hlt
   cases' le_or_lt N b with h h
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -362,7 +362,7 @@ theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
     (finite_lt_nat N).eventually_all.2 fun b _hb => eventually_imp_distrib_left.2 (this b)
   rcases(this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
   rcases hx m with ⟨a, b, hb, hne, hlt⟩
-  lift b to ℕ using zero_le_one.trans hb.le; norm_cast  at hb ; push_cast at hne hlt
+  lift b to ℕ using zero_le_one.trans hb.le; norm_cast at hb ; push_cast at hne hlt
   cases' le_or_lt N b with h h
   · refine' (hN b h a hne).not_lt (hlt.trans_le _)
     replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
feat: port NumberTheory.Liouville.LiouvilleWith (#4596)

Dependencies 12 + 918

919 files ported (98.7%)
401756 lines ported (98.6%)
Show graph

The unported dependencies are

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