The previous implementation was using the following heuristic
```lean
-- heuristic: use non-dependent arrows only if possible for whole group to avoid
-- noisy mix like `(α : Type) → Type → (γ : Type) → ...`.
let dependent := curNames.any fun n => hasIdent n.getId stxBody
```
The result produced by this heuristic was **not** producing an
accidental name capture, but I agree
it was confusing to have `∀ (a : True), ∃ a, a = a : Prop` instead of
`True → ∃ a, a = a : Prop` since there is no dependency.
AFAICT, all examples affected by this commit have a better output now.
cc @digma0 @kha
5 lines
139 B
Text
5 lines
139 B
Text
#check True → (∃ a : Nat, a = a)
|
|
-- True → ∃ a, a = a : Prop
|
|
|
|
#check True → (∃ b : Nat, b = b)
|
|
-- True → ∃ b, b = b : Prop
|