Skip to content

Commit

Permalink
feat(order/bounded_lattice): coe_unbot simp lemma (#9258)
Browse files Browse the repository at this point in the history
  • Loading branch information
semorrison committed Sep 18, 2021
1 parent 811c87a commit 429aaa3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/order/bounded_lattice.lean
Expand Up @@ -504,6 +504,10 @@ def unbot : Π (x : with_bot α), x ≠ ⊥ → α
| ⊥ h := absurd rfl h
| (some x) h := x

@[simp] lemma coe_unbot {α : Type*} (x : with_bot α) (h : x ≠ ⊥) :
(x.unbot h : with_bot α) = x :=
by { cases x, simpa using h, refl, }

@[simp] lemma unbot_coe (x : α) (h : (x : with_bot α) ≠ ⊥ := coe_ne_bot _) :
(x : with_bot α).unbot h = x := rfl

Expand Down Expand Up @@ -728,6 +732,10 @@ option.ne_none_iff_exists
def untop : Π (x : with_top α), x ≠ ⊤ → α :=
with_bot.unbot

@[simp] lemma coe_untop {α : Type*} (x : with_top α) (h : x ≠ ⊤) :
(x.untop h : with_top α) = x :=
by { cases x, simpa using h, refl, }

@[simp] lemma untop_coe (x : α) (h : (x : with_top α) ≠ ⊤ := coe_ne_top) :
(x : with_top α).untop h = x := rfl

Expand Down

0 comments on commit 429aaa3

Please sign in to comment.