Skip to content

[Merged by Bors] - feat(Data/ENNReal/Inv): add ENNReal.div_mul_div_cancel - #37954

Closed
jdhart81 wants to merge 5 commits into
leanprover-community:masterfrom
jdhart81:feat/ennreal-div-mul-div-cancel
Closed

jdhart81 wants to merge 5 commits into
leanprover-community:masterfrom
jdhart81:feat/ennreal-div-mul-div-cancel

Conversation

@jdhart81

Copy link
Copy Markdown
Contributor

Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal. Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).


Open in Gitpod

Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal.
Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).
@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Apr 12, 2026
@github-actions

Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions

github-actions Bot commented Apr 12, 2026 •

Copy link
Copy Markdown

PR summary e87775419e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

++ div_mul_div_cancel

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit e877754).

  • +2 new declarations
  • −0 removed declarations
+ENNReal.div_mul_div_cancel
+EReal.div_mul_div_cancel

No changes to strong technical debt.
No changes to weak technical debt.

Current commit e87775419e
Reference commit 7d32461ad2

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-data Data (lists, quotients, numbers, etc) label Apr 12, 2026

@felixpernegger felixpernegger left a comment

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.

Good to have; I'm surprised this is still missing (but in fact actually is, according to loogle).

While you are at it, can you also add the corresponding lemma in EReal?

Comment thread Mathlib/Data/ENNReal/Inv.lean Resolved
@felixpernegger

Copy link
Copy Markdown
Contributor

awaiting-author

@github-actions github-actions Bot added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 27, 2026
@jdhart81

Copy link
Copy Markdown
Contributor Author

Thanks @felixpernegger — yes, I’ll add the corresponding EReal.div_mul_div_cancel lemma and reword the ENNReal docstring so it doesn’t describe b as a shared denominator. I’ll push both updates together.

@jdhart81

Copy link
Copy Markdown
Contributor Author

Implemented both review requests in dd84ea8:

  • Reworded the ENNReal docstring to describe cancellation of the finite nonzero middle term.
  • Added the corresponding EReal.div_mul_div_cancel lemma.

Both changed modules compile locally with the pinned mathlib toolchain.

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 27, 2026
@jdhart81

Copy link
Copy Markdown
Contributor Author

CI note: the fresh fork workflow is failing before it reaches the changed files. Both red jobs stop in the cache restore step with uncaught exception: leantar not found in Lean sysroot under Lean v4.29.0-rc1. The style/lint checks pass, and I locally rebuilt Mathlib.Data.ENNReal.Inv and Mathlib.Data.EReal.Inv successfully at dd84ea8283. I left the source unchanged; fork contributors cannot rerun the upstream workflow without repository admin permission.

Comment thread Mathlib/Data/ENNReal/Inv.lean Resolved
@felixpernegger

Copy link
Copy Markdown
Contributor

@jdhart81 try to merge Master on github, this probably solves the issue

@jdhart81

Copy link
Copy Markdown
Contributor Author

Done — I merged current master and removed both docstrings. The refreshed CI suite is green.

@jdhart81

jdhart81 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@felixpernegger Thanks again for the review and approval. The PR is still green and mergeable on my side. Is there anything further needed from me to move it into the maintainer delegation/merge queue? I’m happy to address any remaining issue.

@felixpernegger

Copy link
Copy Markdown
Contributor

@felixpernegger Thanks again for the review and approval. The PR is still green and mergeable on my side. Is there anything further needed from me to move it into the maintainer delegation/merge queue? I’m happy to address any remaining issue.

I dont have perms to do that sadly :)
Just be patient though, unfortunately the review queue is quite long and getting longer by the day.

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 31, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 12, 2026

@joneugster joneugster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR!

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by joneugster.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 13, 2026

@jcommelin jcommelin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 14, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 14, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal. Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).

Co-authored-by: Jdhart82 <[email protected]>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@mathlib-bors mathlib-bors Bot removed the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal. Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).

Co-authored-by: Jdhart82 <[email protected]>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@mathlib-bors mathlib-bors Bot removed the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal. Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).

Co-authored-by: Jdhart82 <[email protected]>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@mathlib-bors mathlib-bors Bot removed the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Proves a / b * (b / c) = a / c for b ≠ 0, b ≠ ∞ in ENNReal. Proof via mul_div_assoc and existing div_mul_cancel.

AI Disclosure: This PR was developed with assistance from an LLM (Claude, Anthropic) for proof exploration and text drafting. The proof was compiled and verified locally by the contributor, who understands the mathematical content. This lemma is extracted from a larger formalization of information-theoretic bounds (Zenodo DOI: 10.5281/zenodo.19317983).

Co-authored-by: Jdhart82 <[email protected]>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 14, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Data/ENNReal/Inv): add ENNReal.div_mul_div_cancel [Merged by Bors] - feat(Data/ENNReal/Inv): add ENNReal.div_mul_div_cancel Sep 14, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 14, 2026
rosborn added a commit to rosborn/mathlib4 that referenced this pull request Sep 15, 2026
* origin/master: (958 commits)
  chore(Combinatorics/SimpleGraph/Trails): golf and cleanup (leanprover-community#41447)
  refactor(Probability/Kernel): remove redundant case split in Invariant.comp (leanprover-community#43805)
  chore: bump toolchain to v4.34.0 (leanprover-community#43798)
  feat(Data/List/SignVariations): add List.signVariations (leanprover-community#43783)
  feat(LinearAlgebra/Span/Basic): add Submodule.prodEquiv (leanprover-community#43664)
  feat(cache): put with native Azure and S3 backends (leanprover-community#43378)
  feat(Combinatorics/SimpleGraph/Walk): more `transfer` API (leanprover-community#41717)
  feat(SimpleGraph): girth-diameter inequality (leanprover-community#25834)
  feat: make `simps?` and `to_dual?`/`to_additive?` more concise (leanprover-community#43775)
  feat(Basic/IsEmpty/Defs): add Fin.isEmpty_iff (leanprover-community#43763)
  feat(Data/ENNReal/Inv): add ENNReal.div_mul_div_cancel (leanprover-community#37954)
  chore(Tactic/Simproc/ExistsAndEq): fix two typos (leanprover-community#43797)
  feat(LinearAlgebra/Matrix/GeneralLinearGroup/Defs): add the proof of the range of toGL to be the ker of the determinant and the induced equivalence (leanprover-community#41786)
  chore(Data/Num/Lemmas): golf `transfer` tactic (leanprover-community#41167)
  refactor(Data/Nat/Choose/Central): move and rename `four_pow_le_two_mul_add_one_mul_central_binom` (leanprover-community#42606)
  feat(Combinatorics/Graph): edge cut of `Graph` (leanprover-community#37865)
  feat(Algebra/QuadraticAlgebra): classify quadratic algebras by their discriminant (leanprover-community#42708)
  fix: use the PR number in the deprecation reminder message (leanprover-community#43786)
  feat(Data/Fintype/Defs): add DecidableLE (∀ a, β a) (leanprover-community#43425)
  chore: redefine `Finsupp.indicator` using `Finsupp.onFinset` (leanprover-community#33434)
  ...

# Conflicts:
#	Mathlib/Tactic/Linter/DirectoryDependency.lean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants