From c27bc9b0fbb1d5557a1a56e4c4cac0b00fa4fb83 Mon Sep 17 00:00:00 2001 From: Scott Morrison Date: Fri, 17 Sep 2021 21:09:59 +1000 Subject: [PATCH] chore(order/bounded_lattice): trivial generalizations --- src/order/bounded_lattice.lean | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/order/bounded_lattice.lean b/src/order/bounded_lattice.lean index a603029989009..9ea269aeebcfe 100644 --- a/src/order/bounded_lattice.lean +++ b/src/order/bounded_lattice.lean @@ -556,12 +556,12 @@ instance order_bot [partial_order α] : order_bot (with_bot α) := @[simp] theorem some_le_some [preorder α] {a b : α} : @has_le.le (with_bot α) _ (some a) (some b) ↔ a ≤ b := coe_le_coe -theorem coe_le [partial_order α] {a b : α} : +theorem coe_le [preorder α] {a b : α} : ∀ {o : option α}, b ∈ o → ((a : with_bot α) ≤ o ↔ a ≤ b) | _ rfl := coe_le_coe @[norm_cast] -lemma coe_lt_coe [partial_order α] {a b : α} : (a : with_bot α) < b ↔ a < b := some_lt_some +lemma coe_lt_coe [preorder α] {a b : α} : (a : with_bot α) < b ↔ a < b := some_lt_some lemma le_coe_get_or_else [preorder α] : ∀ (a : with_bot α) (b : α), a ≤ a.get_or_else b | (some a) b := le_refl a @@ -782,12 +782,12 @@ instance order_top [partial_order α] : order_top (with_top α) := { le_top := λ a a' h, option.no_confusion h, ..with_top.partial_order, .. with_top.has_top } -@[simp, norm_cast] theorem coe_le_coe [partial_order α] {a b : α} : +@[simp, norm_cast] theorem coe_le_coe [preorder α] {a b : α} : (a : with_top α) ≤ b ↔ a ≤ b := ⟨λ h, by rcases h b rfl with ⟨_, ⟨⟩, h⟩; exact h, λ h a' e, option.some_inj.1 e ▸ ⟨a, rfl, h⟩⟩ -theorem le_coe [partial_order α] {a b : α} : +theorem le_coe [preorder α] {a b : α} : ∀ {o : option α}, a ∈ o → (@has_le.le (with_top α) _ o b ↔ a ≤ b) | _ rfl := coe_le_coe @@ -805,15 +805,15 @@ theorem lt_iff_exists_coe [partial_order α] : ∀{a b : with_top α}, a < b ↔ | none b := by simp [none_eq_top] @[norm_cast] -lemma coe_lt_coe [partial_order α] {a b : α} : (a : with_top α) < b ↔ a < b := some_lt_some +lemma coe_lt_coe [preorder α] {a b : α} : (a : with_top α) < b ↔ a < b := some_lt_some -lemma coe_lt_top [partial_order α] (a : α) : (a : with_top α) < ⊤ := some_lt_none a +lemma coe_lt_top [preorder α] (a : α) : (a : with_top α) < ⊤ := some_lt_none a -theorem coe_lt_iff [partial_order α] {a : α} : ∀{x : with_top α}, ↑a < x ↔ (∀b:α, x = ↑b → a < b) +theorem coe_lt_iff [preorder α] {a : α} : ∀{x : with_top α}, ↑a < x ↔ (∀b:α, x = ↑b → a < b) | (some b) := by simp [some_eq_coe, coe_eq_coe, coe_lt_coe] | none := by simp [none_eq_top, coe_lt_top] -lemma not_top_le_coe [partial_order α] (a : α) : ¬ (⊤:with_top α) ≤ ↑a := +lemma not_top_le_coe [preorder α] (a : α) : ¬ (⊤:with_top α) ≤ ↑a := λ h, (lt_irrefl ⊤ (lt_of_le_of_lt h (coe_lt_top a))).elim instance decidable_le [preorder α] [@decidable_rel α (≤)] : @decidable_rel (with_top α) (≤) :=