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
8 lines
342 B
Text
8 lines
342 B
Text
∀ (p p_1 : Prop),
|
|
p = p_1 →
|
|
∀ {inst : Decidable p} {inst_1 : Decidable p_1} (a a_1 : Nat) (e_3 : a = a_1) (h : a > 0),
|
|
g p a h = g p_1 a_1 (_ : a_1 > 0)
|
|
∀ (p p_1 : Prop),
|
|
p = p_1 →
|
|
∀ {inst : Decidable p} [inst_1 : Decidable p_1] (a a_1 : Nat) (e_3 : a = a_1) (h : a > 0),
|
|
g p a h = g p_1 a_1 (_ : a_1 > 0)
|