dummy declaration used as target of squeeze_loc attribute
Equations
squeeze_simp, squeeze_simpa and squeeze_dsimp perform the same
task with the difference that squeeze_simp relates to simp while
squeeze_simpa relates to simpa and squeeze_dsimp relates to
dsimp. The following applies to squeeze_simp, squeeze_simpa and
squeeze_dsimp.
squeeze_simp behaves like simp (including all its arguments)
and prints a simp only invocation to skip the search through the
simp lemma list.
For instance, the following is easily solved with simp:
example : 0 + 1 = 1 + 0 := by simp
To guide the proof search and speed it up, we may replace simp
with squeeze_simp:
example : 0 + 1 = 1 + 0 := by squeeze_simp
-- prints:
-- Try this: simp only [add_zero, eq_self_iff_true, zero_add]
squeeze_simp suggests a replacement which we can use instead of
squeeze_simp.
example : 0 + 1 = 1 + 0 := by simp only [add_zero, eq_self_iff_true, zero_add]
squeeze_simp only prints nothing as it already skips the simp list.
This tactic is useful for speeding up the compilation of a complete file. Steps:
- search and replace
simpwithsqueeze_simp(the space helps avoid the replacement ofsimpin@[simp]) throughout the file. - Starting at the beginning of the file, go to each printout in turn, copy
the suggestion in place of
squeeze_simp. - after all the suggestions were applied, search and replace
squeeze_simpwithsimpto remove the occurrences ofsqueeze_simpthat did not produce a suggestion.
Known limitation(s):
- in cases where
squeeze_simpis used after a;(e.g.cases x; squeeze_simp),squeeze_simpwill produce as many suggestions as the number of goals it is applied to. It is likely that none of the suggestion is a good replacement but they can all be combined by concatenating their list of lemmas.squeeze_scopecan be used to combine the suggestions:by squeeze_scope { cases x; squeeze_simp } - sometimes,
simplemmas are also_refl_lemmaand they can be used without appearing in the resulting proof.squeeze_simpwon't know to try that lemma unless it is called assqueeze_simp?