Universally quantified variables are the same as free variables in the following two lemmas from the Isabelle (2021) tutorial section 8.1.2 (with slight changes on the second one):
Given
primrec swap::"'a × 'a ⇒ 'a × 'a" where "swap (x, y) = (y, x)"
the lemma:
lemma "swap (swap p) = p"
is equivalent to:
lemma "⋀ p. swap (swap p) = p"
However, certain tactics/rules (such as apply (simp only:split_paired_all)
used in that section) only work on a goal if it's stated with universal quantification using \<And>
(and not in the free form).
My question is:
Is there an idiomatic way to convert the first goal to the second goal during a proof, and vice versa from lemma 2 to lemma 1?
That is, while proving lemma 1, is it possible to convert the subgoal to the quantified form of lemma 2, and then use whatever methods that work for lemma 2 to prove lemma 1 (and vice versa)?
(I originally posted this question in SO, but didn't get a definitive answer. So I am deleting the question there and posting it here for more attention.)