Zulip Chat Archive

Stream: new members

Topic: Why doesn't this get reduced?


Etienne Marion (Nov 05 2025 at 20:35):

Why is the following expression not reduced?

#reduce (fun (f : Nat  Nat)   (n : Nat), f n = f (n + 1)) Nat.succ

It appears in Metaprogramming in Lean 4 But there it says it should reduce to

 (n : Nat), Nat.succ n = Nat.succ (Nat.succ n)

which it doesn't.

Aaron Liu (Nov 05 2025 at 20:35):

I think you have to #reduce (types := true)

Etienne Marion (Nov 05 2025 at 20:36):

Indeed that works, but why?

Aaron Liu (Nov 05 2025 at 20:37):

because (fun (f : Nat → Nat) ↦ ∀ (n : Nat), f n = f (n + 1)) Nat.succ is a type?

Etienne Marion (Nov 05 2025 at 20:38):

Obviously :man_facepalming: thanks!


Last updated: Dec 20 2025 at 21:32 UTC