Zulip Chat Archive

Stream: new members

Topic: timeout at `whnf`, maximum number of heartbeats


Snir Broshi (Aug 26 2025 at 23:24):

I tried to use docs#minpoly.eq_of_irreducible_of_monic and got a weird error:

import Mathlib.Data.Real.Basic
import Mathlib.FieldTheory.Minpoly.Field

open Polynomial

def h : Polynomial.aeval (0 : ) (X : [X]) = 0 := by simp
def h' := @minpoly.eq_of_irreducible_of_monic   _ _ _ 0 _ X irreducible_X h monic_X

Lean marks an error at the usage of h in h':
(deterministic) timeout at whnf, maximum number of heartbeats (200000) has been reached

I expected the error to be that it can't synthesize Field ℤ (btw i'm not sure why that theorem requires this), what happened?

Thanks!

Ruben Van de Velde (Aug 27 2025 at 07:21):

Yeah, if you start removing arguments from the end, the error changes to "failed to synthesize" as soon as you remove the h

Ruben Van de Velde (Aug 27 2025 at 07:23):

So lean is trying to unify the argument with your h and gets lost. Possibly for the same reason, maybe for another

Damiano Testa (Aug 27 2025 at 07:47):

With respect to the Field assumption, maybe it could be weakened to having no zero-divisors. However, B=Z/pB = \mathbb{Z}/p is an A=Z/p2A = \mathbb{Z}/p^2 algebra, the polynomial xpx-p vanishes on 0 modulo p, and yet xpx-p is not a minimal polynomial of 0 in A.

Damiano Testa (Aug 27 2025 at 07:58):

Actually, the example above may even work with A=ZA = \mathbb{Z}. I wonder if the "correct" assumption is that the algebra map ABA \to B be injective.


Last updated: Dec 20 2025 at 21:32 UTC