Skip to content

[Merged by Bors] - feat: Sedrakyan's lemma#19311

Closed
vihdzp wants to merge 16 commits intomasterfrom
vi.sedrakyan
Closed

[Merged by Bors] - feat: Sedrakyan's lemma#19311
vihdzp wants to merge 16 commits intomasterfrom
vi.sedrakyan

Conversation

@vihdzp
Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp commented Nov 20, 2024

This is a specialization of the Cauchy-Schwarz inequality which is often useful in math olympiad problems.

In order to prove it in general ordered semifields, we have to show slightly more general forms of the AM-GM and Cauchy-Schwarz inequalities, which indirectly work with square roots.

Co-authored-by: Alex Brodbelt 64128135+AlexBrodbelt@users.noreply.github.com
Co-authored-by: Heather Macbeth 25316162+hrmacbeth@users.noreply.github.com


Open in Gitpod

@vihdzp vihdzp added the t-algebra Algebra (groups, rings, fields, etc) label Nov 20, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 20, 2024

PR summary a0fa1f1309

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ sq_sum_div_le_sum_sq_div
+ sum_sq_le_sum_mul_sum_of_sq_eq_mul
+ two_mul_le_add_of_sq_eq_mul

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).

@eric-wieser
Copy link
Copy Markdown
Member

Orthogonal to my question above, I wonder if we want the "generalized form" from https://brilliant.org/wiki/titus-lemma/#generalized-form as well.

@vihdzp
Copy link
Copy Markdown
Collaborator Author

vihdzp commented Nov 21, 2024

I didn't even know there was a generalized form! I think we can add it later if it ever becomes useful for anything.

@vihdzp vihdzp changed the title feat(Data/Real/Sqrt): Sedrakyan's lemma feat: Sedrakyan's lemma Nov 22, 2024
@vihdzp vihdzp requested a review from eric-wieser November 22, 2024 01:36
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.

Thanks! Looks like a great improvement over the original version


This is a specialization of the Cauchy-Schwarz inequality with the sequences `f n / √(g n)` and
`√(g n)`, though here it is proven without relying on square roots. -/
theorem sq_sum_div_le_sum_sq_div [LinearOrderedSemifield R] [ExistsAddOfLE R] (s : Finset ι)
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.

Can you move this out of the LinearOrderedCommSemiring section?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This theorem is right after the end of that section. I didn't think it'd make sense to make a new section for just this one theorem.

Copy link
Copy Markdown
Collaborator Author

@vihdzp vihdzp Nov 22, 2024

Choose a reason for hiding this comment

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

Actually, I think it makes more sense to just have a "named inequalities" section in the file. (I also want to add Nesbitt in a subsequent PR, which can be proven as a consequence of Sedrakyan).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've reordered the file slightly, does this change make sense?

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 22, 2024
vihdzp and others added 5 commits November 22, 2024 07:58
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@vihdzp vihdzp removed the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 22, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 22, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 22, 2024
Comment on lines +160 to +161
/-! ### Named inequalities -/

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.

I suspect this grouping isn't particularly helpful in the long term, because inevitably it ends up being desirable to extract a helper lemma that sits between these. I'll let @YaelDillies decide though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fair, this wasn't meant so much as a "inequalities with names go here" but rather as a "the more difficult and mathematically interesting results go here".

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.

I suspect it will change again once we add the inequalities you both mentioned, but until then this looks like a mostly okay sectioning.

bors merge

@eric-wieser
Copy link
Copy Markdown
Member

bors d=@YaelDillies

Thanks, this now looks great!

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Nov 23, 2024

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

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Nov 23, 2024
mathlib-bors bot pushed a commit that referenced this pull request Nov 23, 2024
This is a specialization of the Cauchy-Schwarz inequality which is often useful in math olympiad problems.

In order to prove it in general ordered semifields, we have to show slightly more general forms of the AM-GM and Cauchy-Schwarz inequalities, which indirectly work with square roots.

Co-authored-by: Alex Brodbelt <64128135+AlexBrodbelt@users.noreply.github.com>
Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Nov 23, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Sedrakyan's lemma [Merged by Bors] - feat: Sedrakyan's lemma Nov 23, 2024
@mathlib-bors mathlib-bors bot closed this Nov 23, 2024
@mathlib-bors mathlib-bors bot deleted the vi.sedrakyan branch November 23, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants