Skip to content

[Merged by Bors] - chore(Analysis/Convex): drop unused arguments#24392

Closed
urkud wants to merge 3 commits intomasterfrom
YK-convex-unused
Closed

[Merged by Bors] - chore(Analysis/Convex): drop unused arguments#24392
urkud wants to merge 3 commits intomasterfrom
YK-convex-unused

Conversation

@urkud
Copy link
Copy Markdown
Member

@urkud urkud commented Apr 26, 2025

Also weaken typeclass assumptions here and there.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 26, 2025

PR summary e1d422bbb5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ segment_inter_subset_endpoint_of_linearIndependent_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.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh 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-analysis Analysis (normed *, calculus) label Apr 26, 2025
@urkud urkud requested a review from YaelDillies April 26, 2025 17:46
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Hmm... I'm not convinced. What's your use case?

Given that the whole convexity library needs a rewrite (the current definition is mathematically incorrect over non-fields), I think that fine-tuning assumptions is currently a waste of time.

By the way, before you ask, that convexity refactor will probably happen soon because it's tangential to Toric, and in particular might help figure out how to arrange files.

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Apr 26, 2025

My only argument is to reduce the number of typeclass searches. If the refactor will bring most or all of the assumptions back, I think it's OK.

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Apr 26, 2025

!bench

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Apr 26, 2025

BTW, I think that you should discuss the design choices you're making in the pending refactor on Zulip before you commit lots of time to actually doing it.

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit e1d422b.
There were no significant changes against commit a91fc5c.

@github-actions
Copy link
Copy Markdown

File Instructions %
build -10.142⬝10⁹ (+0.00%)
lint -1.392⬝10⁹ (-0.01%)
Mathlib.Analysis.Convex.Segment +1.633⬝10⁹ (+3.02%)
2 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.Topology.Sheaves.Stalks -1.86⬝10⁹ (-0.95%)
Mathlib.Analysis.Convex.StrictConvexSpace -1.647⬝10⁹ (-8.46%)

CI run

@YaelDillies
Copy link
Copy Markdown
Contributor

Given how modest the speedup is, let's just close maybe?

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Apr 27, 2025

On the one hand, I see no downside in merging this PR.
On the other hand, I don't think it's important either way.

If you want to close it, then please first open a PR adding text to these TODOs explaining why they shouldn't be closed for now.

@sgouezel
Copy link
Copy Markdown
Contributor

Since Yury has already done the work on the files, I don't see a good reason not to merge it.
maintainer merge

@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Apr 28, 2025
@YaelDillies
Copy link
Copy Markdown
Contributor

The good reason not to merge it is that IMO it sets a precedent for mildly disruptive low added value PRs, as we've recently seen for the last few file splits, especially since Yury is a maintainer.

@sgouezel
Copy link
Copy Markdown
Contributor

To me, the added value of the PR is strictly positive. Not positive enough that I would have wanted to do it myself, but since it has been done and leads to a strict improvement of the library, better merge it than not!

@jcommelin
Copy link
Copy Markdown
Member

Thanks 🎉

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Apr 28, 2025
mathlib-bors bot pushed a commit that referenced this pull request Apr 28, 2025
Also weaken typeclass assumptions here and there.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 28, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Analysis/Convex): drop unused arguments [Merged by Bors] - chore(Analysis/Convex): drop unused arguments Apr 28, 2025
@mathlib-bors mathlib-bors bot closed this Apr 28, 2025
@mathlib-bors mathlib-bors bot deleted the YK-convex-unused branch April 28, 2025 15:18
tannerduve pushed a commit that referenced this pull request May 13, 2025
Also weaken typeclass assumptions here and there.
mathlib-bors bot pushed a commit that referenced this pull request Oct 14, 2025
… a single ring of scalars (#29342)

Currently the definition of Absolutely Convex in Mathlib is a little unexpected:
```
def AbsConvex (s : Set E) : Prop := Balanced 𝕜 s ∧ Convex ℝ s
```
At the time this definition was formulated, Mathlib's definition of `Convex` required the scalars to be an `OrderedSemiring` whereas the definition of `Balanced` required the scalars to be a `SeminormedRing`. Mathlib didn't  have a concept of a semi-normed ordered ring, so a set was defined as `AbsConvex` if it is balanced over a `SeminormedRing` `𝕜` and convex over `ℝ`.

Recently the requirements for the definition of `Convex` have been relaxed (#24392, #20595) so it is now possible to use a single scalar ring in common with the literature.

Previous discussion:

- #17029 (comment)
- #26345 (comment)
Jlh18 pushed a commit to Jlh18/mathlib4 that referenced this pull request Oct 24, 2025
… a single ring of scalars (leanprover-community#29342)

Currently the definition of Absolutely Convex in Mathlib is a little unexpected:
```
def AbsConvex (s : Set E) : Prop := Balanced 𝕜 s ∧ Convex ℝ s
```
At the time this definition was formulated, Mathlib's definition of `Convex` required the scalars to be an `OrderedSemiring` whereas the definition of `Balanced` required the scalars to be a `SeminormedRing`. Mathlib didn't  have a concept of a semi-normed ordered ring, so a set was defined as `AbsConvex` if it is balanced over a `SeminormedRing` `𝕜` and convex over `ℝ`.

Recently the requirements for the definition of `Convex` have been relaxed (leanprover-community#24392, leanprover-community#20595) so it is now possible to use a single scalar ring in common with the literature.

Previous discussion:

- leanprover-community#17029 (comment)
- leanprover-community#26345 (comment)
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Nov 7, 2025
… a single ring of scalars (leanprover-community#29342)

Currently the definition of Absolutely Convex in Mathlib is a little unexpected:
```
def AbsConvex (s : Set E) : Prop := Balanced 𝕜 s ∧ Convex ℝ s
```
At the time this definition was formulated, Mathlib's definition of `Convex` required the scalars to be an `OrderedSemiring` whereas the definition of `Balanced` required the scalars to be a `SeminormedRing`. Mathlib didn't  have a concept of a semi-normed ordered ring, so a set was defined as `AbsConvex` if it is balanced over a `SeminormedRing` `𝕜` and convex over `ℝ`.

Recently the requirements for the definition of `Convex` have been relaxed (leanprover-community#24392, leanprover-community#20595) so it is now possible to use a single scalar ring in common with the literature.

Previous discussion:

- leanprover-community#17029 (comment)
- leanprover-community#26345 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants