Skip to content

Commit 87a17a9

Browse files
committed
Miscellaneous golfs
1 parent 36c8df4 commit 87a17a9

File tree

2 files changed

+32
-58
lines changed

2 files changed

+32
-58
lines changed

Carleson/ForestOperator/LargeSeparation.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ lemma four_lt_sum_χtilde
185185
lemma bigger_than_𝓙_is_not_in_𝓙₀ {𝔖 : Set (𝔓 X)} {A B : Grid X}
186186
(le : A ≤ B) (sle : s A < s B) (A_in : A ∈ 𝓙 𝔖) :
187187
B ∉ 𝓙₀ 𝔖 := by
188-
apply And.right at A_in
188+
replace A_in := A_in.2
189189
simp only [Grid.le_def, and_imp] at A_in
190190
intro contr
191191
apply Lean.Omega.Int.le_lt_asymm (x := s A) (y := s B)

Carleson/TileExistence.lean

Lines changed: 31 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
982982
· exact (NeZero.ne (2 ^ (4 * a)))
983983
· finiteness
984984
letI : Countable (Yk X (k - K')) := (Yk_countable X (k - K')).to_subtype
985+
classical
985986
calc
986987
K' * ∑' (z : ↑(Yk X (k - K'))), volume (⋃ (_ : clProp(hk_mK,z|hk,y)), I3 hk_mK z)
987988
= ∑ (_ : Ioc (k - K') k),
@@ -995,6 +996,7 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
995996
intro x
996997
simp only [Finset.mem_univ, true_implies]
997998
symm
999+
classical
9981000
refine measure_iUnion ?_ ?_
9991001
· intro i i' hneq
10001002
simp only [disjoint_iUnion_right, disjoint_iUnion_left]
@@ -1004,8 +1006,6 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
10041006
apply hneq
10051007
exact I3_prop_1 hk_mK hx
10061008
· intro i
1007-
letI : Decidable (clProp(hk_mK,i|hk,y)):=
1008-
Classical.propDecidable _
10091009
rw [Set.iUnion_eq_if]
10101010
if h:(clProp(hk_mK,i|hk,y)) then
10111011
rw [if_pos h]
@@ -1048,9 +1048,7 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
10481048
intro _ _
10491049
rw [Set.disjoint_iff]
10501050
intro x hx
1051-
apply hneq
1052-
apply I3_prop_1
1053-
exact hx
1051+
exact hneq <| I3_prop_1 _ hx
10541052
intro i
10551053
apply MeasurableSet.iUnion
10561054
intro _
@@ -1062,7 +1060,6 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
10621060
simp only [Finset.mem_univ, true_implies]
10631061
apply ENNReal.summable.tsum_le_tsum _ (ENNReal.summable)
10641062
intro z
1065-
letI : Decidable (clProp(le_s hk_mK k',z|hk,y)) := Classical.propDecidable _
10661063
simp_rw [iUnion_eq_if,apply_ite volume,measure_empty, mul_ite, mul_zero]
10671064
if h : clProp(le_s hk_mK k',z|hk,y) then
10681065
simp_rw [if_pos h]
@@ -1104,9 +1101,7 @@ lemma small_boundary' (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk
11041101
linarith
11051102
rw [Set.disjoint_iff]
11061103
intro x hx
1107-
apply hneq
1108-
apply I3_prop_1
1109-
exact hx
1104+
exact hneq <| I3_prop_1 _ hx
11101105
_ ≤ C4_1_7 X * ∑' (k' : Ioc (k - K') k),
11111106
volume (⋃ (z : Yk X k'), ⋃ (_:clProp((le_s hk_mK k'),z|hk,y)),
11121107
ball (z : X) (4⁻¹ * D ^ (k' : ℤ))) := by
@@ -1185,41 +1180,33 @@ lemma small_boundary (k : ℤ) (hk : -S ≤ k) (hk_mK : -S ≤ k - K') (y : Yk X
11851180
calc
11861181
∑' (z : Yk X (k - K')), ∑ᶠ (_ : clProp(hk_mK,z|hk,y)), volume (I3 hk_mK z)
11871182
_ = ∑' (z : Yk X (k - K')), volume (⋃ (_ : clProp(hk_mK,z|hk,y)), I3 hk_mK z) := by
1188-
apply tsum_congr
1189-
intro z
1190-
letI : Decidable clProp(hk_mK,z|hk,y):= Classical.propDecidable _
1183+
congr with z
1184+
classical
11911185
rw [finsum_eq_if, iUnion_eq_if]
1192-
if h : clProp(hk_mK,z|hk,y) then
1186+
if h : clProp(hk_mK, z | hk, y) then
11931187
simp_rw [if_pos h]
11941188
else
1195-
simp_rw [if_neg h]
1196-
rw [measure_empty]
1189+
simp_rw [if_neg h, measure_empty]
11971190
_ ≤ 2⁻¹ * volume (I3 hk y) := small_boundary' k hk hk_mK y
11981191

11991192
lemma le_s_1' (n : ℕ) {k : ℤ} (hk_mn1K : -S ≤ k - (n + 1 : ℕ) * K') : (-S ≤ (k - K') - n * K') := by
12001193
simp only [Nat.cast_add, Nat.cast_one] at hk_mn1K
12011194
linarith
12021195

12031196
lemma le_s_2' (n : ℕ) {k : ℤ} (hk_mn1K : -S ≤ k - (n + 1 : ℕ) * K') : (-S ≤ k - K') := by
1204-
simp only [Nat.cast_add, Nat.cast_one] at hk_mn1K
1205-
rw [right_distrib] at hk_mn1K
1197+
simp only [Nat.cast_add, Nat.cast_one, right_distrib] at hk_mn1K
12061198
apply hk_mn1K.trans
1207-
simp only [one_mul, tsub_le_iff_right, sub_add_add_cancel, le_add_iff_nonneg_right]
1208-
positivity
1199+
simpa using by positivity
12091200

12101201
lemma boundary_sum_eq {k : ℤ} (hk : -S ≤ k) {k' : ℤ} (hk' : -S ≤ k') (y : Yk X k) :
12111202
∑'(y' : Yk X k'), ∑ᶠ (_ : clProp(hk',y'|hk,y)), volume (I3 hk' y') =
12121203
volume (⋃ (y' : Yk X k'), ⋃ (_ : clProp(hk',y'|hk,y)), I3 hk' y') := by
1213-
letI := (Yk_countable X k').to_subtype
1204+
have := (Yk_countable X k').to_subtype
12141205
rw [measure_iUnion]
1215-
· apply tsum_congr
1216-
intro y'
1217-
letI : Decidable clProp(hk',y'|hk,y) := Classical.propDecidable _
1218-
rw [finsum_eq_if,iUnion_eq_if]
1219-
if h : clProp(hk',y'|hk,y) then
1220-
simp_rw [if_pos h]
1221-
else
1222-
simp_rw [if_neg h, measure_empty]
1206+
· congr with y'
1207+
classical
1208+
rw [finsum_eq_if, iUnion_eq_if]
1209+
by_cases h: clProp(hk', y' | hk, y) <;> simp [h]
12231210
· intro i i' hneq
12241211
simp only [disjoint_iUnion_right, disjoint_iUnion_left]
12251212
rw [Set.disjoint_iff]
@@ -1231,14 +1218,15 @@ lemma smaller_boundary (n : ℕ) :
12311218
∀ {k : ℤ}, (hk : -S ≤ k) → (hk_mnK : -S ≤ k - n * K') → ∀ (y : Yk X k),
12321219
∑' (y' : Yk X (k - n * K')), ∑ᶠ (_ : clProp(hk_mnK,y'|hk,y)), volume (I3 hk_mnK y') ≤
12331220
2⁻¹ ^ n * volume (I3 hk y) := by
1234-
induction n
1235-
· intro k hk hk_mnK y
1221+
induction n with
1222+
| zero =>
1223+
intro k hk hk_mnK y
12361224
rw [boundary_sum_eq hk hk_mnK y]
12371225
simp only [Int.cast_ofNat_Int, defaultA, pow_zero, one_mul]
12381226
gcongr
12391227
simp only [iUnion_subset_iff]
12401228
exact fun _ hy' => hy'.I3_subset
1241-
rename_i n hinduction
1229+
| succ n hinduction =>
12421230
intro k hk hk_mnK y
12431231
rw [boundary_sum_eq hk hk_mnK y]
12441232
calc
@@ -1273,14 +1261,9 @@ lemma smaller_boundary (n : ℕ) :
12731261
⋃ (_ : clProp(hk_mnK,y''|le_s_2' n hk_mnK,y')), I3 hk_mnK y'') := by
12741262
letI := (Yk_countable X (k - K')).to_subtype
12751263
rw [measure_iUnion]
1276-
· apply tsum_congr
1277-
intro y'
1278-
letI : Decidable clProp(le_s_2' n hk_mnK,y'|hk,y) := Classical.propDecidable _
1279-
rw [iUnion_eq_if, finsum_eq_if]
1280-
if h : clProp(le_s_2' n hk_mnK,y'|hk,y) then
1281-
simp_rw [if_pos h]
1282-
else
1283-
simp_rw [if_neg h, measure_empty]
1264+
· congr with y'
1265+
classical
1266+
by_cases h : clProp(le_s_2' n hk_mnK , y' | hk, y) <;> simp [h]
12841267
· intro i i' hneq
12851268
simp only [disjoint_iUnion_right, disjoint_iUnion_left]
12861269
intro _ y1 hy1i _ y2 hy2i'
@@ -1299,10 +1282,8 @@ lemma smaller_boundary (n : ℕ) :
12991282
_ = ∑' (y' : Yk X (k - K')), ∑ᶠ (_ : clProp(le_s_2' n hk_mnK,y'|hk,y)),
13001283
∑' (y'': Yk X (k - (n + 1 : ℕ) * K')), ∑ᶠ (_ : clProp(hk_mnK,y''|le_s_2' n hk_mnK,y')),
13011284
volume (I3 hk_mnK y'') := by
1302-
apply tsum_congr
1303-
intro y'
1304-
apply finsum_congr
1305-
intro hcly'
1285+
congr with y'
1286+
congr with hcly'
13061287
rw [boundary_sum_eq (le_s_2' n hk_mnK) hk_mnK y']
13071288
_ = ∑' (y' : Yk X (k - K')), ∑ᶠ (_ : clProp(le_s_2' n hk_mnK,y'|hk,y)),
13081289
∑' (y'' : Yk X ((k - K') - n * K')), ∑ᶠ (_ : clProp(le_s_1' n hk_mnK,y''|le_s_2' n hk_mnK,y')),
@@ -1314,25 +1295,18 @@ lemma smaller_boundary (n : ℕ) :
13141295
2⁻¹ ^ n * volume (I3 (le_s_2' n hk_mnK) y') := by
13151296
apply ENNReal.summable.tsum_le_tsum _ (ENNReal.summable)
13161297
intro y'
1317-
letI : Decidable clProp(le_s_2' n hk_mnK,y'|hk,y) := Classical.propDecidable _
1318-
rw [finsum_eq_if, finsum_eq_if]
1319-
if h : clProp(le_s_2' n hk_mnK,y'|hk,y) then
1298+
classical
1299+
by_cases h : clProp(le_s_2' n hk_mnK , y' | hk, y)
1300+
· rw [finsum_eq_if, finsum_eq_if]
13201301
simp_rw [if_pos h]
13211302
apply hinduction
1322-
else
1323-
simp_rw [if_neg h]
1324-
exact le_refl _
1303+
· simp_all
13251304
_ = 2⁻¹ ^ n * ∑' (y' : Yk X (k - K')), ∑ᶠ (_ : clProp(le_s_2' n hk_mnK,y'|hk,y)),
13261305
volume (I3 (le_s_2' n hk_mnK) y') := by
13271306
rw [← ENNReal.tsum_mul_left]
1328-
apply tsum_congr
1329-
intro y'
1330-
letI : Decidable clProp(le_s_2' n hk_mnK,y'|hk,y) := Classical.propDecidable _
1331-
rw [finsum_eq_if,finsum_eq_if]
1332-
if h : clProp(le_s_2' n hk_mnK,y'|hk,y) then
1333-
simp_rw [if_pos h]
1334-
else
1335-
simp_rw [if_neg h, mul_zero]
1307+
congr with y'
1308+
classical
1309+
by_cases h : clProp(le_s_2' n hk_mnK , y' | hk, y) <;> simp [h]
13361310
_ ≤ 2⁻¹ ^ n * (2⁻¹ * volume (I3 hk y)) := by
13371311
gcongr
13381312
apply _root_.small_boundary

0 commit comments

Comments
 (0)