@@ -38,8 +38,7 @@ variable {α β : Type*}
3838
3939/-- A linearly ordered commutative monoid with a zero element. -/
4040class LinearOrderedCommMonoidWithZero (α : Type *) extends CommMonoidWithZero α, LinearOrder α,
41- PosMulStrictMono α, OrderBot α where
42- protected zero_le (a : α) : 0 ≤ a
41+ PosMulStrictMono α, OrderBot α, IsBotZeroClass α where
4342
4443/-- A linearly ordered commutative group with a zero element. -/
4544class LinearOrderedCommGroupWithZero (α : Type *) extends LinearOrderedCommMonoidWithZero α,
@@ -52,20 +51,6 @@ variable [LinearOrderedCommMonoidWithZero α] {a b : α} {n : ℕ}
5251The following facts are true more generally in a (linearly) ordered commutative monoid.
5352-/
5453
55- @[simp] lemma zero_le' : 0 ≤ a := LinearOrderedCommMonoidWithZero.zero_le _
56- @[simp] lemma not_lt_zero' : ¬a < 0 := zero_le'.not_gt
57- @[simp] lemma le_zero_iff : a ≤ 0 ↔ a = 0 := by simp [le_antisymm_iff]
58-
59- lemma zero_lt_iff : 0 < a ↔ a ≠ 0 := by simp [lt_iff_le_and_ne, eq_comm]
60- lemma ne_zero_of_lt (h : b < a) : a ≠ 0 := fun h1 ↦ not_lt_zero' <| show b < 0 from h1 ▸ h
61-
62- /-- See also `bot_eq_zero` and `bot_eq_zero'` for canonically ordered monoids. -/
63- lemma bot_eq_zero'' : (⊥ : α) = 0 := eq_of_forall_ge_iff fun _ ↦ by simp
64-
65- -- See note [lower instance priority]
66- instance (priority := 100 ) LinearOrderedCommMonoidWithZero.toZeroLeOneClass : ZeroLEOneClass α where
67- zero_le_one := zero_le'
68-
6954-- See note [lower instance priority]
7055instance (priority := 100 ) LinearOrderedCommMonoidWithZero.toMulPosStrictMono :
7156 MulPosStrictMono α := posMulStrictMono_iff_mulPosStrictMono.1 inferInstance
@@ -78,12 +63,12 @@ instance (priority := 100) LinearOrderedCommMonoidWithZero.toIsOrderedMonoid :
7863 · simp
7964 obtain rfl | hab := hab.eq_or_lt
8065 · simp
81- · exact (mul_lt_mul_of_pos_right hab <| zero_lt_iff. 2 hc ).le
66+ · exact (mul_lt_mul_of_pos_right hab hc.pos ).le
8267
8368-- See note [lower instance priority]
8469instance (priority := 100 ) : IsCancelMulZero α where
85- mul_left_cancel_of_ne_zero ha := (strictMono_mul_left_of_pos <| zero_lt_iff. 2 ha ).injective
86- mul_right_cancel_of_ne_zero ha := (strictMono_mul_right_of_pos <| zero_lt_iff. 2 ha ).injective
70+ mul_left_cancel_of_ne_zero ha := (strictMono_mul_left_of_pos ha.pos ).injective
71+ mul_right_cancel_of_ne_zero ha := (strictMono_mul_right_of_pos ha.pos ).injective
8772
8873/-- Pullback a `LinearOrderedCommMonoidWithZero` under an injective map.
8974See note [reducible non-instances]. -/
@@ -100,7 +85,7 @@ abbrev Function.Injective.linearOrderedCommMonoidWithZero {β : Type*} [Zero β]
10085 __ := hf.linearOrder f le lt hinf hsup compare
10186 __ := hf.commMonoidWithZero f zero one mul npow
10287 __ := Function.Injective.posMulStrictMono f zero mul lt
103- zero_le _ := le.1 <| zero ▸ zero_le'
88+ isBot_zero _ := le.1 <| zero ▸ zero_le
10489 bot_le _ := le.1 <| bot ▸ bot_le
10590
10691instance (priority := 100 ) LinearOrderedCommMonoidWithZero.toIsMulTorsionFree :
@@ -109,17 +94,18 @@ instance (priority := 100) LinearOrderedCommMonoidWithZero.toIsMulTorsionFree :
10994
11095instance instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual :
11196 LinearOrderedAddCommMonoidWithTop (Additive αᵒᵈ) where
112- top_add' a := by ext; simp [bot_eq_zero'' ]
113- isAddLeftRegular_of_ne_top := by simp +contextual [IsRegular.of_ne_zero, bot_eq_zero'' ]
97+ top_add' a := by ext; simp [bot_eq_zero]
98+ isAddLeftRegular_of_ne_top := by simp +contextual [IsRegular.of_ne_zero, bot_eq_zero]
11499
115100instance instLinearOrderedAddCommMonoidWithTopOrderDualAdditive :
116101 LinearOrderedAddCommMonoidWithTop (Additive α)ᵒᵈ where
117- top_add' a := by ext; simp; simp [bot_eq_zero'' (α := α)]
118- isAddLeftRegular_of_ne_top := by simp; simp +contextual [bot_eq_zero'' , IsRegular.of_ne_zero]
102+ top_add' a := by ext; simp; simp [bot_eq_zero (α := α)]
103+ isAddLeftRegular_of_ne_top := by simp; simp +contextual [bot_eq_zero, IsRegular.of_ne_zero]
119104
120105variable [NoZeroDivisors α]
121106
122- lemma pow_pos_iff (hn : n ≠ 0 ) : 0 < a ^ n ↔ 0 < a := by simp_rw [zero_lt_iff, pow_ne_zero_iff hn]
107+ lemma pow_pos_iff (hn : n ≠ 0 ) : 0 < a ^ n ↔ 0 < a := by
108+ simp_rw [pos_iff_ne_zero, pow_ne_zero_iff hn]
123109
124110end LinearOrderedCommMonoidWithZero
125111
@@ -128,35 +114,35 @@ variable [LinearOrderedCommGroupWithZero α] {a b c d : α} {m n : ℕ}
128114
129115@[simp]
130116theorem Units.zero_lt (u : αˣ) : (0 : α) < u :=
131- zero_lt_iff. 2 u.ne_zero
117+ u.ne_zero.pos
132118
133119theorem mul_inv_lt_of_lt_mul₀ (h : a < b * c) : a * c⁻¹ < b := by
134120 contrapose! h
135- simpa only [inv_inv] using mul_inv_le_of_le_mul₀ zero_le' zero_le' h
121+ simpa only [inv_inv] using mul_inv_le_of_le_mul₀ zero_le zero_le h
136122
137123theorem inv_mul_lt_of_lt_mul₀ (h : a < b * c) : b⁻¹ * a < c := by
138124 rw [mul_comm] at *
139125 exact mul_inv_lt_of_lt_mul₀ h
140126
141127theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d := by
142128 have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
143- rw [← inv_le_inv₀ (zero_lt_iff. 2 ha) hc] at hh
129+ rw [← inv_le_inv₀ ha.pos hc] at hh
144130 simpa [inv_mul_cancel_left₀ ha, inv_mul_cancel_left₀ hc.ne']
145- using mul_lt_mul_of_le_of_lt_of_nonneg_of_pos hh h zero_le' (inv_pos.2 hc)
131+ using mul_lt_mul_of_le_of_lt_of_nonneg_of_pos hh h zero_le (inv_pos.2 hc)
146132
147133instance : LinearOrderedAddCommGroupWithTop (Additive αᵒᵈ) where
148134 top_add' := by simp
149- neg_top := by ext; simp [bot_eq_zero'' ]
135+ neg_top := by ext; simp [bot_eq_zero]
150136 add_neg_cancel_of_ne_top := by
151- simp +contextual [bot_eq_zero'' , Additive.ext_iff, OrderDual.ext_iff, -Additive.toMul_eq_top,
137+ simp +contextual [bot_eq_zero, Additive.ext_iff, OrderDual.ext_iff, -Additive.toMul_eq_top,
152138 -ofDual_eq_zero]
153139
154140instance : LinearOrderedAddCommGroupWithTop (Additive α)ᵒᵈ where
155141 top_add' := by simp
156- neg_top := by ext; simp; simp [bot_eq_zero'' ]
142+ neg_top := by ext; simp; simp [bot_eq_zero]
157143 add_neg_cancel_of_ne_top := by
158144 simp
159- simp +contextual [bot_eq_zero'' , Additive.ext_iff, OrderDual.ext_iff, -Additive.toMul_eq_top,
145+ simp +contextual [bot_eq_zero, Additive.ext_iff, OrderDual.ext_iff, -Additive.toMul_eq_top,
160146 -ofDual_eq_zero]
161147
162148-- Counterexample with monoid for the backward direction:
@@ -171,7 +157,7 @@ lemma denselyOrdered_iff_denselyOrdered_units_and_nontrivial_units :
171157 refine ⟨Units.mk0 z (ne_zero_of_lt hz.1 ), by simp [← Units.val_lt_val, hz]⟩
172158 · refine ⟨fun x y h ↦ ?_⟩
173159 lift y to αˣ using (ne_zero_of_lt h).isUnit
174- obtain rfl | hx := (zero_le' (a := x)).eq_or_lt
160+ obtain rfl | hx := eq_zero_or_pos x
175161 · obtain ⟨z, hz⟩ := exists_one_lt' (α := αˣ)
176162 exact ⟨(y * z⁻¹ : αˣ), by simp, Units.val_lt_val.mpr <| by simp [hz]⟩
177163 · lift x to αˣ using hx.ne'.isUnit
@@ -201,7 +187,7 @@ instance instLinearOrderedCommMonoidWithZeroMultiplicativeOrderDual
201187 zero := .ofAdd <| .toDual ⊤
202188 zero_mul := @top_add _ (_)
203189 mul_zero := @add_top _ (_)
204- zero_le _ := (le_top : _ ≤ ⊤)
190+ isBot_zero _ := (le_top : _ ≤ ⊤)
205191 mul_lt_mul_of_pos_left := by
206192 simpa [← ofAdd_add, ← toDual_add]
207193 using fun a ha b c hbc ↦ add_right_strictMono_of_ne_top (by simpa using ha.ne') hbc
@@ -214,7 +200,7 @@ theorem ofAdd_toDual_eq_zero_iff [LinearOrderedAddCommMonoidWithTop α]
214200theorem ofDual_toAdd_eq_top_iff [LinearOrderedAddCommMonoidWithTop α]
215201 (x : Multiplicative αᵒᵈ) : OrderDual.ofDual x.toAdd = ⊤ ↔ x = 0 := Iff.rfl
216202
217- @ [deprecated bot_eq_zero'' (since := "2025-11-17" )]
203+ @ [deprecated bot_eq_zero (since := "2025-11-17" )]
218204theorem ofAdd_bot [LinearOrderedAddCommMonoidWithTop α] :
219205 Multiplicative.ofAdd ⊥ = (0 : Multiplicative αᵒᵈ) := rfl
220206
@@ -255,7 +241,11 @@ instance instOrderBot : OrderBot (WithZero α) := inferInstanceAs <| OrderBot (W
255241instance instBoundedOrder [OrderTop α] : BoundedOrder (WithZero α) :=
256242 inferInstanceAs <| BoundedOrder (WithBot α)
257243
258- @[simp] lemma zero_le (a : WithZero α) : 0 ≤ a := bot_le (a := a)
244+ instance : IsBotZeroClass (WithZero α) where
245+ isBot_zero _ := bot_le
246+
247+ -- TODO: deprecate
248+ lemma zero_le (a : WithZero α) : 0 ≤ a := by simp
259249
260250/-- There is a general version `le_zero_iff`, but this lemma does not require a `PartialOrder`. -/
261251@[simp]
@@ -521,7 +511,7 @@ instance instCanonicallyOrderedAdd [AddZeroClass α] [Preorder α] [CanonicallyO
521511
522512instance instLinearOrderedCommMonoidWithZero [CommMonoid α] [LinearOrder α]
523513 [IsOrderedCancelMonoid α] : LinearOrderedCommMonoidWithZero (WithZero α) where
524- zero_le := WithZero.zero_le
514+ isBot_zero := WithZero.zero_le
525515 mul_lt_mul_of_pos_left
526516 | (a : α), _, 0 , (c : α), _ => by simp [← WithZero.coe_mul]
527517 | (a : α), _, (b : α), (c : α), hbc => by norm_cast at *; exact mul_lt_mul_right hbc _
0 commit comments