Skip to content

Commit e307a2c

Browse files
chore: bump mathlib and golf (#506)
Fixing two proofs was a bit painful, but otherwise little breakage. Take advantage of the new mathlib version by golfing a bit using positivity and the field tactic. --------- Co-authored-by: Ruben Van de Velde <[email protected]>
1 parent 2ea3e21 commit e307a2c

31 files changed

+125
-138
lines changed

Carleson.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import Carleson.ToMathlib.MeasureTheory.Measure.NNReal
8181
import Carleson.ToMathlib.MeasureTheory.Measure.Prod
8282
import Carleson.ToMathlib.MinLayer
8383
import Carleson.ToMathlib.Misc
84-
import Carleson.ToMathlib.Order.Chain
8584
import Carleson.ToMathlib.Order.LiminfLimsup
8685
import Carleson.ToMathlib.RealInterpolation.InterpolatedExponents
8786
import Carleson.ToMathlib.RealInterpolation.LorentzInterpolation

Carleson/Antichain/AntichainOperator.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ lemma dens1_antichain_rearrange (bg : BoundedCompactSupport g) :
7373
exact enorm_integral_mul_starRingEnd_comm
7474
_ ≤ 2 * ∑ p with p ∈ 𝔄, ∑ p' with p' ∈ 𝔄 ∧ 𝔰 p' ≤ 𝔰 p,
7575
‖∫ x, adjointCarleson p g x * conj (adjointCarleson p' g x)‖ₑ := by
76-
rw [two_mul]; gcongr with p mp; exact fun _And.imp_right Int.le_of_lt
76+
rw [two_mul]; gcongr with p mp; exact fun hh.le
7777
_ = _ := by congr! 3 with p mp p' mp'; exact enorm_integral_mul_starRingEnd_comm
7878

7979
open Classical in

Carleson/Antichain/AntichainTileCount.lean

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ lemma stack_density (𝔄 : Set (𝔓 X)) (ϑ : Θ X) (N : ℕ) (L : Grid X) :
181181
rw [mem_toFinset] at hp
182182
calc volume (E p ∩ G)
183183
_ ≤ volume (E₂ 2 p) := by
184-
apply measure_mono (fun x hx ↦ ?_)
184+
gcongr; intro x hx
185185
have hQ : Q x ∈ ball_(p) (𝒬 p) 1 := subset_cball hx.1.2.1
186186
simp only [E₂, TileLike.toSet, smul_fst, smul_snd, mem_inter_iff, mem_preimage, mem_ball]
187187
exact ⟨⟨hx.1.1, hx.2⟩, lt_trans hQ one_lt_two⟩
@@ -190,19 +190,24 @@ lemma stack_density (𝔄 : Set (𝔓 X)) (ϑ : Θ X) (N : ℕ) (L : Grid X) :
190190
have h2a : ((2 : ℝ≥0∞) ^ a)⁻¹ = 2^(-(a : ℤ)) := by
191191
rw [← zpow_natCast, ENNReal.zpow_neg]
192192
rw [← ENNReal.div_le_iff (ne_of_gt (hIL ▸ volume_coeGrid_pos (defaultD_pos a)))
193-
(by finiteness), ← ENNReal.div_le_iff' (Ne.symm (NeZero.ne' (2 ^ a))) (by finiteness),
193+
(by finiteness), ← ENNReal.div_le_iff' (NeZero.ne (2 ^ a)) (by finiteness),
194194
ENNReal.div_eq_inv_mul, h2a, dens₁]
195-
refine le_iSup₂_of_le p hp fun c hc ↦ ?_
196-
have h2c : 2 ^ (-(a : ℤ)) * (volume (E₂ 2 p) / volume (L : Set X)) ≤
197-
(c : WithTop ℝ≥0) := by
195+
refine le_iSup₂_of_le p hp ?_--fun c hc ↦ ?_
196+
rw [WithTop.le_iff_forall]
197+
intro c hc
198+
have h2c : 2 ^ (-(a : ℤ)) * (volume (E₂ 2 p) / volume (L : Set X)) ≤ (c : WithTop ℝ≥0) := by
198199
simp only [← hc]
199-
refine le_iSup₂_of_le 2 (le_refl _) fun d hd ↦ ?_
200+
refine le_iSup₂_of_le 2 (le_refl _) ?_
201+
rw [WithTop.le_iff_forall]
202+
intro d hd
200203
have h2d : 2 ^ (-(a : ℤ)) * (volume (E₂ 2 p) / volume (L : Set X)) ≤
201204
(d : WithTop ℝ≥0) := by
202205
rw [← hd]
203206
gcongr
204207
· norm_cast
205-
· refine le_iSup₂_of_le p (mem_lowerCubes.mpr ⟨p, hp, le_refl _⟩) fun r hr ↦ ?_
208+
· refine le_iSup₂_of_le p (mem_lowerCubes.mpr ⟨p, hp, le_refl _⟩) ?_
209+
rw [WithTop.le_iff_forall]
210+
intro r hr
206211
have h2r : (volume (E₂ 2 p) / volume (L : Set X)) ≤ (r : WithTop ℝ≥0) := by
207212
rw [← hr]
208213
refine le_iSup_of_le (le_refl _) ?_

