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] - fix(order/complete_lattice): fix diamond in sup vs max and min vs inf #11309

Closed

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Jan 8, 2022

complete_linear_order has separate max and sup fields. There is no need to have both, so this removes one of them by telling the structure compiler to merge the two fields. The same is true of inf and min.

As well as diamonds being possible in the abstract case, a handful of concrete example of this diamond existed.
linear_order instances with default-populated fields were usually to blame.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-CI The author would like to see what CI has to say before doing more work. awaiting-review The author would like community review of the PR labels Jan 10, 2022
@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 Jan 11, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jan 11, 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 Jan 11, 2022
@leanprover-community-bot-assistant
Copy link
Collaborator

This PR/issue depends on:

@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 Jan 11, 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 Jan 11, 2022
Comment on lines 87 to 88
{ max_def := rfl,
min_def := rfl,
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 no idea why rfl works here but the reflexivity auto_param does not. Either way, I'm inclined not to care. I can leave a TODO comment if someone else cares.

Copy link
Member

Choose a reason for hiding this comment

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

These lines create a new diamond: now max on ennreal is not defeq sup, so we'll have two sups. Please derive linear_order and use it here. Or just use .. (infer_instance : linear_order ennreal).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, I must not have been paying attention. derive is the right choice here.

(or.inl ∘ coe_le_coe.2))),
(or.inl ∘ coe_le_coe.2))) }

noncomputable instance : linear_order enat :=
Copy link
Member

Choose a reason for hiding this comment

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

Note that we have lattice.to_linear_order.

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 don't think a full lattice is available yet?

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant 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 Jan 12, 2022
bors bot pushed a commit that referenced this pull request Jan 12, 2022
…#11309)

`complete_linear_order` has separate `max` and `sup` fields. There is no need to have both, so this removes one of them by telling the structure compiler to merge the two fields. The same is true of `inf` and `min`.

As well as diamonds being possible in the abstract case, a handful of concrete example of this diamond existed.
`linear_order` instances with default-populated fields were usually to blame.
@bors
Copy link

bors bot commented Jan 12, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jan 12, 2022
…#11309)

`complete_linear_order` has separate `max` and `sup` fields. There is no need to have both, so this removes one of them by telling the structure compiler to merge the two fields. The same is true of `inf` and `min`.

As well as diamonds being possible in the abstract case, a handful of concrete example of this diamond existed.
`linear_order` instances with default-populated fields were usually to blame.
@bors
Copy link

bors bot commented Jan 12, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(order/complete_lattice): fix diamond in sup vs max and min vs inf [Merged by Bors] - fix(order/complete_lattice): fix diamond in sup vs max and min vs inf Jan 12, 2022
@bors bors bot closed this Jan 12, 2022
@bors bors bot deleted the eric-wieser/fix-complete_linear_order-diamond branch January 12, 2022 20:16
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

4 participants