-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Merged by Bors] - feat(ENat): (∀ a : ℕ, a ≤ m → a ≤ n) ↔ m ≤ n
#23101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
a0ad4ef
0b4647d
294dc8b
55572e6
4d62325
feeb51f
b8f36bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,8 +151,10 @@ lemma map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f | |
|
|
||
| lemma ne_bot_iff_exists {x : WithBot α} : x ≠ ⊥ ↔ ∃ a : α, ↑a = x := Option.ne_none_iff_exists | ||
|
|
||
| lemma forall_ne_iff_eq_bot {x : WithBot α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊥ := | ||
| Option.forall_some_ne_iff_eq_none | ||
| lemma eq_bot_iff_forall_ne {x : WithBot α} : x = ⊥ ↔ ∀ a : α, ↑a ≠ x := | ||
| Option.eq_none_iff_forall_some_ne | ||
|
|
||
| @[deprecated (since := "2025-03-19")] alias forall_ne_iff_eq_bot := eq_bot_iff_forall_ne | ||
|
|
||
| /-- Deconstruct a `x : WithBot α` to the underlying value in `α`, given a proof that `x ≠ ⊥`. -/ | ||
| def unbot : ∀ x : WithBot α, x ≠ ⊥ → α | (x : α), _ => x | ||
|
|
@@ -325,14 +327,17 @@ alias le_coe_unbot' := le_coe_unbotD | |
| @[simp] | ||
| theorem lt_coe_bot [OrderBot α] : x < (⊥ : α) ↔ x = ⊥ := by cases x <;> simp | ||
|
|
||
| lemma forall_lt_iff_eq_bot : (∀ b : α, x < b) ↔ x = ⊥ := by | ||
| lemma eq_bot_iff_forall_lt : x = ⊥ ↔ ∀ b : α, x < b := by | ||
| cases x <;> simp; simpa using ⟨_, lt_irrefl _⟩ | ||
|
|
||
| lemma forall_le_iff_eq_bot [NoMinOrder α] : (∀ b : α, x ≤ b) ↔ x = ⊥ := by | ||
| refine ⟨fun h ↦ forall_lt_iff_eq_bot.1 fun y ↦ ?_, by simp +contextual⟩ | ||
| lemma eq_bot_iff_forall_le [NoMinOrder α] : x = ⊥ ↔ ∀ b : α, x ≤ b := by | ||
| refine ⟨by simp +contextual, fun h ↦ eq_bot_iff_forall_lt.2 fun y ↦ ?_⟩ | ||
| obtain ⟨w, hw⟩ := exists_lt y | ||
| exact (h w).trans_lt (coe_lt_coe.2 hw) | ||
|
|
||
| @[deprecated (since := "2025-03-19")] alias forall_lt_iff_eq_bot := eq_bot_iff_forall_lt | ||
| @[deprecated (since := "2025-03-19")] alias forall_le_iff_eq_bot := eq_bot_iff_forall_le | ||
|
|
||
| end Preorder | ||
|
|
||
| instance semilatticeSup [SemilatticeSup α] : SemilatticeSup (WithBot α) where | ||
|
|
@@ -638,8 +643,10 @@ theorem ofDual_map (f : αᵒᵈ → βᵒᵈ) (a : WithTop αᵒᵈ) : | |
|
|
||
| lemma ne_top_iff_exists {x : WithTop α} : x ≠ ⊤ ↔ ∃ a : α, ↑a = x := Option.ne_none_iff_exists | ||
|
|
||
| lemma forall_ne_iff_eq_top {x : WithTop α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊤ := | ||
| Option.forall_some_ne_iff_eq_none | ||
| lemma eq_top_iff_forall_ne {x : WithTop α} : x = ⊤ ↔ ∀ a : α, ↑a ≠ x := | ||
| Option.eq_none_iff_forall_some_ne | ||
|
|
||
| @[deprecated (since := "2025-03-19")] alias forall_ne_iff_eq_top := eq_top_iff_forall_ne | ||
|
|
||
| /-- Deconstruct a `x : WithTop α` to the underlying value in `α`, given a proof that `x ≠ ⊤`. -/ | ||
| def untop : ∀ x : WithTop α, x ≠ ⊤ → α | (x : α), _ => x | ||
|
|
@@ -806,11 +813,19 @@ alias coe_untop'_le := coe_untopD_le | |
| @[simp] | ||
| theorem coe_top_lt [OrderTop α] : (⊤ : α) < x ↔ x = ⊤ := by cases x <;> simp | ||
|
|
||
| lemma forall_gt_iff_eq_top : (∀ a : α, a < y) ↔ y = ⊤ := by | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hold on, why are these getting removed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, in #23101 (comment) you said you wanted
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ehhh, okay |
||
| lemma eq_top_iff_forall_gt : y = ⊤ ↔ ∀ a : α, a < y := by | ||
| cases y <;> simp; simpa using ⟨_, lt_irrefl _⟩ | ||
|
YaelDillies marked this conversation as resolved.
|
||
|
|
||
| lemma forall_ge_iff_eq_top [NoMaxOrder α] : (∀ a : α, a ≤ y) ↔ y = ⊤ := | ||
| WithBot.forall_le_iff_eq_bot (α := αᵒᵈ) | ||
| lemma eq_top_iff_forall_ge [NoMaxOrder α] : y = ⊤ ↔ ∀ a : α, a ≤ y := | ||
| WithBot.eq_bot_iff_forall_le (α := αᵒᵈ) | ||
|
|
||
| @[deprecated (since := "2025-03-19")] alias forall_lt_iff_eq_top := eq_top_iff_forall_gt | ||
| @[deprecated (since := "2025-03-19")] alias forall_le_iff_eq_top := eq_top_iff_forall_ge | ||
|
Comment on lines
+822
to
+823
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These have the wrong name. (Do we care?)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| lemma forall_coe_le_iff_le [NoMaxOrder α] {x y : WithTop α} : (∀ a : α, a ≤ x → a ≤ y) ↔ x ≤ y := by | ||
| obtain _ | x := x | ||
| · simp [WithTop.none_eq_top, eq_top_iff_forall_ge] | ||
| · exact ⟨fun h ↦ h _ le_rfl, fun hmn a ham ↦ ham.trans hmn⟩ | ||
|
|
||
| end Preorder | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.