1

Having recently learnt how to drop an unwanted premise in an apply-style proof, I now wonder how to drop an unneeded variable. That is, suppose I have the goal

1. !!x y z. A ⟹ B ⟹ C

where y does not appear in A, B or C. How can I transform it to the following?

1. !!x z. A ⟹ B ⟹ C
Community
  • 1
  • 1
John Wickerson
  • 1,204
  • 12
  • 23

2 Answers2

3

triv_forall_equality is indeed the Pure rule to strip redundant parameters. There is also prune_params_tac to do that as ML tactic, it operates on all subgoals. Note that the latter is not exposed as Isar proof method, since it is hardly ever required in practice: tools like simp and auto already include it by default.

Note that the approach via (simp only: triv_forall_equality) works in many situations, but there is also a snag: the only modifier in Isabelle/HOL does a bit more than "only" using the given simp rules. It includes things like arithmetic solvers, which might cause surprise or confusion some situations.

To imitate prune_params_tac precisely within the Isar method language, you could use (unfold triv_forall_equality) although there is a tiny conceptual snag: its use of arbitrary rewriting instead of just infolding equations c = t is just a historical accident.

Makarius
  • 2,165
  • 18
  • 20
2

A simple:

apply simp

will do the trick. If you don't want to perform any other transformations on the goal state, you can try:

apply (simp only: triv_forall_equality)

which will remove the unnecessary meta-quantifiers, but otherwise not modify the goal state.

davidg
  • 5,868
  • 2
  • 33
  • 51