]> matita.cs.unibo.it Git - helm.git/blob - helm/www/matita/docs/manual/axiom_definition_declaration.html
manual regenerated
[helm.git] / helm / www / matita / docs / manual / 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">
3 <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" href="docbook.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Matita V0.1.0&#10; User Manual (rev. 1α)" /><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="../../images/matita-tiny.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" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="axiom"></a><span class="bold"><strong>axiom</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span><span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span></h3></div></div></div><p><strong class="userinput"><code>axiom H: P</code></strong></p><p><span><strong class="command">H</strong></span> is declared as an axiom that states <span><strong class="command">P</strong></span></p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="definition"></a><span class="bold"><strong>definition</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span>[<span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>] [<span class="bold"><strong>≝</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>]</h3></div></div></div><p><strong class="userinput"><code>definition f: T ≝ t</code></strong></p><p><span><strong class="command">f</strong></span> is defined as <span><strong class="command">t</strong></span>;
4      <span><strong class="command">T</strong></span> is its type. An error is raised if the type of
5      <span><strong class="command">t</strong></span> is not convertible to <span><strong class="command">T</strong></span>.</p><p><span><strong class="command">T</strong></span> is inferred from <span><strong class="command">t</strong></span> if
6       omitted.</p><p><span><strong class="command">t</strong></span> can be omitted only if <span><strong class="command">T</strong></span> is
7      given. In this case Matita enters in interactive mode and
8      <span><strong class="command">f</strong></span> must be defined by means of tactics.</p><p>Notice that the command is equivalent to <span><strong class="command">theorem f: T ≝ t</strong></span>.</p></div><div class="sect2" lang="en" xml:lang="en"><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 href="sec_terms.html#id">id</a></em></span> [<span class="emphasis"><em><a href="sec_terms.html#args2">args2</a></em></span>]… <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span> <span class="bold"><strong>≝</strong></span> [<span class="bold"><strong>|</strong></span>] [<span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>] [<span class="bold"><strong>|</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>]…
9 [<span class="bold"><strong>with</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span> <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span> <span class="bold"><strong>≝</strong></span> [<span class="bold"><strong>|</strong></span>] [<span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>] [<span class="bold"><strong>|</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span><span class="bold"><strong>:</strong></span><span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>]…]…
10 </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
11      <span><strong class="command">i</strong></span> and <span><strong class="command">i'</strong></span> whose types are
12      <span><strong class="command">S</strong></span> and <span><strong class="command">S'</strong></span>, which must be convertible
13      to sorts.</p><p>The constructors <span><strong class="command">ki</strong></span> of type <span><strong class="command">Ti</strong></span>
14      and <span><strong class="command">ki'</strong></span> of type <span><strong class="command">Ti'</strong></span> are also
15      simultaneously declared. The declared types <span><strong class="command">i</strong></span> and
16      <span><strong class="command">i'</strong></span> may occur in the types of the constructors, but
17      only in strongly positive positions according to the rules of the
18      calculus.</p><p>The whole family is parameterized over the arguments <span><strong class="command">x,y,z</strong></span>.</p><p>If the keyword <span><strong class="command">coinductive</strong></span> is used, the declared
19      types are considered mutually coinductive.</p><p>Elimination principles for the record are automatically generated
20      by Matita, if allowed by the typing rules of the calculus according to
21      the sort <span><strong class="command">S</strong></span>. If generated,
22      they are named <span><strong class="command">i_ind</strong></span>, <span><strong class="command">i_rec</strong></span> and
23      <span><strong class="command">i_rect</strong></span> according to the sort of their induction
24      predicate.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="record"></a><span class="bold"><strong>record</strong></span> <span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span> [<span class="emphasis"><em><a href="sec_terms.html#args2">args2</a></em></span>]… <span class="bold"><strong>:</strong></span> <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span> <span class="bold"><strong>≝</strong></span><span class="bold"><strong>{</strong></span>[<span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span> [<span class="bold"><strong>:</strong></span>|<span class="bold"><strong>:&gt;</strong></span>] <span class="emphasis"><em><a href="sec_terms.html#term">term</a></em></span>] [<span class="bold"><strong>;</strong></span><span class="emphasis"><em><a href="sec_terms.html#id">id</a></em></span> [<span class="bold"><strong>:</strong></span>|<span class="bold"><strong>:&gt;</strong></span>] <span class="emphasis"><em><a href="sec_terms.html#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><strong class="command">id</strong></span> parameterized over
25      <span><strong class="command">x,y,z</strong></span>.</p><p><span><strong class="command">S</strong></span> is the type of the record
26      and it must be convertible to a sort.</p><p>Each field <span><strong class="command">fi</strong></span> is declared by giving its type
27      <span><strong class="command">Ti</strong></span>. A record without any field is admitted.</p><p>Elimination principles for the record are automatically generated
28      by Matita, if allowed by the typing rules of the calculus according to
29      the sort <span><strong class="command">S</strong></span>. If generated,
30      they are named <span><strong class="command">i_ind</strong></span>, <span><strong class="command">i_rec</strong></span> and
31      <span><strong class="command">i_rect</strong></span> according to the sort of their induction
32      predicate.</p><p>For each field <span><strong class="command">fi</strong></span> a record projection
33      <span><strong class="command">fi</strong></span> is also automatically generated if projection
34      is allowed by the typing rules of the calculus according to the
35      sort <span><strong class="command">S</strong></span>, the type <span><strong class="command">T1</strong></span> and
36      the definability of depending record projections.</p><p>If the type of a field is declared with <span><strong class="command">:&gt;</strong></span>,
37      the corresponding record projection becomes an implicit coercion.
38      This is just syntactic sugar and it has the same effect of declaring the
39      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>