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/lattice): "algebraic" constructors for (semi-)lattices #6460

Closed
wants to merge 8 commits into from

Conversation

bryangingechen
Copy link
Collaborator

@bryangingechen bryangingechen commented Feb 27, 2021

I also added a module doc string for order/lattice.lean.


@bryangingechen bryangingechen added the awaiting-review The author would like community review of the PR label Feb 27, 2021
src/order/lattice.lean Outdated Show resolved Hide resolved
src/order/lattice.lean Outdated Show resolved Hide resolved
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
src/order/lattice.lean Outdated Show resolved Hide resolved
src/order/lattice.lean Outdated Show resolved Hide resolved
src/order/lattice.lean Outdated Show resolved Hide resolved
src/order/lattice.lean Outdated Show resolved Hide resolved
src/order/lattice.lean Outdated Show resolved Hide resolved
Comment on lines 277 to 296
{ inf := (⊓),
le := λ a b, a = a ⊓ b,
le_refl := λ a, (inf_idem a).symm,
le_trans := λ a b c hab hbc,
begin
dsimp only [(≤)] at *,
rw [hab, inf_assoc, ←hbc],
end,
le_antisymm := λ a b hab hba,
begin
dsimp only [(≤)] at *,
rw [hba, inf_comm, ←hab],
end,
inf_le_left := λ a b, show a ⊓ b = a ⊓ b ⊓ a, by rw [inf_comm, inf_assoc, inf_idem],
inf_le_right := λ a b, show a ⊓ b = a ⊓ b ⊓ b, by rw [inf_assoc, inf_idem],
le_inf := λ a b c hac hbc,
begin
dsimp only [(≤), preorder.le] at *,
rwa [←inf_assoc, ←hac],
end }
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if this is Kosher, but:

Suggested change
{ inf := (⊓),
le := λ a b, a = a ⊓ b,
le_refl := λ a, (inf_idem a).symm,
le_trans := λ a b c hab hbc,
begin
dsimp only [(≤)] at *,
rw [hab, inf_assoc, ←hbc],
end,
le_antisymm := λ a b hab hba,
begin
dsimp only [(≤)] at *,
rw [hba, inf_comm, ←hab],
end,
inf_le_left := λ a b, show a ⊓ b = a ⊓ b ⊓ a, by rw [inf_comm, inf_assoc, inf_idem],
inf_le_right := λ a b, show a ⊓ b = a ⊓ b ⊓ b, by rw [inf_assoc, inf_idem],
le_inf := λ a b c hac hbc,
begin
dsimp only [(≤), preorder.le] at *,
rwa [←inf_assoc, ←hac],
end }
begin
haveI : semilattice_sup (order_dual α) := semilattice_sup.mk' inf_comm inf_assoc inf_idem,
haveI i := order_dual.semilattice_inf (order_dual α),
exact i,
end

Copy link
Member

Choose a reason for hiding this comment

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

Strictly I think you ought to have a lemma like:

theorem preorder.dual_dual (α : Type*) [H : preorder α] :
  order_dual.preorder (order_dual α) = H :=
preorder.ext $ λ _ _, iff.rfl

but for semilattice_inf, and then use that on the last line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what you mean with the last suggestion. It might be easier if you push your changes to this branch?

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 made an attempt at incorporating the changes as far as I understood them. I'm not sure what to do with semilattice_inf.dual_dual and semilattice_sup.dual_dual though.

Copy link
Member

Choose a reason for hiding this comment

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

I think those lemmas are worth having whether you use them or not, but maybe @gebner or whoever it was that was worrying about defeq abuse can chime in about how to use them here.

@jcommelin
Copy link
Member

Apart from the dual_dual issue, this looks good to me. Lots of docs! Thanks!

Let's Get This Merged

@bryangingechen
Copy link
Collaborator Author

@jcommelin Thanks for taking a look! Do you know how the dual_dual lemmas might be used? I guess I'm not really seeing how @eric-wieser's construction of semilattce_inf.mk' is "defeq abuse". What would the alternative be?

@jcommelin
Copy link
Member

Hmm, sorry, I misunderstood what's going on. It's actually fine. Thanks for the PR!

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 Mar 4, 2021
bors bot pushed a commit that referenced this pull request Mar 4, 2021
)

I also added a module doc string for `order/lattice.lean`.
@bors
Copy link

bors bot commented Mar 4, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(order/lattice): "algebraic" constructors for (semi-)lattices [Merged by Bors] - feat(order/lattice): "algebraic" constructors for (semi-)lattices Mar 4, 2021
@bors bors bot closed this Mar 4, 2021
@bors bors bot deleted the construct_latt_alg branch March 4, 2021 21:17
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
)

I also added a module doc string for `order/lattice.lean`.
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