Skip to content

Commit a29e051

Browse files
authored
wip: use fun_prop for BoundedCompactSupport (#499)
- Many proofs can be golfed nicely. This PR also golfs some other proofs using fun_prop. - The proof in `AntichainOperator` puzzles me and smells like a fun_prop bug. - A couple of proofs do not work because `BoundedCompactSupport.indicator` has a measurability side condition; running `fun_prop (discharger := assumption)` did not work. Perhaps a better incantation will fix this.
1 parent 5b71d4d commit a29e051

File tree

6 files changed

+80
-60
lines changed

6 files changed

+80
-60
lines changed

Carleson/Antichain/AntichainOperator.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ variable {X : Type*} {a : ℕ} {q : ℝ} {K : X → X → ℂ} {σ₁ σ₂ : X
2020
[MetricSpace X] [ProofData a q K σ₁ σ₂ F G] [TileStructure Q D κ S o]
2121
{𝔄 : Set (𝔓 X)} {f g : X → ℂ}
2222

23+
-- set_option trace.Meta.Tactic.fun_prop true in
2324
open Classical in
2425
lemma dens1_antichain_rearrange (bg : BoundedCompactSupport g) :
2526
eLpNorm (adjointCarlesonSum 𝔄 g) 2 ^ 2
@@ -36,8 +37,15 @@ lemma dens1_antichain_rearrange (bg : BoundedCompactSupport g) :
3637
congr 1
3738
rw [integral_finset_sum]
3839
· congr! with p mp
39-
exact integral_finset_sum _ fun p' mp' ↦
40-
(bg.adjointCarleson.mul bg.adjointCarleson.conj).integrable
40+
exact integral_finset_sum _ fun p' mp' ↦ by
41+
-- This smells like a fun_prop bug: removing the `change` makes fun_prop fail to prove
42+
-- `fails` below, even though it knows about `BoundedCompactSupport.integrable` and
43+
-- can prove that.
44+
have : BoundedCompactSupport (fun x ↦ (starRingEnd ℂ) (adjointCarleson p' g x)) volume := by fun_prop
45+
--have fails : Integrable (fun x ↦ (starRingEnd ℂ) (adjointCarleson p' g x)) volume := by
46+
-- fun_prop
47+
change Integrable (adjointCarleson p g * star (adjointCarleson p' g)) volume
48+
fun_prop
4149
· exact fun p mp ↦ (BoundedCompactSupport.finset_sum fun p' mp' ↦
4250
bg.adjointCarleson.mul bg.adjointCarleson.conj).integrable
4351
_ ≤ ∑ p with p ∈ 𝔄, ‖∑ p' with p' ∈ 𝔄,

Carleson/ForestOperator/Forests.lean

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -893,23 +893,21 @@ lemma forest_operator_g_prelude
893893
calc
894894
_ = ‖∑ u with u ∈ t, ∫ x, conj (g x) * carlesonSum (t u) f x‖ₑ := by
895895
congr; rw [← integral_finset_sum]; swap
896-
· exact fun _ _ ↦ (bg.conj.mul bf.carlesonSum).integrable
896+
· fun_prop
897897
simp_rw [Finset.mul_sum]
898898
_ = ‖∑ u with u ∈ t, ∫ x, conj (adjointCarlesonSum (t u) g x) * f x‖ₑ := by
899899
congr! 2 with u mu; exact adjointCarlesonSum_adjoint bf bg _
900900
_ = ‖∫ x, f x * ∑ u with u ∈ t, conj (adjointCarlesonSum (t u) g x)‖ₑ := by
901901
congr; rw [← integral_finset_sum]; swap
902-
· exact fun _ _ ↦ (bg.adjointCarlesonSum.conj.mul bf).integrable
902+
· intro _ _
903+
fun_prop
903904
simp_rw [Finset.mul_sum, mul_comm (f _)]
904905
_ ≤ ∫⁻ x, ‖f x‖ₑ * ‖∑ u with u ∈ t, conj (adjointCarlesonSum (t u) g x)‖ₑ := by
905906
simp_rw [← enorm_mul]; exact enorm_integral_le_lintegral_enorm _
906907
_ ≤ _ := by
907908
simp_rw [← map_sum, RCLike.enorm_conj]
908909
conv_rhs => rw [← eLpNorm_enorm]; enter [2]; rw [← eLpNorm_enorm]
909-
exact ENNReal.lintegral_mul_le_eLpNorm_mul_eLqNorm inferInstance
910-
bf.enorm.aestronglyMeasurable.aemeasurable
911-
(BoundedCompactSupport.finset_sum fun _ _ ↦
912-
bg.adjointCarlesonSum).enorm.aestronglyMeasurable.aemeasurable
910+
exact ENNReal.lintegral_mul_le_eLpNorm_mul_eLqNorm inferInstance (by fun_prop) (by fun_prop)
913911

914912
lemma adjointCarlesonRowSum_rowSupport :
915913
adjointCarlesonRowSum t j f = adjointCarlesonRowSum t j ((rowSupport t j).indicator f) := by
@@ -952,9 +950,7 @@ lemma forest_operator_g_main (hg : Measurable g) (h2g : ∀ x, ‖g x‖ ≤ G.i
952950
let TR (j : ℕ) (x : X) := adjointCarlesonRowSum t j ((rowSupport t j).indicator g) x
953951
have bcsrsi (j : ℕ) : BoundedCompactSupport ((t.rowSupport j).indicator g) volume :=
954952
bg.indicator measurableSet_rowSupport
955-
have bcsTR (j : ℕ) : BoundedCompactSupport (TR j) :=
956-
BoundedCompactSupport.finset_sum fun _ _ ↦
957-
BoundedCompactSupport.finset_sum fun _ _ ↦ (bcsrsi j).adjointCarleson
953+
have bcsTR (j : ℕ) : BoundedCompactSupport (TR j) := by unfold TR adjointCarlesonRowSum; fun_prop
958954
calc
959955
_ = eLpNorm (∑ j ∈ Finset.range (2 ^ n), adjointCarlesonRowSum t j g ·) 2 ^ 2 := by
960956
congr; ext x
@@ -1061,8 +1057,7 @@ lemma forest_operator_f_prelude
10611057
rw [indicator_of_notMem hx, norm_le_zero_iff] at h2g
10621058
rw [h2g, zero_mul]
10631059
_ ≤ _ :=
1064-
ENNReal.lintegral_mul_le_eLpNorm_mul_eLqNorm inferInstance
1065-
bg.enorm.aestronglyMeasurable.aemeasurable
1060+
ENNReal.lintegral_mul_le_eLpNorm_mul_eLqNorm inferInstance (by fun_prop)
10661061
((BoundedCompactSupport.finset_sum fun _ _ ↦
10671062
bf.carlesonSum).indicator measurableSet_G).enorm.aestronglyMeasurable.aemeasurable
10681063

@@ -1104,8 +1099,8 @@ lemma forest_operator_f_inner (hf : Measurable f) (h2f : ∀ x, ‖f x‖ ≤ F.
11041099
apply ENNReal.lintegral_mul_le_eLpNorm_mul_eLqNorm inferInstance
11051100
· exact ((BoundedCompactSupport.finset_sum fun _ _ ↦ bIGTf.adjointCarlesonSum).indicator
11061101
measurableSet_F).enorm.aestronglyMeasurable.aemeasurable
1107-
· exact bf.enorm.aestronglyMeasurable.aemeasurable
1108-
_ ≤ _ := by exact mul_le_mul_right' (indicator_row_bound bIGTf support_indicator_subset) _
1102+
· fun_prop
1103+
_ ≤ _ := by gcongr; exact indicator_row_bound bIGTf support_indicator_subset
11091104

11101105
/-- The constant in the `f` side of Proposition 2.0.4.
11111106
Has value `2 ^ (283 * a ^ 3)` in the blueprint. -/
@@ -1269,7 +1264,7 @@ theorem forest_operator' {n : ℕ} (𝔉 : Forest X n) {f : X → ℂ} {A : Set
12691264
the sum to be controlled. -/
12701265
have bf := bcs_of_measurable_of_le_indicator_f hf h2f
12711266
rw [← enorm_integral_starRingEnd_mul_eq_lintegral_enorm]; swap
1272-
· exact (BoundedCompactSupport.finset_sum (fun i hi ↦ bf.carlesonSum.restrict)).integrable
1267+
· exact (BoundedCompactSupport.finset_sum (fun i hi ↦ by fun_prop)).integrable
12731268
rw [← integral_indicator hA]
12741269
simp_rw [indicator_mul_left, ← comp_def,
12751270
Set.indicator_comp_of_zero (g := starRingEnd ℂ) (by simp)]
@@ -1281,10 +1276,7 @@ theorem forest_operator' {n : ℕ} (𝔉 : Forest X n) {f : X → ℂ} {A : Set
12811276
· rw [hnorm]; norm_num
12821277
· rw [div_self hnorm]
12831278
apply (forest_operator 𝔉 hf h2f ?_ fun x ↦ ?_).trans; rotate_left
1284-
· refine Measurable.indicator ?_ hA
1285-
suffices Measurable (∑ u with u ∈ 𝔉, carlesonSum (𝔉 u) f ·) by
1286-
exact this.div (measurable_ofReal.comp this.norm)
1287-
exact Finset.measurable_sum _ fun _ _ ↦ measurable_carlesonSum hf
1279+
· exact Measurable.indicator (by fun_prop) hA
12881280
· exact (bAi _).trans (indicator_le_indicator_apply_of_subset sA (by simp))
12891281
gcongr
12901282
· simp only [sub_nonneg, inv_le_inv₀ zero_lt_two (q_pos X)]
@@ -1313,9 +1305,8 @@ theorem forest_operator_le_volume {n : ℕ} (𝔉 : Forest X n) {f : X → ℂ}
13131305
apply (forest_operator' 𝔉 hf h2f hA sA).trans
13141306
gcongr
13151307
calc
1316-
_ ≤ eLpNorm (F.indicator (fun x ↦ 1) : X → ℝ) 2 volume := by
1317-
apply eLpNorm_mono (fun x ↦ ?_)
1318-
exact (h2f x).trans (le_abs_self _)
1308+
_ ≤ eLpNorm (F.indicator (fun x ↦ 1) : X → ℝ) 2 volume :=
1309+
eLpNorm_mono (fun x ↦ (h2f x).trans (le_abs_self _))
13191310
_ ≤ _ := by
13201311
rw [eLpNorm_indicator_const measurableSet_F (by norm_num) (by norm_num)]
13211312
simp

Carleson/ForestOperator/QuantativeEstimate.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,11 @@ lemma density_tree_bound1
463463
simpa using density_tree_bound_aux hf hc hg h2g hu
464464

465465
omit [TileStructure Q D κ S o] in
466-
-- move somewhere else
466+
-- TODO: move somewhere else
467467
lemma _root_.MeasureTheory.BoundedCompactSupport.const_smul (hf : BoundedCompactSupport f) (c : ℝ) :
468-
BoundedCompactSupport (c • f) := by
469-
simp_rw [Pi.smul_def,Complex.real_smul]
470-
apply hf.const_mul
468+
BoundedCompactSupport (c • f) := by
469+
simp_rw [Pi.smul_def, Complex.real_smul]
470+
fun_prop
471471

472472
omit [TileStructure Q D κ S o] [MetricSpace X] in
473473
-- rename, move somewhere else

Carleson/Operators.lean

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ with nontrivial rework in order to move from `Measurable` to `AEStronglyMeasurab
4242
lemma measurable_carlesonOn {p : 𝔓 X} {f : X → ℂ} (measf : Measurable f) :
4343
Measurable (carlesonOn p f) := by
4444
refine (StronglyMeasurable.integral_prod_right ?_).measurable.indicator measurableSet_E
45-
refine ((Measurable.mul ?_ measurable_Ks).mul ?_).stronglyMeasurable
46-
· have : Measurable fun (p : X × X) ↦ (p.1, p.1) := by fun_prop
47-
refine ((Measurable.sub ?_ ?_).const_mul I).cexp <;> apply measurable_ofReal.comp
48-
· exact measurable_Q₂
49-
· exact measurable_Q₂.comp this
50-
· exact measf.comp measurable_snd
45+
exact ((Measurable.mul (by fun_prop) measurable_Ks).mul (by fun_prop)).stronglyMeasurable
5146

5247
open Classical in
5348
/-- The operator `T_ℭ f` defined at the bottom of Section 7.4.
@@ -65,13 +60,8 @@ lemma _root_.MeasureTheory.AEStronglyMeasurable.carlesonOn {p : 𝔓 X} {f : X
6560
refine .indicator ?_ measurableSet_E
6661
refine .integral_prod_right'
6762
(f := fun z ↦ exp (Complex.I * (Q z.1 z.2 - Q z.1 z.1)) * Ks (𝔰 p) z.1 z.2 * f z.2) ?_
68-
refine (AEStronglyMeasurable.mul ?_ aestronglyMeasurable_Ks).mul ?_
69-
· apply Measurable.aestronglyMeasurable
70-
have : Measurable fun (p : X × X) ↦ (p.1, p.1) := by fun_prop
71-
refine ((Measurable.sub ?_ ?_).const_mul I).cexp <;> apply measurable_ofReal.comp
72-
· exact measurable_Q₂
73-
· exact measurable_Q₂.comp this
74-
· exact hf.comp_snd
63+
refine (AEStronglyMeasurable.mul (by fun_prop) aestronglyMeasurable_Ks).mul ?_
64+
exact hf.comp_snd
7565

7666
lemma _root_.MeasureTheory.AEStronglyMeasurable.carlesonSum {ℭ : Set (𝔓 X)}
7767
{f : X → ℂ} (hf : AEStronglyMeasurable f) : AEStronglyMeasurable (carlesonSum ℭ f) :=
@@ -156,6 +146,7 @@ theorem BoundedCompactSupport.bddAbove_norm_carlesonOn
156146
_ = volume.real (closedBall x₀ r₀) * (CK * (eLpNorm f ⊤ volume).toReal) :=
157147
integral_indicator_const _ measurableSet_closedBall
158148

149+
@[fun_prop]
159150
theorem BoundedCompactSupport.carlesonOn {f : X → ℂ}
160151
(hf : BoundedCompactSupport f) : BoundedCompactSupport (carlesonOn p f) where
161152
memLp_top := by
@@ -175,6 +166,7 @@ theorem BoundedCompactSupport.bddAbove_norm_carlesonSum
175166
apply BddAbove.range_mono _ fun _ ↦ norm_sum_le ..
176167
exact .range_finsetSum fun _ _ ↦ hf.bddAbove_norm_carlesonOn _
177168

169+
@[fun_prop]
178170
theorem BoundedCompactSupport.carlesonSum {ℭ : Set (𝔓 X)} {f : X → ℂ}
179171
(hf : BoundedCompactSupport f) : BoundedCompactSupport (carlesonSum ℭ f) :=
180172
.finset_sum (fun _ _ ↦ hf.carlesonOn)
@@ -306,6 +298,7 @@ theorem BoundedCompactSupport.bddAbove_norm_adjointCarleson (hf : BoundedCompact
306298
· simp only [image_eq_zero_of_notMem_tsupport hy,
307299
norm_zero, mul_zero, eLpNorm_exponent_top]; positivity
308300

301+
@[fun_prop]
309302
theorem BoundedCompactSupport.adjointCarleson (hf : BoundedCompactSupport f) :
310303
BoundedCompactSupport (adjointCarleson p f) where
311304
memLp_top := by
@@ -342,9 +335,11 @@ theorem BoundedCompactSupport.bddAbove_norm_adjointCarlesonSum
342335
apply BddAbove.range_mono _ fun _ ↦ norm_sum_le ..
343336
exact .range_finsetSum fun _ _ ↦ hf.bddAbove_norm_adjointCarleson _
344337

338+
@[fun_prop]
345339
theorem BoundedCompactSupport.adjointCarlesonSum {ℭ : Set (𝔓 X)}
346340
(hf : BoundedCompactSupport f) : BoundedCompactSupport (adjointCarlesonSum ℭ f) :=
347-
BoundedCompactSupport.finset_sum fun _ _ ↦ hf.adjointCarleson
341+
-- TODO: cannot seem to unfold adjointCarlesonSum, so fun_prop cannot apply fully
342+
BoundedCompactSupport.finset_sum fun _ _ ↦ by fun_prop
348343

349344
end MeasureTheory
350345

@@ -377,7 +372,7 @@ lemma adjointCarleson_adjoint
377372
gcongr; exact norm_mul_le ..
378373
_ ≤ ‖g x‖ * 1 * ‖MKD (𝔰 p) x y‖ * ‖f y‖ := by
379374
gcongr
380-
· exact le_of_eq <| RCLike.norm_conj _
375+
· exact (RCLike.norm_conj _).le
381376
· exact norm_indicator_one_le ..
382377
_ = ‖MKD (𝔰 p) x y‖ * (‖g x‖ * ‖f y‖) := by rw [mul_one, mul_comm ‖g _‖, mul_assoc]
383378
_ ≤ M₀ * (‖g x‖ * ‖f y‖) := by gcongr; exact norm_MKD_le_norm_Ks.trans hM₀
@@ -395,13 +390,7 @@ lemma adjointCarleson_adjoint
395390
.indicator aestronglyMeasurable_const measurableSet_E
396391
exact this.comp_fst
397392
· unfold MKD
398-
refine .mul ?_ aestronglyMeasurable_Ks
399-
apply Measurable.aestronglyMeasurable
400-
have : Measurable fun (p : X × X) ↦ (p.1, p.1) :=
401-
.prodMk (.fst measurable_id') (.fst measurable_id')
402-
refine ((Measurable.sub ?_ ?_).const_mul I).cexp <;> apply measurable_ofReal.comp
403-
· exact measurable_Q₂
404-
· exact measurable_Q₂.comp this
393+
fun_prop
405394
· apply ae_of_all
406395
intro z
407396
refine _root_.trans (hHleH₀ z.1 z.2) ?_
@@ -433,26 +422,25 @@ lemma adjointCarleson_adjoint
433422
congr; funext; rw [map_mul, ← exp_conj, mul_comm (cexp _)]
434423
congr; simp; ring
435424

425+
-- Bug: why is `integrable_fun_mul` needed, despite `integrable_mul` existing?
426+
-- the fun_prop documentation implies it's superfluous. TODO ask on zulip!
427+
436428
/-- `adjointCarlesonSum` is the adjoint of `carlesonSum`. -/
437429
lemma adjointCarlesonSum_adjoint
438430
(hf : BoundedCompactSupport f) (hg : BoundedCompactSupport g) (ℭ : Set (𝔓 X)) :
439431
∫ x, conj (g x) * carlesonSum ℭ f x = ∫ x, conj (adjointCarlesonSum ℭ g x) * f x := by
440432
classical calc
441433
_ = ∫ x, ∑ p with p ∈ ℭ, conj (g x) * carlesonOn p f x := by
442434
unfold carlesonSum; simp_rw [Finset.mul_sum]
443-
_ = ∑ p with p ∈ ℭ, ∫ x, conj (g x) * carlesonOn p f x := by
444-
apply integral_finset_sum; intro p _
445-
refine hg.conj.mul hf.carlesonOn |>.integrable
435+
_ = ∑ p with p ∈ ℭ, ∫ x, conj (g x) * carlesonOn p f x :=
436+
integral_finset_sum _ fun p _ ↦ by fun_prop
446437
_ = ∑ p with p ∈ ℭ, ∫ y, conj (adjointCarleson p g y) * f y := by
447438
simp_rw [adjointCarleson_adjoint hf hg]
448-
_ = ∫ y, ∑ p with p ∈ ℭ, conj (adjointCarleson p g y) * f y := by
449-
symm; apply integral_finset_sum; intro p _
450-
refine BoundedCompactSupport.mul ?_ hf |>.integrable
451-
exact hg.adjointCarleson.conj
439+
_ = ∫ y, ∑ p with p ∈ ℭ, conj (adjointCarleson p g y) * f y :=
440+
(integral_finset_sum _ fun p _ ↦ by fun_prop).symm
452441
_ = _ := by congr!; rw [← Finset.sum_mul, ← map_sum]; rfl
453442

454443
lemma integrable_adjointCarlesonSum (s : Set (𝔓 X)) {f : X → ℂ} (hf : BoundedCompactSupport f) :
455-
Integrable (adjointCarlesonSum s f ·) :=
456-
integrable_finset_sum _ fun i _ ↦ hf.adjointCarleson (p := i).integrable
444+
Integrable (adjointCarlesonSum s f ·) := by fun_prop
457445

458446
end Adjoint

Carleson/Psi.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ lemma measurable_Ks {s : ℤ} : Measurable (fun x : X × X ↦ Ks s x.1 x.2) :=
840840
unfold Ks _root_.ψ
841841
exact measurable_K.mul (by fun_prop)
842842

843+
@[fun_prop]
843844
lemma aestronglyMeasurable_Ks {s : ℤ} : AEStronglyMeasurable (fun x : X × X ↦ Ks s x.1 x.2) :=
844845
measurable_Ks.aestronglyMeasurable
845846

@@ -850,7 +851,7 @@ lemma integrable_Ks_x {s : ℤ} {x : X} (hD : 1 < (D : ℝ)) : Integrable (Ks s
850851
rw [← integrableOn_iff_integrable_of_support_subset (s := (ball x r)ᶜ)]
851852
· refine integrableOn_K_mul ?_ x hr (subset_refl _)
852853
apply Continuous.integrable_of_hasCompactSupport
853-
· exact continuous_ofReal.comp <| continuous_ψ.comp <| (by fun_prop)
854+
· unfold «ψ»; fun_prop
854855
· apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall x (D ^ s / 2))
855856
intro y hy
856857
rw [mem_support, ne_eq, ofReal_eq_zero, ← ne_eq, ← mem_support, support_ψ (one_lt_realD X)] at hy

0 commit comments

Comments
 (0)