Zulip Chat Archive

Stream: mathlib4

Topic: toLex in decreasing_by


Violeta Hernández (Oct 31 2024 at 04:31):

This code snippet is behaving a bit weirdly:

import Mathlib.Order.Synonym

def foo :     
  | 0, _ => 0
  | m + 1, n => foo m n
termination_by m n => toLex (m, n)
decreasing_by sorry

Violeta Hernández (Oct 31 2024 at 04:32):

Putting the cursor right after decreasing_by reveals the goal to be

sizeOf (toLex (m, n)) < sizeOf (toLex (a✝¹, a))

rather than the expected toLex (m, n) < toLex (m + 1, n)

Violeta Hernández (Oct 31 2024 at 04:33):

Is there no WellFoundedRelation instance on Lex (α × β)?

Violeta Hernández (Oct 31 2024 at 04:35):

By the way, I get that in this example I can just use termination_by m n => (m, n) to the same effect, but in my actual use case that doesn't quite work

Violeta Hernández (Oct 31 2024 at 04:38):

Apparently no, there isn't, and yes, adding one fixes the issue


Last updated: May 02 2025 at 03:31 UTC