Module docstring
{"# Canonically ordered monoids "}
{"# Canonically ordered monoids "}
CanonicallyOrderedAdd
structure
(α : Type*) [Add α] [LE α] : Prop
extends ExistsAddOfLE α
/-- An ordered additive monoid is `CanonicallyOrderedAdd`
if the ordering coincides with the subtractibility relation,
which is to say, `a ≤ b` iff there exists `c` with `b = a + c`.
This is satisfied by the natural numbers, for example, but not
the integers or other nontrivial `OrderedAddCommGroup`s. -/
class CanonicallyOrderedAdd (α : Type*) [Add α] [LE α] : Prop
extends ExistsAddOfLE α where
/-- For any `a` and `b`, `a ≤ a + b` -/
protected le_self_add : ∀ a b : α, a ≤ a + b
CanonicallyOrderedMul
structure
(α : Type*) [Mul α] [LE α] : Prop
extends ExistsMulOfLE α
/-- An ordered monoid is `CanonicallyOrderedMul`
if the ordering coincides with the divisibility relation,
which is to say, `a ≤ b` iff there exists `c` with `b = a * c`.
Examples seem rare; it seems more likely that the `OrderDual`
of a naturally-occurring lattice satisfies this than the lattice
itself (for example, dual of the lattice of ideals of a PID or
Dedekind domain satisfy this; collections of all things ≤ 1 seem to
be more natural that collections of all things ≥ 1). -/
@[to_additive]
class CanonicallyOrderedMul (α : Type*) [Mul α] [LE α] : Prop
extends ExistsMulOfLE α where
/-- For any `a` and `b`, `a ≤ a * b` -/
protected le_self_mul : ∀ a b : α, a ≤ a * b
CanonicallyOrderedAddCommMonoid
structure
(α : Type*) extends
OrderedAddCommMonoid α, OrderBot α
/-- A canonically ordered additive monoid is an ordered commutative additive monoid
in which the ordering coincides with the subtractibility relation,
which is to say, `a ≤ b` iff there exists `c` with `b = a + c`.
This is satisfied by the natural numbers, for example, but not
the integers or other nontrivial `OrderedAddCommGroup`s. -/
@[deprecated "Use `[OrderedAddCommMonoid α] [CanonicallyOrderedAdd α]` instead."
(since := "2025-01-13")]
structure CanonicallyOrderedAddCommMonoid (α : Type*) extends
OrderedAddCommMonoid α, OrderBot α where
/-- For `a ≤ b`, there is a `c` so `b = a + c`. -/
protected exists_add_of_le : ∀ {a b : α}, a ≤ b → ∃ c, b = a + c
/-- For any `a` and `b`, `a ≤ a + b` -/
protected le_self_add : ∀ a b : α, a ≤ a + b
CanonicallyOrderedCommMonoid
structure
(α : Type*) extends OrderedCommMonoid α, OrderBot α
/-- A canonically ordered monoid is an ordered commutative monoid
in which the ordering coincides with the divisibility relation,
which is to say, `a ≤ b` iff there exists `c` with `b = a * c`.
Examples seem rare; it seems more likely that the `OrderDual`
of a naturally-occurring lattice satisfies this than the lattice
itself (for example, dual of the lattice of ideals of a PID or
Dedekind domain satisfy this; collections of all things ≤ 1 seem to
be more natural that collections of all things ≥ 1).
-/
@[to_additive,
deprecated "Use `[OrderedCommMonoid α] [CanonicallyOrderedMul α]` instead."
(since := "2025-01-13")]
structure CanonicallyOrderedCommMonoid (α : Type*) extends OrderedCommMonoid α, OrderBot α where
/-- For `a ≤ b`, there is a `c` so `b = a * c`. -/
protected exists_mul_of_le : ∀ {a b : α}, a ≤ b → ∃ c, b = a * c
/-- For any `a` and `b`, `a ≤ a * b` -/
protected le_self_mul : ∀ a b : α, a ≤ a * b
le_self_mul
theorem
: a ≤ a * b
@[to_additive]
theorem le_self_mul : a ≤ a * b :=
CanonicallyOrderedMul.le_self_mul _ _
self_le_mul_right
theorem
(a b : α) : a ≤ a * b
@[to_additive (attr := simp)]
theorem self_le_mul_right (a b : α) : a ≤ a * b :=
le_self_mul
le_iff_exists_mul
theorem
: a ≤ b ↔ ∃ c, b = a * c
@[to_additive]
theorem le_iff_exists_mul : a ≤ b ↔ ∃ c, b = a * c :=
⟨exists_mul_of_le, by
rintro ⟨c, rfl⟩
exact le_self_mul⟩
le_of_mul_le_left
theorem
: a * b ≤ c → a ≤ c
@[to_additive]
theorem le_of_mul_le_left : a * b ≤ c → a ≤ c :=
le_self_mul.trans
le_mul_of_le_left
theorem
: a ≤ b → a ≤ b * c
@[to_additive]
theorem le_mul_of_le_left : a ≤ b → a ≤ b * c :=
le_self_mul.trans'
le_mul_self
theorem
: a ≤ b * a
@[to_additive]
theorem le_mul_self : a ≤ b * a := by
rw [mul_comm]
exact le_self_mul
self_le_mul_left
theorem
(a b : α) : a ≤ b * a
@[to_additive (attr := simp)]
theorem self_le_mul_left (a b : α) : a ≤ b * a :=
le_mul_self
le_of_mul_le_right
theorem
: a * b ≤ c → b ≤ c
@[to_additive]
theorem le_of_mul_le_right : a * b ≤ c → b ≤ c :=
le_mul_self.trans
le_mul_of_le_right
theorem
: a ≤ c → a ≤ b * c
@[to_additive]
theorem le_mul_of_le_right : a ≤ c → a ≤ b * c :=
le_mul_self.trans'
le_iff_exists_mul'
theorem
: a ≤ b ↔ ∃ c, b = c * a
@[to_additive]
theorem le_iff_exists_mul' : a ≤ b ↔ ∃ c, b = c * a := by
simp only [mul_comm _ a, le_iff_exists_mul]
one_le
theorem
(a : α) : 1 ≤ a
@[to_additive (attr := simp) zero_le]
theorem one_le (a : α) : 1 ≤ a :=
le_self_mul.trans_eq (one_mul _)
CanonicallyOrderedMul.toOrderBot
instance
: OrderBot α
@[to_additive]
instance (priority := 10) CanonicallyOrderedMul.toOrderBot : OrderBot α where
bot := 1
bot_le := one_le
bot_eq_one
theorem
: (⊥ : α) = 1
@[to_additive] theorem bot_eq_one : (⊥ : α) = 1 := rfl
one_lt_of_gt
theorem
(h : a < b) : 1 < b
@[to_additive (attr := simp)]
theorem one_lt_of_gt (h : a < b) : 1 < b :=
h.bot_lt
le_one_iff_eq_one
theorem
: a ≤ 1 ↔ a = 1
@[to_additive (attr := simp)] theorem le_one_iff_eq_one : a ≤ 1 ↔ a = 1 := le_bot_iff
one_lt_iff_ne_one
theorem
: 1 < a ↔ a ≠ 1
@[to_additive] theorem one_lt_iff_ne_one : 1 < a ↔ a ≠ 1 := bot_lt_iff_ne_bot
one_lt_of_ne_one
theorem
(h : a ≠ 1) : 1 < a
@[to_additive] theorem one_lt_of_ne_one (h : a ≠ 1) : 1 < a := h.bot_lt
one_not_mem_iff
theorem
{s : Set α} : 1 ∉ s ↔ ∀ x ∈ s, 1 < x
@[to_additive] lemma one_not_mem_iff {s : Set α} : 1 ∉ s1 ∉ s ↔ ∀ x ∈ s, 1 < x := bot_not_mem_iff
exists_one_lt_mul_of_lt
theorem
(h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b
@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b := by
obtain ⟨c, hc⟩ := le_iff_exists_mul.1 h.le
refine ⟨c, one_lt_iff_ne_one.2 ?_, hc.symm⟩
rintro rfl
simp [hc, lt_irrefl] at h
lt_iff_exists_mul
theorem
[MulLeftStrictMono α] : a < b ↔ ∃ c > 1, b = a * c
@[to_additive]
theorem lt_iff_exists_mul [MulLeftStrictMono α] : a < b ↔ ∃ c > 1, b = a * c := by
rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
apply exists_congr
intro c
rw [and_comm, and_congr_left_iff, gt_iff_lt]
rintro rfl
constructor
· rw [one_lt_iff_ne_one]
apply mt
rintro rfl
rw [mul_one]
· rw [← (self_le_mul_right a c).lt_iff_ne]
apply lt_mul_of_one_lt_right'
CanonicallyOrderedMul.toMulLeftMono
instance
: MulLeftMono α
@[to_additive]
instance (priority := 10) CanonicallyOrderedMul.toMulLeftMono :
MulLeftMono α where
elim a b c hbc := by
obtain ⟨c, hc, rfl⟩ := exists_mul_of_le hbc
rw [le_iff_exists_mul]
exact ⟨c, (mul_assoc _ _ _).symm⟩
CanonicallyOrderedMul.toIsOrderedMonoid
theorem
[CommMonoid α] [PartialOrder α] [CanonicallyOrderedMul α] : IsOrderedMonoid α
@[to_additive]
lemma CanonicallyOrderedMul.toIsOrderedMonoid
[CommMonoid α] [PartialOrder α] [CanonicallyOrderedMul α] : IsOrderedMonoid α where
mul_le_mul_left _ _ := mul_le_mul_left'
CanonicallyOrderedCommMonoid.toUniqueUnits
instance
: Unique αˣ
@[to_additive] instance CanonicallyOrderedCommMonoid.toUniqueUnits : Unique αˣ where
uniq a := Units.ext <| le_one_iff_eq_one.mp (le_of_mul_le_left a.mul_inv.le)
one_lt_mul_iff
theorem
: 1 < a * b ↔ 1 < a ∨ 1 < b
@[to_additive (attr := simp) add_pos_iff]
theorem one_lt_mul_iff : 1 < a * b ↔ 1 < a ∨ 1 < b := by
simp only [one_lt_iff_ne_one, Ne, mul_eq_one, not_and_or]
NeZero.pos
theorem
{M} [AddZeroClass M] [PartialOrder M] [CanonicallyOrderedAdd M] (a : M) [NeZero a] : 0 < a
theorem pos {M} [AddZeroClass M] [PartialOrder M] [CanonicallyOrderedAdd M]
(a : M) [NeZero a] : 0 < a :=
(zero_le a).lt_of_ne <| NeZero.out.symm
NeZero.of_gt
theorem
{M} [AddZeroClass M] [Preorder M] [CanonicallyOrderedAdd M] {x y : M} (h : x < y) : NeZero y
theorem of_gt {M} [AddZeroClass M] [Preorder M] [CanonicallyOrderedAdd M]
{x y : M} (h : x < y) : NeZero y :=
of_pos <| pos_of_gt h
NeZero.of_gt'
instance
{M : Type*} [AddZeroClass M] [Preorder M] [CanonicallyOrderedAdd M] [One M] {y : M} [Fact (1 < y)] : NeZero y
instance (priority := 10) of_gt' {M : Type*} [AddZeroClass M] [Preorder M] [CanonicallyOrderedAdd M]
[One M] {y : M}
[Fact (1 < y)] : NeZero y := of_gt <| @Fact.out (1 < y) _
CanonicallyLinearOrderedAddCommMonoid
structure
(α : Type*)
extends CanonicallyOrderedAddCommMonoid α, LinearOrderedAddCommMonoid α
/-- A canonically linear-ordered additive monoid is a canonically ordered additive monoid
whose ordering is a linear order. -/
@[deprecated "Use `[LinearOrderedAddCommMonoid α] [CanonicallyOrderedAdd α]` instead."
(since := "2025-01-13")]
structure CanonicallyLinearOrderedAddCommMonoid (α : Type*)
extends CanonicallyOrderedAddCommMonoid α, LinearOrderedAddCommMonoid α
CanonicallyLinearOrderedCommMonoid
structure
(α : Type*)
extends CanonicallyOrderedCommMonoid α, LinearOrderedCommMonoid α
/-- A canonically linear-ordered monoid is a canonically ordered monoid
whose ordering is a linear order. -/
@[to_additive,
deprecated "Use `[LinearOrderedCommMonoid α] [CanonicallyOrderedMul α]` instead."
(since := "2025-01-13")]
structure CanonicallyLinearOrderedCommMonoid (α : Type*)
extends CanonicallyOrderedCommMonoid α, LinearOrderedCommMonoid α
min_mul_distrib
theorem
(a b c : α) : min a (b * c) = min a (min a b * min a c)
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
rcases le_total a b with hb | hb
· simp [hb, le_mul_right]
· rcases le_total a c with hc | hc
· simp [hc, le_mul_left]
· simp [hb, hc]
min_mul_distrib'
theorem
(a b c : α) : min (a * b) c = min (min a c * min b c) c
@[to_additive]
theorem min_mul_distrib' (a b c : α) : min (a * b) c = min (min a c * min b c) c := by
simpa [min_comm _ c] using min_mul_distrib c a b
one_min
theorem
(a : α) : min 1 a = 1
@[to_additive]
theorem one_min (a : α) : min 1 a = 1 :=
min_eq_left (one_le a)
min_one
theorem
(a : α) : min a 1 = 1
@[to_additive]
theorem min_one (a : α) : min a 1 = 1 :=
min_eq_right (one_le a)
bot_eq_one'
theorem
: (⊥ : α) = 1
/-- In a linearly ordered monoid, we are happy for `bot_eq_one` to be a `@[simp]` lemma. -/
@[to_additive (attr := simp)
"In a linearly ordered monoid, we are happy for `bot_eq_zero` to be a `@[simp]` lemma"]
theorem bot_eq_one' : (⊥ : α) = 1 :=
bot_eq_one