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] - refactor(set_theory/game/pgame): tweak relabelling definition #14941

Closed
wants to merge 20 commits into from

Conversation

vihdzp
Copy link
Collaborator

@vihdzp vihdzp commented Jun 25, 2022

We simplify the definition for a relabelling by using R instead of R.symm. This overall leads to more symmetric proofs.

We also create a constructor with the equivalences swapped. This allows us to golf various theorems.

Further, we add basic API on destructuring relabellings, which makes it so that we don't have to case on them all the time.


Open in Gitpod

@vihdzp vihdzp added the awaiting-review The author would like community review of the PR label Jun 25, 2022
@vihdzp vihdzp requested a review from alreadydone June 25, 2022 04:54
Copy link
Collaborator

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

It appears to me that mk' is the only thing in this PR that improve things, and the benefit of the other changes are unclear.

src/set_theory/game/pgame.lean Outdated Show resolved Hide resolved
src/set_theory/game/pgame.lean Outdated Show resolved Hide resolved
{ apply equiv.equiv_punit },
{ apply equiv.equiv_pempty },
{ simp }
refine ⟨_, _, λ i, _, is_empty.elim _⟩,
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 a bit of a regression here, as for whatever reason Lean is now unable to see through some quite dense def-eqs. But given how particularly messy this proof is, I wouldn't worry much.

@vihdzp
Copy link
Collaborator Author

vihdzp commented Jun 26, 2022

I've changed this PR to use @alreadydone's suggestion for relabelling. This ends up simplifying proofs even further than before.

Also, I've added some basic API on destructuring relabellings, since it allows for even more golfing.

Comment on lines 725 to 763
@[refl] def relabelling.refl : Π (x : pgame), x ≡r x
| ⟨xl, xr, xL, xR⟩ := ⟨equiv.refl _, equiv.refl _, λ i, relabelling.refl _, λ j, relabelling.refl _⟩
@[refl] def refl : Π (x : pgame), x ≡r x
| x := ⟨equiv.refl _, equiv.refl _, λ i, refl _, λ j, refl _⟩
using_well_founded { dec_tac := pgame_wf_tac }
Copy link
Member

Choose a reason for hiding this comment

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

This type of cleanup is independent of the change to the definition of relabelling, right? If so, would you mind splitting out the remove-⟨xl, xr, xL, xR⟩ and namespace relabelling part of this change, just to make it easier to evaluation what the advantage of removing the .symm is?

Feel free to tag me in the split PR / zulip / discord to get a quick review.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll put that elsewhere.

@mathlib-dependent-issues-bot mathlib-dependent-issues-bot added blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. 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 Jun 29, 2022
@mathlib-dependent-issues-bot
Copy link
Collaborator

@digama0
Copy link
Member

digama0 commented Jul 18, 2022

bors r+

@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 Jul 18, 2022
bors bot pushed a commit that referenced this pull request Jul 19, 2022
We simplify the definition for a `relabelling` by using `R` instead of `R.symm`. This overall leads to more symmetric proofs.

We also create a constructor with the equivalences swapped. This allows us to golf various theorems.

Further, we add basic API on destructuring relabellings, which makes it so that we don't have to case on them all the time.
@bors
Copy link

bors bot commented Jul 19, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(set_theory/game/pgame): tweak relabelling definition [Merged by Bors] - refactor(set_theory/game/pgame): tweak relabelling definition Jul 19, 2022
@bors bors bot closed this Jul 19, 2022
@bors bors bot deleted the relabelling_mk' branch July 19, 2022 03:29
joelriou pushed a commit that referenced this pull request Jul 23, 2022
We simplify the definition for a `relabelling` by using `R` instead of `R.symm`. This overall leads to more symmetric proofs.

We also create a constructor with the equivalences swapped. This allows us to golf various theorems.

Further, we add basic API on destructuring relabellings, which makes it so that we don't have to case on them all the time.
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