lean4-htt/tests/lean/etaReducedMvarAssignments.lean
JovanGerb c87205bc9b
fix: eta reduce mvar assignments in isDefEq (#4387)
I made a modification to the `mkLambdaFVars` function, adding a
`etaReduce : Bool` parameter that determines whether a new lambda of the
form `fun x => f x` should be replaced by `f`. I then set this option to
true at `isDefEq` when processing metavariable assignments.

This means that many unnecessary eta unreduced expression are now
reduced. This is beneficial for users, so that they do not have to deal
with such unreduced expressions. It is also beneficial for performance,
leading to a 0.6% improvement in build instructions. Most notably,
`Mathlib.Algebra.DirectLimit`, previously a top 50 slowest file, has
sped up by 40%.

Quite a number of proof in mathlib broke. Many of these involve removing
a now unnecessary `simp only`. In other cases, a simp or rewrite doesn't
work anymore, such as a `simp_rw [mul_comm]` that was used to rewrite
`fun x => 2*x`, but now this term has turned into `HMul.hMul 2`.

Closes #4386
2024-06-18 23:41:40 +00:00

8 lines
276 B
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.

instance Pi.hasLe {ι : Type u} {α : ι → Type v} [∀ i, LE (α i)] :
LE (∀ i, α i) where le x y := ∀ i, x i ≤ y i
variable {ι : Type u} {α : ι → Type v} [inst : (i : ι) → LE (α i)]
set_option trace.Meta.isDefEq.assign true
#check @Pi.hasLe ι _ inst