lean4-htt/tests/lean/ppMotives.lean.expected.out
Leonardo de Moura 10a56bf4a1 fix: fixes #1571
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
2022-09-15 11:16:16 -07:00

30 lines
1.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

protected def Nat.add : Nat → Nat → Nat :=
fun x x_1 =>
Nat.brecOn x_1
(fun x f x_2 =>
(match x_2, x with
| a, Nat.zero => fun x => a
| a, Nat.succ b => fun x => Nat.succ (PProd.fst x.fst a))
f)
x
protected def Nat.add : Nat → Nat → Nat :=
fun x x_1 =>
Nat.brecOn (motive := fun x => Nat → Nat) x_1
(fun x f x_2 =>
(match (motive := Nat → (x : Nat) → Nat.below (motive := fun x => Nat → Nat) x → Nat) x_2, x with
| a, Nat.zero => fun x => a
| a, Nat.succ b => fun x => Nat.succ (PProd.fst x.fst a))
f)
x
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), HEq (cast h a) a :=
fun x x_1 x_2 x_3 =>
match x, x_1, x_2, x_3 with
| α, .(α), Eq.refl α, a => HEq.refl a
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), HEq (cast h a) a :=
fun x x_1 x_2 x_3 =>
match (motive := ∀ (x x_4 : Sort u) (x_5 : x = x_4) (x_6 : x), HEq (cast x_5 x_6) x_6) x, x_1, x_2, x_3 with
| α, .(α), Eq.refl α, a => HEq.refl a
def fact : Nat → Nat :=
fun n => Nat.recOn n 1 fun n acc => (n + 1) * acc
def fact : Nat → Nat :=
fun n => Nat.recOn (motive := fun x => Nat) n 1 fun n acc => (n + 1) * acc