patternMinor
Naming facts exported from blocks in Isabelle/HOL
Viewed 0 times
exportedblocksisabelleholnamingfromfacts
Problem
I'm using Isabelle/HOL. Isabelle exports the last fact in a block, allowing the context that contains the block to use it. Ordinarily when I generate facts, I can give them convenient names. How do I name facts that are exported from blocks?
Simple example:
Right now I use
Simple example:
lemma mylemma: "i=i"
proof -
{
fix j::nat
have "j=j" by auto
}
show ?thesis using ‹⋀j. j = j› by auto
qedRight now I use
‹⋀j. j = j› to refer to the exported fact as a proposition literal. I'd like to be able give it a simple name, though, as when I named the lemma mylemma. Thanks for any suggestions!Solution
From section 1.1.2 in the document isar-ref: you can reference facts via explicit name, implicit name and literal position. In this case, the explicit name has not been provided. I believe that the canonical method to provide an explicit name is to reference the fact of interest by its implicit name immediately after the end of the block. For example,
As a side remark, I would like to mention that general questions about Isabelle or the syntax of Isar are best posed on Stack Overflow. I believe that this would drastically increase the chances of your questions being answered promptly.
lemma mylemma: "i = i"
proof -
{
fix j :: nat
have "j = j" by auto
}
note name = this
show ?thesis using name by auto
qedAs a side remark, I would like to mention that general questions about Isabelle or the syntax of Isar are best posed on Stack Overflow. I believe that this would drastically increase the chances of your questions being answered promptly.
Code Snippets
lemma mylemma: "i = i"
proof -
{
fix j :: nat
have "j = j" by auto
}
note name = this
show ?thesis using name by auto
qedContext
StackExchange Computer Science Q#124936, answer score: 5
Revisions (0)
No revisions yet.