Zulip Chat Archive

Stream: general

Topic: battling with large pp.all terms


Kevin Buzzard (Apr 21 2019 at 04:36):

Is it possible to have some sort of tool where large pp.all terms can be folded up in manageable ways -- I am looking at a term that starts @eq alpha (XXXXXXXXXXXXXXXX...) (YYYYYYYYYYYYYYYYYYY.....) and I would like to see the head term of YYYYY... but it's hard to find in the pp.all output.

Simon Hudon (Apr 21 2019 at 04:39):

Have you tried other pp options?

Mario Carneiro (Apr 21 2019 at 04:39):

I would get the expr out with tactics

Mario Carneiro (Apr 21 2019 at 04:41):

set_option pp.all true
open tactic
example (fooooooo barrrrrrrrr : ) : fooooooo = barrrrrrrrr :=
by do `(%%_ = %%e)  target,
  pp e >>= trace

Kevin Buzzard (Apr 21 2019 at 04:42):

convert rfl is not safe to use! You don't want to try proving mul_comm with it.

example (X : Type) [comm_group X] (a b  : X) : a * b = b * a :=
begin intros,
convert rfl, -- ⊢ b = a
  repeat {sorry},
end

I would like to be able to do some more delicate analysis

Mario Carneiro (Apr 21 2019 at 04:43):

there is a :1 argument for convert I think

Mario Carneiro (Apr 21 2019 at 04:44):

convert rfl using 0

Mario Carneiro (Apr 21 2019 at 04:47):

hm, congr' 0 fails because it makes no progress. I think convert needs to be fixed to reflect that

Mario Carneiro (Apr 21 2019 at 04:48):

oh but in your case it's fine because you want congr' 1 anyway

Mario Carneiro (Apr 21 2019 at 04:49):

example (X : Type) [comm_group X] (a b  : X) : a * b = b * a :=
begin intros,
  convert rfl using 1, -- ⊢ b * a = a * b
  repeat {sorry},
end

Mario Carneiro (Apr 21 2019 at 04:49):

that said, convert rfl looks pretty useless

Kevin Buzzard (Apr 21 2019 at 04:51):

convert rfl` is really good when you have two terms which are defeq up to subsingleton typeclass inference equality issues

Mario Carneiro (Apr 21 2019 at 04:51):

isn't that just congr'?

Kevin Buzzard (Apr 21 2019 at 04:51):

This happened to me a fair bit when I was doing sheaves.

Kevin Buzzard (Apr 21 2019 at 04:52):

Maybe; I don't know the difference between congr and congr', I don't really understand them properly.

Mario Carneiro (Apr 21 2019 at 04:52):

congr' is congr with bugfixes

Mario Carneiro (Apr 21 2019 at 04:52):

and a depth limiter

Kevin Buzzard (Apr 21 2019 at 05:02):

I've never used it without 1

Jesse Michael Han (Apr 21 2019 at 16:14):

i also thought convert rfl using k is equivalent to congr' k


Last updated: Dec 20 2023 at 11:08 UTC