6

let's assume I want to show the following lemma

lemma "⟦ A; B; C ⟧ ⟹ D"

I get the goal

1. A ⟹ B ⟹ C ⟹ D

However, I don't need B. How can I transfer my goal to something like

1. A ⟹ C ⟹ D

I don't want to alter the original lemma statement, just the current goal in apply style.

corny
  • 7,824
  • 3
  • 14
  • 20

2 Answers2

6

What you want is apply (thin_tac B). However, the last time I did this, Peter Lammich shouted "Oh god, why are you doing this!" in disgust and rewrote my proof in order to get rid of the thin_tac. So using this tactic doesn't exactly seem to be encouraged anymore.

Manuel Eberl
  • 7,858
  • 15
  • 24
  • 1
    Here is a realistic example that shows what happens when you use `thin_tac` all the time: http://afp.sourceforge.net/entries/Group-Ring-Module.shtml – Makarius Mar 09 '13 at 15:40
  • 3
    Note that you can also use a pattern inside `thin_tac`: for example, `apply (thin_tac "?x ∧ ?y")` would discard the premise `(1 + 1 = 2) ∧ (2 + 2 = 4)`. This can help reduce that amount of typing/duplication in your proof scripts. – davidg Mar 10 '13 at 22:53
5

Normally it is better to avoid unwanted stuff in a goal state, instead of removing it later. The way you formulate a proof problem affects the way you solve it.

This is particularly important for structured proofs: you appeal positively to those facts that should participate in the next step of the proof, instead of suppressing some of them negatively.

E.g. like this:

from `A` and `C` have D ...

Telling which facts are relevant to a proof is already a start for readability.

Following that style, your initial problem will look like this:

lemma
  assumes A and B and C 
  shows D
proof -
  from `A` and `C` show D sorry
qed

or like this with reduced verbosity, if A B C D are large propositions:

lemma
  assumes a: A and b: B and c: C 
  shows D
proof -
  from a c show ?thesis sorry
qed
Makarius
  • 2,165
  • 18
  • 20
  • 1
    Can such "positive appealing" be done in an apply-style script? Initial assumptions can of course be named, but what about intermediate assumptions? – davidg Mar 10 '13 at 22:55
  • 3
    If you insist in one big apply script to make a proof, it is getting difficult. But why do this? You can easily make the outer structure in proper Isar, and degrade towards apply scripts only in leaf positions, if at all. – Makarius Mar 11 '13 at 10:21