WithBot, WithTop #
Adding a bot or a top to an order.
Main declarations #
With<Top/Bot> α: EquipsOption αwith the order onαplusnoneas the top/bottom element.
Specialization of Option.getD to values in WithBot α that respects API boundaries.
Equations
- WithBot.unbotD d x = WithBot.recBotCoe d id x
Instances For
Lift a map f : α → β to WithBot α → WithBot β. Implemented using Option.map.
Equations
- WithBot.map f = Option.map f
Instances For
Alias of WithBot.eq_bot_iff_forall_ne.
Deconstruct a x : WithBot α to the underlying value in α, given a proof that x ≠ ⊥.
Equations
- WithBot.unbot (some x_2) x_3 = x_2
Instances For
Function that sends an element of WithBot α to α,
with an arbitrary default value for ⊥.
Equations
Instances For
A universe-polymorphic version of EquivFunctor.mapEquiv WithBot e.
Equations
- e.withBotCongr = { toFun := WithBot.map ⇑e, invFun := WithBot.map ⇑e.symm, left_inv := ⋯, right_inv := ⋯ }
Instances For
The order on WithBot α, defined by ⊥ ≤ ⊥, ⊥ ≤ ↑a and a ≤ b → ↑a ≤ ↑b.
Equivalently, x ≤ y can be defined as ∀ a : α, x = ↑a → ∃ b : α, y = ↑b ∧ a ≤ b,
see le_if_forall. The definition as an inductive predicate is preferred since it
cannot be accidentally unfolded too far.
- bot_le {α : Type u_1} [LE α] (x : WithBot α) : ⊥.LE x
- coe_le_coe {α : Type u_1} [LE α] {a b : α} : a ≤ b → (↑a).LE ↑b
Instances For
Equations
- WithBot.instLE = { le := WithBot.LE }
Equations
- WithBot.instOrderBot = { toBot := WithBot.bot, bot_le := ⋯ }
Equations
- WithBot.instBoundedOrder = { toTop := WithBot.instTop, le_top := ⋯, toOrderBot := WithBot.instOrderBot }
There is a general version le_bot_iff, but this lemma does not require a PartialOrder.
The order on WithBot α, defined by ⊥ < ↑a and a < b → ↑a < ↑b.
Equivalently, x ≤ y can be defined as ∀ b : α, y = ↑v → ∃ a : α, x = ↑a ∧ a ≤ b,
see le_if_forall. The definition as an inductive predicate is preferred since it
cannot be accidentally unfolded too far.
Equations
- One or more equations did not get rendered due to their size.
A version of bot_lt_iff_ne_bot for WithBot that only requires LT α, not
PartialOrder α.
Equations
- WithBot.instPreorder = { toLE := WithBot.instLE, toLT := WithBot.instLT, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯ }
Equations
- WithBot.instPartialOrder = { toPreorder := WithBot.instPreorder, le_antisymm := ⋯ }
Alias of the reverse direction of WithBot.monotone_map_iff.
Alias of the reverse direction of WithBot.strictMono_map_iff.
Alias of WithBot.eq_bot_iff_forall_lt.
Alias of WithBot.eq_bot_iff_forall_le.
Equations
- One or more equations did not get rendered due to their size.
Equations
- WithBot.semilatticeInf = { toPartialOrder := WithBot.instPartialOrder, inf := WithBot.map₂ fun (x1 x2 : α) => x1 ⊓ x2, inf_le_left := ⋯, inf_le_right := ⋯, le_inf := ⋯ }
Equations
- WithBot.lattice = { toSemilatticeSup := WithBot.semilatticeSup, inf := SemilatticeInf.inf, inf_le_left := ⋯, inf_le_right := ⋯, le_inf := ⋯ }
Equations
- WithBot.distribLattice = { toLattice := WithBot.lattice, le_sup_inf := ⋯ }
Equations
Equations
- WithBot.decidableLE none x✝ = isTrue ⋯
- WithBot.decidableLE (some a) none = isFalse ⋯
- WithBot.decidableLE (some a) (some b) = decidable_of_iff' (a ≤ b) ⋯
Equations
- x✝.decidableLT none = isFalse ⋯
- WithBot.decidableLT none (some a) = isTrue ⋯
- WithBot.decidableLT (some a) (some b) = decidable_of_iff' (a < b) ⋯
Equations
WithTop.toDual is the equivalence sending ⊤ to ⊥ and any a : α to toDual a : αᵒᵈ.
See WithTop.toDualBotEquiv for the related order-iso.
Equations
Instances For
WithTop.ofDual is the equivalence sending ⊤ to ⊥ and any a : αᵒᵈ to ofDual a : α.
See WithTop.toDualBotEquiv for the related order-iso.
Equations
Instances For
WithBot.toDual is the equivalence sending ⊥ to ⊤ and any a : α to toDual a : αᵒᵈ.
See WithBot.toDual_top_equiv for the related order-iso.
Equations
Instances For
WithBot.ofDual is the equivalence sending ⊥ to ⊤ and any a : αᵒᵈ to ofDual a : α.
See WithBot.ofDual_top_equiv for the related order-iso.
Equations
Instances For
Specialization of Option.getD to values in WithTop α that respects API boundaries.
Equations
- WithTop.untopD d x = WithTop.recTopCoe d id x
Instances For
Lift a map f : α → β to WithTop α → WithTop β. Implemented using Option.map.
Equations
- WithTop.map f = Option.map f
Instances For
Alias of WithTop.eq_top_iff_forall_ne.
Deconstruct a x : WithTop α to the underlying value in α, given a proof that x ≠ ⊤.
Equations
- WithTop.untop (some x_2) x_3 = x_2
Instances For
Function that sends an element of WithTop α to α,
with an arbitrary default value for ⊤.
Equations
Instances For
A universe-polymorphic version of EquivFunctor.mapEquiv WithTop e.
Equations
- e.withTopCongr = { toFun := WithTop.map ⇑e, invFun := WithTop.map ⇑e.symm, left_inv := ⋯, right_inv := ⋯ }
Instances For
The order on WithTop α, defined by ⊤ ≤ ⊤, ↑a ≤ ⊤ and a ≤ b → ↑a ≤ ↑b.
Equations
- WithTop.instLE = { le := fun (a b : WithTop α) => WithBot.LE b a }
Equations
- WithTop.orderTop = { toTop := WithTop.top, le_top := ⋯ }
Equations
- WithTop.orderBot = { toBot := WithTop.instBot, bot_le := ⋯ }
Equations
- WithTop.boundedOrder = { toOrderTop := WithTop.orderTop, toOrderBot := WithTop.orderBot }
There is a general version top_le_iff, but this lemma does not require a PartialOrder.
The order on WithTop α, defined by ↑a < ⊤ and a < b → ↑a < ↑b.
A version of lt_top_iff_ne_top for WithTop that only requires LT α, not
PartialOrder α.
Equations
- WithTop.preorder = { toLE := WithTop.instLE, toLT := WithTop.instLT, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯ }
Equations
- WithTop.partialOrder = { toPreorder := WithTop.preorder, le_antisymm := ⋯ }
Alias of the reverse direction of WithTop.monotone_map_iff.
Alias of the reverse direction of WithTop.strictMono_map_iff.
Alias of WithTop.eq_top_iff_forall_gt.
Alias of WithTop.eq_top_iff_forall_ge.
Equations
- One or more equations did not get rendered due to their size.
Equations
- WithTop.semilatticeSup = { toPartialOrder := WithTop.partialOrder, sup := WithTop.map₂ fun (x1 x2 : α) => x1 ⊔ x2, le_sup_left := ⋯, le_sup_right := ⋯, sup_le := ⋯ }
Equations
- WithTop.lattice = { toSemilatticeSup := WithTop.semilatticeSup, inf := SemilatticeInf.inf, inf_le_left := ⋯, inf_le_right := ⋯, le_inf := ⋯ }
Equations
- WithTop.distribLattice = { toLattice := WithTop.lattice, le_sup_inf := ⋯ }
Equations
Equations
- x✝.decidableLE none = isTrue ⋯
- WithTop.decidableLE none (some a) = isFalse ⋯
- WithTop.decidableLE (some a) (some b) = decidable_of_iff' (a ≤ b) ⋯
Equations
- WithTop.decidableLT none x✝ = isFalse ⋯
- WithTop.decidableLT (some a) none = isTrue ⋯
- WithTop.decidableLT (some a) (some b) = decidable_of_iff' (a < b) ⋯