Zulip Chat Archive

Stream: mathlib4

Topic: simp on Compares downstream effects


Yakov Pechersky (Nov 18 2022 at 02:41):

In mathlib4#569, the simp linter complains (https://github.com/leanprover-community/mathlib4/actions/runs/3493270005/jobs/5847924039) because the Compare definition simplifies on the LHS, thus toDual_compares_toDual : Compares o (toDual a) (toDual b) ↔ Compares o b a simplifies partially. Apparently, this is not an issue for the mathlib3 simp linter. Should we untag Compares with [simp]?

Mario Carneiro (Nov 18 2022 at 02:58):

this is another lean 4 change: nonrecursive definitions marked as @[simp] and defined by the equation compiler eagerly unfold (into a match expression), which is usually undesirable and not what lean 3 simp did

Mario Carneiro (Nov 18 2022 at 02:58):

(this should be mentioned on the wiki and/or fixed in core)

Mario Carneiro (Nov 18 2022 at 02:59):

the fix is to not mark it as simp and instead mark the equations (e.g. compares_lt, compares_eq, ..) as simp

Adam Topaz (Nov 18 2022 at 03:12):

Can simps be modified so that a @[simps] on such a definition would mark the equations with simp?


Last updated: Dec 20 2023 at 11:08 UTC