Zulip Chat Archive
Stream: new members
Topic: Evaluating Polynomial Z on real number
Alex Gu (Apr 04 2025 at 00:17):
How can I evaluate a polynomial with integer coefficients on a real number? I tried something like this, but it doesn't work. Also, not sure how to quickly find answers to these simple questions, any advice on more efficiently searching for things (rather than posting every time) would be helpful too!
theorem common_roots {P : Polynomial ℤ} :
∀ (x : ℝ), P.eval x = 0 → P.eval 0 = 0 := by sorry
Aaron Liu (Apr 04 2025 at 00:19):
Try using docs#Polynomial.map over docs#Int.castRingHom first before evaluating it.
Aaron Liu (Apr 04 2025 at 00:21):
As for searching things, I use loogle, moogle, leansearch, and the docs page.
Alex Gu (Apr 04 2025 at 00:22):
So like this?
theorem common_roots {P : Polynomial ℤ} :
∀ (x : ℝ), (P.map (Int.castRingHom ℝ)).eval x = 0 → (P.map (Int.castRingHom ℝ)).eval 0 = 0
Aaron Liu (Apr 04 2025 at 00:23):
P.eval 0
can also stay as-is
Aaron Liu (Apr 04 2025 at 00:25):
You can also use docs#Polynomial.eval₂
Eric Wieser (Apr 04 2025 at 01:10):
Or aeval
Last updated: May 02 2025 at 03:31 UTC