There is the syntax subgoal premises prems
to bind the premises of the subgoal to the name prems
(or any other name – but prems
is a sensible default):
lemma "0 < n ? ((2::nat)^n < 3^n)"
apply(auto)
subgoal premises prems
proof -
thm prems
There is also a method called goal_cases
that automatically gives names to all the current subgoals – I find it very useful. If subgoal premises
did not exist, you could do this instead:
lemma "0 < n ? ((2::nat)^n < 3^n)"
apply(auto)
subgoal
proof goal_cases
case 1
By the way, looking at your example, it is considered a bad idea to do anything after auto
that depends on the exact form of the proof state, such as metis
calls or Isar proofs. auto
is fairly brutal and might behave differently in the next Isabelle release so that such proofs break. I recommend doing a nice structured Isar proof here.
Also note that your theorem is a direct consequence of power_strict_mono
and power_less_imp_less_base
and can be proven in a single line:
lemma "0 < n ? ((2::nat)^n < 3^n)"
by (auto intro: Nat.gr0I power_strict_mono)`
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…