Note that there are some explanatory texts on larger screens.

plurals
  1. POIsabelle: Use of the "induct" or "induct_tac" methods
    primarykey
    data
    text
    <p>Let's say I have a lemma about a simple inductively-defined set:</p> <pre><code>inductive_set foo :: "'a ⇒ 'a list set" for x :: 'a where "[] ∈ foo x" | "[x] ∈ foo x" lemma "⋀x y. y ∈ foo x ⟹ qux x y ⟹ baz x y" </code></pre> <p>(It's important to me that the "⋀x y" bit stays, because the lemma is actually stating the state of my proof in the middle of a long apply chain.)</p> <p>I'm having trouble starting the proof of this lemma. I would like to proceed by rule induction. </p> <h2>First attempt</h2> <p>I tried writing</p> <pre><code>apply (induct rule: foo.induct) </code></pre> <p>but that doesn't work: the <code>induct</code> method fails. I find I can get around this by fixing <code>x</code> and <code>y</code> explicitly, and then invoking the <code>induct</code> method, like so:</p> <pre><code>proof - fix x :: 'a fix y :: "'a list" assume "y ∈ foo x" and "qux x y" thus "baz x y" apply (induct rule: foo.induct) oops </code></pre> <p>However, since I'm actually in the middle of an apply chain, I would rather not enter a structured proof block. </p> <h2>Second attempt</h2> <p>I tried using the <code>induct_tac</code> method instead, but unfortunately <code>induct_tac</code> does not apply the <code>foo.induct</code> rule in the way I would like. If I type</p> <pre><code>apply (induct_tac rule: foo.induct, assumption) </code></pre> <p>then the first subgoal is</p> <pre><code>⋀x y. y ∈ foo x ⟹ qux x y ⟹ baz x [] </code></pre> <p>which is not what I want: I wanted <code>qux x []</code> instead of <code>qux x y</code>. The <code>induct</code> method got this right, but had other problems, discussed above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload