Lean Kernel Arena (Preview) / corner-cases/vanishing-occurrence

Test "corner-cases/vanishing-occurrence"

Expected: 🤷 either · Size: 7.4 KB · Lines: 110 · lean4export: 3.2.0 · Lean: 4.38.0-nightly-2026-12-03 · 📄 Declaration · 🔗 Source

Two inductive types whose constructor field mentions the type being declared only inside a beta-redex that weak head normalisation removes:

| node : (fun _ : Type => Nat) VanishPos → VanishPos
| node : (fun _ : Type => Nat) (VanishNeg → Nat) → VanishNeg

A checker that puts a constructor field in weak head normal form before looking for occurrences finds Nat and accepts both (the tutorial's reduceCtorParam shows the same reduction keeping an occurrence). Weak head normalisation does not reduce below the head: when the vanishing occurrence sits in the domain of an arrow inside the field, as in corner-cases/positivity-whnf or the tutorial's indNegReducible, such a checker rejects. The isRec flag in the export, on the other hand, comes from a syntactic search, so the export says isRec = true for both types although the only occurrence is reduced away before the positivity check. A checker that looks for occurrences before reducing, or recomputes isRec after reducing, rejects these two; that is a reasonable reading of a rule that is not applied uniformly here (see the discussion at Lean Kernel Arena PR #181). The elaborator never writes such a field.

Checker Result ⏱️ 🧠
gruszka 👍 1.85 ms 76.2 MB
nano-lean 👍 0.540 ms 21.7 MB
pestka 👍 2.13 ms 14.6 MB
con-leche 👍 4.14 ms 23.2 MB
con-ron 👍 28.5 ms 41.5 MB
nucleus 🚫 24.8 ms 13.8 MB
official 👍 42.4 ms 112.6 MB