Skip to content

Commit

Permalink
Bump mathlib
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelDillies committed Aug 26, 2024
1 parent 0e6c20d commit 7bc4dcd
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 292 deletions.
1 change: 0 additions & 1 deletion LeanAPAP.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import LeanAPAP.Extras.BSG
import LeanAPAP.FiniteField.Basic
import LeanAPAP.Mathlib.Algebra.Group.AddChar
import LeanAPAP.Mathlib.Algebra.Order.Group.Unbundled.Basic
import LeanAPAP.Mathlib.Algebra.Order.GroupWithZero.Unbundled
import LeanAPAP.Mathlib.Analysis.RCLike.Basic
import LeanAPAP.Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar
import LeanAPAP.Mathlib.Analysis.SpecialFunctions.Log.Basic
Expand Down
6 changes: 3 additions & 3 deletions LeanAPAP/Extras/BSG.lean
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ lemma lemma_one {c K : ℝ} (hc : 0 < c) (hK : 0 < K)
refine h.le.trans ?_
rw [mul_assoc]
gcongr _ * ?_
field_simp [hA, hB, hK, le_div_iff, div_le_iff] at hE ⊢
field_simp [hA, hB, hK, le_div_iff, div_le_iff] at hE ⊢
convert_to (A.card ^ 2 * B.card) ^ 2 ≤ (E[A, B] * K) ^ 2
· ring_nf
· ring_nf
Expand Down Expand Up @@ -407,8 +407,8 @@ theorem BSG_aux {K : ℝ} (hK : 0 < K) (hA : (0 : ℝ) < A.card) (hB : (0 : ℝ)
· rw [← mul_inv, inv_mul_eq_div]
exact oneOfPair_bound (filter_subset _ _) this (hX₃.trans_eq' (by norm_num)) hX₂
have := big_quadruple_bound (H := H) (fun x hx ↦ (mem_filter.1 hx).2) (filter_subset _ _) hX₂
rw [le_div_iff (by positivity)]
rw [mul_div_assoc', div_le_iff (by positivity)] at this
rw [le_div_iff (by positivity)]
rw [mul_div_assoc', div_le_iff (by positivity)] at this
exact this.trans_eq (by ring)

theorem BSG {K : ℝ} (hK : 0 ≤ K) (hB : B.Nonempty) (hAB : K⁻¹ * (A.card ^ 2 * B.card) ≤ E[A, B]) :
Expand Down
14 changes: 6 additions & 8 deletions LeanAPAP/FiniteField/Basic.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import LeanAPAP.Mathlib.Algebra.Order.GroupWithZero.Unbundled
import LeanAPAP.Mathlib.Analysis.SpecialFunctions.Log.Basic
import LeanAPAP.Mathlib.Analysis.SpecialFunctions.Pow.Real
import LeanAPAP.Mathlib.Data.Rat.Cast.Order
import LeanAPAP.Prereqs.Convolution.ThreeAP
import LeanAPAP.Prereqs.FourierTransform.Compact
Expand Down Expand Up @@ -30,7 +28,7 @@ lemma global_dichotomy (hA : A.Nonempty) (hγC : γ ≤ C.dens) (hγ : 0 < γ)
Nat.succ_le_iff.1 (le_mul_of_one_le_right zero_le' $ Nat.ceil_pos.2 $ curlog_pos hγ hγ₁)
have hp' : (p⁻¹ : ℝ≥0) < 1 := inv_lt_one $ mod_cast hp
have hp'' : (p : ℝ≥0).IsConjExponent _ := .conjExponent $ mod_cast hp
rw [mul_comm, ← div_div, div_le_iff (zero_lt_two' ℝ)]
rw [mul_comm, ← div_div, div_le_iff (zero_lt_two' ℝ)]
calc
_ ≤ _ := div_le_div_of_nonneg_right hAC (card G).cast_nonneg
_ = |⟪balance (μ A) ∗ balance (μ A), μ C⟫_[ℝ]| := ?_
Expand All @@ -46,7 +44,7 @@ lemma global_dichotomy (hA : A.Nonempty) (hγC : γ ≤ C.dens) (hγ : 0 < γ)
expect_mu ℝ hA, sum_mu ℝ hC, conj_trivial, one_mul, mul_one, ← mul_inv_cancel₀, ← mul_sub,
abs_mul, abs_of_nonneg, mul_div_cancel_left₀] <;> positivity
· rw [lpNorm_mu hp''.symm.one_le hC, hp''.symm.coe.inv_sub_one, NNReal.coe_natCast, ← mul_rpow]
rw [nnratCast_dens, le_div_iff, mul_comm] at hγC
rw [nnratCast_dens, le_div_iff, mul_comm] at hγC
refine rpow_le_rpow_of_nonpos ?_ hγC (neg_nonpos.2 ?_)
all_goals positivity
· simp_rw [Nat.cast_mul, Nat.cast_two, p]
Expand Down Expand Up @@ -128,7 +126,7 @@ lemma di_in_ff (hq₃ : 3 ≤ q) (hq : q.Prime) (hε₀ : 0 < ε) (hε₁ : ε <
-- mul_inv_cancel₀ (show (card G : ℝ) ≠ 0 by positivity)]
· have hγ' : (1 : ℝ≥0) ≤ 2 * ⌈γ.curlog⌉₊ := sorry
sorry
-- simpa [wlpNorm_nsmul hγ', ← nsmul_eq_mul, div_le_iff' (show (0 : ℝ) < card G by positivity),
-- simpa [wlpNorm_nsmul hγ', ← nsmul_eq_mul, div_le_iff' (show (0 : ℝ) < card G by positivity),
-- ← div_div, *] using global_dichotomy hA hγC hγ hAC
sorry

Expand All @@ -148,7 +146,7 @@ theorem ff (hq₃ : 3 ≤ q) (hq : q.Prime) {A : Finset G} (hA₀ : A.Nonempty)
have : 0 < log q := log_pos ‹_›
obtain hα | hα := le_total (q ^ (n / 2) : ℝ) (2 * α⁻¹ ^ 2)
· rw [rpow_le_iff_le_log, log_mul, log_pow, Nat.cast_two, ← mul_div_right_comm,
mul_div_assoc, ← le_div_iff] at hα
mul_div_assoc, ← le_div_iff] at hα
calc
_ ≤ (log 2 + 2 * log α⁻¹) / (log q / 2) := hα
_ = 4 / log q * (log α⁻¹ + log 2 / 2) := by ring
Expand Down Expand Up @@ -213,7 +211,7 @@ theorem ff (hq₃ : 3 ≤ q) (hq : q.Prime) {A : Finset G} (hA₀ : A.Nonempty)
all_goals positivity
rw [hB.l2Inner_mu_conv_mu_mu_two_smul_mu] at hBV
suffices h : (q ^ (n - 65 * curlog α ^ 9) : ℝ) ≤ q ^ (n / 2) by
rw [rpow_le_rpow_left_iff ‹_›, sub_le_comm, sub_half, div_le_iff' zero_lt_two, ← mul_assoc] at h
rw [rpow_le_rpow_left_iff ‹_›, sub_le_comm, sub_half, div_le_iff' zero_lt_two, ← mul_assoc] at h
norm_num at h
exact h
calc
Expand All @@ -239,7 +237,7 @@ theorem ff (hq₃ : 3 ≤ q) (hq : q.Prime) {A : Finset G} (hA₀ : A.Nonempty)
rw [← natCast_card_mul_nnratCast_dens, mul_pow, mul_inv, ← mul_assoc,
← div_eq_mul_inv (card V : ℝ), ← zpow_one_sub_natCast₀ (by positivity)] at hBV
have : 0 < (card V : ℝ) := by positivity
simpa [le_inv_mul_iff₀', mul_inv_le_iff₀', this, zero_lt_two, mul_comm] using hBV
simpa [le_inv_mul_iff₀, mul_inv_le_iff₀, this, zero_lt_two, mul_comm] using hBV
_ ≤ 2 * α⁻¹ ^ 2 := by gcongr
_ ≤ _ := hα
simpa [card_eq_pow_finrank (K := ZMod q) (V := V), ZMod.card] using hq'.pow
235 changes: 0 additions & 235 deletions LeanAPAP/Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean

This file was deleted.

1 change: 0 additions & 1 deletion LeanAPAP/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import LeanAPAP.Mathlib.Algebra.Order.GroupWithZero.Unbundled

namespace Real
variable {x : ℝ}
Expand Down
30 changes: 0 additions & 30 deletions LeanAPAP/Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,6 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real
namespace Real
variable {x y z : ℝ}

lemma rpow_le_iff_le_log (hx : 0 < x) (hy : 0 < y) : x ^ z ≤ y ↔ z * log x ≤ log y := by
rw [← log_le_log_iff (rpow_pos_of_pos hx _) hy, log_rpow hx]

lemma rpow_lt_iff_lt_log (hx : 0 < x) (hy : 0 < y) : x ^ z < y ↔ z * log x < log y := by
rw [← log_lt_log_iff (rpow_pos_of_pos hx _) hy, log_rpow hx]

lemma pow_le_iff_le_log {n : ℕ} (hx : 0 < x) (hy : 0 < y) :
x ^ n ≤ y ↔ n * log x ≤ log y := by rw [← rpow_le_iff_le_log hx hy, rpow_natCast]

lemma zpow_le_iff_le_log {n : ℤ} (hx : 0 < x) (hy : 0 < y) :
x ^ n ≤ y ↔ n * log x ≤ log y := by rw [← rpow_le_iff_le_log hx hy, rpow_intCast]

lemma pow_lt_iff_lt_log {n : ℕ} (hx : 0 < x) (hy : 0 < y) :
x ^ n < y ↔ n * log x < log y := by rw [← rpow_lt_iff_lt_log hx hy, rpow_natCast]

lemma zpow_lt_iff_lt_log {n : ℤ} (hx : 0 < x) (hy : 0 < y) :
x ^ n < y ↔ n * log x < log y := by rw [← rpow_lt_iff_lt_log hx hy, rpow_intCast]

lemma le_pow_iff_log_le {n : ℕ} (hx : 0 < x) (hy : 0 < y) : x ≤ y ^ n ↔ log x ≤ n * log y := by
rw [← le_rpow_iff_log_le hx hy, rpow_natCast]

lemma le_zpow_iff_log_le {n : ℤ} (hx : 0 < x) (hy : 0 < y) : x ≤ y ^ n ↔ log x ≤ n * log y := by
rw [← le_rpow_iff_log_le hx hy, rpow_intCast]

lemma lt_pow_iff_log_lt {n : ℕ} (hx : 0 < x) (hy : 0 < y) : x < y ^ n ↔ log x < n * log y := by
rw [← lt_rpow_iff_log_lt hx hy, rpow_natCast]

lemma lt_zpow_iff_log_lt {n : ℤ} (hx : 0 < x) (hy : 0 < y) : x < y ^ n ↔ log x < n * log y := by
rw [← lt_rpow_iff_log_lt hx hy, rpow_intCast]

-- TODO: Replace in mathlib
alias rpow_add_intCast := rpow_add_int
alias rpow_add_natCast := rpow_add_nat
Expand Down
6 changes: 3 additions & 3 deletions LeanAPAP/Physics/AlmostPeriodicity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ lemma lemma28_end (hε : 0 < ε) (hm : 1 ≤ m) (hk : 64 * m / ε ^ 2 ≤ k) :
refine pow_le_pow_left (by positivity) ?_ _
rw [mul_right_comm, mul_comm _ ε, mul_pow, ← mul_assoc, sq (k : ℝ), ← mul_assoc]
refine mul_le_mul_of_nonneg_right ?_ (Nat.cast_nonneg k)
rw [mul_right_comm, div_mul_eq_mul_div, one_mul, div_mul_eq_mul_div, le_div_iff' (zero_lt_two' ℝ),
← div_le_iff', ← mul_assoc]
rw [mul_right_comm, div_mul_eq_mul_div, one_mul, div_mul_eq_mul_div, le_div_iff' (zero_lt_two' ℝ),
← div_le_iff', ← mul_assoc]
· norm_num1; exact hk
positivity

Expand Down Expand Up @@ -337,7 +337,7 @@ lemma T_bound (hK' : 2 ≤ K) (Lc Sc Ac ASc Tc : ℕ) (hk : k = ⌈(64 : ℝ) *
have : (0 : ℝ) < Ac ^ k := by positivity
refine le_of_mul_le_mul_left ?_ this
have : (Ac : ℝ) ^ k ≤ K * Lc := by
rw [div_le_iff'] at h₂
rw [div_le_iff'] at h₂
refine h₂.trans (mul_le_mul_of_nonneg_right hK' (Nat.cast_nonneg _))
exact zero_lt_two
rw [neg_mul, neg_div, Real.rpow_neg hK.le, mul_left_comm,
Expand Down
Loading

0 comments on commit 7bc4dcd

Please sign in to comment.