Zulip Chat Archive

Stream: general

Topic: lattice_bot


Yaël Dillies (Oct 14 2021 at 19:23):

We don't have lattice_bot. It turns out it is the correct generality for the following definition:

/-- A finite partition of `a : α` is a pairwise disjoint finite set of elements whose supremum is
`a`. -/
@[ext] structure finpartition {α : Type*} [bounded_lattice α] (a : α) :=
(parts : finset α)
(disjoint : (parts : set α).pairwise_disjoint)
(sup_parts : parts.sup id = a)
(not_bot_mem :   parts)

Yaël Dillies (Oct 14 2021 at 19:25):

I could replace the final field by (not_bot_of_mem {b : α} : b ∈ parts → ¬ is_bot b), but that's pretty artificial and, most importantly, I still can't prove lemmas in terms of . So do people mind if I define lattice_bot?

Yaël Dillies (Oct 14 2021 at 19:25):

My use case is finset α, which is indeed not a bounded_lattice.

Kevin Buzzard (Oct 14 2021 at 19:45):

finset α is a semilattice_sup_bot, right?

Yaël Dillies (Oct 14 2021 at 19:50):

Yep, but pairwise_disjoint needs a semilattice_inf_bot. I really need both sup and inf here

Scott Morrison (Oct 14 2021 at 20:01):

I wonder if we should consider breaking out has_top as a Prop valued mixin. When we have partial_order (rather than preorder) the bottom element is unique and we could nonconstructively provide it via .

Scott Morrison (Oct 14 2021 at 20:02):

(Thereby hopefully getting rid of semilattice_(sup|inf)_(top|bot), and avoiding the need here for lattice_(top|bot).

Yaël Dillies (Oct 14 2021 at 20:22):

Yeah, I was already thinking that when adding distrib_lattice_bot a while back.

Yaël Dillies (Oct 14 2021 at 20:23):

The question is how far we want to go that way. For example, what about decoupling has_inf and has_sup as well?

Scott Morrison (Oct 14 2021 at 22:49):

I think the problem will be that we'll no longer be able to write bounded_lattice, but instead some huge chain of [order_bot] [order_top] [semilattice_inf] [semilattice_sup]. Perhaps we should wait to see if [[lattice]] notation as discussed previously (i.e. automatically add all transitively required typeclass arguments) might be available in Lean4.

Scott Morrison (Oct 14 2021 at 22:51):

Then we could redefine bounded_lattice as a completely empty typeclass (no fields, no ancestors!), but that requires all these constituent parts.

Yaël Dillies (Oct 14 2021 at 23:00):

That's not the only obstacle, right? I thought there was this exponential explosion of underlying terms when computing the prod of the prod of the prod...

Yaël Dillies (Oct 14 2021 at 23:01):

Did we just decide that this doesn't come up enough in practice to bother?

Scott Morrison (Oct 14 2021 at 23:51):

I think this is the main previous discussion of this blow-up.

Scott Morrison (Oct 14 2021 at 23:54):

But I don't understand this well enough to guess how this would affect the bounded_lattice change discussed above.


Last updated: Dec 20 2023 at 11:08 UTC