1 <!-- ================= Tactics ========================= -->
3 <chapter id="sec_declarative_tactics">
4 <title>Declarative Tactics</title>
7 id="declarative_tactics_quickref">
8 <title>Quick reference card</title>
10 &declarativetacticref;
15 <sect1 id="tac_assume">
17 <titleabbrev>assume</titleabbrev>
18 <para><userinput>assume x : t</userinput></para>
21 <varlistentry role="tactic.synopsis">
22 <term>Synopsis:</term>
24 <para><emphasis role="bold">assume</emphasis> &id; <emphasis role="bold"> : </emphasis> &sterm;</para>
28 <term>Pre-conditions:</term>
30 <para>The conclusion of the current proof must be
31 <command>∀x:T.P</command> or
32 <command>T→P</command> where <command>T</command> is
33 a data type (i.e. <command>T</command> has type
34 <command>Set</command> or <command>Type</command>).</para>
40 <para>It adds to the context of the current sequent to prove a new
41 declaration <command>x : T </command>. The new conclusion becomes
42 <command>P</command>.</para>
46 <term>New sequents to prove:</term>
55 <sect1 id="tac_byinduction">
56 <title>by induction hypothesis we know</title>
57 <titleabbrev>by induction hypothesis we know</titleabbrev>
58 <para><userinput>by induction hypothesis we know t (id)</userinput></para>
61 <varlistentry role="tactic.synopsis">
62 <term>Synopsis:</term>
63 <listitem><para><emphasis role="bold">by induction hypothesis we know</emphasis> &term; <emphasis role="bold"> (</emphasis> &id; <emphasis role="bold">)</emphasis></para>
67 <term>Pre-condition:</term>
69 <para>To be used in a proof by induction to state the inductive
76 <para> Introduces the inductive hypothesis. </para>
80 <term>New sequents to prove:</term>
91 <titleabbrev>case</titleabbrev>
92 <para><userinput>case id (id1:t1) … (idn:tn)</userinput></para>
95 <varlistentry role="tactic.synopsis">
96 <term>Synopsis:</term>
98 <para><emphasis role="bold">case</emphasis> &id; [<emphasis role="bold">(</emphasis> &id; <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">)</emphasis>] … </para>
102 <term>Pre-condition:</term>
104 <para>To be used in a proof by induction or by cases to start
111 <para>Starts the new case <command>id</command> declaring
112 the local parameters <command>(id1:t1) … (idn:tn)</command></para>
116 <term>New sequents to prove:</term>
125 <sect1 id="tac_bydone">
127 <titleabbrev>done</titleabbrev>
128 <para><userinput>justification done</userinput></para>
131 <varlistentry role="tactic.synopsis">
132 <term>Synopsis:</term>
134 <para>&justification; <emphasis role="bold">done</emphasis></para>
138 <term>Pre-condition:</term>
146 <para>It closes the current sequent given the justification.</para>
150 <term>New sequents to prove:</term>
160 <sect1 id="tac_exitselim">
161 <title>let such that</title>
162 <titleabbrev>let such that</titleabbrev>
163 <para><userinput>justification let x:t such that p (id)</userinput>
167 <varlistentry role="tactic.synopsis">
168 <term>Synopsis:</term>
170 <para>&justification; <emphasis role="bold">let</emphasis> &id;
171 <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">such that</emphasis> &term;
172 <emphasis role="bold">(</emphasis> &id; <emphasis role="bold">)</emphasis></para>
176 <term>Pre-condition:</term>
185 <para>It derives <command>∃x:t.p</command> using the
186 <command>justification</command> and then it introduces in the context
187 <command>x</command> and the hypothesis
188 <command>p</command> labelled with
189 <command>id</command>.
194 <term>New sequent to prove:</term>
203 <sect1 id="tac_obtain">
204 <title>obtain</title>
205 <titleabbrev>obtain</titleabbrev>
206 <para><userinput>obtain H t1 = t2 justification</userinput></para>
209 <varlistentry role="tactic.synopsis">
210 <term>Synopsis:</term>
212 <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>
216 <term>Pre-condition:</term>
218 <para><command>conclude</command> can be used only if the current
219 sequent is stating an equality. The left hand side must be omitted
220 in an equality chain.</para>
226 <para>Starts or continues an equality chain. If the chain starts
227 with <command>obtain H</command> a new subproof named
228 <command>H</command> is started.</para>
232 <term>New sequent to prove:</term>
234 <para>If the chain starts
235 with <command>obtain H</command> a nre sequent for
236 <command>t2 = ?</command> is opened.
244 <sect1 id="tac_suppose">
245 <title>suppose</title>
246 <titleabbrev>suppose</titleabbrev>
247 <para><userinput>suppose t1 (x) that is equivalent to t2</userinput></para>
250 <varlistentry role="tactic.synopsis">
251 <term>Synopsis:</term>
253 <para><emphasis role="bold">suppose</emphasis> &term; <emphasis role="bold"> (</emphasis> &id;
254 <emphasis role="bold">) </emphasis> [ <emphasis role="bold">that is equivalent to</emphasis> &term; ]</para>
258 <term>Pre-condition:</term>
260 <para>The conclusion of the current proof must be
261 <command>∀x:T.P</command> or
262 <command>T→P</command> where <command>T</command> is
263 a proposition (i.e. <command>T</command> has type
264 <command>Prop</command> or <command>CProp</command>).</para>
270 <para>It adds to the context of the current sequent to prove a new
271 declaration <command>x : T </command>. The new conclusion becomes
272 <command>P</command>.</para>
276 <term>New sequents to prove:</term>
285 <sect1 id="tac_thesisbecomes">
286 <title>the thesis becomes</title>
287 <titleabbrev>the thesis becomes</titleabbrev>
288 <para><userinput>the thesis becomes t</userinput></para>
291 <varlistentry role="tactic.synopsis">
292 <term>Synopsis:</term>
294 <para><emphasis role ="bold">the thesis becomes</emphasis> &term; </para>
298 <term>Pre-condition:</term>
300 <para>The provided term <command>t</command> must be convertible with
301 current sequent.</para>
307 <para>It changes the current goal to the one provided.</para>
311 <term>New sequent to prove:</term>
320 <sect1 id="tac_weneedtoprove">
321 <title>we need to prove</title>
322 <titleabbrev>we need to prove</titleabbrev>
323 <para><userinput>we need to prove t1 (id) or equivalently t2</userinput></para>
326 <varlistentry role="tactic.synopsis">
327 <term>Synopsis:</term>
329 <para><emphasis role="bold">we need to prove</emphasis> &term;
330 [<emphasis role="bold">(</emphasis>&id;
331 <emphasis role="bold">)</emphasis>]
332 [ <emphasis role="bold">or equivalently</emphasis> &term;]</para>
336 <term>Pre-condition:</term>
344 <para>If <command>id</command> is provided, starts a subproof that once concluded
345 will be named <command>id</command>. Otherwise states what needs to be proved.
346 If <command>t2</command> is provided, the new goal is
347 immediately changed to <command>t2</command> wich must
348 be equivalent to <command>t1</command>.
353 <term>New sequents to prove:</term>
355 <para>The stated one if <command>id</command> is provided</para>
363 <sect1 id="tac_andelim">
364 <title>we have</title>
365 <titleabbrev>we have</titleabbrev>
366 <para><userinput>justification we have t1 (id1) and t2 (id2)</userinput>
370 <varlistentry role="tactic_synopsis">
371 <term>Synopsis:</term>
373 <para>&justification; <emphasis role="bold">we have</emphasis> &term;
374 <emphasis role="bold">( </emphasis> &id; <emphasis role="bold"> ) and </emphasis> &term;
375 <emphasis role="bold"> ( </emphasis> &id; <emphasis role="bold">)</emphasis></para>
379 <term>Pre-condition:</term>
387 <para>It derives <command>t1∧t2</command> using the
388 <command>justification</command> then it introduces in the context
389 <command>t1</command> labelled with <command>id1</command> and
390 <command>t2</command> labelled with <command>id2</command>.
395 <term>New sequent to prove:</term>
404 <sect1 id="tac_weproceedbycases">
405 <title>we proceed by cases on</title>
406 <titleabbrev>we proceed by cases on</titleabbrev>
407 <para><userinput>we proceed by cases on t to prove th</userinput></para>
410 <varlistentry role="tactic.synopsis">
411 <term>Synopsis:</term>
413 <para><emphasis role="bold">we proceed by cases on</emphasis> &term; <emphasis role="bold">to prove</emphasis> &term; </para>
417 <term>Pre-condition:</term>
419 <para><command>t</command> must inhabitant of an inductive type and
420 <command>th</command> must be the conclusion to be proved by
427 <para> It proceeds by cases on <command>t</command> </para>
431 <term>New sequents to prove:</term>
433 <para>It opens one new sequent for each constructor of the
434 type of <command>t</command>.</para>
441 <sect1 id="tac_weproceedbyinduction">
442 <title>we proceed by induction on</title>
443 <titleabbrev>we proceed by induction on</titleabbrev>
444 <para><userinput>we proceed by induction on t to prove th</userinput></para>
447 <varlistentry role="tactic.synopsis">
448 <term>Synopsis:</term>
450 <para><emphasis role="bold">we proceed by induction on</emphasis> &term; <emphasis role="bold"> to prove </emphasis> &term; </para>
454 <term>Pre-condition:</term>
456 <para><command>t</command> must inhabitant of an inductive type and
457 <command>th</command> must be the conclusion to be proved by induction.
464 <para>It proceed by induction on <command>t</command>.</para>
468 <term>New sequents to prove:</term>
470 <para>It opens one new sequent for each constructor of the
471 type of <command>t</command>.</para>
479 <sect1 id="tac_bytermweproved">
480 <title>we proved</title>
481 <titleabbrev>we proved</titleabbrev>
482 <para><userinput>justification we proved t (id)</userinput></para>
485 <varlistentry role="tactic.synopsis">
486 <term>Synopsis:</term>
488 <para>&justification; <emphasis role="bold">we proved</emphasis> &term;
489 <emphasis role="bold">(</emphasis> &id;
490 <emphasis role="bold">)</emphasis></para>
494 <term>Pre-condition:</term>
496 <para><command>t</command>must have type <command>Prop</command>.
503 <para>It derives <command>t</command>
504 using the justification and labels the conclusion with
505 <command>id</command>.
510 <term>New sequent to prove:</term>