Zulip Chat Archive
Stream: new members
Topic: Introduction: Cormac Deignan
Cormac Deignan (Mar 16 2022 at 12:47):
Hello everyone, hope all is well. I'm a maths student interested in Lean, but am still only a learner. Not sure if this is the right place for it, but I'm stuck on this problem:
example (x n : ℕ) : 1 + x ^ n = (1 - (x^n)^2) / (1 - x ^ n) :=
begin
sorry,
end
I tried ring_exp, but no luck. I know this is probably a trivial question, (or already explained somewhere here), so thanks in advance for any help.
Adam Topaz (Mar 16 2022 at 12:52):
This is false:
import tactic.slim_check
example (x n : ℕ) : 1 + x ^ n = (1 - (x^n)^2) / (1 - x ^ n) :=
by slim_check
Adam Topaz (Mar 16 2022 at 12:53):
The issue is that subtraction and division for natural numbers don't behave as mathematicians usually expect.
Johan Commelin (Mar 16 2022 at 12:58):
The solution is to prove
example (x n : ℕ) : (1 + x ^ n : ℚ) = (1 - (x^n)^2) / (1 - x ^ n) :=
begin
sorry,
end
Johan Commelin (Mar 16 2022 at 13:00):
Note that this is still false for x ^ n = 1
, since you'll be dividing by 0
.
Adam Topaz (Mar 16 2022 at 13:06):
Here's a proof with the additional assumption that :
import data.rat.basic
import tactic.field_simp
import tactic.ring
example (x n : ℕ) (h : x^n ≠ 1): (1 + x ^ n : ℚ) = (1 - (x^n)^2) / (1 - x ^ n) :=
begin
have : (1 - x^n : ℚ) ≠ 0,
{ contrapose h,
simp only [not_not] at h ⊢,
rw sub_eq_zero at h,
exact_mod_cast h.symm },
field_simp,
ring,
end
Ruben Van de Velde (Mar 16 2022 at 13:09):
{ contrapose h,
simp only [not_not] at h ⊢,
can probably be
{ contrapose! h,
Adam Topaz (Mar 16 2022 at 13:10):
Yeah, I always forget contrapose!
exists ;)
Yaël Dillies (Mar 16 2022 at 13:14):
Why not just intro h
?
Adam Topaz (Mar 16 2022 at 13:14):
sure, you can intro c, apply h
, but I think the word "contrapose" hits closer to home for most mathematicians....
Last updated: Dec 20 2023 at 11:08 UTC