with_bot
, with_top
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Adding a bot
or a top
to an order.
Main declarations #
with_<top/bot> α
: Equipsoption α
with the order onα
plusnone
as the top/bottom element.
Attach ⊥
to a type.
Instances for with_bot
- with_bot.has_le
- with_bot.has_lt
- with_bot.has_to_format
- with_bot.has_repr
- with_bot.has_coe_t
- with_bot.has_bot
- with_bot.has_reflect
- with_bot.inhabited
- with_bot.nontrivial
- with_bot.can_lift
- with_bot.order_bot
- with_bot.order_top
- with_bot.bounded_order
- with_bot.preorder
- with_bot.partial_order
- with_bot.semilattice_sup
- with_bot.semilattice_inf
- with_bot.lattice
- with_bot.distrib_lattice
- with_bot.is_total_le
- with_bot.linear_order
- with_bot.densely_ordered
- with_bot.no_top_order
- with_bot.no_max_order
- with_bot.trichotomous.lt
- with_bot.is_well_order.lt
- with_bot.trichotomous.gt
- with_bot.is_well_order.gt
- with_bot.has_one
- with_bot.has_zero
- with_bot.has_add
- with_bot.add_semigroup
- with_bot.add_comm_semigroup
- with_bot.add_zero_class
- with_bot.add_monoid
- with_bot.add_comm_monoid
- with_bot.add_monoid_with_one
- with_bot.add_comm_monoid_with_one
- with_bot.zero_le_one_class
- with_bot.covariant_class_add_le
- with_bot.covariant_class_swap_add_le
- with_bot.contravariant_class_add_lt
- with_bot.contravariant_class_swap_add_lt
- with_bot.ordered_add_comm_monoid
- with_bot.linear_ordered_add_comm_monoid
- with_bot.has_Sup
- with_bot.has_Inf
- with_bot.conditionally_complete_lattice
- with_bot.with_top.complete_lattice
- with_bot.with_top.complete_linear_order
- with_bot.mul_zero_class
- with_bot.mul_zero_one_class
- with_bot.no_zero_divisors
- with_bot.semigroup_with_zero
- with_bot.monoid_with_zero
- with_bot.comm_monoid_with_zero
- with_bot.comm_semiring
- with_bot.pos_mul_mono
- with_bot.mul_pos_mono
- with_bot.pos_mul_strict_mono
- with_bot.mul_pos_strict_mono
- with_bot.pos_mul_reflect_lt
- with_bot.mul_pos_reflect_lt
- with_bot.pos_mul_mono_rev
- with_bot.mul_pos_mono_rev
- with_bot.ordered_comm_semiring
- with_bot.locally_finite_order
- with_bot.succ_order
- with_bot.pred_order
- with_bot.pred_order_of_no_min_order
Equations
- with_bot.has_repr = {repr := λ (o : with_bot α), with_bot.has_repr._match_1 o}
- with_bot.has_repr._match_1 (option.some a) = "↑" ++ repr a
- with_bot.has_repr._match_1 option.none = "⊥"
Equations
- with_bot.has_coe_t = {coe := option.some α}
Equations
- with_bot.has_bot = {bot := option.none α}
Equations
- with_bot.inhabited = {default := ⊥}
Specialization of option.get_or_else
to values in with_bot α
that respects API boundaries.
Equations
- with_bot.unbot' d x = with_bot.rec_bot_coe d id x
Lift a map f : α → β
to with_bot α → with_bot β
. Implemented using option.map
.
Equations
- with_bot.map f = option.map f
Deconstruct a x : with_bot α
to the underlying value in α
, given a proof that x ≠ ⊥
.
Equations
- with_bot.unbot (option.some x) h = x
- ⊥.unbot h = absurd with_bot.unbot._main._proof_1 h
Equations
- with_bot.order_top = {top := option.some ⊤, le_top := _}
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 := _}
A version of bot_lt_iff_ne_bot
for with_bot
that only requires has_lt α
, not
partial_order α
.
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 := _}
Alias of the reverse direction of with_bot.monotone_map_iff
.
Alias of the reverse direction of with_bot.strict_mono_map_iff
.
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 := option.map₂ has_inf.inf, 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.distrib_lattice = {sup := lattice.sup with_bot.lattice, le := lattice.le with_bot.lattice, lt := lattice.lt with_bot.lattice, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := lattice.inf with_bot.lattice, inf_le_left := _, inf_le_right := _, le_inf := _, le_sup_inf := _}
Equations
- with_bot.decidable_le (option.some x) (option.some y) = dite (x ≤ y) (λ (h : x ≤ y), decidable.is_true _) (λ (h : ¬x ≤ y), decidable.is_false _)
- with_bot.decidable_le (option.some x) option.none = decidable.is_false _
- with_bot.decidable_le option.none x = decidable.is_true _
Equations
- with_bot.decidable_lt (option.some x) (option.some y) = dite (x < y) (λ (h : x < y), decidable.is_true _) (λ (h : ¬x < y), decidable.is_false _)
- with_bot.decidable_lt (option.some val) option.none = decidable.is_false _
- with_bot.decidable_lt option.none (option.some x) = decidable.is_true _
- with_bot.decidable_lt option.none option.none = decidable.is_false with_bot.decidable_lt._main._proof_1
Equations
Attach ⊤
to a type.
Instances for with_top
- with_top.has_le
- with_top.has_lt
- with_top.has_to_format
- with_top.has_repr
- with_top.has_coe_t
- with_top.has_top
- with_top.has_reflect
- with_top.inhabited
- with_top.nontrivial
- with_top.can_lift
- with_top.order_top
- with_top.order_bot
- with_top.bounded_order
- with_top.preorder
- with_top.partial_order
- with_top.semilattice_inf
- with_top.semilattice_sup
- with_top.lattice
- with_top.distrib_lattice
- with_top.is_total_le
- with_top.linear_order
- with_top.trichotomous.lt
- with_top.is_well_order.lt
- with_top.trichotomous.gt
- with_top.is_well_order.gt
- with_top.densely_ordered
- with_top.no_bot_order
- with_top.no_min_order
- with_top.has_one
- with_top.has_zero
- with_top.zero_le_one_class
- with_top.has_add
- with_top.covariant_class_add_le
- with_top.covariant_class_swap_add_le
- with_top.contravariant_class_add_lt
- with_top.contravariant_class_swap_add_lt
- with_top.add_semigroup
- with_top.add_comm_semigroup
- with_top.add_zero_class
- with_top.add_monoid
- with_top.add_comm_monoid
- with_top.add_monoid_with_one
- with_top.add_comm_monoid_with_one
- with_top.ordered_add_comm_monoid
- with_top.linear_ordered_add_comm_monoid_with_top
- with_top.has_exists_add_of_le
- with_top.canonically_ordered_add_monoid
- with_top.canonically_linear_ordered_add_monoid
- with_top.char_zero
- with_top.has_Sup
- with_top.has_Inf
- with_top.complete_linear_order
- with_top.conditionally_complete_lattice
- with_top.with_bot.complete_lattice
- with_top.with_bot.complete_linear_order
- with_top.mul_zero_class
- with_top.no_zero_divisors
- with_top.mul_zero_one_class
- with_top.semigroup_with_zero
- with_top.monoid_with_zero
- with_top.comm_monoid_with_zero
- with_top.comm_semiring
- with_top.canonically_ordered_comm_semiring
- with_top.locally_finite_order
- with_top.succ_order
- with_top.pred_order
- with_top.succ_order_of_no_max_order
- with_top.has_sub
- with_top.has_ordered_sub
- associates.factor_set.has_mem
Equations
- with_top.has_repr = {repr := λ (o : with_top α), with_top.has_repr._match_1 o}
- with_top.has_repr._match_1 (option.some a) = "↑" ++ repr a
- with_top.has_repr._match_1 option.none = "⊤"
Equations
- with_top.has_coe_t = {coe := option.some α}
Equations
- with_top.has_top = {top := option.none α}
Equations
- with_top.inhabited = {default := ⊤}
with_top.to_dual
is the equivalence sending ⊤
to ⊥
and any a : α
to to_dual a : αᵒᵈ
.
See with_top.to_dual_bot_equiv
for the related order-iso.
Equations
with_top.of_dual
is the equivalence sending ⊤
to ⊥
and any a : αᵒᵈ
to of_dual a : α
.
See with_top.to_dual_bot_equiv
for the related order-iso.
Equations
with_bot.to_dual
is the equivalence sending ⊥
to ⊤
and any a : α
to to_dual a : αᵒᵈ
.
See with_bot.to_dual_top_equiv
for the related order-iso.
Equations
with_bot.of_dual
is the equivalence sending ⊥
to ⊤
and any a : αᵒᵈ
to of_dual a : α
.
See with_bot.to_dual_top_equiv
for the related order-iso.
Equations
Specialization of option.get_or_else
to values in with_top α
that respects API boundaries.
Equations
- with_top.untop' d x = with_top.rec_top_coe d id x
Lift a map f : α → β
to with_top α → with_top β
. Implemented using option.map
.
Equations
- with_top.map f = option.map f
Deconstruct a x : with_top α
to the underlying value in α
, given a proof that x ≠ ⊤
.
Equations
Equations
- with_top.order_bot = {bot := option.some ⊥, bot_le := _}
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 := _}
A version of lt_top_iff_ne_top
for with_top
that only requires has_lt α
, not
partial_order α
.
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 := _}
Alias of the reverse direction of with_top.monotone_map_iff
.
Alias of the reverse direction of with_top.strict_mono_map_iff
.
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 := option.map₂ has_sup.sup, 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.distrib_lattice = {sup := lattice.sup with_top.lattice, le := lattice.le with_top.lattice, lt := lattice.lt with_top.lattice, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := lattice.inf with_top.lattice, inf_le_left := _, inf_le_right := _, le_inf := _, le_sup_inf := _}
Equations
- with_top.decidable_le = λ (_x _x_1 : with_top α), decidable_of_decidable_of_iff (with_bot.decidable_le (⇑with_top.to_dual _x_1) (⇑with_top.to_dual _x)) with_top.to_dual_le_to_dual_iff
Equations
- with_top.decidable_lt = λ (_x _x_1 : with_top α), decidable_of_decidable_of_iff (with_bot.decidable_lt (⇑with_top.to_dual _x_1) (⇑with_top.to_dual _x)) with_top.to_dual_lt_to_dual_iff