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): closure operators #5524

Closed
wants to merge 9 commits into from
Closed

Conversation

b-mehta
Copy link
Collaborator

@b-mehta b-mehta commented Dec 29, 2020

Adds closure operators on a partial order, as in wikipedia. I made them bundled for no particular reason, I don't mind unbundling.

@b-mehta b-mehta added the awaiting-review The author would like community review of the PR label Dec 29, 2020
src/order/closure.lean Outdated Show resolved Hide resolved
@kbuzzard
Copy link
Member

Looks great! Is there a Galois insertion one can prove here?

@b-mehta
Copy link
Collaborator Author

b-mehta commented Dec 30, 2020

Added the Galois insertion!

src/order/closure.lean Outdated Show resolved Hide resolved
@urkud
Copy link
Member

urkud commented Jan 1, 2021

There are two kinds of closure operators in mathlib now:

  • in topology, we use closure : set α → set α;
  • in submonoids, submodules etc, we use submonoid.closure : set M → submonoid M.

How hard is it to have a general theory that works in both settings? Something like closure_operator {α β : Type*} (f : β → α) + 2 notations/abbreviations for closure_operator α α (λ x, x) and closure_operator α β coe?

@b-mehta
Copy link
Collaborator Author

b-mehta commented Jan 1, 2021

There are two kinds of closure operators in mathlib now:

  • in topology, we use closure : set α → set α;
  • in submonoids, submodules etc, we use submonoid.closure : set M → submonoid M.

How hard is it to have a general theory that works in both settings? Something like closure_operator {α β : Type*} (f : β → α) + 2 notations/abbreviations for closure_operator α α (λ x, x) and closure_operator α β coe?

I'm not sure how your suggestion would work - to state idempotency and extensivity the domain and range of the operator need to be the same. The obvious fix here is to include the reverse as well, but then the notion is exactly a Galois insertion, which I think is the general theory you're looking for. Should I make it more clear in this file that closure operators are just special cases of Galois insertions?

@bryangingechen
Copy link
Collaborator

Could you mention the connection to Galois insertions in the module docstring?

Copy link
Collaborator

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

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

LGTM, but I'll let @urkud take a look.

src/order/closure.lean Outdated Show resolved Hide resolved
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
@eric-wieser
Copy link
Member

Are there any functions already in mathlib than can be bundled in this way?

@b-mehta
Copy link
Collaborator Author

b-mehta commented Jan 7, 2021

Perhaps closure : set α → set α for topologies as Yury mentioned could be done - I'd expect there could be more but I'm not certain. That said, my guess is that in practice when the closure operator is fixed and has an explicit definition, it's more helpful to express as a Galois insertion with the subtype of closed elements rather than as an endomorphism like this. I think the main use case for this file is for general closure operators (eg Moore collections, universal closure operators). In any case, I think explicit examples can happen in another PR :)

@bryangingechen
Copy link
Collaborator

Let's merge this now, but I do want to see some (more) examples in future PRs.

Thanks!
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 Jan 14, 2021
bors bot pushed a commit that referenced this pull request Jan 14, 2021
Adds closure operators on a partial order, as in [wikipedia](https://en.wikipedia.org/wiki/Closure_operator#Closure_operators_on_partially_ordered_sets). I made them bundled for no particular reason, I don't mind unbundling.
@bors
Copy link

bors bot commented Jan 15, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(order): closure operators [Merged by Bors] - feat(order): closure operators Jan 15, 2021
@bors bors bot closed this Jan 15, 2021
@bors bors bot deleted the closure branch January 15, 2021 01:33
b-mehta added a commit that referenced this pull request Jan 16, 2021
Adds closure operators on a partial order, as in [wikipedia](https://en.wikipedia.org/wiki/Closure_operator#Closure_operators_on_partially_ordered_sets). I made them bundled for no particular reason, I don't mind unbundling.
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

6 participants