Zulip Chat Archive
Stream: new members
Topic: smul casting
Jalex Stark (Jun 09 2020 at 09:27):
I think the following is true and should follow easily from the library but I don't yet have a clue about the proof:
example (d : ℕ) : (d : ℤ) = d • (1 : ℤ) := sorry
Jalex Stark (Jun 09 2020 at 09:31):
here's an induction proof
local attribute [simp]
lemma nat.smul_one (d : ℕ) : d • (1 : ℤ) = (d : ℤ) :=
begin
induction d with k hk, simp,
rw nat.succ_eq_add_one, push_cast,
rw ← hk, rw add_smul, simp,
end
Jalex Stark (Jun 09 2020 at 09:36):
this feels like a simp lemma? \Z
should generalize to an arbitrary ring?
Kevin Buzzard (Jun 09 2020 at 09:40):
Yeah maybe there should be some smul_one
simp lemma in some generality.
Jalex Stark (Jun 09 2020 at 09:44):
I'll take that as evidence that using local attribute [simp] in my local project is not a terrible choice
Jalex Stark (Jun 09 2020 at 09:46):
oh my proof already works for generalizing integers to rings
Jalex Stark (Jun 09 2020 at 09:46):
local attribute [simp]
lemma nat.smul_one (d : ℕ) (R : Type*) [ring R] : d • (1 : R) = (d : R) :=
begin
induction d with k hk, simp,
rw nat.succ_eq_add_one, push_cast,
rw ← hk, rw add_smul, simp,
end
Kevin Buzzard (Jun 09 2020 at 09:47):
There was some change recently about some other smul involving naturals, I guess someone who understands that will know whether this affects what's going on here
Last updated: Dec 20 2023 at 11:08 UTC