I wanted to transform this proof to Isar as ab exercise (for myself to learn Isar) using only basic natural deduction rules (ND) from propositional logic (e.g. notI
, notE
, impI
, impE
... etc).
I can do it in an apply script easily:
lemma very_simple0: "A ⟶ A ∨ B"
apply (rule impI) (* A ⟹ A ∨ B *)
thm disjI1 (* ?P ⟹ ?P ∨ ?Q *)
apply (rule disjI1) (* A ⟹ A *)
by assumption
but my attempts at an Isar proof fail:
lemma very_simple1: "A ⟶ A ∨ B"
proof (* TODO why/how does this introduce A by itself*)
assume A (* probably not neccessary since Isabelle did impI by itself *)
have "A ⟹ A" by disjI1
show "A ⟹ A" by assumption
qed
my main error is:
Undefined method: "disjI1"⌂
which seems mysterious to me because the rules worked just fine in the apply script before.
What am I doing wrong?
Note this also leads to an error:
lemma very_simple2: "A ⟶ A ∨ B"
proof impI
assume A (* probably not neccessary since Isabelle did impI by itself *)
have "A ⟹ A" by disjI1
show "A ⟹ A" by assumption
qed
same error as above:
Undefined method: "impI"⌂
why?
Edit:
I learned that a 'method' still requires the work rule impI
or metis etc
but the script still fails:
lemma very_simple1: "A ⟶ A ∨ B"
proof (rule impI)
assume A (* probably not neccessary since Isabelle did impI by itself *)
have "A ⟹ A" by (rule disjI1)
show "A ⟹ A" by assumption
qed
Edit2:
lemma very_simple1: "A ⟶ A ∨ B"
proof (rule impI)
have 0: "A ⟹ A ∨ B" by (rule disjI1)
have 1: "A ⟹ A" by assumption
from 1 show "True" by assumption
qed
I still can't complete the proof.