]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/system_T/t.tex
added few cases
[helm.git] / helm / papers / system_T / t.tex
1 \documentclass[a4paper]{article}
2 \pagestyle{headings}
3 %\usepackage{graphicx}
4 \usepackage{amssymb,amsmath,mathrsfs}
5 %\usepackage{hyperref}
6 %\usepackage{picins}
7
8 \newcommand{\sem}[1]{[\![ #1 ]\!]}
9 \newcommand{\R}{\;\mathscr{R}\;}
10 \newcommand{\N}{\,\mathbb{N}\,}
11 \newcommand{\NT}{\,\mathbb{N}\,}
12 \newcommand{\NH}{\,\mathbb{N}\,}
13 \title{...}
14 \author{...}
15
16
17 \begin{document}
18 \maketitle
19
20 \begin{abstract}
21 ...
22 \end{abstract}
23
24 \section{Heyting's arithmetics}
25
26 {\bf Axioms}
27
28 \begin{itemize}
29
30 \item $nat\_ind: P(0) \to (\forall x.P(x) \to P(S(x))) \to \forall x.P(x)$ 
31 \item $ex\_ind: (\forall x.P(x) \to Q) \to \exists x.P(x) \to Q$
32 \item $ex\_intro: \forall x.(P \to \exists x.P)$
33 \item $fst: P \land Q \to P$
34 \item $snd: P \land Q \to Q$
35 \item $conj: P \to Q \to P \land Q$
36 \item $false\_ind: \bot \to Q$
37 \item $discriminate:\forall x.0 = S(x) \to \bot$
38 \item $injS: \forall x,y.S(x) = S(y) \to x=y$
39 \item $plus\_O:\forall x.x+0=x$
40 \item $plus\_S:\forall x,y.x+S(y)=S(x+y)$ 
41 \item $times\_O:\forall x.x*0=0$
42 \item $times\_S:\forall x,y.x*S(y)=x+(x*y)$ 
43 \end{itemize}
44
45 \noindent
46 {\bf Inference Rules}
47
48 \[ 
49    (\to_i)\frac{\Gamma,x:A \vdash M:Q}{\Gamma \vdash \lambda x:A.M: A \to Q} \hspace{2cm}
50    (\to_e)\frac{\Gamma \vdash M: A \to Q \hspace{1cm}\Gamma \vdash N: A}
51     {\Gamma \vdash M N: Q} 
52 \]
53
54 %\[ 
55 %   (\land_i)\frac{\Gamma \vdash M:A \hspace{1cm}\Gamma \vdash N:B}
56 %   {\Gamma \vdash <M,N> : A \land B} 
57 %\hspace{2cm}
58 %   (\land_{el})\frac{\Gamma \vdash A \land B}{\Gamma \vdash A}
59 %\hspace{2cm}
60 %   (\land_{er})\frac{\Gamma \vdash A \land B}{\Gamma \vdash B}  
61 %\]
62
63 \[ 
64    (\forall_i)\frac{\Gamma \vdash M:P}{\Gamma \vdash 
65    \lambda x:\N.M: \forall x.P}(*) \hspace{2cm}
66    (\forall_e)\frac{\Gamma \vdash M :\forall x.P}{\Gamma \vdash M t: P[t/x]} 
67 \]
68
69
70 %\[ 
71 %   (\exists_i)\frac{\Gamma \vdash P[t/x]}{\Gamma \vdash \exists x.P}\hspace{2cm}
72 %   (\exists_e)\frac{\Gamma \vdash \exists x.P\hspace{1cm}\Gamma \vdash \forall x.P \to Q}
73 %{\Gamma \vdash Q} 
74 %\]
75
76 \section{Extraction}
77
78 \begin{itemize}
79 \item $\sem{A} = 1$ if A is atomic
80 \item $\sem{A \land B} = \sem{A}\times \sem{B}$
81 \item $\sem{A \to B} = \sem{A}\to \sem{B}$
82 \item $\sem{\forall x.P} = \N \to \sem{P}$
83 \item $\sem{\exists x.P} = \N \times \sem{P}$
84 \end{itemize}
85
86 definition.
87 For any type T of system T $\bot_T: 1 \to T$  is inuctively defined as follows:
88 \begin{enumerate}
89 \item $\bot_1 = \lambda x:1.x$
90 \item $\bot_N = \lambda x:1.0$
91 \item $\bot_{U\times V} = \lambda x:1.<\bot_{U} x,\bot_{V} x>$
92 \item $\bot_{U\to V} = \lambda x:1.\lambda \_:U. \bot_{V} x$
93 \end{enumerate}
94
95 \begin{itemize}
96 \item $\sem{nat\_ind} = R$
97 \item $\sem{ex\_ind} = (\lambda f:(\N \to \sem{P} \to \sem{Q}).
98 \lambda p:\N\times \sem{P}.f (fst \,p) (snd \,p)$. 
99 \item $\sem{ex\_intro} = \lambda x:\N.\lambda f:\sem{P}.<x,f>$
100 \item $\sem{fst} = fst$
101 \item $\sem{snd} = snd$
102 \item $\sem{conj} = \lambda x:\sem{P}.\lambda y:\sem{Q}.<x,y>$
103 \item $\sem{false\_ind} = \bot_{\sem{Q}}$
104 \item $\sem{discriminate} = \lambda \_:\N.\lambda \_:1.*$
105 \item $\sem{injS}= \lambda \_:\N. \lambda \_:\N.\lambda \_:1.*$
106 \item $\sem{plus\_O} = \sem{times\_O} = \lambda \_:\N.*$
107 \item $\sem{plus\_S} = \sem{times_S} = \lambda \_:\N. \lambda \_:\N.*$
108 \end{itemize}
109
110 In the case of structured proofs:
111 \begin{itemize}
112 \item $\sem{M N} = \sem{M} \sem{N}$
113 \item $\sem{\lambda x:A.M} = \lambda x:\sem{A}.\sem{M}$
114 \item $\sem{\lambda x:\N.M} = \lambda x:\N.\sem{M}$
115 \item $\sem{M t} = \sem{M} \sem{t}$
116 \end{itemize}
117
118 \section{Realizability}
119 The realizability relation is a relation $f \R P$ where $f: \sem{P}$.
120 In particular:
121 \begin{itemize}
122 \item $\neg (* \R \bot)$
123 \item $* \R (t_1=t_2)$ iff $t_1=t_2$ is true ...
124 \item $<f,g> \R (P\land Q)$ iff $f \R P$ and $g \R Q$
125 \item $f \R (P\to Q)$ iff for any $m$ such that $m \R P$, $(f \,m) \R Q$
126 \item $f \R (\forall x.P)$ iff for any natural number $n$ $(f n) \R P[\underline{n}/x]$
127 \item $<n,g> \R (\exists x.P)$ iff $g \R P[\underline{n}/x]$
128 \end{itemize}
129
130 \noindent
131 We proceed to prove that all axioms $ax:Ax$ are realized by $\sem{ax}$.
132
133 \begin{itemize}
134 \item $nat\_ind$. 
135   We must prove that the recursion schema $R$ realizes the induction principle.
136   To this aim we must prove that for any $a$ and $f$ such that $a \R P(0)$ and
137   $f \R \forall x.(P(x) \to P(S(x)))$, and any natural number $n$, $(R \,a \,f
138   \,n) \R P(\underline{n})$.\\ 
139   We proceed by induction on n.\\ 
140   If $n=O$, $(R \,a \,f \,O) = a$ and by hypothesis $a \R P(0)$.\\ 
141   Suppose by induction that
142   $(R \,a \,f \,n) \R P(\underline{n})$, and let us prove that the relation
143   still holds for $n+1$.  By definition 
144   $(R \,a \,f \,(n+1)) = f \,n \,(R \,a \,f \,n)$, 
145   and since $f \R \forall x.(P(x) \to P(S(x)))$,  
146   $(f n (R a f n)) \R P(S(\underline{n}))=P(\underline{n+1})$.
147
148 \item $ex\_ind$. 
149   We must prove that $$\underline{ex\_ind} \R (\forall x:(P x)
150   \to Q) \to (\exists x:(P x)) \to Q$$ Following the definition of $\R$ we have
151   to prove that given\\ $f~\R~\forall~x:((P~x)~\to~Q)$ and
152   $p~\R~\exists~x:(P~x)$, then $\underline{ex\_ind}~f~p \R Q$.\\ 
153   $p$ is a couple $<n_p,g_p>$ such that $g_p \R P[\underline{n_p}/x]$, while
154   $f$ is a function such that forall $n$ and for all $m \R P[\underline{n}/x]$
155   then $f~n~m \R Q$.  Exapanding the definition of $\underline{ex\_ind}$, $fst$
156   and $snd$ we obtain $f~n_p~g_p$ that we know is in relation $\R$ with $Q$
157   since $g_p \R P[\underline{n_p}/x]$.
158
159 \item $false\_ind$. 
160   We have to prove that $\bot_{\sem{Q}} \R \bot \to Q$. 
161   Trivial, since there is no $m \R \bot$.
162
163 \item $discriminate$. 
164   Since there is no $n$ such that $0 = S n$ is true... \\
165   $\underline{discriminate}~n \R 0 = S~\underline{n} \to \bot$ for each n.
166
167 \end{itemize}
168
169 \begin{thebibliography}{}
170
171
172 \end{thebibliography}
173
174 \end{document}
175