Skip to content

Commit 73a6419

Browse files
committed
feat: has_le.le.not_lt_iff_eq (#768)
Matches leanprover-community/mathlib3#17734
1 parent 7ee8c7b commit 73a6419

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Mathlib/Order/Basic.lean

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,18 @@ namespace LE.le
219219
protected theorem ge [LE α] {x y : α} (h : x ≤ y) : y ≥ x :=
220220
h
221221

222-
theorem lt_iff_ne [PartialOrder α] {x y : α} (h : x ≤ y) : x < y ↔ x ≠ y :=
223-
fun h ↦ h.ne, h.lt_of_ne⟩
222+
section partial_order
223+
variable [PartialOrder α] {a b : α}
224+
225+
lemma lt_iff_ne (h : a ≤ b) : a < b ↔ a ≠ b := ⟨fun h ↦ h.ne, h.lt_of_ne⟩
226+
lemma gt_iff_ne (h : a ≤ b) : a < b ↔ b ≠ a := ⟨fun h ↦ h.ne.symm, h.lt_of_ne'⟩
227+
lemma not_lt_iff_eq (h : a ≤ b) : ¬ a < b ↔ a = b := h.lt_iff_ne.not_left
228+
lemma not_gt_iff_eq (h : a ≤ b) : ¬ a < b ↔ b = a := h.gt_iff_ne.not_left
229+
230+
lemma le_iff_eq (h : a ≤ b) : b ≤ a ↔ b = a := ⟨fun h' ↦ h'.antisymm h, Eq.le⟩
231+
lemma ge_iff_eq (h : a ≤ b) : b ≤ a ↔ a = b := ⟨h.antisymm, Eq.ge⟩
224232

225-
theorem le_iff_eq [PartialOrder α] {x y : α} (h : x ≤ y) : y ≤ x ↔ y = x :=
226-
fun h' ↦ h'.antisymm h, Eq.le⟩
233+
end partial_order
227234

228235
theorem lt_or_le [LinearOrder α] {a b : α} (h : a ≤ b) (c : α) : a < c ∨ c ≤ b :=
229236
((lt_or_ge a c).imp id) fun hc ↦ le_trans hc h

0 commit comments

Comments
 (0)