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

archive(imo1988_q6): a formalization of Q6 on IMO1988 #1455

Merged
merged 14 commits into from
Oct 16, 2019
Merged

Conversation

jcommelin
Copy link
Member

Another attempt at formalizing Q6 of IMO1988

@jcommelin jcommelin requested a review from a team as a code owner September 18, 2019 11:23
@robertylewis
Copy link
Member

You have a bunch of nonterminal simp calls here. My suspicion is that the archive will be relatively hard to maintain as mathlib shifts, since a lot of the proofs are specialized. Nonterminal simps are one cause of unmaintainability. Are they avoidable here?

@jcommelin
Copy link
Member Author

Mostly, ring seems to be not powerful enough. I guess it has issues with negations, because it is designed for commutative semirings. This leads to ugly suffices : bla, by simpa statements that shouldn't be there (I think).
I've removed the non-terminal simps that acted on the goal. I think non-terminal simps on rather elementary hypothesis are probably ok.

@digama0
Copy link
Member

digama0 commented Sep 18, 2019

@jcommelin ring is supposed to work on rings too, including full support for negation, provided it is the real negation (i.e. not nat.sub). Could you be more specific?

@semorrison
Copy link
Collaborator

@jcommelin, shall we make push_cast first, and use that here, or just proceed as is?

archive/imo1988_q6.lean Outdated Show resolved Hide resolved
@jcommelin
Copy link
Member Author

@semorrison I don't care too much. This can wait for a push_cast tactic. But we can also merge this, and maybe come back to it later.

We need a long list of assumptions for this lemma.
The upside is that it takes care of several annoying edge cases.
First of all, the user should provide x and y
that satisfy the predicate H(x,y).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I had a hard time following this, and I already know roughly how to solve the IMO problem. I think it would help to give as an example the particular H(x,y) which is used for the IMO problem. Also, you never mention claim, which is pretty important (at least if you are trying to understand the lemma just from the docstring, and not from looking at its type).

Copy link
Member Author

Choose a reason for hiding this comment

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

I have thoroughly rewritten the docstring. I hope it is better now.

archive/imo1988_q6.lean Outdated Show resolved Hide resolved
let p : ℕ × ℕ := ⟨x,y⟩,
have hp : p ∈ upper_branch := ⟨h₀, hxy⟩,
-- We also consider the exceptional set of solutions (a,b) that satisfy
-- a = 0 or a = b or B a = b or B a = b + a.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment doesn't seem to match the definition--it's missing the "base case". It would be better to say why we doing this, that is, move the "strategy" comment a bit earlier and probably also expand it to contain an outline of the entire rest of the proof.

It seems that the strategy is really: Do descent starting from the given (x, y). The exceptional locus is where we can't keep descending, but our assumptions were chosen to handle those cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tried to improve these comments a bit.

archive/imo1988_q6.lean Outdated Show resolved Hide resolved
@semorrison semorrison added the awaiting-author A reviewer has asked the author a question or requested changes label Sep 20, 2019
@jcommelin jcommelin added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Sep 27, 2019
@robertylewis
Copy link
Member

This looks mergeable to me. @rwbarton @jcommelin is this waiting on anything?

@jcommelin
Copy link
Member Author

I think I've processed all the comments. So now it's up to the other mathlib overlords (-;

@robertylewis robertylewis added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Oct 16, 2019
@mergify mergify bot merged commit cbf81df into master Oct 16, 2019
@mergify mergify bot deleted the imo-1988-q6 branch October 16, 2019 18:45
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…munity#1455)

* archive(imo1988_q6): a formalization of Q6 on IMO1988

* WIP

* Clean up, document, and use omega

* Remove some non-terminal simps

* Non-terminal simp followed by ring is fine

* Include copyright statement

* Add comment justifying example

* Process review comments

* Oops, forgot a line

* Improve comments in the proof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants