Zulip Chat Archive

Stream: Is there code for X?

Topic: Clear true tactic


Bolton Bailey (Jul 13 2021 at 22:09):

Is there a tactic that will clear all true statements from the local context? This would be useful for me in dealing with a large number of automatically generated equations, many of which simplify to true.

Kevin Buzzard (Jul 13 2021 at 22:10):

As far as I know we don't, although this strikes me as being an even easier tactic to write for a beginner than the "hello world" tactic, namely assumption.

Yaël Dillies (Jul 14 2021 at 05:41):

Isn't it exactly what clear does?

Yaël Dillies (Jul 14 2021 at 05:42):

Or are you saying that you want to simplify hypothesis that aren't true but equal to true? That seems a bit harder.

Mario Carneiro (Jul 14 2021 at 06:06):

I think the task is to automatically find the list of hypotheses to clear based on the type. clear takes a list of hypotheses, not a type

Yaël Dillies (Jul 14 2021 at 07:09):

Ah maybe that's the job of the hypothetical clear!

Alex J. Best (Jul 14 2021 at 11:10):

@Bolton Bailey does using tactic#cases_matching suit your purpose?

import tactic

example (h h' : true) : false :=
begin
  cases_matching* true,
end

Eric Wieser (Jul 14 2021 at 11:31):

docs#tactic.interactive.cases_matching?

Alex J. Best (Jul 14 2021 at 11:32):

Thanks! I guess tactic#cases_type is even better actually


Last updated: Dec 20 2023 at 11:08 UTC