Skip to content

[Merged by Bors] - feat: Miscellaneous small ENNReal lemmas.#13938

Closed
kkytola wants to merge 41 commits intomasterfrom
kkytola/misc_ENNReal_lemmas
Closed

[Merged by Bors] - feat: Miscellaneous small ENNReal lemmas.#13938
kkytola wants to merge 41 commits intomasterfrom
kkytola/misc_ENNReal_lemmas

Conversation

@kkytola
Copy link
Copy Markdown
Collaborator

@kkytola kkytola commented Jun 18, 2024

ENNReal.*: .toNNReal_toReal_eq, .sub_add_eq_add_sub, .zpow_neg, .zpow_sub, .tendsto_pow_atTop_nhds_top + instance MeasurableSMul₂ ℝ≥0 ℝ≥0∞


Open in Gitpod

@kkytola kkytola added the WIP Work in progress label Jun 18, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 18, 2024

PR summary 326e10bcf0

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ ENNReal.tendsto_pow_atTop_nhds_top_iff
+ coe_toNNReal_eq_toReal
+ instance : MeasurableSMul₂ ℝ≥0 ℝ≥0∞
+ sub_add_eq_add_sub
+ toNNReal_toReal_eq
+ zpow_neg
+ zpow_sub

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@kkytola kkytola added awaiting-review and removed WIP Work in progress labels Jun 19, 2024
rfl

/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toNNReal ∘ xs) = toNNReal (liminf xs)`. -/
lemma liminf_toNNReal_eq {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't it enough to assume the weaker condition that xs i is eventually not equal to ? If the liminf is infinity in this case, it means that the sequence is tending to infinity, so the liminf in NNReal is probably zero (what other choice of junk value could we have? I haven't checked).

Copy link
Copy Markdown
Collaborator Author

@kkytola kkytola Jul 10, 2024

Choose a reason for hiding this comment

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

True. The existing lemma Monotone.map_liminf_of_continuousAt used here had suboptimal assumptions, so it looks like the right course is to generalize that first. I made PR #14591 for the generalization. With it, I will return and generalize this lemma (and liminf_toReal_eq above, which inherited a similar suboptimal assumption).

Actually, I belatedly realized that your observation was stronger than the general generalization it made me think of. In the ENNReal case the junk value choice should allow for an even weaker assumption than coboundedness. I will therefore think about fixing the ENNReal-lemmas independently of the generalization in the other PR, which I nevertheless still think is fixing suboptimal generality elsewhere. [UPDATE: The requested generalization ended up depending on the other PR's generalization in any case.]

Copy link
Copy Markdown
Collaborator Author

@kkytola kkytola Jul 24, 2024

Choose a reason for hiding this comment

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

I moved the generalization of this lemma and the ones below to #15115. (Unfortunately I missed that these are not completely independent: the new PR still depends on one lemma in the current simple PR. I still think the division makes the PRs clearer that way.)

@sgouezel sgouezel added awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Jun 22, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 9, 2024
@kkytola kkytola removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 24, 2024
@kkytola kkytola mentioned this pull request Jul 29, 2024
3 tasks
@[simp] theorem toReal_nonneg {a : ℝ≥0∞} : 0 ≤ a.toReal := a.toNNReal.2

@[simp] theorem toNNReal_toReal_eq (z : ℝ≥0∞) : z.toReal.toNNReal = z.toNNReal := by
ext; simp only [Real.coe_toNNReal', ge_iff_le, toReal_nonneg, max_eq_left]; rfl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need the rfl here? Missing lemmas?

Copy link
Copy Markdown
Collaborator Author

@kkytola kkytola Aug 4, 2024

Choose a reason for hiding this comment

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

The goal after this simp only [...], before rfl, was essentially the following lemma, which is true by rfl but indeed seemed to be missing. However, creating it and making it a @[simp] lemma causes a loop in a simp later, so maybe there is a reason... On the other hand, the RHS below should definitely in my opinion be the simp normal form of this expression!

theorem coe_toNNReal_eq_toReal (z : ℝ≥0∞) : (z.toNNReal : ℝ) = z.toReal := rfl

I added it now without @[simp] tag, and providing this to simp now avoids the last rfl.

@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 6, 2024
@kkytola kkytola removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 6, 2024
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

Assuming the norm_cast suggestion works and you implement the other suggestions:

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 6, 2024

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

kkytola and others added 3 commits August 6, 2024 23:22
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
…ommunity/mathlib4 into kkytola/misc_ENNReal_lemmas
@kkytola
Copy link
Copy Markdown
Collaborator Author

kkytola commented Aug 6, 2024

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Aug 6, 2024
`ENNReal.*`: `.toNNReal_toReal_eq`, `.sub_add_eq_add_sub`, `.zpow_neg`, `.zpow_sub`, `.tendsto_pow_atTop_nhds_top` + instance `MeasurableSMul₂ ℝ≥0 ℝ≥0∞`



Co-authored-by: kkytola <“kalle.kytola@aalto.fi”>
Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 6, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Miscellaneous small ENNReal lemmas. [Merged by Bors] - feat: Miscellaneous small ENNReal lemmas. Aug 6, 2024
@mathlib-bors mathlib-bors bot closed this Aug 6, 2024
@mathlib-bors mathlib-bors bot deleted the kkytola/misc_ENNReal_lemmas branch August 6, 2024 21:36
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
`ENNReal.*`: `.toNNReal_toReal_eq`, `.sub_add_eq_add_sub`, `.zpow_neg`, `.zpow_sub`, `.tendsto_pow_atTop_nhds_top` + instance `MeasurableSMul₂ ℝ≥0 ℝ≥0∞`



Co-authored-by: kkytola <“kalle.kytola@aalto.fi”>
Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
`ENNReal.*`: `.toNNReal_toReal_eq`, `.sub_add_eq_add_sub`, `.zpow_neg`, `.zpow_sub`, `.tendsto_pow_atTop_nhds_top` + instance `MeasurableSMul₂ ℝ≥0 ℝ≥0∞`



Co-authored-by: kkytola <“kalle.kytola@aalto.fi”>
Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
`ENNReal.*`: `.toNNReal_toReal_eq`, `.sub_add_eq_add_sub`, `.zpow_neg`, `.zpow_sub`, `.tendsto_pow_atTop_nhds_top` + instance `MeasurableSMul₂ ℝ≥0 ℝ≥0∞`



Co-authored-by: kkytola <“kalle.kytola@aalto.fi”>
Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants