leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.75k stars 428 forks source link

`reduce` does not recurse into binder types #6084

Open JLimperg opened 2 weeks ago

JLimperg commented 2 weeks ago

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

reduce does not recurse into binder types, even with skipTypes := false. As a result, the expression computed by reduce is not the input expression's normal form (at the given transparency).

MWE:

import Lean

open Lean Lean.Meta

def Foo := True

def Bar := Foo → Foo

run_meta do
  logInfo $ ← reduceAll (.const ``Bar [])
  -- Foo → True

Versions

"4.15.0-nightly-2024-11-14"

Impact

Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.