Test "corner-cases/nested-redex-aux"
Expected: 🤷 either · Size: 43.5 KB · Lines: 755 · lean4export: 3.2.0 · Lean: 4.38.0-nightly-2026-12-03 · 📄 Declaration · 🔗 Source
A nested inductive whose two nested occurrences differ only by a beta-redex:
| a : List ((fun _ : Bool => NestedRedex) true) → NestedRedex
| b : List NestedRedex → NestedRedex
Finding nested occurrences syntactically makes these two auxiliary types, so
the exported NestedRedex.rec has three motives; the theorem reduces a
recursor application that goes through both, and a checker that finds
nested occurrences syntactically accepts it.
A checker that normalises constructor types before it collects nested occurrences merges the two into one auxiliary type, derives a recursor with two motives and rejects the theorem. Whether such a field is a nested occurrence at all is debatable: the elaborator never writes one, and the answer of a syntactic test follows from that test rather than from the type theory (see sokonanoda issue #12).