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

Commit a6d3d65

Browse files
committed
chore(data/set/intervals): more simp lemmas (#3564)
1 parent 692a689 commit a6d3d65

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

src/data/set/intervals/basic.lean

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,34 @@ end partial_order
370370
section linear_order
371371
variables {α : Type u} [linear_order α] {a a₁ a₂ b b₁ b₂ : α}
372372

373-
lemma compl_Iic : (Iic a)ᶜ = Ioi a := ext $ λ _, not_le
374-
lemma compl_Ici : (Ici a)ᶜ = Iio a := ext $ λ _, not_le
375-
lemma compl_Iio : (Iio a)ᶜ = Ici a := ext $ λ _, not_lt
376-
lemma compl_Ioi : (Ioi a)ᶜ = Iic a := ext $ λ _, not_lt
373+
@[simp] lemma compl_Iic : (Iic a)ᶜ = Ioi a := ext $ λ _, not_le
374+
@[simp] lemma compl_Ici : (Ici a)ᶜ = Iio a := ext $ λ _, not_le
375+
@[simp] lemma compl_Iio : (Iio a)ᶜ = Ici a := ext $ λ _, not_lt
376+
@[simp] lemma compl_Ioi : (Ioi a)ᶜ = Iic a := ext $ λ _, not_lt
377+
378+
@[simp] lemma Ici_diff_Ici : Ici a \ Ici b = Ico a b :=
379+
by rw [diff_eq, compl_Ici, Ici_inter_Iio]
380+
381+
@[simp] lemma Ici_diff_Ioi : Ici a \ Ioi b = Icc a b :=
382+
by rw [diff_eq, compl_Ioi, Ici_inter_Iic]
383+
384+
@[simp] lemma Ioi_diff_Ioi : Ioi a \ Ioi b = Ioc a b :=
385+
by rw [diff_eq, compl_Ioi, Ioi_inter_Iic]
386+
387+
@[simp] lemma Ioi_diff_Ici : Ioi a \ Ici b = Ioo a b :=
388+
by rw [diff_eq, compl_Ici, Ioi_inter_Iio]
389+
390+
@[simp] lemma Iic_diff_Iic : Iic b \ Iic a = Ioc a b :=
391+
by rw [diff_eq, compl_Iic, inter_comm, Ioi_inter_Iic]
392+
393+
@[simp] lemma Iio_diff_Iic : Iio b \ Iic a = Ioo a b :=
394+
by rw [diff_eq, compl_Iic, inter_comm, Ioi_inter_Iio]
395+
396+
@[simp] lemma Iic_diff_Iio : Iic b \ Iio a = Icc a b :=
397+
by rw [diff_eq, compl_Iio, inter_comm, Ici_inter_Iic]
398+
399+
@[simp] lemma Iio_diff_Iio : Iio b \ Iio a = Ico a b :=
400+
by rw [diff_eq, compl_Iio, inter_comm, Ici_inter_Iio]
377401

378402
lemma Ioo_eq_empty_iff [densely_ordered α] : Ioo a b = ∅ ↔ b ≤ a :=
379403
⟨λ eq, le_of_not_lt $ λ h,
@@ -440,12 +464,7 @@ begin
440464
end
441465

442466
@[simp] lemma Iio_subset_Iic_iff [densely_ordered α] : Iio a ⊆ Iic b ↔ a ≤ b :=
443-
begin
444-
refine ⟨λh, _, λh, Iio_subset_Iic h⟩,
445-
by_contradiction ba,
446-
obtain ⟨c, bc, ca⟩ : ∃c, b < c ∧ c < a := dense (not_le.mp ba),
447-
exact lt_irrefl _ (lt_of_lt_of_le bc (h ca))
448-
end
467+
by rw [← diff_eq_empty, Iio_diff_Iic, Ioo_eq_empty_iff]
449468

450469
/-! ### Unions of adjacent intervals -/
451470

0 commit comments

Comments
 (0)