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
{{ message }}
Repository navigation
DefEq transitivity failures for unit-like eta #2258
Reduced the issue to a self-contained, reproducible test case.
Description
The criteria for isDefEqUnitLike is not strong enough, and leads to failures of transitivity of the definitional equality:
Steps to Reproduce
example (p : α → Unit) : p = λ _ => () := rfl --worksexample (q : α → Unit) : (λ _ => ()) = p := rfl --worksexample (p q : α → Unit) : p = q := rfl --failsstructureFoowherefoo : Unit
example (p : Foo) : p = ⟨()⟩ := rfl --worksexample (q : Foo) : ⟨()⟩ = q := rfl --worksexample (p q : Foo) : p = q := rfl --failsstructureBar : Type where
bar : True
example (p : Bar) : p = ⟨.intro⟩ := rfl --worksexample (q : Bar) : ⟨.intro⟩ = q := rfl --worksexample (p q : Bar) : p = q := rfl --fails
Expected behavior: All these examples should work
Actual behavior: some fail
Reproduces how often: 100%
Versions
4.0.0-nightly-2023-06-01
Additional Information
Agda supports eta-for-unit defeq, and uses a type-based approach similar to lean's for its record types and arrow types. Currently in lean, unit-like types are inductive types with one constructor and no fields in said constructor. The fix would be to extend this criteria such that any arrow type whose codomain is unit-like is itself unit-like, and any structure-like inductive for which all fields are unit-like is itself unit-like.
Reacted by Bhavik Mehta, jthulhu, Daniel Weber and Kadanstsev Georgii
I've taken the liberty of making a fix for this issue on a fork, by extending the criteria for which a type may be considered unit-like. Would a PR for this be welcomed ?
Activity
feat : extend unit-like criteria for eta
feat : extend unit-like criteria for eta
feat : extend unit-like criteria for eta
feat : extend unit-like criteria for eta
arthur-adjedj commentedon Jul 17, 2023
I've taken the liberty of making a fix for this issue on a fork, by extending the criteria for which a type may be considered unit-like. Would a PR for this be welcomed ?
feat : extend unit-like criteria for eta
feat: change `structure` command to elaborate fields as if structures…
feat: change `structure` command to elaborate fields as if structures…
[-]DefEq transitivity failures for eta[/-][+]DefEq transitivity failures for unit-like eta[/+]Add corner cases for the planned eta changes to the official kernel (#…
feat: extend unit-like criteria for eta (leanprover#15372)