⊤ 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
- subsemigroup.has_top
- add_subsemigroup.has_top
- submonoid.has_top
- add_submonoid.has_top
- associates.has_top
- subgroup.has_top
- add_subgroup.has_top
- subsemiring.has_top
- subring.has_top
- submodule.has_top
- enat.has_top
- order_hom.has_top
- sup_hom.has_top
- inf_hom.has_top
- Inf_hom.has_top
- filter.has_top
- topological_space.closeds.has_top
- topological_space.clopens.has_top
- topological_space.compacts.has_top
- topological_space.nonempty_compacts.has_top
- topological_space.positive_compacts.has_top
- topological_space.compact_opens.has_top
- group_topology.has_top
- add_group_topology.has_top
- uniform_space.has_top
- open_subgroup.has_top
- open_add_subgroup.has_top
- subfield.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
- subsemigroup.has_bot
- add_subsemigroup.has_bot
- submonoid.has_bot
- add_submonoid.has_bot
- associates.has_bot
- subgroup.has_bot
- add_subgroup.has_bot
- subsemiring.has_bot
- subring.has_bot
- sub_mul_action.has_bot
- submodule.has_bot
- enat.has_bot
- order_hom.has_bot
- linear_pmap.has_bot
- pequiv.has_bot
- sup_hom.has_bot
- inf_hom.has_bot
- Sup_hom.has_bot
- topological_space.closeds.has_bot
- topological_space.clopens.has_bot
- topological_space.compacts.has_bot
- topological_space.compact_opens.has_bot
- group_topology.has_bot
- add_group_topology.has_bot
- uniform_space.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
- sum.lex.order_top
- ordinal.α.order_top
- top_hom.order_top
- sup_hom.order_top
- inf_hom.order_top
- inf_top_hom.order_top
- Inf_hom.order_top
- topological_space.nonempty_compacts.order_top
- topological_space.positive_compacts.order_top
- open_subgroup.order_top
- open_add_subgroup.order_top
Alias of ne_top_of_lt
.
Alias of is_max_iff_eq_top
.
Alias of is_top_iff_eq_top
.
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.set_semiring.order_bot
- set.Iic.order_bot
- set.Ici.order_bot
- associates.order_bot
- submodule.order_bot
- part.order_bot
- enat.order_bot
- order_hom.order_bot
- cardinal.order_bot
- linear_pmap.order_bot
- finsupp.order_bot
- sum.lex.order_bot
- pequiv.order_bot
- bot_hom.order_bot
- sup_hom.order_bot
- inf_hom.order_bot
- sup_bot_hom.order_bot
- Sup_hom.order_bot
- fractional_ideal.order_bot
- topological_space.compacts.order_bot
- topological_space.compact_opens.order_bot
- intermediate_field.lifts.order_bot
- nonneg.order_bot
- nnreal.order_bot
Alias of ne_bot_of_gt
.
Alias of is_min_iff_eq_bot
.
Alias of is_bot_iff_eq_bot
.
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
- sum.lex.bounded_order
- sup_hom.bounded_order
- inf_hom.bounded_order
- topological_space.closeds.bounded_order
- topological_space.compacts.bounded_order
- topological_space.compact_opens.bounded_order
- group_topology.bounded_order
- add_group_topology.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
In this section we prove some properties about monotone and antitone operations on Prop
#
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 := _}
Pullback a bounded_order
.
Equations
- bounded_order.lift f map_le map_top map_bot = {top := order_top.top (order_top.lift f map_le map_top), le_top := _, bot := order_bot.bot (order_bot.lift f map_le map_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.bounded_order = {top := order_top.top with_bot.order_top, le_top := _, bot := order_bot.bot with_bot.order_bot, bot_le := _}
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
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.bounded_order = {top := order_top.top with_top.order_top, le_top := _, bot := order_bot.bot with_top.order_bot, bot_le := _}
Equations
- with_top.preorder = {le := has_le.le with_top.has_le, 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.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.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
Subtype, order dual, product lattices #
A subtype remains a bounded order if the property holds at ⊥
and ⊤
.
Equations
- subtype.bounded_order hbot htop = {top := order_top.top (subtype.order_top htop), le_top := _, bot := order_bot.bot (subtype.order_bot hbot), bot_le := _}
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.