⊤ and ⊥, bounded lattices and variants #
This file defines top and bottom elements (greatest and least elements) of a type, the bounded
variants of different kinds of lattices, sets up the typeclass hierarchy between them and provides
instances for Prop
and fun
.
Main declarations #
has_<top/bot> α
: Typeclasses to declare the⊤
/⊥
notation.order_<top/bot> α
: Order with a top/bottom element.bounded_order α
: Order with a top and bottom element.with_<top/bot> α
: Equipsoption α
with the order onα
plusnone
as the top/bottom element.is_compl x y
: In a bounded lattice, predicate for "x
is a complement ofy
". Note that in a non distributive lattice, an element can have several complements.is_complemented α
: Typeclass stating that any element of a lattice has a complement.
Common lattices #
- Distributive lattices with a bottom element. Notated by
[distrib_lattice α] [order_bot α]
It captures the properties ofdisjoint
that are common togeneralized_boolean_algebra
anddistrib_lattice
whenorder_bot
. - Bounded and distributive lattice. Notated by
[distrib_lattice α] [bounded_order α]
. Typical examples includeProp
andset α
.
Implementation notes #
We didn't prove things about [distrib_lattice α] [order_top α]
because the dual notion of
disjoint
isn't really used anywhere.
Top, bottom element #
- top : α
Typeclass for the ⊤
(\top
) notation
Instances
- order_top.to_has_top
- boolean_algebra.core.to_has_top
- linear_ordered_add_comm_monoid_with_top.to_has_top
- complete_lattice.to_has_top
- pi.has_top
- with_top.has_top
- order_dual.has_top
- prod.has_top
- submonoid.has_top
- add_submonoid.has_top
- quiver.wide_subquiver.has_top
- subgroup.has_top
- add_subgroup.has_top
- subsemiring.has_top
- subring.has_top
- associates.has_top
- submodule.has_top
- enat.has_top
- order_hom.has_top
- bot : α
Typeclass for the ⊥
(\bot
) notation
Instances
- order_bot.to_has_bot
- generalized_boolean_algebra.to_has_bot
- boolean_algebra.core.to_has_bot
- canonically_ordered_add_monoid.to_has_bot
- canonically_ordered_monoid.to_has_bot
- complete_lattice.to_has_bot
- conditionally_complete_linear_order_bot.to_has_bot
- pi.has_bot
- with_bot.has_bot
- order_dual.has_bot
- prod.has_bot
- submonoid.has_bot
- add_submonoid.has_bot
- quiver.wide_subquiver.has_bot
- subgroup.has_bot
- add_subgroup.has_bot
- subsemiring.has_bot
- subring.has_bot
- sub_mul_action.has_bot
- associates.has_bot
- submodule.has_bot
- enat.has_bot
- order_hom.has_bot
An order is an order_top
if it has a greatest element.
We state this using a data mixin, holding the value of ⊤
and the greatest element constraint.
Instances
- bounded_order.to_order_top
- linear_ordered_add_comm_monoid_with_top.to_order_top
- pi.order_top
- with_bot.order_top
- with_top.order_top
- order_dual.order_top
- prod.order_top
- set.order_top
- finset.order_top
- set.Iic.order_top
- set.Ici.order_top
- associates.order_top
- submodule.order_top
- enat.order_top
- order_hom.order_top
Alias of ne_top_of_lt
.
An order is an order_bot
if it has a least element.
We state this using a data mixin, holding the value of ⊥
and the least element constraint.
Instances
- bounded_order.to_order_bot
- generalized_boolean_algebra.to_order_bot
- canonically_ordered_add_monoid.to_order_bot
- canonically_ordered_monoid.to_order_bot
- conditionally_complete_linear_order_bot.to_order_bot
- pi.order_bot
- with_bot.order_bot
- with_top.order_bot
- order_dual.order_bot
- prod.order_bot
- with_zero.order_bot
- nat.order_bot
- nat.subtype.order_bot
- multiset.order_bot
- finset.order_bot
- pnat.order_bot
- set.Iic.order_bot
- set.Ici.order_bot
- associates.order_bot
- submodule.order_bot
- finsupp.order_bot
- part.order_bot
- enat.order_bot
- order_hom.order_bot
- nonneg.order_bot
- nnreal.order_bot
Alias of ne_bot_of_gt
.
Bounded order #
A bounded order describes an order (≤)
with a top and bottom element,
denoted ⊤
and ⊥
respectively.
Instances
- boolean_algebra.core.to_bounded_order
- complete_lattice.to_bounded_order
- Prop.bounded_order
- pi.bounded_order
- with_bot.bounded_order
- with_top.bounded_order
- order_dual.bounded_order
- prod.bounded_order
- bool.bounded_order
- fin.bounded_order
- set.Iic.bounded_order
- set.Ici.bounded_order
- associates.bounded_order
- enat.bounded_order
Propositions form a distributive lattice.
Equations
- Prop.distrib_lattice = {sup := or, le := λ (a b : Prop), a → b, lt := lattice.lt._default (λ (a b : Prop), a → b), le_refl := Prop.distrib_lattice._proof_1, le_trans := Prop.distrib_lattice._proof_2, lt_iff_le_not_le := Prop.distrib_lattice._proof_3, le_antisymm := Prop.distrib_lattice._proof_4, le_sup_left := or.inl, le_sup_right := or.inr, sup_le := Prop.distrib_lattice._proof_5, inf := and, inf_le_left := and.left, inf_le_right := and.right, le_inf := Prop.distrib_lattice._proof_6, le_sup_inf := Prop.distrib_lattice._proof_7}
Propositions form a bounded order.
Equations
- Prop.bounded_order = {top := true, le_top := Prop.bounded_order._proof_1, bot := false, bot_le := false.elim}
Equations
- Prop.linear_order = lattice.to_linear_order Prop Prop.linear_order._proof_1
Function lattices #
Equations
- pi.has_bot = {bot := λ (i : ι), ⊥}
Equations
- pi.has_top = {top := λ (i : ι), ⊤}
Equations
- pi.bounded_order = {top := order_top.top pi.order_top, le_top := _, bot := order_bot.bot pi.order_bot, bot_le := _}
Equations
- with_bot.has_coe_t = {coe := some α}
Equations
- with_bot.has_bot = {bot := none α}
Equations
- with_bot.inhabited = {default := ⊥}
Recursor for with_bot
using the preferred forms ⊥
and ↑a
.
Equations
- with_bot.rec_bot_coe h₁ h₂ = option.rec h₁ h₂
Equations
- with_bot.preorder = {le := has_le.le with_bot.has_le, lt := has_lt.lt with_bot.has_lt, le_refl := _, le_trans := _, lt_iff_le_not_le := _}
Equations
- with_bot.partial_order = {le := preorder.le with_bot.preorder, lt := preorder.lt with_bot.preorder, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _}
Equations
- with_bot.semilattice_sup = {sup := option.lift_or_get has_sup.sup, le := partial_order.le with_bot.partial_order, lt := partial_order.lt with_bot.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _}
Equations
- with_bot.semilattice_inf = {inf := λ (o₁ o₂ : with_bot α), option.bind o₁ (λ (a : α), option.map (λ (b : α), a ⊓ b) o₂), le := partial_order.le with_bot.partial_order, lt := partial_order.lt with_bot.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, inf_le_left := _, inf_le_right := _, le_inf := _}
Equations
- with_bot.lattice = {sup := semilattice_sup.sup with_bot.semilattice_sup, le := semilattice_sup.le with_bot.semilattice_sup, lt := semilattice_sup.lt with_bot.semilattice_sup, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := semilattice_inf.inf with_bot.semilattice_inf, inf_le_left := _, inf_le_right := _, le_inf := _}
Equations
- with_bot.linear_order = lattice.to_linear_order (with_bot α) with_bot.linear_order._proof_1
Equations
- with_bot.bounded_order = {top := order_top.top with_bot.order_top, le_top := _, bot := order_bot.bot with_bot.order_bot, bot_le := _}
Equations
- with_top.has_coe_t = {coe := some α}
Equations
- with_top.has_top = {top := none α}
Equations
- with_top.inhabited = {default := ⊤}
Recursor for with_top
using the preferred forms ⊤
and ↑a
.
Equations
- with_top.rec_top_coe h₁ h₂ = option.rec h₁ h₂
Deconstruct a x : with_top α
to the underlying value in α
, given a proof that x ≠ ⊤
.
Equations
Equations
- with_top.preorder = {le := λ (o₁ o₂ : option α), ∀ (a : α), a ∈ o₂ → (∃ (b : α) (H : b ∈ o₁), b ≤ a), lt := has_lt.lt with_top.has_lt, le_refl := _, le_trans := _, lt_iff_le_not_le := _}
Equations
- with_top.partial_order = {le := preorder.le with_top.preorder, lt := preorder.lt with_top.preorder, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _}
Equations
- with_top.decidable_le = λ (x y : with_top α), with_bot.decidable_le y x
Equations
- with_top.decidable_lt = λ (x y : with_top α), with_bot.decidable_lt y x
Equations
- with_top.semilattice_inf = {inf := option.lift_or_get has_inf.inf, le := partial_order.le with_top.partial_order, lt := partial_order.lt with_top.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, inf_le_left := _, inf_le_right := _, le_inf := _}
Equations
- with_top.semilattice_sup = {sup := λ (o₁ o₂ : with_top α), option.bind o₁ (λ (a : α), option.map (λ (b : α), a ⊔ b) o₂), le := partial_order.le with_top.partial_order, lt := partial_order.lt with_top.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _}
Equations
- with_top.lattice = {sup := semilattice_sup.sup with_top.semilattice_sup, le := semilattice_sup.le with_top.semilattice_sup, lt := semilattice_sup.lt with_top.semilattice_sup, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := semilattice_inf.inf with_top.semilattice_inf, inf_le_left := _, inf_le_right := _, le_inf := _}
Equations
- with_top.linear_order = lattice.to_linear_order (with_top α) with_top.linear_order._proof_1
Equations
- with_top.bounded_order = {top := order_top.top with_top.order_top, le_top := _, bot := order_bot.bot with_top.order_bot, bot_le := _}
Subtype, order dual, product lattices #
Equations
- order_dual.has_top α = {top := ⊥}
Equations
- order_dual.has_bot α = {bot := ⊤}
Equations
- order_dual.bounded_order α = {top := order_top.top (order_dual.order_top α), le_top := _, bot := order_bot.bot (order_dual.order_bot α), bot_le := _}
Equations
- prod.bounded_order α β = {top := order_top.top (prod.order_top α β), le_top := _, bot := order_bot.bot (prod.order_bot α β), bot_le := _}
Disjointness and complements #
- exists_is_compl : ∀ (a : α), ∃ (b : α), is_compl a b
A complemented bounded lattice is one where every element has a (not necessarily unique) complement.