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(combinatorics/additive/small_roth): Small Roth numbers #10645

Closed
wants to merge 35 commits into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Dec 6, 2021

This implements the BASIC2 algorithm from that paper.

Co-authored-by: Mario Carneiro
Co-authored-by: Bhavik Mehta bhavikmehta8@gmail.com


An example search is available on branch roth_demo. We will add tactics to perform and cache the search automatically later.

Open in Gitpod

@YaelDillies YaelDillies added the WIP Work in progress label Dec 6, 2021
@github-actions github-actions bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Dec 6, 2021
@github-actions github-actions bot added merge-conflict Please `git merge origin/master` then a bot will remove this label. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Dec 13, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 14, 2021
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Apr 21, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Apr 26, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Apr 26, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Apr 27, 2022
@sgouezel sgouezel added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels May 2, 2022
@YaelDillies YaelDillies requested a review from a team as a code owner June 10, 2023 22:35
@github-actions github-actions bot added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Jun 10, 2023
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-combinatorics Combinatorics and removed awaiting-author A reviewer has asked the author a question or requested changes modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. labels Jun 11, 2023
Copy link
Collaborator

@sgouezel sgouezel left a comment

Choose a reason for hiding this comment

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

Could you make the file more self-contained by expanding greatly the docstrings, to explain what is being computed and what are the properties that are satisfied by everything? In its current state, it is very hard to review.


namespace roth

/-- `roth.presalem_spencer a l` returns whether there doesn't exist `b, c ∈ l` such that
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/-- `roth.presalem_spencer a l` returns whether there doesn't exist `b, c ∈ l` such that
/-- `roth.presalem_spencer a l` returns true iff there doesn't exist `b, c ∈ l` such that

namespace roth

/-- `roth.presalem_spencer a l` returns whether there doesn't exist `b, c ∈ l` such that
`a + c = 2 * b`. `l` is a Salem-Spencer iff `presalem_spencer a l'` holds for all `a ∈ l` with `l'`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`a + c = 2 * b`. `l` is a Salem-Spencer iff `presalem_spencer a l'` holds for all `a ∈ l` with `l'`
`a + c = 2 * b`. The list `l` is a Salem-Spencer iff `presalem_spencer a l'` holds for all `a ∈ l` with `l'`

something is missing before the iff.

(H.2.1 hb hc e).not_gt $ hl.rel hb) }
end

/-- The Roth number algorithm invariant. -/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you expand the docstring, and give a better name?

@sgouezel sgouezel added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jun 11, 2023
@YaelDillies
Copy link
Collaborator Author

Bhavik and I decided that we need to know more about the complexity of Lean 4's operations to decide whether this algorithm is worth pursuing, the tradeoff being that this algorithm does a lot of search (it's a barely optimised DFS), while Lean 4 might let us do a lot of reasoning for little cost.

Graph Theory and Combinatorics automation moved this from In progress to Done Jun 11, 2023
@YaelDillies YaelDillies added maybe-later and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jun 11, 2023
@YaelDillies YaelDillies moved this from Done to To do in Graph Theory and Combinatorics Jun 11, 2023
@YaelDillies YaelDillies deleted the small_roth branch June 16, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants