Zulip Chat Archive

Stream: mathlib4

Topic: mathlib4#560


Ruben Van de Velde (Nov 17 2022 at 23:09):

mathlib4#560 could use help from someone who knows how decreasing_by works

Jireh Loreaux (Nov 17 2022 at 23:26):

Haven't looked at the PR but you should just need to provide a proof that the recursive argument is smaller than the input.

Mario Carneiro (Nov 17 2022 at 23:38):

This is the definition:

theorem WellFounded.asymmetric {α : Sort _} {r : α  α  Prop} (h : WellFounded r) :
     a b⦄, r a b  ¬r b a
  | a => fun b hab hba => asymmetric h hba hab
termination_by _ => h
decreasing_by {
  sorry
}

this is not a recursive definition, it is a name resolution issue. (We need to document this on the port wiki page.)

Mario Carneiro (Nov 17 2022 at 23:39):

you need to use an appropriately qualified version of asymmetric here; lean 3 would resolve this without WellFounded.asymmetric in scope but lean 4 will think you are calling yourself here

Scott Morrison (Nov 17 2022 at 23:43):

Over in mathlib3 we have

theorem well_founded.asymmetric {α : Sort*} {r : α  α  Prop} (h : well_founded r) :
   a b⦄, r a b  ¬ r b a
| a := λ b hab hba, well_founded.asymmetric hba hab
using_well_founded { rel_tac := λ _ _, `[exact _, h⟩],
                     dec_tac := tactic.assumption }

Mario Carneiro (Nov 17 2022 at 23:49):

oh, I stand corrected

Mario Carneiro (Nov 17 2022 at 23:49):

I don't even know what mathport does with using_well_founded clauses

Mario Carneiro (Nov 17 2022 at 23:52):

the answer is: nothing at all, it completely forgot those existed

Scott Morrison (Nov 17 2022 at 23:55):

Something is weird, here, however.

Scott Morrison (Nov 17 2022 at 23:55):

You can replace the sorry above with change (0 : ℕ) < 0, so it's not going to be provable as written.

Mario Carneiro (Nov 17 2022 at 23:59):

the termination_by is incorrect and was not added by mathport

Mario Carneiro (Nov 18 2022 at 00:00):

oof, there is a bug in lean 3 causing using_well_founded clauses not to be exported at all, so we'll need to cut a new release

Yakov Pechersky (Nov 18 2022 at 00:05):

The termination_by is my attempt to approximate the rel_tac in mathlib3, not knowing what I am doing!

Scott Morrison (Nov 18 2022 at 00:36):

I've fixed this now, using an auxiliary definition


Last updated: Dec 20 2023 at 11:08 UTC