Porting notes: additional beta_reduction necessary
grunweg opened this issue · comments
This issue is tracking all porting notes where additional beta_reduction is necessary.
Often, these porting notes take a form like
or
mathlib4/Mathlib/Topology/Gluing.lean
Line 393 in b45f0d8
We might just declare victory on this one: I don't think we're planning to remove the need for these beta_reduce
s, so the porting note is not actionable.
I think it would be good to track down the "structure constructor" occurrence further; it seems that the lack of beta reduction only happens sometimes.
Is there some explanation of what changed here? What was doing a beta reduction before that is no longer done?
Here's one example:
namespace nested
structure Foo where
toFun : Nat → Nat
structure Bar extends Foo where
prop : toFun 0 = 0
def bar : Bar where
toFun x := x
prop :=
-- goal is { toFun := fun x => x }.toFun 0 = 0
sorry
end nested
namespace flat
structure FlatHack
structure Foo extends FlatHack where
toFun : Nat → Nat
structure Bar extends FlatHack, Foo where
prop : toFun 0 = 0
def bar : Bar where
toFun x := x
prop :=
-- goal is (fun x => x) 0 = 0
sorry
end flat
vs the lean3 behavior:
set_option old_structure_cmd true
structure foo :=
(to_fun : nat → nat)
structure bar extends foo :=
(prop : to_fun 0 = 0)
def the_bar : bar :=
{ to_fun := λ x, x,
prop :=
-- goal is 0 = 0
sorry }
(it would be really great if leanprover/lean4#2666 could be ok'd just so we can test this kind of thing without creating FlatHack
every time...)