Skip to content

Commit

Permalink
feat(Order/WithBot): Equiv.withBotSubtypeNe (#19251)
Browse files Browse the repository at this point in the history
Needed in #19210

From the Carleson project
  • Loading branch information
nomeata committed Nov 20, 2024
1 parent 23f454f commit 55c020e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Mathlib/Order/WithBot.lean
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ theorem eq_unbot_iff {a : α} {b : WithBot α} (h : b ≠ ⊥) :
· simpa using h rfl
· simp

/-- The equivalence between the non-bottom elements of `WithBot α` and `α`. -/
@[simps] def _root_.Equiv.withBotSubtypeNe : {y : WithBot α // y ≠ ⊥} ≃ α where
toFun := fun ⟨x,h⟩ => WithBot.unbot x h
invFun x := ⟨x, WithBot.coe_ne_bot⟩
left_inv _ := by simp
right_inv _ := by simp

section LE

variable [LE α]
Expand Down Expand Up @@ -729,6 +736,13 @@ theorem eq_untop_iff {a : α} {b : WithTop α} (h : b ≠ ⊤) :
a = b.untop h ↔ a = b :=
WithBot.eq_unbot_iff (α := αᵒᵈ) h

/-- The equivalence between the non-top elements of `WithTop α` and `α`. -/
@[simps] def _root_.Equiv.withTopSubtypeNe : {y : WithTop α // y ≠ ⊤} ≃ α where
toFun := fun ⟨x,h⟩ => WithTop.untop x h
invFun x := ⟨x, WithTop.coe_ne_top⟩
left_inv _ := by simp
right_inv _:= by simp

section LE

variable [LE α]
Expand Down

0 comments on commit 55c020e

Please sign in to comment.