Zulip Chat Archive

Stream: new members

Topic: unable to rw


Damiano Testa (Oct 09 2020 at 07:41):

Dear All,

I am trying to prove the lemma below, but I cannot get rw, simp_rw and conv to do what I would expect them to. What am I doing wrong?

Thank you very much!

import data.polynomial.degree.basic

open polynomial

lemma fac {R : Type*} [integral_domain R] {n : } {f g : polynomial R} {h : X^n = f*g} : (X ^ n).coeff (f.nat_degree+g.nat_degree)  0 :=
begin
--  simp_rw h, --simplify tactic failed to simplify
  conv_lhs {congr,rw h,}, --rewrite tactic failed, did not find instance of the pattern in the target expression
--  X ^ n
end

Kevin Buzzard (Oct 09 2020 at 07:44):

If you just click on the X^n's in the infoview you'll see that one is in R[X] and the other is in N[X] so they don't unify

Damiano Testa (Oct 09 2020 at 07:44):

Aaaahh!!! Thanks!!

Kevin Buzzard (Oct 09 2020 at 07:45):

even better, you can click on the X's

Damiano Testa (Oct 09 2020 at 07:47):

Indeed! I had clicked on X^n and failed to spot the difference... Thank you very much!

Damiano Testa (Oct 09 2020 at 07:49):

For the record, below is the statement that has a chance of being true!

lemma fac {R : Type*} [integral_domain R] {n : } {f g : polynomial R} {h : X^n = f*g} : ((X:polynomial R) ^ n).coeff (f.nat_degree+g.nat_degree)  0 :=
begin
  rw h,
  sorry,
end

Last updated: Dec 20 2023 at 11:08 UTC