Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3310acf

Browse files
committed
feat(order/bounds/basic): add is_greatest_univ_iff etc (#18162)
Also add `ae_measurable_const'` and golf 2 proofs.
1 parent c3350db commit 3310acf

File tree

3 files changed

+36
-48
lines changed

3 files changed

+36
-48
lines changed

src/measure_theory/constructions/borel_space.lean

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,51 +1049,32 @@ begin
10491049
exact measurable_set.Union (λ i, hf i (is_open_gt' _).measurable_set)
10501050
end
10511051

1052-
private lemma ae_measurable.is_glb_of_nonempty {ι} (hι : nonempty ι)
1053-
{μ : measure δ} [countable ι] {f : ι → δ → α} {g : δ → α}
1052+
lemma ae_measurable.is_glb {ι} {μ : measure δ} [countable ι] {f : ι → δ → α} {g : δ → α}
10541053
(hf : ∀ i, ae_measurable (f i) μ) (hg : ∀ᵐ b ∂μ, is_glb {a | ∃ i, f i b = a} (g b)) :
10551054
ae_measurable g μ :=
10561055
begin
1056+
nontriviality α,
1057+
haveI hα : nonempty α := infer_instance,
1058+
casesI is_empty_or_nonempty ι with hι hι,
1059+
{ simp only [is_empty.exists_iff, set_of_false, is_glb_empty_iff] at hg,
1060+
exact ae_measurable_const' (hg.mono $ λ a ha, hg.mono $ λ b hb, (hb _).antisymm (ha _)) },
10571061
let p : δ → (ι → α) → Prop := λ x f', is_glb {a | ∃ i, f' i = a} (g x),
1058-
let g_seq := λ x, ite (x ∈ ae_seq_set hf p) (g x) (⟨g x⟩ : nonempty α).some,
1062+
let g_seq := (ae_seq_set hf p).piecewise g (λ _, hα.some),
10591063
have hg_seq : ∀ b, is_glb {a | ∃ i, ae_seq hf p i b = a} (g_seq b),
10601064
{ intro b,
1061-
haveI hα : nonempty α := nonempty.map g ⟨b⟩,
1062-
simp only [ae_seq, g_seq],
1065+
simp only [ae_seq, g_seq, set.piecewise],
10631066
split_ifs,
10641067
{ have h_set_eq : {a : α | ∃ (i : ι), (hf i).mk (f i) b = a} = {a : α | ∃ (i : ι), f i b = a},
10651068
{ ext x,
10661069
simp_rw [set.mem_set_of_eq, ae_seq.mk_eq_fun_of_mem_ae_seq_set hf h], },
10671070
rw h_set_eq,
10681071
exact ae_seq.fun_prop_of_mem_ae_seq_set hf h, },
1069-
{ have h_singleton : {a : α | ∃ (i : ι), hα.some = a} = {hα.some},
1070-
{ ext1 x,
1071-
exact ⟨λ hx, hx.some_spec.symm, λ hx, ⟨hι.some, hx.symm⟩⟩, },
1072-
rw h_singleton,
1073-
exact is_glb_singleton, }, },
1072+
{ exact is_least.is_glb ⟨(@exists_const (hα.some = hα.some) ι _).2 rfl, λ x ⟨i, hi⟩, hi.le⟩ } },
10741073
refine ⟨g_seq, measurable.is_glb (ae_seq.measurable hf p) hg_seq, _⟩,
1075-
exact (ite_ae_eq_of_measure_compl_zero g (λ x, (⟨g x⟩ : nonempty α).some) (ae_seq_set hf p)
1074+
exact (ite_ae_eq_of_measure_compl_zero g (λ x, .some) (ae_seq_set hf p)
10761075
(ae_seq.measure_compl_ae_seq_set_eq_zero hf hg)).symm,
10771076
end
10781077

1079-
lemma ae_measurable.is_glb {ι} {μ : measure δ} [countable ι] {f : ι → δ → α} {g : δ → α}
1080-
(hf : ∀ i, ae_measurable (f i) μ) (hg : ∀ᵐ b ∂μ, is_glb {a | ∃ i, f i b = a} (g b)) :
1081-
ae_measurable g μ :=
1082-
begin
1083-
by_cases hμ : μ = 0, { rw hμ, exact ae_measurable_zero_measure },
1084-
haveI : μ.ae.ne_bot, { simpa [ne_bot_iff] },
1085-
by_cases hι : nonempty ι, { exact ae_measurable.is_glb_of_nonempty hι hf hg, },
1086-
suffices : ∃ x, g =ᵐ[μ] λ y, g x,
1087-
by { exact ⟨(λ y, g this.some), measurable_const, this.some_spec⟩, },
1088-
have h_empty : ∀ x, {a : α | ∃ (i : ι), f i x = a} = ∅,
1089-
{ intro x,
1090-
ext1 y,
1091-
rw [set.mem_set_of_eq, set.mem_empty_iff_false, iff_false],
1092-
exact λ hi, hι (nonempty_of_exists hi), },
1093-
simp_rw h_empty at hg,
1094-
exact ⟨hg.exists.some, hg.mono (λ y hy, is_glb.unique hy hg.exists.some_spec)⟩,
1095-
end
1096-
10971078
protected lemma monotone.measurable [linear_order β] [order_closed_topology β] {f : β → α}
10981079
(hf : monotone f) : measurable f :=
10991080
suffices h : ∀ x, ord_connected (f ⁻¹' Ioi x),

src/measure_theory/measure/ae_measurable.lean

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,15 @@ let ⟨g, hgm, hg⟩ := h in hgm.null_measurable.congr hg.symm
208208

209209
end ae_measurable
210210

211+
lemma ae_measurable_const' (h : ∀ᵐ x y ∂μ, f x = f y) : ae_measurable f μ :=
212+
begin
213+
rcases eq_or_ne μ 0 with rfl | hμ,
214+
{ exact ae_measurable_zero_measure },
215+
{ haveI := ae_ne_bot.2 hμ,
216+
rcases h.exists with ⟨x, hx⟩,
217+
exact ⟨const α (f x), measurable_const, eventually_eq.symm hx⟩ }
218+
end
219+
211220
lemma ae_measurable_uIoc_iff [linear_order α] {f : α → β} {a b : α} :
212221
(ae_measurable f $ μ.restrict $ Ι a b) ↔
213222
(ae_measurable f $ μ.restrict $ Ioc a b) ∧ (ae_measurable f $ μ.restrict $ Ioc b a) :=
@@ -274,18 +283,15 @@ lemma ae_measurable_Ioi_of_forall_Ioc {β} {mβ : measurable_space β}
274283
ae_measurable g (μ.restrict (Ioi x)) :=
275284
begin
276285
haveI : nonempty α := ⟨x⟩,
277-
haveI : (at_top : filter α).ne_bot := at_top_ne_bot,
278286
obtain ⟨u, hu_tendsto⟩ := exists_seq_tendsto (at_top : filter α),
279287
have Ioi_eq_Union : Ioi x = ⋃ n : ℕ, Ioc x (u n),
280288
{ rw Union_Ioc_eq_Ioi_self_iff.mpr _,
281-
rw tendsto_at_top_at_top at hu_tendsto,
282-
exact λ y _, ⟨(hu_tendsto y).some, (hu_tendsto y).some_spec (hu_tendsto y).some le_rfl⟩, },
289+
exact λ y _, (hu_tendsto.eventually (eventually_ge_at_top y)).exists },
283290
rw [Ioi_eq_Union, ae_measurable_Union_iff],
284291
intros n,
285292
cases lt_or_le x (u n),
286293
{ exact g_meas (u n) h, },
287-
{ rw Ioc_eq_empty (not_lt.mpr h),
288-
simp only [measure.restrict_empty],
294+
{ rw [Ioc_eq_empty (not_lt.mpr h), measure.restrict_empty],
289295
exact ae_measurable_zero_measure, },
290296
end
291297

src/order/bounds/basic.lean

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -571,25 +571,25 @@ by simp only [Ici_inter_Iic.symm, subset_inter_iff, bdd_below_iff_subset_Ici,
571571
#### Univ
572572
-/
573573

574-
lemma is_greatest_univ [preorder γ] [order_top γ] : is_greatest (univ : set γ) ⊤ :=
575-
⟨mem_univ _, λ x hx, le_top⟩
574+
@[simp] lemma is_greatest_univ_iff : is_greatest univ a ↔ is_top a :=
575+
by simp [is_greatest, mem_upper_bounds, is_top]
576+
577+
lemma is_greatest_univ [order_top α] : is_greatest (univ : set α) ⊤ :=
578+
is_greatest_univ_iff.2 is_top_top
576579

577580
@[simp] lemma order_top.upper_bounds_univ [partial_order γ] [order_top γ] :
578581
upper_bounds (univ : set γ) = {⊤} :=
579582
by rw [is_greatest_univ.upper_bounds_eq, Ici_top]
580583

581-
lemma is_lub_univ [preorder γ] [order_top γ] : is_lub (univ : set γ) ⊤ :=
582-
is_greatest_univ.is_lub
584+
lemma is_lub_univ [order_top α] : is_lub (univ : set α) ⊤ := is_greatest_univ.is_lub
583585

584586
@[simp] lemma order_bot.lower_bounds_univ [partial_order γ] [order_bot γ] :
585587
lower_bounds (univ : set γ) = {⊥} :=
586588
@order_top.upper_bounds_univ γᵒᵈ _ _
587589

588-
lemma is_least_univ [preorder γ] [order_bot γ] : is_least (univ : set γ) ⊥ :=
589-
@is_greatest_univ γᵒᵈ _ _
590-
591-
lemma is_glb_univ [preorder γ] [order_bot γ] : is_glb (univ : set γ) ⊥ :=
592-
is_least_univ.is_glb
590+
@[simp] lemma is_least_univ_iff : is_least univ a ↔ is_bot a := @is_greatest_univ_iff αᵒᵈ _ _
591+
lemma is_least_univ [order_bot α] : is_least (univ : set α) ⊥ := @is_greatest_univ αᵒᵈ _ _
592+
lemma is_glb_univ [order_bot α] : is_glb (univ : set α) ⊥ := is_least_univ.is_glb
593593

594594
@[simp] lemma no_max_order.upper_bounds_univ [no_max_order α] : upper_bounds (univ : set α) = ∅ :=
595595
eq_empty_of_subset_empty $ λ b hb, let ⟨x, hx⟩ := exists_gt b in
@@ -619,10 +619,11 @@ by simp only [bdd_above, upper_bounds_empty, univ_nonempty]
619619
@[simp] lemma bdd_below_empty [nonempty α] : bdd_below (∅ : set α) :=
620620
by simp only [bdd_below, lower_bounds_empty, univ_nonempty]
621621

622-
lemma is_glb_empty [preorder γ] [order_top γ] : is_glb ∅ (⊤:γ) :=
623-
by simp only [is_glb, lower_bounds_empty, is_greatest_univ]
622+
@[simp] lemma is_glb_empty_iff : is_glb ∅ a ↔ is_top a := by simp [is_glb]
623+
@[simp] lemma is_lub_empty_iff : is_lub ∅ a ↔ is_bot a := @is_glb_empty_iff αᵒᵈ _ _
624624

625-
lemma is_lub_empty [preorder γ] [order_bot γ] : is_lub ∅ (⊥:γ) := @is_glb_empty γᵒᵈ _ _
625+
lemma is_glb_empty [order_top α] : is_glb ∅ (⊤:α) := is_glb_empty_iff.2 is_top_top
626+
lemma is_lub_empty [order_bot α] : is_lub ∅ (⊥:α) := @is_glb_empty αᵒᵈ _ _
626627

627628
lemma is_lub.nonempty [no_min_order α] (hs : is_lub s a) : s.nonempty :=
628629
let ⟨a', ha'⟩ := exists_lt a in
@@ -683,11 +684,11 @@ by rw [insert_eq, upper_bounds_union, upper_bounds_singleton]
683684
by rw [insert_eq, lower_bounds_union, lower_bounds_singleton]
684685

685686
/-- When there is a global maximum, every set is bounded above. -/
686-
@[simp] protected lemma order_top.bdd_above [preorder γ] [order_top γ] (s : set γ) : bdd_above s :=
687+
@[simp] protected lemma order_top.bdd_above [order_top α] (s : set α) : bdd_above s :=
687688
⟨⊤, λ a ha, order_top.le_top a⟩
688689

689690
/-- When there is a global minimum, every set is bounded below. -/
690-
@[simp] protected lemma order_bot.bdd_below [preorder γ] [order_bot γ] (s : set γ) : bdd_below s :=
691+
@[simp] protected lemma order_bot.bdd_below [order_bot α] (s : set α) : bdd_below s :=
691692
⟨⊥, λ a ha, order_bot.bot_le a⟩
692693

693694
/-!

0 commit comments

Comments
 (0)