2 <!-- =========== Terms, declarations and definitions ============ -->
4 <chapter id="sec_terms">
5 <title>Terms, axioms, definitions, declarations and proofs</title>
14 <entry id="id">&id;</entry>
16 <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
26 <entry id="nat">&nat;</entry>
28 <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
38 <entry id="uri">&uri;</entry>
40 <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
50 <entry id="term">&term;</entry>
53 <entry>identifier</entry>
59 <entry>a qualified reference</entry>
64 <entry><emphasis role="bold">Prop</emphasis></entry>
65 <entry>the impredicative sort of propositions</entry>
70 <entry><emphasis role="bold">Set</emphasis></entry>
71 <entry>the impredicate sort of datatypes</entry>
76 <entry><emphasis role="bold">Type</emphasis></entry>
77 <entry>one predicatie sort of datatypes</entry>
82 <entry>&term; &term;</entry>
83 <entry>application</entry>
88 <entry><emphasis role="bold">λ</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
89 <entry>λ-abstraction</entry>
94 <entry><emphasis role="bold">Π</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
95 <entry>dependent product meant to define a datatype</entry>
100 <entry><emphasis role="bold">∀</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
101 <entry>dependent product meant to define a proposition</entry>
106 <entry>&term; <emphasis role="bold">→</emphasis> &term;</entry>
107 <entry>non-dependent product (logical implication or function space)</entry>
112 <entry><emphasis role="bold">let</emphasis> [&id;|(&id;<emphasis role="bold">:</emphasis> &term;)] <emphasis role="bold">≝</emphasis> &term; <emphasis role="bold">in</emphasis> &term;</entry>
113 <entry>local definition</entry>
118 <entry><emphasis role="bold">match</emphasis> &term;
119 [ <emphasis role="bold">in</emphasis> &term; ]
120 [ <emphasis role="bold">return</emphasis> &term; ]
121 <emphasis role="bold">with</emphasis>
123 <entry>case analysis</entry>
129 <emphasis role="bold">[</emphasis>
130 &term_pattern; <emphasis role="bold"> ⇒ </emphasis> &term;
132 <emphasis role="bold">|</emphasis>
133 &term_pattern; <emphasis role="bold"> ⇒ </emphasis> &term;
134 ]…<emphasis role="bold">]</emphasis> </entry>
140 <entry><emphasis role="bold">let</emphasis>
141 [<emphasis role="bold">co</emphasis>]<emphasis role="bold">rec</emphasis>
142 &id; [&id;]… [<emphasis role="bold">on</emphasis> &nat;]
143 [<emphasis role="bold">:</emphasis> &term;]
144 <emphasis role="bold">≝</emphasis> &term;
146 <entry>(co)recursive definitions</entry>
152 [<emphasis role="bold">and</emphasis>
153 &id; [&id;]… [<emphasis role="bold">on</emphasis> &nat;]
154 [<emphasis role="bold">:</emphasis> &term;]
155 <emphasis role="bold">≝</emphasis> &term;]…
163 <emphasis role="bold">in</emphasis> &term;
176 <entry id="term_pattern">&term_pattern;</entry>
179 <entry>0-ary constructor</entry>
184 <entry><emphasis role="bold">(</emphasis>&id; &id; [&id;]…<emphasis role="bold">)</emphasis></entry>
185 <entry>n-ary constructor (binds the n arguments)</entry>
193 <title>axiom &id;: &term;</title>
194 <titleabbrev>axiom</titleabbrev>
195 <para><userinput>axiom H: P</userinput></para>
196 <para><command>H</command> is declared as an axiom that states <command>P</command></para>
199 <sect1 id="definition">
200 <title>definition &id;[: &term;] [≝ &term;]</title>
201 <titleabbrev>definition</titleabbrev>
202 <para><userinput>definition f: T ≝ t</userinput></para>
203 <para><command>f</command> is defined as <command>t</command>;
204 <command>T</command> is its type. An error is raised if the type of
205 <command>t</command> is not convertible to <command>T</command>.</para>
206 <para><command>T</command> is inferred from <command>t</command> if
208 <para><command>t</command> can be omitted only if <command>T</command> is
209 given. In this case Matita enters in interactive mode and
210 <command>f</command> must be defined by means of tactics.</para>
211 <para>Notice that the command is equivalent to <command>theorem f: T ≝ t</command>.</para>
214 <sect1 id="inductive">
215 <title>[co]inductive &id; (of inductive types)</title>
216 <titleabbrev>(co)inductive types declaration</titleabbrev>
217 <para> &TODO; </para>
221 <title>Proofs</title>
223 <title>theorem &id;[: &term;] [≝ &term;]</title>
224 <titleabbrev>theorem</titleabbrev>
225 <para><userinput>theorem f: P ≝ p</userinput></para>
226 <para>Proves a new theorem <command>f</command> whose thesis is
227 <command>P</command>.</para>
228 <para>If <command>p</command> is provided, it must be a proof term for
229 <command>P</command>. Otherwise an interactive proof is started.</para>
230 <para><command>P</command> can be omitted only if the proof is not
232 <para>Proving a theorem already proved in the library is an error.
233 To provide an alternative name and proof for the same theorem, use
234 <command>variant f: P ≝ p</command>.</para>
235 <para>A warning is raised if the name of the theorem cannot be obtained
236 by mangling the name of the constants in its thesis.</para>
237 <para>Notice that the command is equivalent to <command>definition f: T ≝ t</command>.</para>
240 <title>variant &id;[: &term;] [≝ &term;]</title>
241 <titleabbrev>variant</titleabbrev>
242 <para><userinput>variant f: T ≝ t</userinput></para>
243 <para>Same as <command>theorem f: T ≝ t</command>, but it does not
244 complain if the theorem has already been proved. To be used to give
245 an alternative name or proof to a theorem.</para>
248 <title>lemma &id;[: &term;] [≝ &term;]</title>
249 <titleabbrev>lemma</titleabbrev>
250 <para><userinput>lemma f: T ≝ t</userinput></para>
251 <para>Same as <command>theorem f: T ≝ t</command></para>
254 <title>fact &id;[: &term;] [≝ &term;]</title>
255 <titleabbrev>fact</titleabbrev>
256 <para><userinput>fact f: T ≝ t</userinput></para>
257 <para>Same as <command>theorem f: T ≝ t</command></para>
260 <title>remark &id;[: &term;] [≝ &term;]</title>
261 <titleabbrev>remark</titleabbrev>
262 <para><userinput>remark f: T ≝ t</userinput></para>
263 <para>Same as <command>theorem f: T ≝ t</command></para>