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

Commit b5e542d

Browse files
committed
feat(measure_theory/measurable_space): defining a measurable function on countably many pieces (#11532)
Also, remove `open_locale classical` in this file and add decidability assumptions where needed. And add a few isolated useful lemmas.
1 parent 1d762c7 commit b5e542d

File tree

3 files changed

+88
-11
lines changed

3 files changed

+88
-11
lines changed

src/measure_theory/group/basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,16 @@ class is_add_haar_measure {G : Type*} [add_group G] [topological_space G] [measu
335335

336336
attribute [to_additive] is_haar_measure
337337

338+
/- Record that a Haar measure on a locally compact space is locally finite. This is needed as the
339+
fact that a measure which is finite on compacts is locally finite is not registered as an instance,
340+
to avoid an instance loop. -/
341+
@[priority 100, to_additive] -- see Note [lower instance priority]
342+
instance is_locally_finite_measure_of_is_haar_measure
343+
[group G] [measurable_space G] [topological_space G] [locally_compact_space G]
344+
(μ : measure G) [is_haar_measure μ] :
345+
is_locally_finite_measure μ :=
346+
is_locally_finite_measure_of_is_finite_measure_on_compacts
347+
338348
section
339349

340350
variables [group G] [measurable_space G] [topological_space G] (μ : measure G) [is_haar_measure μ]

src/measure_theory/measurable_space.lean

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ measurable space, σ-algebra, measurable function, measurable equivalence, dynki
6060
-/
6161

6262
open set encodable function equiv
63-
open_locale classical filter measure_theory
63+
open_locale filter measure_theory
6464

6565

6666
variables {α β γ δ δ' : Type*} {ι : Sort*} {s t u : set α}
@@ -283,6 +283,13 @@ instance : measurable_space ℕ := ⊤
283283
instance : measurable_space ℤ := ⊤
284284
instance : measurable_space ℚ := ⊤
285285

286+
instance : measurable_singleton_class empty := ⟨λ _, trivial⟩
287+
instance : measurable_singleton_class punit := ⟨λ _, trivial⟩
288+
instance : measurable_singleton_class bool := ⟨λ _, trivial⟩
289+
instance : measurable_singleton_class ℕ := ⟨λ _, trivial⟩
290+
instance : measurable_singleton_class ℤ := ⟨λ _, trivial⟩
291+
instance : measurable_singleton_class ℚ := ⟨λ _, trivial⟩
292+
286293
lemma measurable_to_encodable [measurable_space α] [encodable α] {f : β → α}
287294
(h : ∀ y, measurable_set (f ⁻¹' {f y})) :
288295
measurable f :=
@@ -308,12 +315,13 @@ measurable_from_top
308315
lemma measurable_to_nat {f : α → ℕ} : (∀ y, measurable_set (f ⁻¹' {f y})) → measurable f :=
309316
measurable_to_encodable
310317

311-
lemma measurable_find_greatest' {p : α → ℕ → Prop}
318+
lemma measurable_find_greatest' {p : α → ℕ → Prop} [∀ x, decidable_pred (p x)]
312319
{N : ℕ} (hN : ∀ k ≤ N, measurable_set {x | nat.find_greatest (p x) N = k}) :
313320
measurable (λ x, nat.find_greatest (p x) N) :=
314321
measurable_to_nat $ λ x, hN _ N.find_greatest_le
315322

316-
lemma measurable_find_greatest {p : α → ℕ → Prop} {N} (hN : ∀ k ≤ N, measurable_set {x | p x k}) :
323+
lemma measurable_find_greatest {p : α → ℕ → Prop} [∀ x, decidable_pred (p x)]
324+
{N} (hN : ∀ k ≤ N, measurable_set {x | p x k}) :
317325
measurable (λ x, nat.find_greatest (p x) N) :=
318326
begin
319327
refine measurable_find_greatest' (λ k hk, _),
@@ -322,8 +330,8 @@ begin
322330
measurable_set.Inter_Prop, measurable_set.compl, hN]; try { intros } }
323331
end
324332

325-
lemma measurable_find {p : α → ℕ → Prop} (hp : ∀ x, ∃ N, p x N)
326-
(hm : ∀ k, measurable_set {x | p x k}) :
333+
lemma measurable_find {p : α → ℕ → Prop} [∀ x, decidable_pred (p x)]
334+
(hp : ∀ x, ∃ N, p x N) (hm : ∀ k, measurable_set {x | p x k}) :
327335
measurable (λ x, nat.find (hp x)) :=
328336
begin
329337
refine measurable_to_nat (λ x, _),
@@ -557,7 +565,10 @@ lemma measurable_set_swap_iff {s : set (α × β)} :
557565
measurable_set (prod.swap ⁻¹' s) ↔ measurable_set s :=
558566
⟨λ hs, by { convert measurable_swap hs, ext ⟨x, y⟩, refl }, λ hs, measurable_swap hs⟩
559567

560-
lemma measurable_from_prod_encodable [encodable β] [measurable_singleton_class β]
568+
omit m
569+
570+
lemma measurable_from_prod_encodable
571+
[measurable_space α] [encodable β] [measurable_singleton_class β]
561572
{f : α × β → γ} (hf : ∀ y, measurable (λ x, f (x, y))) :
562573
measurable f :=
563574
begin
@@ -569,6 +580,47 @@ begin
569580
exact measurable_set.Union (λ y, (hf y hs).prod (measurable_set_singleton y))
570581
end
571582

583+
/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
584+
@[measurability]
585+
lemma measurable.find {m : measurable_space α}
586+
{f : ℕ → α → β} {p : ℕ → α → Prop} [∀ n, decidable_pred (p n)]
587+
(hf : ∀ n, measurable (f n)) (hp : ∀ n, measurable_set {x | p n x}) (h : ∀ x, ∃ n, p n x) :
588+
measurable (λ x, f (nat.find (h x)) x) :=
589+
begin
590+
have : measurable (λ (p : α × ℕ), f p.2 p.1) := measurable_from_prod_encodable (λ n, hf n),
591+
exact this.comp (measurable.prod_mk measurable_id (measurable_find h hp)),
592+
end
593+
594+
/-- Given countably many disjoint measurable sets `t n` and countably many measurable
595+
functions `g n`, one can construct a measurable function that coincides with `g n` on `t n`. -/
596+
lemma exists_measurable_piecewise_nat {m : measurable_space α} (t : ℕ → set β)
597+
(t_meas : ∀ n, measurable_set (t n)) (t_disj : pairwise (disjoint on t))
598+
(g : ℕ → β → α) (hg : ∀ n, measurable (g n)) :
599+
∃ f : β → α, measurable f ∧ (∀ n x, x ∈ t n → f x = g n x) :=
600+
begin
601+
classical,
602+
let p : ℕ → β → Prop := λ n x, x ∈ t n ∪ (⋃ k, t k)ᶜ,
603+
have M : ∀ n, measurable_set {x | p n x} :=
604+
λ n, (t_meas n).union (measurable_set.compl (measurable_set.Union t_meas)),
605+
have P : ∀ x, ∃ n, p n x,
606+
{ assume x,
607+
by_cases H : ∀ (i : ℕ), x ∉ t i,
608+
{ exact ⟨0, or.inr (by simpa only [mem_Inter, compl_Union] using H)⟩ },
609+
{ simp only [not_forall, not_not_mem] at H,
610+
rcases H with ⟨n, hn⟩,
611+
exact ⟨n, or.inl hn⟩ } },
612+
refine ⟨λ x, g (nat.find (P x)) x, measurable.find hg M P, _⟩,
613+
assume n x hx,
614+
have : x ∈ t (nat.find (P x)),
615+
{ have B : x ∈ t (nat.find (P x)) ∪ (⋃ k, t k)ᶜ := nat.find_spec (P x),
616+
have B' : (∀ (i : ℕ), x ∉ t i) ↔ false,
617+
{ simp only [iff_false, not_forall, not_not_mem], exact ⟨n, hx⟩ },
618+
simpa only [B', mem_union_eq, mem_Inter, or_false, compl_Union, mem_compl_eq] using B },
619+
congr,
620+
by_contra h,
621+
exact t_disj n (nat.find (P x)) (ne.symm h) ⟨hx, this
622+
end
623+
572624
end prod
573625

574626
section pi
@@ -603,7 +655,7 @@ measurable_pi_iff.mpr hf
603655
This doesn't require `f` to be measurable.
604656
This should not be confused with the statement that `update f a x` is measurable. -/
605657
@[measurability]
606-
lemma measurable_update (f : Π (a : δ), π a) {a : δ} : measurable (update f a) :=
658+
lemma measurable_update (f : Π (a : δ), π a) {a : δ} [decidable_eq δ] : measurable (update f a) :=
607659
begin
608660
apply measurable_pi_lambda,
609661
intro x, by_cases hx : x = a,
@@ -623,9 +675,11 @@ lemma measurable_set.univ_pi [encodable δ] {t : Π i : δ, set (π i)}
623675
(ht : ∀ i, measurable_set (t i)) : measurable_set (pi univ t) :=
624676
measurable_set.pi (countable_encodable _) (λ i _, ht i)
625677

626-
lemma measurable_set_pi_of_nonempty {s : set δ} {t : Π i, set (π i)} (hs : countable s)
678+
lemma measurable_set_pi_of_nonempty
679+
{s : set δ} {t : Π i, set (π i)} (hs : countable s)
627680
(h : (pi s t).nonempty) : measurable_set (pi s t) ↔ ∀ i ∈ s, measurable_set (t i) :=
628681
begin
682+
classical,
629683
rcases h with ⟨f, hf⟩, refine ⟨λ hst i hi, _, measurable_set.pi hs⟩,
630684
convert measurable_update f hst, rw [update_preimage_pi hi], exact λ j hj _, hf j hj
631685
end
@@ -702,7 +756,7 @@ begin
702756
{ exact (measurable_pi_apply i).prod_mk ih }
703757
end
704758

705-
lemma measurable_tprod_elim : ∀ {l : list δ} {i : δ} (hi : i ∈ l),
759+
lemma measurable_tprod_elim [decidable_eq δ] : ∀ {l : list δ} {i : δ} (hi : i ∈ l),
706760
measurable (λ (v : tprod π l), v.elim hi)
707761
| (i :: is) j hj := begin
708762
by_cases hji : j = i,
@@ -711,7 +765,7 @@ lemma measurable_tprod_elim : ∀ {l : list δ} {i : δ} (hi : i ∈ l),
711765
exact (measurable_tprod_elim (hj.resolve_left hji)).comp measurable_snd }
712766
end
713767

714-
lemma measurable_tprod_elim' {l : list δ} (h : ∀ i, i ∈ l) :
768+
lemma measurable_tprod_elim' [decidable_eq δ] {l : list δ} (h : ∀ i, i ∈ l) :
715769
measurable (tprod.elim' h : tprod π l → Π i, π i) :=
716770
measurable_pi_lambda _ (λ i, measurable_tprod_elim (h i))
717771

@@ -1159,7 +1213,8 @@ def Pi_congr_right (e : Π a, π a ≃ᵐ π' a) : (Π a, π a) ≃ᵐ (Π a, π
11591213

11601214
/-- Pi-types are measurably equivalent to iterated products. -/
11611215
@[simps {fully_applied := ff}]
1162-
noncomputable def pi_measurable_equiv_tprod {l : list δ'} (hnd : l.nodup) (h : ∀ i, i ∈ l) :
1216+
def pi_measurable_equiv_tprod [decidable_eq δ']
1217+
{l : list δ'} (hnd : l.nodup) (h : ∀ i, i ∈ l) :
11631218
(Π i, π i) ≃ᵐ list.tprod π l :=
11641219
{ to_equiv := list.tprod.pi_equiv_tprod hnd h,
11651220
measurable_to_fun := measurable_tprod_mk l,

src/measure_theory/measure/haar.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,18 @@ begin
622622
... = (μ K.1 / ν K.1) • ν : by rw ← haar_measure_unique (is_mul_left_invariant_haar ν) K }
623623
end
624624

625+
@[priority 90, to_additive] -- see Note [lower instance priority]]
626+
instance regular_of_is_haar_measure
627+
[locally_compact_space G] [second_countable_topology G] (μ : measure G) [is_haar_measure μ] :
628+
regular μ :=
629+
begin
630+
have K : positive_compacts G := classical.choice (topological_space.nonempty_positive_compacts G),
631+
obtain ⟨c, c0, ctop, hμ⟩ : ∃ (c : ℝ≥0∞), (c ≠ 0) ∧ (c ≠ ∞) ∧ (μ = c • haar_measure K) :=
632+
is_haar_measure_eq_smul_is_haar_measure μ _,
633+
rw hμ,
634+
exact regular.smul ctop,
635+
end
636+
625637
/-- Any Haar measure is invariant under inversion in a commutative group. -/
626638
@[to_additive]
627639
lemma map_haar_inv

0 commit comments

Comments
 (0)