Stream: Beginner Questions

Topic: Postpone Goals


view this post on Zulip Jakob Schulz (Jan 16 2023 at 15:13):

Hi :) I am currently doing proofs in which similar goals are generated multiple times. As a simplified example, let's say I have the following code:

context cring begin

definition inc where
"inc x โ‰ก x โŠ• ๐Ÿญ"

lemma inc_closed[simp]: "x โˆˆ carrier R โŸน inc x โˆˆ carrier R"
  unfolding inc_def by simp

lemma
  assumes "x โˆˆ carrier R"
  shows "x โŠ— (inc (inc x)) โˆˆ carrier R"
  apply (intro m_closed)

Then, the application of introleaves these two subgoals:

goal (2 subgoals):
 1. x โˆˆ carrier R
 2. inc (inc x) โˆˆ carrier R

I could now prove the first subgoal by writing using assms apply simpdirectly, but if I would start proving the second subgoal by apply (intro inc_closed), this would generate exactly the same as the first subgoal. So, is there a way to postpone the first subgoal, so that I can simplify the second subgoal first and then solve the remaining equal goals at once?

view this post on Zulip Lukas Stevens (Jan 16 2023 at 15:37):

You can use defer but that is not good style.

view this post on Zulip Lukas Stevens (Jan 16 2023 at 15:39):

I think apply(intro m_closed; (intro inc_closed)?) should work


Last updated: Dec 21 2024 at 16:20 UTC