Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4367b19

Browse files
committed
feat(data/set/intervals/basic): generalize from linear_order to preorder (#18876)
The lemma statements are unchanged, but the proofs are rewritten
1 parent e4bc74c commit 4367b19

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

src/data/set/intervals/basic.lean

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,19 @@ lemma _root_.is_min.Iio_eq (h : is_min a) : Iio a = ∅ := eq_empty_of_subset_em
407407
lemma Iic_inter_Ioc_of_le (h : a ≤ c) : Iic a ∩ Ioc b c = Ioc b a :=
408408
ext $ λ x, ⟨λ H, ⟨H.2.1, H.1⟩, λ H, ⟨H.2, H.1, H.2.trans h⟩⟩
409409

410+
lemma not_mem_Icc_of_lt (ha : c < a) : c ∉ Icc a b := λ h, ha.not_le h.1
411+
lemma not_mem_Icc_of_gt (hb : b < c) : c ∉ Icc a b := λ h, hb.not_le h.2
412+
lemma not_mem_Ico_of_lt (ha : c < a) : c ∉ Ico a b := λ h, ha.not_le h.1
413+
lemma not_mem_Ioc_of_gt (hb : b < c) : c ∉ Ioc a b := λ h, hb.not_le h.2
414+
415+
@[simp] lemma not_mem_Ioi_self : a ∉ Ioi a := lt_irrefl _
416+
@[simp] lemma not_mem_Iio_self : b ∉ Iio b := lt_irrefl _
417+
418+
lemma not_mem_Ioc_of_le (ha : c ≤ a) : c ∉ Ioc a b := λ h, lt_irrefl _ $ h.1.trans_le ha
419+
lemma not_mem_Ico_of_ge (hb : b ≤ c) : c ∉ Ico a b := λ h, lt_irrefl _ $ h.2.trans_le hb
420+
lemma not_mem_Ioo_of_le (ha : c ≤ a) : c ∉ Ioo a b := λ h, lt_irrefl _ $ h.1.trans_le ha
421+
lemma not_mem_Ioo_of_ge (hb : b ≤ c) : c ∉ Ioo a b := λ h, lt_irrefl _ $ h.2.trans_le hb
422+
410423
end preorder
411424

412425
section partial_order
@@ -594,38 +607,10 @@ lemma not_mem_Ici : c ∉ Ici a ↔ c < a := not_le
594607

595608
lemma not_mem_Iic : c ∉ Iic b ↔ b < c := not_le
596609

597-
lemma not_mem_Icc_of_lt (ha : c < a) : c ∉ Icc a b :=
598-
not_mem_subset Icc_subset_Ici_self $ not_mem_Ici.mpr ha
599-
600-
lemma not_mem_Icc_of_gt (hb : b < c) : c ∉ Icc a b :=
601-
not_mem_subset Icc_subset_Iic_self $ not_mem_Iic.mpr hb
602-
603-
lemma not_mem_Ico_of_lt (ha : c < a) : c ∉ Ico a b :=
604-
not_mem_subset Ico_subset_Ici_self $ not_mem_Ici.mpr ha
605-
606-
lemma not_mem_Ioc_of_gt (hb : b < c) : c ∉ Ioc a b :=
607-
not_mem_subset Ioc_subset_Iic_self $ not_mem_Iic.mpr hb
608-
609610
lemma not_mem_Ioi : c ∉ Ioi a ↔ c ≤ a := not_lt
610611

611612
lemma not_mem_Iio : c ∉ Iio b ↔ b ≤ c := not_lt
612613

613-
@[simp] lemma not_mem_Ioi_self : a ∉ Ioi a := lt_irrefl _
614-
615-
@[simp] lemma not_mem_Iio_self : b ∉ Iio b := lt_irrefl _
616-
617-
lemma not_mem_Ioc_of_le (ha : c ≤ a) : c ∉ Ioc a b :=
618-
not_mem_subset Ioc_subset_Ioi_self $ not_mem_Ioi.mpr ha
619-
620-
lemma not_mem_Ico_of_ge (hb : b ≤ c) : c ∉ Ico a b :=
621-
not_mem_subset Ico_subset_Iio_self $ not_mem_Iio.mpr hb
622-
623-
lemma not_mem_Ioo_of_le (ha : c ≤ a) : c ∉ Ioo a b :=
624-
not_mem_subset Ioo_subset_Ioi_self $ not_mem_Ioi.mpr ha
625-
626-
lemma not_mem_Ioo_of_ge (hb : b ≤ c) : c ∉ Ioo a b :=
627-
not_mem_subset Ioo_subset_Iio_self $ not_mem_Iio.mpr hb
628-
629614
@[simp] lemma compl_Iic : (Iic a)ᶜ = Ioi a := ext $ λ _, not_le
630615
@[simp] lemma compl_Ici : (Ici a)ᶜ = Iio a := ext $ λ _, not_le
631616
@[simp] lemma compl_Iio : (Iio a)ᶜ = Ici a := ext $ λ _, not_lt

0 commit comments

Comments
 (0)