Hi! I'm using the keyword abbreviation
for some frequently used complex constants in my code, in the hope to improve readability of the code. But the abbreviations are automatically expanded in proof state, making it hard to read. Is there a way to disable the expansion of abbreviations in the proof state? Or, what is the best practice in such case?
I have tried with definition
instead of abbreviation
, and add the definition to the simpset of proof or unfold the definition wherever needed, but I don't think this is the best solution because I would need to do that very frequently, however as I understand, definition
's are not supposed to be unfolded anywhere.
abbreviations are not unfolded. They are folded in during printing. Hence, if they disappear in the output, it means that they could not be folded in
Mathias Fleury said:
abbreviations are not unfolded. They are folded in during printing. Hence, if they disappear in the output, it means that they could not be folded in
Thank you! I wonder why they could not be folded in. I compared the strings printed in the proof state and the abbreviated constant expression itself, they are exactly the same. I have no knowledge how the printing works. Is there anything I can do to make them possible to be folded in during printing?
copy paste the part that you want to be folded A
, put it into a lemma of A = abbreviation
and see if they are really equal. You should find a minor difference (like a typing or something like that)
I tried such lemmas, they can be proven by e.g. blast. And I think I can rule out typos since they always appear as a whole and I always use the abbreviations only.
no no no
the important thing is not that it is proven by blast
the important thing is that the abbreviation get folded in immediatly
and that apply (rule refl)
is able to prove it
You need stuff on the left and the right to be identical
if they are not identical, folding will not work
that includes associativity of operators
Mathias Fleury said:
and that
apply (rule refl)
is able to prove it
Yes, I confirmed that one singleapply (rule refl)
can directly prove it
then it is really strangle that it is not folding
can you show the abbreviation and the term you have?
Sure, and I just realized that the issue won't occur if I define the abbreviation outside of the locale -- is there anything I should know about locale and abbreviation?
image.png
basically, there are issues that can arise with locales and abbreviation (there are more posts on the mailing list, but the archives are gone sadly)
Mathias Fleury said:
basically, there are issues that can arise with locales and abbreviation (there are more posts on the mailing list, but the archives are gone sadly)
I see, thank you very much!
Last updated: Mar 09 2025 at 12:28 UTC