Skip to content

Commit

Permalink
instance
Browse files Browse the repository at this point in the history
  • Loading branch information
vihdzp committed Oct 30, 2024
1 parent 305a53d commit e9f9114
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Mathlib/Order/Interval/Set/Infinite.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ preorder is an infinite type.

variable {α : Type*} [Preorder α]

/-- A nonempty preorder with no maximal element is infinite. This is not an instance to avoid
a cycle with `Infinite α → Nontrivial α → Nonempty α`. -/
theorem NoMaxOrder.infinite [Nonempty α] [NoMaxOrder α] : Infinite α :=
/-- A nonempty preorder with no maximal element is infinite. -/
instance NoMaxOrder.infinite [Nonempty α] [NoMaxOrder α] : Infinite α :=
let ⟨f, hf⟩ := Nat.exists_strictMono α
Infinite.of_injective f hf.injective

/-- A nonempty preorder with no minimal element is infinite. This is not an instance to avoid
a cycle with `Infinite α → Nontrivial α → Nonempty α`. -/
theorem NoMinOrder.infinite [Nonempty α] [NoMinOrder α] : Infinite α :=
/-- A nonempty preorder with no minimal element is infinite. -/
instance NoMinOrder.infinite [Nonempty α] [NoMinOrder α] : Infinite α :=
@NoMaxOrder.infinite αᵒᵈ _ _ _

namespace Set
Expand Down

0 comments on commit e9f9114

Please sign in to comment.