]> matita.cs.unibo.it Git - helm.git/blob - helm/www/matita/docs/manual-0.5.9/axiom_definition_declaration.html
0.5.9 released
[helm.git] / helm / www / matita / docs / manual-0.5.9 / axiom_definition_declaration.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Definitions and declarations</title><link rel="stylesheet" type="text/css" href="docbook.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="Matita V0.5.9 User Manual (rev. 0.5.9 )" /><link rel="up" href="sec_terms.html" title="Chapter 4. Syntax" /><link rel="prev" href="sec_terms.html" title="Chapter 4. Syntax" /><link rel="next" href="proofs.html" title="Proofs" /></head><body><a xmlns="" href="../../../"><div class="matita_logo"><img src="figures/matita.png" alt="Tiny Matita logo" /><span>Matita Home</span></div></a><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Definitions and declarations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec_terms.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Syntax</th><td width="20%" align="right"> <a accesskey="n" href="proofs.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="axiom_definition_declaration"></a>Definitions and declarations</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="axiom"></a><span class="bold"><strong>axiom</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span><span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span></h3></div></div></div><p><strong class="userinput"><code>axiom H: P</code></strong></p><p><span class="command"><strong>H</strong></span> is declared as an axiom that states <span class="command"><strong>P</strong></span></p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="definition"></a><span class="bold"><strong>definition</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span>[<span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>] [<span class="bold"><strong>≝</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>]</h3></div></div></div><p><strong class="userinput"><code>definition f: T ≝ t</code></strong></p><p><span class="command"><strong>f</strong></span> is defined as <span class="command"><strong>t</strong></span>;
3      <span class="command"><strong>T</strong></span> is its type. An error is raised if the type of
4      <span class="command"><strong>t</strong></span> is not convertible to <span class="command"><strong>T</strong></span>.</p><p><span class="command"><strong>T</strong></span> is inferred from <span class="command"><strong>t</strong></span> if
5       omitted.</p><p><span class="command"><strong>t</strong></span> can be omitted only if <span class="command"><strong>T</strong></span> is
6      given. In this case Matita enters in interactive mode and
7      <span class="command"><strong>f</strong></span> must be defined by means of tactics.</p><p>Notice that the command is equivalent to <span class="command"><strong>theorem f: T ≝ t</strong></span>.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="letrec"></a><span class="bold"><strong>letrec</strong></span> <span class="emphasis"><em>TODO</em></span></h3></div></div></div><p><span class="emphasis"><em>TODO</em></span></p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="inductive"></a>[<span class="bold"><strong>inductive</strong></span>|<span class="bold"><strong>coinductive</strong></span>] <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span> [<span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.args2">args2</a></em></span>]… <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span> <span class="bold"><strong>≝</strong></span> [<span class="bold"><strong>|</strong></span>] [<span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>] [<span class="bold"><strong>|</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>]…
8 [<span class="bold"><strong>with</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span> <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span> <span class="bold"><strong>≝</strong></span> [<span class="bold"><strong>|</strong></span>] [<span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>] [<span class="bold"><strong>|</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>]…]…
9 </h3></div></div></div><p><strong class="userinput"><code>inductive i x y z: S ≝ k1:T1 | … | kn:Tn with i' : S' ≝ k1':T1' | … | km':Tm'</code></strong></p><p>Declares a family of two mutually inductive types
10      <span class="command"><strong>i</strong></span> and <span class="command"><strong>i'</strong></span> whose types are
11      <span class="command"><strong>S</strong></span> and <span class="command"><strong>S'</strong></span>, which must be convertible
12      to sorts.</p><p>The constructors <span class="command"><strong>ki</strong></span> of type <span class="command"><strong>Ti</strong></span>
13      and <span class="command"><strong>ki'</strong></span> of type <span class="command"><strong>Ti'</strong></span> are also
14      simultaneously declared. The declared types <span class="command"><strong>i</strong></span> and
15      <span class="command"><strong>i'</strong></span> may occur in the types of the constructors, but
16      only in strongly positive positions according to the rules of the
17      calculus.</p><p>The whole family is parameterized over the arguments <span class="command"><strong>x,y,z</strong></span>.</p><p>If the keyword <span class="command"><strong>coinductive</strong></span> is used, the declared
18      types are considered mutually coinductive.</p><p>Elimination principles for the record are automatically generated
19      by Matita, if allowed by the typing rules of the calculus according to
20      the sort <span class="command"><strong>S</strong></span>. If generated,
21      they are named <span class="command"><strong>i_ind</strong></span>, <span class="command"><strong>i_rec</strong></span> and
22      <span class="command"><strong>i_rect</strong></span> according to the sort of their induction
23      predicate.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="record"></a><span class="bold"><strong>record</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span> [<span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.args2">args2</a></em></span>]… <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span> <span class="bold"><strong>≝</strong></span><span class="bold"><strong>{</strong></span>[<span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span> [<span class="bold"><strong>:</strong></span>|<span class="bold"><strong>:&gt;</strong></span>] <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>] [<span class="bold"><strong>;</strong></span><span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.id">id</a></em></span> [<span class="bold"><strong>:</strong></span>|<span class="bold"><strong>:&gt;</strong></span>] <span class="emphasis"><em><a class="link" href="sec_terms.html#grammar.term">term</a></em></span>]…<span class="bold"><strong>}</strong></span></h3></div></div></div><p><strong class="userinput"><code>record id x y z: S ≝ { f1: T1; …; fn:Tn }</code></strong></p><p>Declares a new record family <span class="command"><strong>id</strong></span> parameterized over
24      <span class="command"><strong>x,y,z</strong></span>.</p><p><span class="command"><strong>S</strong></span> is the type of the record
25      and it must be convertible to a sort.</p><p>Each field <span class="command"><strong>fi</strong></span> is declared by giving its type
26      <span class="command"><strong>Ti</strong></span>. A record without any field is admitted.</p><p>Elimination principles for the record are automatically generated
27      by Matita, if allowed by the typing rules of the calculus according to
28      the sort <span class="command"><strong>S</strong></span>. If generated,
29      they are named <span class="command"><strong>i_ind</strong></span>, <span class="command"><strong>i_rec</strong></span> and
30      <span class="command"><strong>i_rect</strong></span> according to the sort of their induction
31      predicate.</p><p>For each field <span class="command"><strong>fi</strong></span> a record projection
32      <span class="command"><strong>fi</strong></span> is also automatically generated if projection
33      is allowed by the typing rules of the calculus according to the
34      sort <span class="command"><strong>S</strong></span>, the type <span class="command"><strong>T1</strong></span> and
35      the definability of depending record projections.</p><p>If the type of a field is declared with <span class="command"><strong>:&gt;</strong></span>,
36      the corresponding record projection becomes an implicit coercion.
37      This is just syntactic sugar and it has the same effect of declaring the
38      record projection as a coercion later on.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec_terms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sec_terms.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="proofs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Syntax </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Proofs</td></tr></table></div></body></html>