Carleson/Antichain/Basic.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@ lemma maximal_bound_antichain {𝔄 : Set (𝔓 X)} (h𝔄 : IsAntichain (· ≤
182182
rw [carlesonSum, Finset.sum_eq_single_of_mem p.1 hp hne_p]
183183
_ ≤ ∫⁻ y, ‖exp (I * (Q x y - Q x x)) * Ks (𝔰 p.1) x y * f y‖ₑ := by
184184
rw [carlesonOn, indicator, if_pos hxE]
185-
refine le_trans (enorm_integral_le_lintegral_enorm _) (lintegral_mono fun z w h ↦ ?_)
186-
simp only [nnnorm_mul, coe_mul, some_eq_coe', zpow_neg, Ks, mul_assoc,
187-
enorm_eq_nnnorm] at h ⊢
188-
use w
185+
exact le_trans (enorm_integral_le_lintegral_enorm _) (lintegral_mono fun z ↦ le_rfl)
189186
_ ≤ ∫⁻ y, ‖Ks (𝔰 p.1) x y * f y‖ₑ := by
190187
simp only [enorm_mul]
191188
exact lintegral_mono fun y ↦ (by simp [← Complex.ofReal_sub])

Carleson/Antichain/TileCorrelation.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,10 @@ lemma I12_le' {p p' : 𝔓 X} (hle : 𝔰 p' ≤ 𝔰 p) {g : X → ℂ} (x1 : E
350350
C2_0_5 a * volume (ball x1.1 (D ^ 𝔰 p')) *
351351
(C6_2_1 a / (volume (ball x1.1 (D ^ 𝔰 p')) * volume (ball x2.1 (D ^ 𝔰 p)))) := by
352352
gcongr
353-
-- Note: simp, ring_nf, field_simp did not help.
353+
-- Note: simp, ring_nf, field_simp did not help (because we work with ℝ≥0∞).
354354
have heq : C2_0_5 a * volume (ball x1.1 (D ^ 𝔰 p')) *
355-
(C6_2_1 a / (volume (ball x1.1 (D ^ 𝔰 p')) * volume (ball x2.1 (D ^ 𝔰 p)))) =
356-
C2_0_5 a * (C6_2_1 a / volume (ball x2.1 (D ^ 𝔰 p))) := by
355+
(C6_2_1 a / (volume (ball x1.1 (D ^ 𝔰 p')) * volume (ball x2.1 (D ^ 𝔰 p)))) =
356+
C2_0_5 a * (C6_2_1 a / volume (ball x2.1 (D ^ 𝔰 p))) := by
357357
simp only [mul_assoc]
358358
congr 1
359359
rw [ENNReal.div_eq_inv_mul, ENNReal.mul_inv (.inr measure_ball_ne_top)

Carleson/Classical/Basic.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Carleson.ToMathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality
44
import Carleson.ToMathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions
55
import Carleson.ToMathlib.Topology.Instances.AddCircle.Defs
66
import Mathlib.Analysis.Fourier.AddCircle
7+
import Mathlib.Tactic.Field
78

89
/- This file contains basic definitions and lemmas. -/
910

@@ -196,7 +197,7 @@ lemma lower_secant_bound_aux {η : ℝ} (ηpos : 0 < η) {x : ℝ} (le_abs_x :
196197
calc (2 / π) * η
197198
_ ≤ (2 / π) * x := by gcongr
198199
_ = 1 - ((1 - (2 / π) * (x - π / 2)) * Real.cos (π / 2) + ((2 / π) * (x - π / 2)) * Real.cos (π)) := by
199-
field_simp -- a bit slow
200+
field_simp
200201
simp
201202
_ ≤ 1 - (Real.cos ((1 - (2 / π) * (x - π / 2)) * (π / 2) + (((2 / π) * (x - π / 2)) * (π)))) := by
202203
gcongr
@@ -207,7 +208,7 @@ lemma lower_secant_bound_aux {η : ℝ} (ηpos : 0 < η) {x : ℝ} (le_abs_x :
207208
exact mul_le_of_le_div₀ (by norm_num) (div_nonneg (by norm_num) pi_nonneg) (by simpa)
208209
· exact mul_nonneg (div_nonneg (by norm_num) pi_nonneg) (by linarith [h])
209210
· simp
210-
_ = 1 - Real.cos x := by congr; field_simp; ring -- slow
211+
_ = 1 - Real.cos x := by congr; field
211212
_ ≤ Real.sqrt ((1 - Real.cos x) ^ 2) := by
212213
exact Real.sqrt_sq_eq_abs _ ▸ le_abs_self _
213214
_ ≤ ‖1 - Complex.exp (Complex.I * ↑x)‖ := by

Carleson/Classical/ControlApproximationEffect.lean

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ lemma C_control_approximation_effect_pos {ε : ℝ} (εpos : 0 < ε) : 0 < C_con
497497
lt_trans' (lt_C_control_approximation_effect εpos) pi_pos
498498

499499
lemma C_control_approximation_effect_eq {ε : ℝ} {δ : ℝ} (ε_nonneg : 0 ≤ ε) :
500-
C_control_approximation_effect ε * δ = ((δ * C10_0_1 4 2 * (4 * π) ^ (2 : ℝ)⁻¹ * (2 / ε) ^ (2 : ℝ)⁻¹) / π) + π * δ := by
500+
C_control_approximation_effect ε * δ =
501+
((δ * C10_0_1 4 2 * (4 * π) ^ (2 : ℝ)⁻¹ * (2 / ε) ^ (2 : ℝ)⁻¹) / π) + π * δ := by
501502
symm
502503
rw [C_control_approximation_effect, mul_comm, mul_div_right_comm, mul_comm δ, mul_assoc,
503504
mul_comm δ, ← mul_assoc, ← mul_assoc, ← add_mul, mul_comm _ (C10_0_1 4 2 : ℝ), mul_assoc]
@@ -507,13 +508,28 @@ lemma C_control_approximation_effect_eq {ε : ℝ} {δ : ℝ} (ε_nonneg : 0 ≤
507508
ring_nf
508509
try rw [mul_assoc, mul_comm (2 ^ _), mul_assoc, mul_assoc, mul_assoc, mul_comm (4 ^ _), ← mul_assoc π⁻¹,
509510
← Real.rpow_neg_one π, ← Real.rpow_add, mul_comm (π ^ _), ← mul_assoc (2 ^ _), ← Real.mul_rpow]
510-
on_goal 1 => congr
511-
· norm_num
512-
on_goal 1 => ring_nf
513-
on_goal 1 => rw [neg_div, Real.rpow_neg]
511+
on_goal 1 =>
512+
field_simp
513+
ring_nf
514+
calc _
515+
_ = (π ^ (1 / (2 : ℝ))) ^ 2 * 2 ^ (1 / (2 : ℝ)) * (ε ^ (1 / (2 : ℝ)))⁻¹ * 2 := by ring
516+
_ = π * 2 ^ (1 / (2 : ℝ)) * (ε ^ (1 / (2 : ℝ)))⁻¹ * 2 := by
517+
-- Golfing of this proof welcome!
518+
congr
519+
rw [← Real.sqrt_eq_rpow π, Real.sq_sqrt', max_eq_left_iff]
520+
positivity
521+
_ = π * (2 ^ (1 / (2 : ℝ)) * 2) * (ε ^ (1 / (2 : ℝ)))⁻¹ := by ring
522+
_ = π * 8 ^ (1 / (2 : ℝ)) * (ε ^ (1 / (2 : ℝ)))⁻¹ := by
523+
congr
524+
-- Golfing of this computation is very welcome!
525+
rw [← Real.sqrt_eq_rpow, ← Real.sqrt_eq_rpow]
526+
have : Real.sqrt 4 = 2 := Real.sqrt_eq_cases.mpr <| Or.inl ⟨by norm_num, by positivity⟩
527+
nth_rw 2 [← this]
528+
rw [← Real.sqrt_mul (by positivity) 4]
529+
norm_num
530+
_ = (ε ^ (1 / (2 : ℝ)))⁻¹ * π * 8 ^ (1 / (2 : ℝ)) := by ring
514531
all_goals linarith [pi_pos]
515532

516-
517533
/- This is Lemma 11.6.4 (partial Fourier sums of small) in the blueprint.-/
518534
lemma control_approximation_effect {ε : ℝ} (εpos : 0 < ε) {δ : ℝ} (hδ : 0 < δ)
519535
{h : ℝ → ℂ} (h_measurable : Measurable h)

Carleson/Classical/DirichletKernel.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import Carleson.Classical.Basic
44
import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite
5+
import Mathlib.Tactic.Field
56

67
open scoped Real
78
open Finset Complex MeasureTheory
@@ -165,6 +166,7 @@ lemma norm_dirichletKernel'_le {x : ℝ} : ‖dirichletKernel' N x‖ ≤ 2 * N
165166
rw [dirichletKernel'_eq_zero h, norm_zero]
166167
linarith
167168

169+
set_option linter.flexible false in -- linter bug; fix pending in mathlib
168170
/-- First part of lemma 11.1.8 (Dirichlet kernel) from the blueprint. -/
169171
lemma partialFourierSum_eq_conv_dirichletKernel {f : ℝ → ℂ} {x : ℝ}
170172
(h : IntervalIntegrable f volume 0 (2 * π)) :
@@ -198,8 +200,7 @@ lemma partialFourierSum_eq_conv_dirichletKernel {f : ℝ → ℂ} {x : ℝ}
198200
rw [fourier_coe_apply, fourier_coe_apply, fourier_coe_apply, ←exp_add]
199201
congr
200202
simp
201-
field_simp
202-
ring
203+
field
203204

204205
lemma partialFourierSum_eq_conv_dirichletKernel' {f : ℝ → ℂ} {x : ℝ}
205206
(h : IntervalIntegrable f volume 0 (2 * π)) :

Carleson/Classical/HilbertStrongType.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Carleson.ToMathlib.MeasureTheory.Integral.MeanInequalities
66
import Carleson.TwoSidedCarleson.Basic
77
import Mathlib.Algebra.BigOperators.Group.Finset.Indicator
88
import Mathlib.Analysis.Real.Pi.Bounds
9+
import Mathlib.Tactic.Field
910

1011
/- This file contains the proof that the Hilbert kernel is a bounded operator. -/
1112

@@ -160,9 +161,7 @@ lemma niceKernel_lowerBound {r x : ℝ} (hr : 0 < r) (h'r : r < 1) (hx : r ≤ x
160161
gcongr
161162
· apply le_inv_of_le_inv₀ hr (by simpa using h'r.le)
162163
· exact hx.1
163-
_ = 5 * r ⁻¹ := by
164-
field_simp
165-
ring
164+
_ = 5 * r ⁻¹ := by field_simp; norm_num
166165

167166
lemma niceKernel_lowerBound' {r x : ℝ} (hr : 0 < r) (h'r : r < 1) (hx : r ≤ |x| ∧ |x| ≤ π) :
168167
1 + r / ‖1 - exp (I * x)‖ ^ 25 * niceKernel r x := by

Carleson/Discrete/ForestComplement.lean

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ lemma exists_j_of_mem_𝔓pos_ℭ (h : p ∈ 𝔓pos (X := X)) (mp : p ∈ ℭ k
153153
let B : ℕ := Finset.card { q | q ∈ 𝔅 k n p }
154154
have Blt : B < 2 ^ (2 * n + 4) := by
155155
calc
156-
_ ≤ Finset.card { m | m ∈ 𝔐 k n ∧ x ∈ 𝓘 m } :=
157-
Finset.card_le_card (Finset.monotone_filter_right _ (Pi.le_def.mpr fun m ⟨m₁, m₂⟩ ↦
158-
⟨m₁, m₂.1.1 mx⟩))
156+
_ ≤ Finset.card { m | m ∈ 𝔐 k n ∧ x ∈ 𝓘 m } := by
157+
apply Finset.card_le_card (Finset.monotone_filter_right _ ?_)
158+
refine fun a _ha ha' ↦ ⟨mem_of_mem_inter_left ha', ?_⟩
159+
obtain ⟨m₁, m₂⟩ := ha'
160+
exact m₂.1.1 mx
159161
_ = stackSize (𝔐 k n) x := by
160162
simp_rw [stackSize, indicator_apply, Pi.one_apply, Finset.sum_boole, Nat.cast_id,
161163
Finset.filter_filter]; rfl
@@ -917,7 +919,7 @@ lemma lintegral_enorm_carlesonSum_le_of_isAntichain_subset_ℭ
917919
· norm_cast
918920
linarith [four_le_a X]
919921
· exact q_le_two X
920-
_ = 5 / (8 * a ^ 3) := by field_simp; ring
922+
_ = 5 / (8 * a ^ 3) := by field_simp; norm_num
921923
_ ≤ 5 / (8 * (4 : ℝ) ^ 3) := by gcongr
922924
_ ≤ 2⁻¹ := by norm_num
923925
· calc

0 commit comments

Comments
 (0)