Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Archive/Imo): formalize IMO 1982q3 #16190

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

feat(Archive/Imo): formalize IMO 1982q3 #16190

wants to merge 40 commits into from

Conversation

AlexBrodbelt
Copy link
Collaborator

@AlexBrodbelt AlexBrodbelt commented Aug 27, 2024

Formalize problem 3 of 1982 IMO.

Co-authored by: Violeta Hernández Palacios [email protected]


Open in Gitpod

@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 Aug 27, 2024
Copy link

github-actions bot commented Aug 27, 2024

PR summary 3e11988adf

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ geom_sum_lt
+ imo1982_q3a
+ imo1982_q3b
+ ineq
+ le_avg

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
AlexBrodbelt and others added 9 commits August 28, 2024 09:32
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
AlexBrodbelt and others added 5 commits September 9, 2024 18:19
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@joneugster joneugster added the IMO Math olympiad problems label Sep 12, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Sep 24, 2024
@hrmacbeth hrmacbeth self-assigned this Sep 24, 2024
@hrmacbeth
Copy link
Member

hrmacbeth commented Sep 24, 2024

@AlexBrodbelt, I have the impression that you have quite a few tricks yet to learn about writing analysis arguments in Lean. As an example, I have pushed an efficient proof of your first lemma.

The "Archive" is for high quality proofs that, while being mathematical "leaf theories", show off the automation and libraries developed in Mathlib. At the moment this proof is quite far from being this kind of showcase. If you want to work on getting this proof to that level, it will take a lot of back-and-forth, and this may proceed rather slowly, depending on reviewers' availability to point out inefficiencies.

If you just want to make this proof available in a public repository for the community to use, you might consider instead contributing it to https://github.com/dwrensha/compfiles. Are you aware of that project?

@vihdzp
Copy link
Collaborator

vihdzp commented Sep 24, 2024

I'm interested in helping clean this proof up! I just haven't found the time for it yet. Maybe sometime during the week?

One thing which I'd like to see beforehand (and I think I already mentioned this above) is Sedrakyan's lemma in a separate PR. There will almost definitely be more IMO problems that depend on this.

@vihdzp vihdzp self-assigned this Nov 22, 2024
@vihdzp
Copy link
Collaborator

vihdzp commented Nov 22, 2024

@AlexBrodbelt I did a complete rewrite of the proof on my own branch. It ends up being only about 100 lines long, and I think that it better showcases Mathlib's automation. If you think what I did is sensible, you can merge the changes in that branch with this branch. Note that my proof depends on PR #19311.

If you're not available to come back to this PR, I can take it over.

@vihdzp vihdzp removed the awaiting-author A reviewer has asked the author a question or requested changes label Dec 2, 2024
@vihdzp
Copy link
Collaborator

vihdzp commented Dec 2, 2024

Since there's been no activity from OP since September, I've decided to take over this PR. The new proof is an almost complete rewrite from the original one, and makes use of the version of Sedrakyan I had previously PR'd onto Mathlib.

@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 Dec 2, 2024
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
Archive/Imo/Imo1982Q3.lean Outdated Show resolved Hide resolved
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Dec 2, 2024
@vihdzp vihdzp removed the awaiting-author A reviewer has asked the author a question or requested changes label Dec 2, 2024
Copy link
Collaborator

@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! 🚀

maintainer merge

Copy link

github-actions bot commented Dec 7, 2024

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

namespace Imo1982Q3
include hn hx

/-- `x (n + 1)` is at most the average of `x 1`, `x 2`, ..., `x n`. -/
Copy link
Member

Choose a reason for hiding this comment

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

This docstring does not seem to correspond to the lemma it's documenting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The actual lemma is just this plus ∑ k ∈ range n, x k added to both sides.

Copy link
Member

@kbuzzard kbuzzard Dec 8, 2024

Choose a reason for hiding this comment

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

That's not true either because of various errors involving bounds (range n is 0<=i<n, right?).

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right, I've updated the docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMO Math olympiad problems maintainer-merge new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants