@@ -103,91 +103,6 @@ theorem hmul_neg (n : Int) (a : M) : n * (-a) = - (n * a) := by
103103
104104end IntModule
105105
106- /-- A preorder is a reflexive, transitive relation `≤` with `a < b` defined in the obvious way. -/
107- class Preorder (α : Type u) extends LE α, LT α where
108- le_refl : ∀ a : α, a ≤ a
109- le_trans : ∀ {a b c : α}, a ≤ b → b ≤ c → a ≤ c
110- lt := fun a b => a ≤ b ∧ ¬b ≤ a
111- lt_iff_le_not_le : ∀ {a b : α}, a < b ↔ a ≤ b ∧ ¬b ≤ a := by intros; rfl
112-
113- namespace Preorder
114-
115- variable {α : Type u} [Preorder α]
116-
117- theorem le_of_lt {a b : α} (h : a < b) : a ≤ b := (lt_iff_le_not_le.mp h).1
118-
119- theorem lt_of_lt_of_le {a b c : α} (h₁ : a < b) (h₂ : b ≤ c) : a < c := by
120- simp [lt_iff_le_not_le] at h₁ ⊢
121- exact ⟨le_trans h₁.1 h₂, fun h => h₁.2 (le_trans h₂ h)⟩
122-
123- theorem lt_of_le_of_lt {a b c : α} (h₁ : a ≤ b) (h₂ : b < c) : a < c := by
124- simp [lt_iff_le_not_le] at h₂ ⊢
125- exact ⟨le_trans h₁ h₂.1 , fun h => h₂.2 (le_trans h h₁)⟩
126-
127- theorem lt_trans {a b c : α} (h₁ : a < b) (h₂ : b < c) : a < c :=
128- lt_of_lt_of_le h₁ (le_of_lt h₂)
129-
130- theorem lt_irrefl {a : α} (h : a < a) : False := by
131- simp [lt_iff_le_not_le] at h
132-
133- end Preorder
134-
135- class IntModule.IsOrdered (M : Type u) [Preorder M] [IntModule M] where
136- neg_le_iff : ∀ a b : M, -a ≤ b ↔ -b ≤ a
137- add_le_left : ∀ {a b : M}, a ≤ b → (c : M) → a + c ≤ b + c
138- hmul_pos : ∀ (k : Int) {a : M}, 0 < a → (0 < k ↔ 0 < k * a)
139- hmul_nonneg : ∀ {k : Int} {a : M}, 0 ≤ k → 0 ≤ a → 0 ≤ k * a
140-
141- namespace IntModule.IsOrdered
142-
143- variable {M : Type u} [Preorder M] [IntModule M] [IntModule.IsOrdered M]
144-
145- theorem le_neg_iff {a b : M} : a ≤ -b ↔ b ≤ -a := by
146- conv => lhs; rw [← neg_neg a]
147- rw [neg_le_iff, neg_neg]
148-
149- theorem neg_lt_iff {a b : M} : -a < b ↔ -b < a := by
150- simp [Preorder.lt_iff_le_not_le]
151- rw [neg_le_iff, le_neg_iff]
152-
153- theorem lt_neg_iff {a b : M} : a < -b ↔ b < -a := by
154- conv => lhs; rw [← neg_neg a]
155- rw [neg_lt_iff, neg_neg]
156-
157- theorem neg_nonneg_iff {a : M} : 0 ≤ -a ↔ a ≤ 0 := by
158- rw [le_neg_iff, neg_zero]
159-
160- theorem neg_pos_iff {a : M} : 0 < -a ↔ a < 0 := by
161- rw [lt_neg_iff, neg_zero]
162-
163- theorem add_lt_left {a b : M} (h : a < b) (c : M) : a + c < b + c := by
164- simp [Preorder.lt_iff_le_not_le] at h ⊢
165- constructor
166- · exact add_le_left h.1 _
167- · intro w
168- apply h.2
169- replace w := add_le_left w (-c)
170- rw [add_assoc, add_assoc, add_neg_cancel, add_zero, add_zero] at w
171- exact w
172-
173- theorem add_le_right (a : M) {b c : M} (h : b ≤ c) : a + b ≤ a + c := by
174- rw [add_comm a b, add_comm a c]
175- exact add_le_left h a
176-
177- theorem add_lt_right (a : M) {b c : M} (h : b < c) : a + b < a + c := by
178- rw [add_comm a b, add_comm a c]
179- exact add_lt_left h a
180-
181- theorem hmul_neg (k : Int) {a : M} (h : a < 0 ) : 0 < k ↔ k * a < 0 := by
182- simpa [IntModule.hmul_neg, neg_pos_iff] using hmul_pos k (neg_pos_iff.mpr h)
183-
184- theorem hmul_nonpos {k : Int} {a : M} (hk : 0 ≤ k) (ha : a ≤ 0 ) : k * a ≤ 0 := by
185- simpa [IntModule.hmul_neg, neg_nonneg_iff] using hmul_nonneg hk (neg_nonneg_iff.mpr ha)
186-
187-
188-
189- end IntModule.IsOrdered
190-
191106/--
192107Special case of Mathlib's `NoZeroSMulDivisors Nat α`.
193108-/
0 commit comments