1 <!-- ================= Tactics ========================= -->
2 <chapter id="sec_declarative_tactics">
3 <title>Declarative Tactics</title>
6 id="declarative_tactics_quickref">
7 <title>Quick reference card</title>
14 <sect1 id="tac_assume">
16 <titleabbrev>assume</titleabbrev>
17 <para><userinput>assume x : t</userinput></para>
20 <varlistentry role="tactic.synopsis">
21 <term>Synopsis:</term>
23 <para><emphasis role="bold">assume</emphasis> &id; <emphasis role="bold"> : </emphasis> &sterm;</para>
27 <term>Pre-conditions:</term>
29 <para>The conclusion of the current proof must be
30 <command>∀x:T.P</command> or
31 <command>T→P</command> where <command>T</command> is
32 a data type (i.e. <command>T</command> has type
33 <command>Set</command> or <command>Type</command>).</para>
39 <para>It adds to the context of the current sequent to prove a new
40 declaration <command>x : T </command>. The new conclusion becomes
41 <command>P</command>.</para>
45 <term>New sequents to prove:</term>
54 <sect1 id="tac_byinduction">
55 <title>by induction hypothesis we know</title>
56 <titleabbrev>by induction hypothesis we know</titleabbrev>
57 <para><userinput>by induction hypothesis we know t (id)</userinput></para>
60 <varlistentry role="tactic.synopsis">
61 <term>Synopsis:</term>
62 <listitem><para><emphasis role="bold">by induction hypothesis we know</emphasis> &term; <emphasis role="bold"> (</emphasis> &id; <emphasis role="bold">)</emphasis></para>
66 <term>Pre-condition:</term>
68 <para>To be used in a proof by induction to state the inductive
75 <para> Introduces the inductive hypothesis. </para>
79 <term>New sequents to prove:</term>
90 <titleabbrev>case</titleabbrev>
91 <para><userinput>case id (id1:t1) … (idn:tn)</userinput></para>
94 <varlistentry role="tactic.synopsis">
95 <term>Synopsis:</term>
97 <para><emphasis role="bold">case</emphasis> &id; [<emphasis role="bold">(</emphasis> &id; <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">)</emphasis>] … </para>
101 <term>Pre-condition:</term>
103 <para>To be used in a proof by induction or by cases to start
110 <para>Starts the new case <command>id</command> declaring
111 the local parameters <command>(id1:t1) … (idn:tn)</command></para>
115 <term>New sequents to prove:</term>
124 <sect1 id="tac_bydone">
126 <titleabbrev>done</titleabbrev>
127 <para><userinput>justification done</userinput></para>
130 <varlistentry role="tactic.synopsis">
131 <term>Synopsis:</term>
133 <para>&justification; <emphasis role="bold">done</emphasis></para>
137 <term>Pre-condition:</term>
145 <para>It closes the current sequent given the justification.</para>
149 <term>New sequents to prove:</term>
159 <sect1 id="tac_exitselim">
160 <title>let such that</title>
161 <titleabbrev>let such that</titleabbrev>
162 <para><userinput>justification let x:t such that p (id)</userinput>
166 <varlistentry role="tactic.synopsis">
167 <term>Synopsis:</term>
169 <para>&justification; <emphasis role="bold">let</emphasis> &id;
170 <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">such that</emphasis> &term;
171 <emphasis role="bold">(</emphasis> &id; <emphasis role="bold">)</emphasis></para>
175 <term>Pre-condition:</term>
184 <para>It derives <command>∃x:t.p</command> using the
185 <command>justification</command> and then it introduces in the context
186 <command>x</command> and the hypothesis
187 <command>p</command> labelled with
188 <command>id</command>.
193 <term>New sequent to prove:</term>
202 <sect1 id="tac_obtain">
203 <title>obtain</title>
204 <titleabbrev>obtain</titleabbrev>
205 <para><userinput>obtain H t1 = t2 justification</userinput></para>
208 <varlistentry role="tactic.synopsis">
209 <term>Synopsis:</term>
211 <para>[<emphasis role="bold">obtain</emphasis> &id; | <emphasis role="bold">conclude</emphasis> &term;] <emphasis role="bold">=</emphasis> &term; [&autoparams; | <emphasis role="bold">using</emphasis> &term; | <emphasis role="bold">using once</emphasis> &term; | <emphasis role="bold">proof</emphasis>] [<emphasis role="bold">done</emphasis>]</para>
215 <term>Pre-condition:</term>
217 <para><command>conclude</command> can be used only if the current
218 sequent is stating an equality. The left hand side must be omitted
219 in an equality chain.</para>
225 <para>Starts or continues an equality chain. If the chain starts
226 with <command>obtain H</command> a new subproof named
227 <command>H</command> is started.</para>
231 <term>New sequent to prove:</term>
233 <para>If the chain starts
234 with <command>obtain H</command> a nre sequent for
235 <command>t2 = ?</command> is opened.
243 <sect1 id="tac_suppose">
244 <title>suppose</title>
245 <titleabbrev>suppose</titleabbrev>
246 <para><userinput>suppose t1 (x) that is equivalent to t2</userinput></para>
249 <varlistentry role="tactic.synopsis">
250 <term>Synopsis:</term>
252 <para><emphasis role="bold">suppose</emphasis> &term; <emphasis role="bold"> (</emphasis> &id;
253 <emphasis role="bold">) </emphasis> [ <emphasis role="bold">that is equivalent to</emphasis> &term; ]</para>
257 <term>Pre-condition:</term>
259 <para>The conclusion of the current proof must be
260 <command>∀x:T.P</command> or
261 <command>T→P</command> where <command>T</command> is
262 a proposition (i.e. <command>T</command> has type
263 <command>Prop</command> or <command>CProp</command>).</para>
269 <para>It adds to the context of the current sequent to prove a new
270 declaration <command>x : T </command>. The new conclusion becomes
271 <command>P</command>.</para>
275 <term>New sequents to prove:</term>
284 <sect1 id="tac_thesisbecomes">
285 <title>the thesis becomes</title>
286 <titleabbrev>the thesis becomes</titleabbrev>
287 <para><userinput>the thesis becomes t</userinput></para>
290 <varlistentry role="tactic.synopsis">
291 <term>Synopsis:</term>
293 <para><emphasis role ="bold">the thesis becomes</emphasis> &term; </para>
297 <term>Pre-condition:</term>
299 <para>The provided term <command>t</command> must be convertible with
300 current sequent.</para>
306 <para>It changes the current goal to the one provided.</para>
310 <term>New sequent to prove:</term>
319 <sect1 id="tac_weneedtoprove">
320 <title>we need to prove</title>
321 <titleabbrev>we need to prove</titleabbrev>
322 <para><userinput>we need to prove t1 (id) or equivalently t2</userinput></para>
325 <varlistentry role="tactic.synopsis">
326 <term>Synopsis:</term>
328 <para><emphasis role="bold">we need to prove</emphasis> &term;
329 [<emphasis role="bold">(</emphasis>&id;
330 <emphasis role="bold">)</emphasis>]
331 [ <emphasis role="bold">or equivalently</emphasis> &term;]</para>
335 <term>Pre-condition:</term>
343 <para>If <command>id</command> is provided, starts a subproof that once concluded
344 will be named <command>id</command>. Otherwise states what needs to be proved.
345 If <command>t2</command> is provided, the new goal is
346 immediately changed to <command>t2</command> wich must
347 be equivalent to <command>t1</command>.
352 <term>New sequents to prove:</term>
354 <para>The stated one if <command>id</command> is provided</para>
362 <sect1 id="tac_andelim">
363 <title>we have</title>
364 <titleabbrev>we have</titleabbrev>
365 <para><userinput>justification we have t1 (id1) and t2 (id2)</userinput>
369 <varlistentry role="tactic_synopsis">
370 <term>Synopsis:</term>
372 <para>&justification; <emphasis role="bold">we have</emphasis> &term;
373 <emphasis role="bold">( </emphasis> &id; <emphasis role="bold"> ) and </emphasis> &term;
374 <emphasis role="bold"> ( </emphasis> &id; <emphasis role="bold">)</emphasis></para>
378 <term>Pre-condition:</term>
386 <para>It derives <command>t1∧t2</command> using the
387 <command>justification</command> then it introduces in the context
388 <command>t1</command> labelled with <command>id1</command> and
389 <command>t2</command> labelled with <command>id2</command>.
394 <term>New sequent to prove:</term>
403 <sect1 id="tac_weproceedbycases">
404 <title>we proceed by cases on</title>
405 <titleabbrev>we proceed by cases on</titleabbrev>
406 <para><userinput>we proceed by cases on t to prove th</userinput></para>
409 <varlistentry role="tactic.synopsis">
410 <term>Synopsis:</term>
412 <para><emphasis role="bold">we proceed by cases on</emphasis> &term; <emphasis role="bold">to prove</emphasis> &term; </para>
416 <term>Pre-condition:</term>
418 <para><command>t</command> must inhabitant of an inductive type and
419 <command>th</command> must be the conclusion to be proved by
426 <para> It proceeds by cases on <command>t</command> </para>
430 <term>New sequents to prove:</term>
432 <para>It opens one new sequent for each constructor of the
433 type of <command>t</command>.</para>
440 <sect1 id="tac_weproceedbyinduction">
441 <title>we proceed by induction on</title>
442 <titleabbrev>we proceed by induction on</titleabbrev>
443 <para><userinput>we proceed by induction on t to prove th</userinput></para>
446 <varlistentry role="tactic.synopsis">
447 <term>Synopsis:</term>
449 <para><emphasis role="bold">we proceed by induction on</emphasis> &term; <emphasis role="bold"> to prove </emphasis> &term; </para>
453 <term>Pre-condition:</term>
455 <para><command>t</command> must inhabitant of an inductive type and
456 <command>th</command> must be the conclusion to be proved by induction.
463 <para>It proceed by induction on <command>t</command>.</para>
467 <term>New sequents to prove:</term>
469 <para>It opens one new sequent for each constructor of the
470 type of <command>t</command>.</para>
478 <sect1 id="tac_bytermweproved">
479 <title>we proved</title>
480 <titleabbrev>we proved</titleabbrev>
481 <para><userinput>justification we proved t (id)</userinput></para>
484 <varlistentry role="tactic.synopsis">
485 <term>Synopsis:</term>
487 <para>&justification; <emphasis role="bold">we proved</emphasis> &term;
488 <emphasis role="bold">(</emphasis> &id;
489 <emphasis role="bold">)</emphasis></para>
493 <term>Pre-condition:</term>
495 <para><command>t</command>must have type <command>Prop</command>.
502 <para>It derives <command>t</command>
503 using the justification and labels the conclusion with
504 <command>id</command>.
509 <term>New sequent to prove:</term>