Skip to content

Commit dc62f3d

Browse files
vihdzpriccardobrasca
authored andcommitted
feat: Iic 2 = {0, 1, 2} (leanprover-community#37557)
1 parent 3e66d22 commit dc62f3d

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

Mathlib/Algebra/Order/Monoid/Canonical/Defs.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public import Mathlib.Algebra.Order.Monoid.Defs
1010
public import Mathlib.Algebra.Order.Monoid.Unbundled.ExistsOfLE
1111
public import Mathlib.Algebra.NeZero
1212
public import Mathlib.Order.BoundedOrder.Basic
13+
public import Mathlib.Order.Interval.Set.Defs
1314

1415
/-!
1516
# Canonically ordered monoids
@@ -137,6 +138,10 @@ end LE
137138
section Preorder
138139
variable [Preorder α] [CanonicallyOrderedMul α] {a b : α}
139140

141+
@[to_additive]
142+
instance isEmpty_Iio_one : IsEmpty (Set.Iio (1 : α)) :=
143+
fun ⟨a, ha⟩ ↦ not_le_of_gt ha (isBot_one a)⟩
144+
140145
@[to_additive (attr := simp) not_lt_zero] lemma not_lt_one : ¬ a < 1 := (one_le a).not_gt
141146

142147
@[deprecated (since := "2025-12-03")] alias not_neg := not_lt_zero

Mathlib/Algebra/Order/SuccPred.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,26 @@ theorem lt_one_iff [CanonicallyOrderedAdd α] : x < 1 ↔ x = 0 := by
259259
theorem le_one_iff [CanonicallyOrderedAdd α] : x ≤ 1 ↔ x = 0 ∨ x = 1 := by
260260
rw [le_iff_lt_or_eq, lt_one_iff]
261261

262+
@[simp]
263+
theorem Iio_one [CanonicallyOrderedAdd α] : Set.Iio (1 : α) = {0} := by
264+
ext; simp
265+
266+
theorem Iic_one [CanonicallyOrderedAdd α] : Set.Iic (1 : α) = {0, 1} := by
267+
ext; simp [le_one_iff]
268+
262269
@[simp]
263270
theorem lt_two_iff : x < 2 ↔ x ≤ 1 := by
264271
rw [← one_add_one_eq_two, lt_add_one_iff]
265272

266273
theorem le_two_iff [CanonicallyOrderedAdd α] : x ≤ 2 ↔ x = 0 ∨ x = 1 ∨ x = 2 := by
267274
rw [le_iff_lt_or_eq, lt_two_iff, le_one_iff, or_assoc]
268275

276+
theorem Iio_two [CanonicallyOrderedAdd α] : Set.Iio (2 : α) = {0, 1} := by
277+
ext; simp [le_one_iff]
278+
279+
theorem Iic_two [CanonicallyOrderedAdd α] : Set.Iic (2 : α) = {0, 1, 2} := by
280+
ext; simp [le_two_iff]
281+
269282
end AddMonoidWithOne
270283

271284
section Sub

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,10 @@ instance : OrderBot Ordinal where
343343
theorem bot_eq_zero : (⊥ : Ordinal) = 0 :=
344344
rfl
345345

346-
instance instIsEmptyIioZero : IsEmpty (Iio (0 : Ordinal)) := by
347-
simp [← bot_eq_zero]
348-
349346
@[deprecated nonpos_iff_eq_zero (since := "2025-11-21")]
350347
protected theorem le_zero {o : Ordinal} : o ≤ 0 ↔ o = 0 :=
351348
le_bot_iff
352349

353-
354350
@[deprecated not_neg (since := "2025-11-21")]
355351
protected theorem not_lt_zero (o : Ordinal) : ¬o < 0 :=
356352
not_lt_bot

0 commit comments

Comments
 (0)