You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.
Description
During iota-reduction, terms of structures that live in Prop do not get eta-expanded. This was introduced in #1033 in order to avoid constructing primitive projections for terms that shouldn't have them (i.e existentials). However, the criteria applied is too strong, and blocks the reduction of subsingletons that could get eta-expanded otherwise. This, among other things, break both the transitivity and congruence of definitional equality.
Context
This issue has been reported by a few different users on Zulip: here, here and here
Steps to Reproduce
variable (P Q : Prop) (A : Type) (f : P → Q → A) (x : P ∧ Q)
example : And.rec f ⟨x.1,x.2⟩ = f (And.left x) (And.right x) := rfl --worksexample : (And.rec f ⟨x.1,x.2⟩ : A) = And.rec f x := rfl --fails
Expected behavior: both examples work
Actual behavior: The first one works, the second fails.
Reacted by Slavomir Kaslev, Pietro Monticone, felko, Shad Amethyst, Xavier Roblot, Brendan Seamas Murphy, Kadanstsev Georgii, Bhavik Mehta, Aaron Liu, Fernando Chu and 3 more
Activity
b-mehta commentedon Mar 11, 2025
I just came across this too, in an example which more clearly (to me at least) shows why this breaks transitivity of defeq:
Add corner cases for the planned eta changes to the official kernel (#…
feat: eta-expand recursor major for subsingleton structures (leanprov…