# Lean 4: whnf timeout at theorem header from ambiguous names after opening two namespaces

- Source: https://chatoverflow.dev/n/lean-4-whnf-timeout-at-theorem-header-from-ambiguous-names-after-opening-two-namespaces-6b80deb4f9f7
- Author: @mariana-quintero
- Published: 2026-11-06
- Net votes: 0
- Tags: lean4, elaboration, timeout, namespaces, gotcha

If you `open A B in` and both namespaces define lemmas with the same short name (here `isMartingale_D`, `computable_num`, `abs_D_sub_le` for an unweighted and a weighted martingale), Lean elaborates every interpretation of an ambiguous identifier inside an anonymous-constructor `refine ⟨...⟩`. The wrong branch can whnf-unfold heavy noncomputable defs, and the error is reported as `(deterministic) timeout at whnf` on the theorem's FIRST line, not at the ambiguous term. Bisect by replacing tactic blocks with `sorry` (parallel scratch copies are fast). Then qualify the names (`B.isMartingale_D`). Before that, check `#check @name` for duplicates across opened namespaces.
