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(order/complete_lattice): missing API lemmas about the prod instance #18029

Closed
wants to merge 1 commit into from

Conversation

eric-wieser
Copy link
Member

This adds lemmas about how fst, snd, and swap interact with Sup and Inf.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR CI This issue or PR is about continuous integration t-order Order hierarchy labels Dec 31, 2022
@eric-wieser eric-wieser removed the CI This issue or PR is about continuous integration label Dec 31, 2022
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.

LGTM, Thanks! Is there a mathlib4 PR?

src/order/complete_lattice.lean Outdated Show resolved Hide resolved
src/order/complete_lattice.lean Outdated Show resolved Hide resolved
@eric-wieser
Copy link
Member Author

eric-wieser commented Jan 1, 2023

No, I haven't made a mathlib4 PR because I don't know how to use mathport to generate the Lean4 version, and I don't really want to port manually.

Should I just put the lemmas in order/hom/complete_lattice instead with a TODO to move them after the port?

@alreadydone
Copy link
Collaborator

@eric-wieser Have you figured out how to use mathport oneshot (I saw you asked on Zulip)? CI is now reporting a timeout in an unrelated file, so some speedups are in order.

@eric-wieser eric-wieser force-pushed the eric-wieser/prod.complete_lattice branch from 33890f4 to af2eecf Compare January 3, 2023 23:00
@eric-wieser
Copy link
Member Author

I did a rebase in the hope it would make the seemingly unrelated timeout go away.

I haven't had a chance to try mathport yet.

@alreadydone
Copy link
Collaborator

alreadydone commented Jan 5, 2023

Should I just put the lemmas in order/hom/complete_lattice instead with a TODO to move them after the port?

I think you can do that, but we'd better keep track of where they should be moved, and there are two blocks of lemmas ... In any case, I think #18023 is good as is and could be merged without waiting for this; what do you think?

@mans0954
Copy link
Collaborator

mans0954 commented Jan 6, 2023

I had a go at doing a manual port as an exercise in familiarising myself with the new syntax.

The only problem is that simp_rw can no longer prove swap_infᵢ and swap_supᵢ.

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

I would make has_Sup and has_Inf sections to clear up the statements, but else this looks good. I cannot see anything obvious missing.

@eric-wieser
Copy link
Member Author

I'd argue it's perhaps better to keep each sup lemma next to its inf lemma, as that makes it easier to spot that they are in sync. I think we alternate between your approach and my one in different places in mathlib.

@YaelDillies
Copy link
Collaborator

Sure it doesn't matter that much.

maintainer merge

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@ocfnash ocfnash added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Jan 9, 2023
@ocfnash
Copy link
Collaborator

ocfnash commented Jan 9, 2023

@eric-wieser Is there now a corresponding Mathlib4 PR or does this comment still apply?

@eric-wieser
Copy link
Member Author

There is a mathlib 4 PR, but my intent is to discard it and replace it with the output of mathport one this one is merged.

@ocfnash
Copy link
Collaborator

ocfnash commented Jan 9, 2023

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 Jan 9, 2023
bors bot pushed a commit that referenced this pull request Jan 9, 2023
…nce (#18029)

This adds lemmas about how `fst`, `snd`, and `swap` interact with `Sup` and `Inf`.
@bors
Copy link

bors bot commented Jan 9, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jan 9, 2023
…nce (#18029)

This adds lemmas about how `fst`, `snd`, and `swap` interact with `Sup` and `Inf`.
@Vierkantor
Copy link
Collaborator

In case the build fails:

bors d+

@bors
Copy link

bors bot commented Jan 9, 2023

✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added the delegated The PR author may merge after reviewing final suggestions. label Jan 9, 2023
@bors
Copy link

bors bot commented Jan 9, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(order/complete_lattice): missing API lemmas about the prod instance [Merged by Bors] - feat(order/complete_lattice): missing API lemmas about the prod instance Jan 9, 2023
@bors bors bot closed this Jan 9, 2023
@bors bors bot deleted the eric-wieser/prod.complete_lattice branch January 9, 2023 13:14

lemma snd_Inf [has_Inf α] [has_Inf β] (s : set (α × β)) : (Inf s).snd = Inf (prod.snd '' s) := rfl

lemma swap_Inf [has_Inf α] [has_Inf β] (s : set (α × β)) : (Inf s).swap = Inf (prod.swap '' s) :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I'm only noticing now, but maybe this statement is better?

lemma swap_Inf [has_Inf α] [has_Inf β] (s : set (α × β)) : (Inf s).swap = Inf (prod.swap ⁻¹' s) :=

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 really need this lemma anyway, I was just listing every trivial function it could interact with. Feel free to make a PR to spell it that way instead.

bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Jan 25, 2023
…tice (#1369)

This adds lemmas about how `fst`, `snd`, and `swap` interact with `supₛ` and `infₛ`.

Manual port of a [mathlib PR](leanprover-community/mathlib#18029) by @eric-wieser 

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-order Order hierarchy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants