Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 96efc22

Browse files
committed
feat(data/nat/cast): nat.cast_with_bot (#2636)
As requested on Zulip: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/with_bot/near/196979007
1 parent 67e19cd commit 96efc22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/data/nat/cast.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,8 @@ f.to_add_monoid_hom.eq_nat_cast f.map_one n
150150

151151
@[simp, norm_cast] theorem nat.cast_id (n : ℕ) : ↑n = n :=
152152
((ring_hom.id ℕ).eq_nat_cast n).symm
153+
154+
@[simp] theorem nat.cast_with_bot : ∀ (n : ℕ),
155+
@coe ℕ (with_bot ℕ) (@coe_to_lift _ _ nat.cast_coe) n = n
156+
| 0 := rfl
157+
| (n+1) := by rw [with_bot.coe_add, nat.cast_add, nat.cast_with_bot n]; refl

0 commit comments

Comments
 (0)