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

chore(order/{rel_iso, directed}): monotone functions and rel_homs are directed #7163

Closed
wants to merge 6 commits into from

Conversation

eric-wieser
Copy link
Member


Open in Gitpod

@eric-wieser eric-wieser added the awaiting-review The author would like community review of the PR label Apr 11, 2021
@eric-wieser eric-wieser changed the title @eric-wieser chore(order/{rel_iso, directed}): monotone functions and rel_homs are directed chore(order/{rel_iso, directed}): monotone functions and rel_homs are directed Apr 11, 2021
instance semilattice_sup.to_directed_order (α) [semilattice_sup α] : directed_order α :=
⟨λ i j, ⟨i ⊔ j, le_sup_left, le_sup_right⟩⟩

/-- A monotone function on a directed order (aka a sup-semilattice) is directed. -/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this description is a little misleading in that it says directed orders are also known as sup-semilattices: perhaps better phrasing would be "on a directed order (in particular a sup-semilattice) is".

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 guess I was trying to hand-wave over the asymmetry with the _inf version below. I'm not really convinced directed_order is useful, since it's really just semilattice_sup with a non-computable sup

Copy link
Collaborator

Choose a reason for hiding this comment

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

Directed orders are very useful! And they're very different from just semilattice_sup: in particular in a directed order there's no guarantee that the given element is a supremum of the two given elements (ie sup_le might not hold), see eg here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I'd argue they can't be that useful because mathlib has no instances of them that aren't linear orders so far!

Copy link
Member Author

Choose a reason for hiding this comment

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

But thanks for clearing that up, I was missing the requirement for uniqueness.

Comment on lines 51 to 59
/-- A `preorder` is a `directed_order` if for any two elements `i`, `j`
there is an element `k` such that `i ≤ k` and `j ≤ k`. -/
class directed_order (α : Type u) extends preorder α :=
(directed : ∀ i j : α, ∃ k, i ≤ k ∧ j ≤ k)

/-- A `preorder` is a `anti_directed_order` if for any two elements `i`, `j`
there is an element `k` such that `k ≤ i` and `k ≤ j`. -/
class anti_directed_order (α : Type u) extends preorder α :=
(directed : ∀ i j : α, ∃ k, k ≤ i ∧ k ≤ j)
Copy link
Member Author

Choose a reason for hiding this comment

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

@b-mehta, does this terminology seem ok to you? "upward-directed" and "downward-directed" are another option for the two names, or perhaps even sup_directed and inf_directed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think your alternatives are slightly nicer but there's nothing wrong with the original - perhaps ask on Zulip? As long as the names aren't misleading I'm probably pretty happy with whatever you pick.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Apr 19, 2021
…d-monotone

# Conflicts:
#	src/order/directed.lean
@eric-wieser eric-wieser force-pushed the eric-wieser/directed-monotone branch from 8c9c842 to 5dd08f0 Compare April 30, 2021 17:06
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Apr 30, 2021
Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Could you fix the build errors? (I assume they arise from the import hierarchy being changed.)

@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels May 7, 2021
@eric-wieser
Copy link
Member Author

I'm not sure I can - I think they're caused by the introduction of the new typeclasses.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jun 7, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Aug 31, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 28, 2021
@YaelDillies
Copy link
Collaborator

YaelDillies commented Feb 19, 2022

For obscure reasons, inserting directed_order severely breaks random stuff downstream. I've had better luck with my relation class is_directed, so this PR is now irrelevant. See #11238

As future work, we might want to add directed_order/codirected_order as shorthands for is_directed α (≤)/is_directed α (swap (≤)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict Please `git merge origin/master` then a bot will remove this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants