Skip to content

Commit 9686731

Browse files
committed
chore(Order/UnorderedInterval): add basic uIoo lemmas (#31438)
Add a couple of lemmas about uIoo that are already present for uIcc. We also rename `uIoo_subset_uIcc` to `uIoo_subset_uIcc_self` for parity with the ordered version.
1 parent 71f5e83 commit 9686731

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Mathlib/Order/Interval/Set/UnorderedInterval.lean

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ lemma uIoo_of_gt (h : b < a) : uIoo a b = Ioo b a := uIoo_of_ge h.le
352352

353353
lemma uIoo_self : uIoo a a = ∅ := by simp [uIoo]
354354

355+
@[simp] lemma left_notMem_uIoo : a ∉ uIoo a b := by simp +contextual [uIoo, le_of_lt]
356+
@[simp] lemma right_notMem_uIoo : b ∉ uIoo a b := by simp +contextual [uIoo, le_of_lt]
357+
355358
lemma Ioo_subset_uIoo : Ioo a b ⊆ uIoo a b := Ioo_subset_Ioo inf_le_left le_sup_right
356359

357360
/-- Same as `Ioo_subset_uIoo` but with `Ioo a b` replaced by `Ioo b a`. -/
@@ -371,9 +374,23 @@ lemma uIoo_of_not_le (h : ¬a ≤ b) : uIoo a b = Ioo b a := uIoo_of_gt <| lt_of
371374

372375
lemma uIoo_of_not_ge (h : ¬b ≤ a) : uIoo a b = Ioo a b := uIoo_of_lt <| lt_of_not_ge h
373376

374-
theorem uIoo_subset_uIcc {α : Type*} [LinearOrder α] (a : α) (b : α) : uIoo a b ⊆ uIcc a b := by
377+
lemma uIoo_subset_uIcc_self : uIoo a b ⊆ uIcc a b := by
375378
simp [uIoo, uIcc, Ioo_subset_Icc_self]
376379

380+
@[deprecated uIoo_subset_uIcc_self (since := "2025-11-09")]
381+
lemma uIoo_subset_uIcc (a b : α) : uIoo a b ⊆ uIcc a b := uIoo_subset_uIcc_self
382+
383+
lemma uIoo_subset_Ioo (ha : a₁ ∈ Icc a₂ b₂) (hb : b₁ ∈ Icc a₂ b₂) : uIoo a₁ b₁ ⊆ Ioo a₂ b₂ :=
384+
Ioo_subset_Ioo (le_inf ha.1 hb.1) (sup_le ha.2 hb.2)
385+
386+
@[simp] lemma nonempty_uIoo [DenselyOrdered α] : (uIoo a b).Nonempty ↔ a ≠ b := by
387+
simp [uIoo, eq_comm]
388+
389+
lemma uIoo_eq_union : uIoo a b = Ioo a b ∪ Ioo b a := by
390+
rcases lt_or_ge a b with h | h
391+
· simp [uIoo_of_lt, h, Ioo_eq_empty_of_le h.le]
392+
· simp [uIoo_of_ge, h]
393+
377394
end uIoo
378395

379396
end LinearOrder

0 commit comments

Comments
 (0)