Zulip Chat Archive

Stream: mathlib4

Topic: problem with change


Patrick Massot (Oct 16 2022 at 19:41):

Is the change tactic meant to work in mathlib4? It doesn't seem to like

import Mathlib.Tactic.Basic
open Prod

theorem lex_def (r : α  α  Prop) (s : β  β  Prop) {p q : α × β} :
    Prod.Lex r s p q  r p.1 q.1  p.1 = q.1  s p.2 q.2 :=
  fun h => by cases h <;> simp [*], fun h =>
    match p, q, h with
    | (a, b), (c, d), Or.inl h => Lex.left _ _ h
    | (a, b), (c, d), Or.inr e, h => by
      change a = c at e
      subst e <;> exact lex.right _ h

By the way, trying to jump to definition on change jumps, to the definition of Iff...

Mario Carneiro (Oct 16 2022 at 20:26):

change is just show now

Patrick Massot (Oct 17 2022 at 07:08):

Then someone should tell mathport about it.

Mario Carneiro (Oct 17 2022 at 07:26):

change e defined in Mathlib.Tactic.Basic as an alias for show e, but the at form and change .. with .. are both defined without implementation in lean 4 core. These are just missing an implementation (and they should either be PR'd to lean 4 or moved to mathlib4).

Patrick Massot (Oct 17 2022 at 18:19):

Switching from change to show doesn't fix anything

Patrick Massot (Oct 17 2022 at 18:20):

It only makes a new weird error message: expected '⟩'

Patrick Massot (Oct 17 2022 at 18:20):

And trying to jump to the definition of show still jumps to the definition of Iff

Mario Carneiro (Oct 17 2022 at 18:22):

that is, change e at h does not exist currently

Patrick Massot (Oct 17 2022 at 18:23):

Oh, I thought you meant we need show e at h

Patrick Massot (Oct 17 2022 at 18:23):

What is the workaround then?

Mario Carneiro (Oct 17 2022 at 18:23):

(it should really be on the tactic porting list, I think it was missed because it is one of the few tactics that has syntax but no elab in lean 4 core)

Mario Carneiro (Oct 17 2022 at 18:24):

no workaround other than revert/intro

Mario Carneiro (Oct 17 2022 at 18:24):

or rw

Mario Carneiro (Oct 17 2022 at 18:24):

or have I guess for the change e at h case

Patrick Massot (Oct 17 2022 at 18:26):

Ok thanks. I guess this gives us a rather urgent tactic porting target.

Ruben Van de Velde (Oct 17 2022 at 18:30):

replace h : _ := h, if that exists already?

Mario Carneiro (Oct 17 2022 at 18:30):

it does exist

Mario Carneiro (Oct 17 2022 at 18:31):

reported as lean4#1745, I'll work on it


Last updated: Dec 20 2023 at 11:08 UTC