Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(measure_theory/measurable_space): defining a measurable function on countably many pieces #11532

Closed
wants to merge 6 commits into from

Conversation

sgouezel
Copy link
Collaborator

Also, remove open_locale classical in this file and add decidability assumptions where needed. And add a few isolated useful lemmas.


Open in Gitpod

@sgouezel sgouezel added the awaiting-review The author would like community review of the PR label Jan 17, 2022
Copy link
Collaborator

@RemyDegenne RemyDegenne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
bors d+

src/measure_theory/measurable_space.lean Outdated Show resolved Hide resolved
src/measure_theory/measurable_space.lean Outdated Show resolved Hide resolved
src/measure_theory/measurable_space.lean Outdated Show resolved Hide resolved
@@ -571,6 +582,46 @@ begin
exact measurable_set.Union (λ y, (hf y hs).prod (measurable_set_singleton y))
end

/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
lemma measurable.find [measurable_space α]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a measurability lemma? There are many hypothesis so the tactic is likely to be stuck after that, but at least it should suggest refine measurable.find _ _ _

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works:

/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
@[measurability]
lemma measurable.find {m : measurable_space α}
  {f : ℕ → α → β} {p : ℕ → α → Prop} [∀ n, decidable_pred (p n)]
  (hf : ∀ n, measurable (f n)) (hp : ∀ n, measurable_set {x | p n x}) (h : ∀ x, ∃ n, p n x) :
  measurable (λ x, f (nat.find (h x)) x) :=
begin
  have : measurable (λ (p : α × ℕ), f p.2 p.1) := measurable_from_prod_encodable (λ n, hf n),
  exact this.comp (measurable.prod_mk measurable_id (measurable_find h hp)),
end

example {m : measurable_space α}
  {f : ℕ → α → β} {p : ℕ → α → Prop} [∀ n, decidable_pred (p n)]
  (hf : ∀ n, measurable (f n)) (hp : ∀ n, measurable_set {x | p n x}) (h : ∀ x, ∃ n, p n x) :
  measurable (λ x, f (nat.find (h x)) x) :=
by measurability

And if I omit hp in the example, it suggests Try this: refine measurable.find hf (λ (n : ℕ), _[n]) (λ (x : α), h x), which is not too bad.

@bors
Copy link

bors bot commented Jan 20, 2022

✌️ sgouezel can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Jan 20, 2022
sgouezel and others added 3 commits January 20, 2022 13:26
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
@sgouezel
Copy link
Collaborator Author

bors r+

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jan 20, 2022
bors bot pushed a commit that referenced this pull request Jan 20, 2022
… 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.
@bors
Copy link

bors bot commented Jan 20, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(measure_theory/measurable_space): defining a measurable function on countably many pieces [Merged by Bors] - feat(measure_theory/measurable_space): defining a measurable function on countably many pieces Jan 20, 2022
@bors bors bot closed this Jan 20, 2022
@bors bors bot deleted the more_measurable_space branch January 20, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants