Skip to content

Commit ebfda4d

Browse files
committed
chore(*): golf, mostly using gcongr (#12944)
Golf, mostly in `MeasureTheory` using `gcongr`. Also add some missing `gcongr` lemmas.
1 parent c6d8fd7 commit ebfda4d

File tree

36 files changed

+213
-224
lines changed

36 files changed

+213
-224
lines changed

Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ theorem hasIntegral_GP_pderiv (f : (Fin (n + 1) → ℝ) → E)
185185
· rcases ((nhdsWithin_hasBasis nhds_basis_closedBall _).tendsto_iff nhds_basis_closedBall).1
186186
(Hs x hx.2) _ (half_pos <| half_pos ε0) with ⟨δ₁, δ₁0, hδ₁⟩
187187
filter_upwards [Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, δ₁0⟩] with δ hδ y₁ hy₁ y₂ hy₂
188-
have : closedBall x δ ∩ (Box.Icc I) ⊆ closedBall x δ₁ ∩ (Box.Icc I) :=
189-
inter_subset_inter_left _ (closedBall_subset_closedBall hδ.2)
188+
have : closedBall x δ ∩ (Box.Icc I) ⊆ closedBall x δ₁ ∩ (Box.Icc I) := by gcongr; exact hδ.2
190189
rw [← dist_eq_norm]
191190
calc
192191
dist (f y₁) (f y₂) ≤ dist (f y₁) (f x) + dist (f y₂) (f x) := dist_triangle_right _ _ _

Mathlib/Data/Set/Accumulate.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ theorem monotone_accumulate [Preorder α] : Monotone (Accumulate s) := fun _ _ h
4242
biUnion_subset_biUnion_left fun _ hz => le_trans hz hxy
4343
#align set.monotone_accumulate Set.monotone_accumulate
4444

45+
@[gcongr]
46+
theorem accumulate_subset_accumulate [Preorder α] {x y} (h : x ≤ y) :
47+
Accumulate s x ⊆ Accumulate s y :=
48+
monotone_accumulate h
49+
4550
theorem biUnion_accumulate [Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y := by
4651
apply Subset.antisymm
4752
· exact iUnion₂_subset fun y hy => monotone_accumulate hy

Mathlib/Data/Set/Prod.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@ noncomputable instance decidableMemProd [DecidablePred (· ∈ s)] [DecidablePre
4343
DecidablePred (· ∈ s ×ˢ t) := fun _ => And.decidable
4444
#align set.decidable_mem_prod Set.decidableMemProd
4545

46+
@[gcongr]
4647
theorem prod_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂ :=
4748
fun _ ⟨h₁, h₂⟩ => ⟨hs h₁, ht h₂⟩
4849
#align set.prod_mono Set.prod_mono
4950

51+
@[gcongr]
5052
theorem prod_mono_left (hs : s₁ ⊆ s₂) : s₁ ×ˢ t ⊆ s₂ ×ˢ t :=
5153
prod_mono hs Subset.rfl
5254
#align set.prod_mono_left Set.prod_mono_left
5355

56+
@[gcongr]
5457
theorem prod_mono_right (ht : t₁ ⊆ t₂) : s ×ˢ t₁ ⊆ s ×ˢ t₂ :=
5558
prod_mono Subset.rfl ht
5659
#align set.prod_mono_right Set.prod_mono_right

Mathlib/MeasureTheory/Constructions/Pi.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ theorem pi_caratheodory :
297297
simp_rw [piPremeasure]
298298
refine' Finset.prod_add_prod_le' (Finset.mem_univ i) _ _ _
299299
· simp [image_inter_preimage, image_diff_preimage, measure_inter_add_diff _ hs, le_refl]
300-
· rintro j - _; apply mono'; apply image_subset; apply inter_subset_left
301-
· rintro j - _; apply mono'; apply image_subset; apply diff_subset
300+
· rintro j - _; gcongr; apply inter_subset_left
301+
· rintro j - _; gcongr; apply diff_subset
302302
#align measure_theory.measure.pi_caratheodory MeasureTheory.Measure.pi_caratheodory
303303

304304
/-- `Measure.pi μ` is the finite product of the measures `{μ i | i : ι}`.

Mathlib/MeasureTheory/Constructions/Prod/Basic.lean

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ do not need the sets to be measurable. -/
349349
@[simp]
350350
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
351351
apply le_antisymm
352-
· set ST := toMeasurable μ s ×ˢ toMeasurable ν t
353-
have hSTm : MeasurableSet ST :=
352+
· set S := toMeasurable μ s
353+
set T := toMeasurable ν t
354+
have hSTm : MeasurableSet (S ×ˢ T) :=
354355
(measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
355356
calc
356-
μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
357-
measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
358-
_ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
357+
μ.prod ν (s ×ˢ t) ≤ μ.prod ν (S ×ˢ T) := by gcongr <;> apply subset_toMeasurable
358+
_ = μ S * ν T := by
359359
rw [prod_apply hSTm]
360-
simp_rw [ST, mk_preimage_prod_right_eq_if, measure_if,
360+
simp_rw [mk_preimage_prod_right_eq_if, measure_if,
361361
lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
362362
restrict_apply_univ, mul_comm]
363363
_ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
@@ -370,7 +370,7 @@ theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν
370370
set s' : Set α := { x | ν t ≤ f x }
371371
have hss' : s ⊆ s' := fun x hx => measure_mono fun y hy => hST <| mk_mem_prod hx hy
372372
calc
373-
μ s * ν t ≤ μ s' * ν t := mul_le_mul_right' (measure_mono hss') _
373+
μ s * ν t ≤ μ s' * ν t := by gcongr
374374
_ = ∫⁻ _ in s', ν t ∂μ := by rw [set_lintegral_const, mul_comm]
375375
_ ≤ ∫⁻ x in s', f x ∂μ := set_lintegral_mono measurable_const hfm fun x => id
376376
_ ≤ ∫⁻ x, f x ∂μ := lintegral_mono' restrict_le_self le_rfl
@@ -533,8 +533,7 @@ lemma set_prod_ae_eq {s s' : Set α} {t t' : Set β} (hs : s =ᵐ[μ] s') (ht :
533533
lemma measure_prod_compl_eq_zero {s : Set α} {t : Set β}
534534
(s_ae_univ : μ sᶜ = 0) (t_ae_univ : ν tᶜ = 0) :
535535
μ.prod ν (s ×ˢ t)ᶜ = 0 := by
536-
rw [Set.compl_prod_eq_union]
537-
apply le_antisymm ((measure_union_le _ _).trans _) (zero_le _)
536+
rw [Set.compl_prod_eq_union, measure_union_null_iff]
538537
simp [s_ae_univ, t_ae_univ]
539538

540539
lemma _root_.MeasureTheory.NullMeasurableSet.prod {s : Set α} {t : Set β}

Mathlib/MeasureTheory/Covering/Besicovitch.lean

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ structure Besicovitch.SatelliteConfig (α : Type*) [MetricSpace α] (N : ℕ) (
141141
#align besicovitch.satellite_config.hlast Besicovitch.SatelliteConfig.hlast
142142
#align besicovitch.satellite_config.inter Besicovitch.SatelliteConfig.inter
143143

144+
namespace Mathlib.Meta.Positivity
145+
146+
open Lean Meta Qq
147+
148+
/-- Extension for the `positivity` tactic: `Besicovitch.SatelliteConfig.r`. -/
149+
@[positivity Besicovitch.SatelliteConfig.r _ _]
150+
def evalBesicovitchSatelliteConfigR : PositivityExt where eval {u α} _zα _pα e := do
151+
match u, α, e with
152+
| 0, ~q(ℝ), ~q(@Besicovitch.SatelliteConfig.r $β $inst $N $τ $self $i) =>
153+
assertInstancesCommute
154+
return .positive q(Besicovitch.SatelliteConfig.rpos $self $i)
155+
| _, _, _ => throwError "not Besicovitch.SatelliteConfig.r"
156+
157+
end Mathlib.Meta.Positivity
158+
144159
/-- A metric space has the Besicovitch covering property if there exist `N` and `τ > 1` such that
145160
there are no satellite configuration of parameter `τ` with `N+1` points. This is the condition that
146161
guarantees that the measurable Besicovitch covering theorem holds. It is satisfied by
@@ -650,8 +665,8 @@ theorem exist_finset_disjoint_balls_large_measure (μ : Measure α) [IsFiniteMea
650665
μ o = 1 / (N + 1) * μ s + N / (N + 1) * μ s := by
651666
rw [μo, ← add_mul, ENNReal.div_add_div_same, add_comm, ENNReal.div_self, one_mul] <;> simp
652667
_ ≤ μ ((⋃ x ∈ w, closedBall (↑x) (r ↑x)) ∩ o) + N / (N + 1) * μ s := by
653-
refine' add_le_add _ le_rfl
654-
rw [div_eq_mul_inv, one_mul, mul_comm, ← div_eq_mul_inv]
668+
gcongr
669+
rw [one_div, mul_comm, ← div_eq_mul_inv]
655670
apply hw.le.trans (le_of_eq _)
656671
rw [← Finset.set_biUnion_coe, inter_comm _ o, inter_iUnion₂, Finset.set_biUnion_coe,
657672
measure_biUnion_finset]
@@ -783,8 +798,7 @@ theorem exists_disjoint_closedBall_covering_ae_of_finiteMeasure_aux (μ : Measur
783798
μ (s \ ⋃ (p : α × ℝ) (_ : p ∈ ⋃ n : ℕ, (u n : Set (α × ℝ))), closedBall p.fst p.snd) ≤
784799
μ (s \ ⋃ (p : α × ℝ) (_ : p ∈ u n), closedBall p.fst p.snd) := by
785800
intro n
786-
apply measure_mono
787-
apply diff_subset_diff (Subset.refl _)
801+
gcongr μ (s \ ?_)
788802
exact biUnion_subset_biUnion_left (subset_iUnion (fun i => (u i : Set (α × ℝ))) n)
789803
have B :
790804
∀ n, μ (s \ ⋃ (p : α × ℝ) (_ : p ∈ u n), closedBall p.fst p.snd) ≤
@@ -1029,12 +1043,10 @@ theorem exists_closedBall_covering_tsum_measure_le (μ : Measure α) [SigmaFinit
10291043
∑ i : Fin N, ∑' x : ((↑) : s' → α) '' S i, μ (closedBall x (r x)) :=
10301044
(add_le_add le_rfl (ENNReal.tsum_iUnion_le (fun x => μ (closedBall x (r x))) _))
10311045
_ ≤ μ s + ε / 2 + ∑ i : Fin N, ε / 2 / N := by
1032-
refine' add_le_add A _
1033-
refine' Finset.sum_le_sum _
1034-
intro i _
1035-
exact B i
1046+
gcongr
1047+
apply B
10361048
_ ≤ μ s + ε / 2 + ε / 2 := by
1037-
refine' add_le_add le_rfl _
1049+
gcongr
10381050
simp only [Finset.card_fin, Finset.sum_const, nsmul_eq_mul, ENNReal.mul_div_le]
10391051
_ = μ s + ε := by rw [add_assoc, ENNReal.add_halves]
10401052
#align besicovitch.exists_closed_ball_covering_tsum_measure_le Besicovitch.exists_closedBall_covering_tsum_measure_le

Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -64,51 +64,20 @@ radius at `1`. -/
6464
def centerAndRescale : SatelliteConfig E N τ where
6565
c i := (a.r (last N))⁻¹ • (a.c i - a.c (last N))
6666
r i := (a.r (last N))⁻¹ * a.r i
67-
rpos i := mul_pos (inv_pos.2 (a.rpos _)) (a.rpos _)
67+
rpos i := by positivity
6868
h i j hij := by
69-
rcases a.h hij with (H | H)
70-
· left
71-
constructor
72-
· rw [dist_eq_norm, ← smul_sub, norm_smul, Real.norm_eq_abs,
73-
abs_of_nonneg (inv_nonneg.2 (a.rpos _).le)]
74-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
75-
rw [dist_eq_norm] at H
76-
convert H.1 using 2
77-
abel
78-
· rw [← mul_assoc, mul_comm τ, mul_assoc]
79-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
80-
exact H.2
81-
· right
82-
constructor
83-
· rw [dist_eq_norm, ← smul_sub, norm_smul, Real.norm_eq_abs,
84-
abs_of_nonneg (inv_nonneg.2 (a.rpos _).le)]
85-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
86-
rw [dist_eq_norm] at H
87-
convert H.1 using 2
88-
abel
89-
· rw [← mul_assoc, mul_comm τ, mul_assoc]
90-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
91-
exact H.2
69+
simp (disch := positivity) only [dist_smul₀, dist_sub_right, mul_left_comm τ,
70+
Real.norm_of_nonneg]
71+
rcases a.h hij with (⟨H₁, H₂⟩ | ⟨H₁, H₂⟩) <;> [left; right] <;> constructor <;> gcongr
9272
hlast i hi := by
93-
have H := a.hlast i hi
94-
constructor
95-
· rw [dist_eq_norm, ← smul_sub, norm_smul, Real.norm_eq_abs,
96-
abs_of_nonneg (inv_nonneg.2 (a.rpos _).le)]
97-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
98-
rw [dist_eq_norm] at H
99-
convert H.1 using 2
100-
abel
101-
· rw [← mul_assoc, mul_comm τ, mul_assoc]
102-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
103-
exact H.2
73+
simp (disch := positivity) only [dist_smul₀, dist_sub_right, mul_left_comm τ,
74+
Real.norm_of_nonneg]
75+
have ⟨H₁, H₂⟩ := a.hlast i hi
76+
constructor <;> gcongr
10477
inter i hi := by
105-
have H := a.inter i hi
106-
rw [dist_eq_norm, ← smul_sub, norm_smul, Real.norm_eq_abs,
107-
abs_of_nonneg (inv_nonneg.2 (a.rpos _).le), ← mul_add]
108-
refine' mul_le_mul_of_nonneg_left _ (inv_nonneg.2 (a.rpos _).le)
109-
rw [dist_eq_norm] at H
110-
convert H using 2
111-
abel
78+
simp (disch := positivity) only [dist_smul₀, ← mul_add, dist_sub_right, Real.norm_of_nonneg]
79+
gcongr
80+
exact a.inter i hi
11281
#align besicovitch.satellite_config.center_and_rescale Besicovitch.SatelliteConfig.centerAndRescale
11382

11483
theorem centerAndRescale_center : a.centerAndRescale.c (last N) = 0 := by
@@ -362,7 +331,7 @@ theorem exists_normalized_aux1 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
362331
have τpos : 0 < τ := _root_.zero_lt_one.trans_le hτ
363332
have I : (1 - δ / 4) * τ ≤ 1 :=
364333
calc
365-
(1 - δ / 4) * τ ≤ (1 - δ / 4) * (1 + δ / 4) := mul_le_mul_of_nonneg_left hδ1 D
334+
(1 - δ / 4) * τ ≤ (1 - δ / 4) * (1 + δ / 4) := by gcongr
366335
_ = (1 : ℝ) - δ ^ 2 / 16 := by ring
367336
_ ≤ 1 := by linarith only [sq_nonneg δ]
368337
have J : 1 - δ ≤ 1 - δ / 4 := by linarith only [δnonneg]
@@ -396,7 +365,6 @@ theorem exists_normalized_aux2 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
396365
simpa only [dist_eq_norm] using a.h
397366
have δnonneg : 0 ≤ δ := by linarith only [hτ, hδ1]
398367
have D : 01 - δ / 4 := by linarith only [hδ2]
399-
have τpos : 0 < τ := _root_.zero_lt_one.trans_le hτ
400368
have hcrj : ‖a.c j‖ ≤ a.r j + 1 := by simpa only [lastc, lastr, dist_zero_right] using a.inter' j
401369
have I : a.r i ≤ 2 := by
402370
rcases lt_or_le i (last N) with (H | H)
@@ -407,25 +375,25 @@ theorem exists_normalized_aux2 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
407375
exact one_le_two
408376
have J : (1 - δ / 4) * τ ≤ 1 :=
409377
calc
410-
(1 - δ / 4) * τ ≤ (1 - δ / 4) * (1 + δ / 4) := mul_le_mul_of_nonneg_left hδ1 D
378+
(1 - δ / 4) * τ ≤ (1 - δ / 4) * (1 + δ / 4) := by gcongr
411379
_ = (1 : ℝ) - δ ^ 2 / 16 := by ring
412380
_ ≤ 1 := by linarith only [sq_nonneg δ]
413381
have A : a.r j - δ ≤ ‖a.c i - a.c j‖ := by
414382
rcases ah inej.symm with (H | H); · rw [norm_sub_rev]; linarith [H.1]
415383
have C : a.r j ≤ 4 :=
416384
calc
417385
a.r j ≤ τ * a.r i := H.2
418-
_ ≤ τ * 2 := mul_le_mul_of_nonneg_left I τpos.le
419-
_ ≤ 5 / 4 * 2 := (mul_le_mul_of_nonneg_right (by linarith only [hδ1, hδ2]) zero_le_two)
386+
_ ≤ τ * 2 := by gcongr
387+
_ ≤ 5 / 4 * 2 := by gcongr; linarith only [hδ1, hδ2]
420388
_ ≤ 4 := by norm_num
421389
calc
422390
a.r j - δ ≤ a.r j - a.r j / 4 * δ := by
423-
refine' sub_le_sub le_rfl _
391+
gcongr _ - ?_
424392
refine' mul_le_of_le_one_left δnonneg _
425393
linarith only [C]
426394
_ = (1 - δ / 4) * a.r j := by ring
427395
_ ≤ (1 - δ / 4) * (τ * a.r i) := mul_le_mul_of_nonneg_left H.2 D
428-
_ ≤ 1 * a.r i := by rw [← mul_assoc]; apply mul_le_mul_of_nonneg_right J (a.rpos _).le
396+
_ ≤ 1 * a.r i := by rw [← mul_assoc]; gcongr
429397
_ ≤ ‖a.c i - a.c j‖ := by rw [one_mul]; exact H.1
430398
set d := (2 / ‖a.c j‖) • a.c j with hd
431399
have : a.r j - δ ≤ ‖a.c i - d‖ + (a.r j - 1) :=

Mathlib/MeasureTheory/Covering/Vitali.lean

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ theorem exists_disjoint_subfamily_covering_enlargment (B : ι → Set α) (t : S
150150
calc
151151
δ c ≤ m := le_csSup bddA (mem_image_of_mem _ ⟨ct, H⟩)
152152
_ = τ * (m / τ) := by field_simp [(zero_lt_one.trans hτ).ne']
153-
_ ≤ τ * δ b := mul_le_mul_of_nonneg_left ha' (zero_le_one.trans hτ.le)
153+
_ ≤ τ * δ b := by gcongr
154154
· rw [← not_disjoint_iff_nonempty_inter] at hcb
155155
exact (hcb (H _ H')).elim
156156
#align vitali.exists_disjoint_subfamily_covering_enlargment Vitali.exists_disjoint_subfamily_covering_enlargment
@@ -386,7 +386,7 @@ theorem exists_disjoint_covering_ae [MetricSpace α] [MeasurableSpace α] [Opens
386386
_ ≤ ∑' a : { a // a ∉ w }, μ (closedBall (c a) (3 * r a)) := measure_iUnion_le _
387387
_ ≤ ∑' a : { a // a ∉ w }, C * μ (B a) := (ENNReal.tsum_le_tsum fun a => μB a (ut (vu a.1.2)))
388388
_ = C * ∑' a : { a // a ∉ w }, μ (B a) := ENNReal.tsum_mul_left
389-
_ ≤ C * (ε / C) := mul_le_mul_left' hw.le _
389+
_ ≤ C * (ε / C) := by gcongr
390390
_ ≤ ε := ENNReal.mul_div_le
391391
#align vitali.exists_disjoint_covering_ae Vitali.exists_disjoint_covering_ae
392392

@@ -418,10 +418,11 @@ protected def vitaliFamily [MetricSpace α] [MeasurableSpace α] [OpensMeasurabl
418418
intro x xs ε εpos
419419
rcases ffine x xs ε εpos with ⟨a, ha, h'a⟩
420420
rcases fsubset x xs ha with ⟨a_closed, a_int, ⟨r, ar, μr⟩⟩
421-
refine' ⟨⟨min r ε, x, a⟩, ⟨_, _, a_int, a_closed, ha, xs⟩, min_le_right _ _, rfl⟩
421+
refine ⟨⟨min r ε, x, a⟩, ⟨?_, ?_, a_int, a_closed, ha, xs⟩, min_le_right _ _, rfl⟩
422422
· rcases min_cases r ε with (h' | h') <;> rwa [h'.1]
423-
· apply le_trans (measure_mono (closedBall_subset_closedBall _)) μr
424-
exact mul_le_mul_of_nonneg_left (min_le_left _ _) zero_le_three
423+
· apply le_trans ?_ μr
424+
gcongr
425+
apply min_le_left
425426
rcases exists_disjoint_covering_ae μ s t C (fun p => p.1) (fun p => p.2.1) (fun p => p.2.2)
426427
(fun p hp => hp.1) (fun p hp => hp.2.1) (fun p hp => hp.2.2.1) (fun p hp => hp.2.2.2.1) A
427428
with ⟨t', t't, _, t'_disj, μt'⟩

Mathlib/MeasureTheory/Decomposition/UnsignedHahn.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ theorem hahn_decomposition [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
110110
· intro n (hmn : m ≤ n) ih
111111
have : γ + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ (n + 1)) ≤ γ + d (f m (n + 1)) := by
112112
calc
113-
γ + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ (n + 1))
113+
γ + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ (n + 1)) =
114114
γ + (γ - 2 * (1 / 2) ^ m + ((1 / 2) ^ n - (1 / 2) ^ (n + 1))) := by
115-
refine' add_le_add_left (add_le_add_left _ _) γ
116-
simp only [pow_add, pow_one, le_sub_iff_add_le]
117-
linarith
115+
rw [pow_succ, mul_one_div, _root_.sub_half]
118116
_ = γ - (1 / 2) ^ (n + 1) + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ n) := by
119117
simp only [sub_eq_add_neg]; abel
120118
_ ≤ d (e (n + 1)) + d (f m n) := add_le_add (le_of_lt <| he₂ _) ih
@@ -126,7 +124,6 @@ theorem hahn_decomposition [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
126124
· exact (he₁ _).union (hf _ _)
127125
· exact he₁ _
128126
_ ≤ γ + d (f m (n + 1)) := add_le_add_right (d_le_γ _ <| (he₁ _).union (hf _ _)) _
129-
130127
exact (add_le_add_iff_left γ).1 this
131128
let s := ⋃ m, ⋂ n, f m n
132129
have γ_le_d_s : γ ≤ d s := by
@@ -169,7 +166,7 @@ theorem hahn_decomposition [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
169166
have : d t ≤ 0 :=
170167
(add_le_add_iff_left γ).1 <|
171168
calc
172-
γ + d t ≤ d s + d t := add_le_add γ_le_d_s le_rfl
169+
γ + d t ≤ d s + d t := by gcongr
173170
_ = d (s ∪ t) := by
174171
rw [d_split _ _ (hs.union ht) ht, union_diff_right, union_inter_cancel_right,
175172
(subset_compl_iff_disjoint_left.1 hts).sdiff_eq_left]

Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ theorem MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets {α : Type
6565
μ t ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u' p ∩ v p q) := by
6666
refine (measure_iUnion_le _).trans ?_
6767
refine ENNReal.tsum_le_tsum fun p => ?_
68-
refine @measure_iUnion_le _ _ _ _ ?_ _
69-
exact (s_count.mono (inter_subset_left _ _)).to_subtype
68+
haveI := (s_count.mono (inter_subset_left _ (Ioi ↑p))).to_subtype
69+
apply measure_iUnion_le
7070
_ ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u p q ∩ v p q) := by
71-
refine ENNReal.tsum_le_tsum fun p => ?_
72-
refine ENNReal.tsum_le_tsum fun q => measure_mono ?_
73-
exact inter_subset_inter_left _ (biInter_subset_of_mem q.2)
71+
gcongr with p q
72+
exact biInter_subset_of_mem q.2
7473
_ = ∑' (p : s) (_ : ↥(s ∩ Ioi p)), (0 : ℝ≥0∞) := by
7574
congr
7675
ext1 p

0 commit comments

Comments
 (0)