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

[Merged by Bors] - feat(set_theory/{pgame, surreal}): add left_distrib_equiv and right_distrib_equiv for pgames #7440

Closed
wants to merge 27 commits into from

Conversation

apurvnakade
Copy link
Collaborator

and several other auxiliary lemmas.

Zulip thread


Open in Gitpod

@apurvnakade apurvnakade added the awaiting-review The author would like community review of the PR label May 2, 2021
@semorrison semorrison 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 5, 2021
@apurvnakade apurvnakade 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 May 5, 2021
@semorrison semorrison 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 6, 2021
@apurvnakade apurvnakade added awaiting-review The author would like community review of the PR WIP Work in progress and removed awaiting-author A reviewer has asked the author a question or requested changes awaiting-review The author would like community review of the PR labels May 6, 2021
@apurvnakade apurvnakade added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels May 6, 2021
Comment on lines -48 to +50
@[refl] theorem le_refl : ∀ x : game, x ≤ x :=
theorem le_refl : ∀ x : game, x ≤ x :=
by { rintro ⟨x⟩, apply pgame.le_refl }
@[trans] theorem le_trans : ∀ x y z : game, x ≤ y → y ≤ z → x ≤ z :=
theorem le_trans : ∀ x y z : game, x ≤ y → y ≤ z → x ≤ z :=
Copy link
Member

Choose a reason for hiding this comment

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

Does the linter reject these now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The issue is not with the linter. There are type check errors in the calc mode proofs and refl proofs. Lean tries to use game.le_trans where it should be using pgame.le_trans.
Similarly, for refl.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's an error here:

calc w + y ≤ move_left x ix + y : add_le_add_right hix

and one here:

le_refl := by { rintros ⟨_⟩, refl },

Copy link
Member

Choose a reason for hiding this comment

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

This worries me quite a bit - I don't see why lean at any point thinks these two are interchangeable

theorem game.le_trans (x y z : game) : x ≤ y → y ≤ z → x ≤ z
theorem pgame.le_trans {x y z : pgame} : x ≤ y → y ≤ z → x ≤ z

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for finding this! This thread is unresolved though :(
Is there any workaround for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if there is some way to assign "priorities" to trans and refl...

Copy link
Member

Choose a reason for hiding this comment

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

Priorities wouldn't help, theproblem is that the refl tactic says "find me the refl lemma for has_le.le", not "find me the refl lemma for @has_le.le pgame".

Your choice to remove them was sensible here - but I'd recommend perhaps going further and either in this PR or a follow-up, removing all the refl and trans attributes about le and lt, and adding them back locally using local attribute [trans] pgame.le_trans etc (along with a link to that thread!).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried this, but it breaks all the calc proofs (and there are lots of them) in surreal.lean

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Several calc proofs are about numeric so can't be moved to pgame.lean

@semorrison
Copy link
Collaborator

@apurvnakade, can you summarise the new results by providing a distrib surreal instance? I think it's good if we keep the instances in sync with the theorems.

@semorrison
Copy link
Collaborator

Either way, this is looking good to me and hopefully we can merge shortly.

@apurvnakade
Copy link
Collaborator Author

@apurvnakade, can you summarise the new results by providing a distrib surreal instance? I think it's good if we keep the instances in sync with the theorems.

There is still a missing numeric_mul lemma. I working on it's proof but the proof is turning out to be quite big.
My plan is to PR mul_assoc for pgames next so that we're done will all the theorems for pgames and then move on to numeric_mul.

@apurvnakade
Copy link
Collaborator Author

Right now, it is not possible to define mul for surreal numbers.

@semorrison
Copy link
Collaborator

bors merge

@github-actions github-actions bot 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 May 11, 2021
bors bot pushed a commit that referenced this pull request May 11, 2021
@bors
Copy link

bors bot commented May 11, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(set_theory/{pgame, surreal}): add left_distrib_equiv and right_distrib_equiv for pgames [Merged by Bors] - feat(set_theory/{pgame, surreal}): add left_distrib_equiv and right_distrib_equiv for pgames May 11, 2021
@bors bors bot closed this May 11, 2021
@bors bors bot deleted the surreal_mul_distrib branch May 11, 2021 09:13
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

3 participants