Skip to content

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

Closed
vihdzp wants to merge 16 commits into
masterfrom
vi.sedrakyan
Closed

vihdzp wants to merge 16 commits into
masterfrom
vi.sedrakyan

Conversation

@vihdzp

@vihdzp vihdzp commented Nov 20, 2024 •

Copy link
Copy Markdown
Collaborator

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 [email protected]
Co-authored-by: Heather Macbeth [email protected]


Open in Gitpod

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

github-actions Bot commented Nov 20, 2024 •

Copy link
Copy Markdown

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

Comment thread Mathlib/Data/Real/Sqrt.lean Resolved
@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

vihdzp commented Nov 21, 2024

Copy link
Copy Markdown
Collaborator Author

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

@YaelDillies YaelDillies 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.

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.

@vihdzp vihdzp Nov 22, 2024 •

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.

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 Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 22, 2024
@vihdzp vihdzp removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. 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

mathlib-bors Bot commented Nov 23, 2024

Copy link
Copy Markdown
Contributor

✌️ 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 <[email protected]>
Co-authored-by: Heather Macbeth <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Nov 23, 2024

Copy link
Copy Markdown
Contributor

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