Changes

MyWikiBiz, Author Your Legacy — Thursday May 02, 2024
Jump to navigationJump to search
no edit summary
Line 1: Line 1:  
{{DISPLAYTITLE:Propositions As Types}}
 
{{DISPLAYTITLE:Propositions As Types}}
 +
 +
'''NB.''' In this discussion, combinators are being applied on the right of their arguments.  The resulting formulas will look backwards to people who are accustomed to applying combinators on the left.
    
==Identity, or the Identifier==
 
==Identity, or the Identifier==
Line 2,223: Line 2,225:  
==Bibliography==
 
==Bibliography==
   −
Here are a three references on combinatory logic and lambda calculus, given in order of difficulty from introductory to advanced, that are especially pertinent to the use of combinators in computer science:
+
Here are three references on combinatory logic and lambda calculus, given in order of difficulty from introductory to advanced, that are especially pertinent to the use of combinators in computer science:
    
# Smullyan, R. (1985), ''To Mock a Mockingbird, And Other Logic Puzzles, Including an Amazing Adventure in Combinatory Logic'', Alfred A. Knopf, New York, NY.
 
# Smullyan, R. (1985), ''To Mock a Mockingbird, And Other Logic Puzzles, Including an Amazing Adventure in Combinatory Logic'', Alfred A. Knopf, New York, NY.
Line 2,274: Line 2,276:  
|-
 
|-
 
|
 
|
::<p><math>\begin{array}{c}
+
::<p><math>\dfrac{~ f : A \to B \quad g : B \to C ~}{gf : A \to C}</math></p>
\underline{~ f : A \to B ~~~~~ g : B \to C ~}
  −
\\
  −
gf : A \to C
  −
\end{array}</math></p>
   
|-
 
|-
 
|
 
|
Line 2,296: Line 2,294:  
|-
 
|-
 
|
 
|
<p>(Lambek & Scott, 5).
+
<p>(Lambek & Scott, 5).</p>
 
|}
 
|}
   Line 2,322: Line 2,320:  
===Natural Transformation===
 
===Natural Transformation===
   −
<pre>
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
| Definition 2.1.  Given functors F, G : $A$ -> $B$,
  −
| a 'natural transformation' t : F -> G is a family
  −
| of arrows t(A) : F(A) -> G(A) in $B$, one arrow for
  −
| each object A of $A$, such that the following square
  −
| commutes for all arrows f : A -> B in $A$:
  −
|
  −
|              t(A)
  −
| F(A) o------------------>o G(A)
  −
|      |                  |
  −
|      |                  |
  −
| F(f) |                  | G(f)
  −
|      |                  |
  −
|      v                  v
  −
| F(B) o------------------>o G(B)
  −
|              t(B)
  −
|
  −
| that is to say, such that
   
|
 
|
| G(f)t(A) =  t(B)F(f).
+
<p>'''Definition 2.1.'''  Given functors <math>F, G : \mathcal{A} \rightrightarrows \mathcal{B},</math> a ''natural transformation'' <math>t : F \to G</math> is a family of arrows <math>t(A) : F(A) \to G(A)</math> in <math>\mathcal{B},</math> one arrow for each object <math>A\!</math> of <math>\mathcal{A},</math> such that the following square commutes for all arrows <math>f : A \to B</math> in <math>\mathcal{A}</math>:</p>
</pre>
  −
 
  −
===Graph (Review)===
      
<pre>
 
<pre>
| We recall (Part 0, Definition 1.2) that, for categories,
  −
| a 'graph' consists of two classes and two mappings
  −
| between them:
  −
|
  −
| o--------------o      source      o--------------o
  −
| |              | ----------------> |              |
  −
| |  Arrows    |                  |  Objects    |
  −
| |              | ----------------> |              |
  −
| o--------------o      target      o--------------o
  −
|
  −
| In graph theory the arrows are usually called "oriented edges"
  −
| and the objects "nodes" or "vertices", but in various branches
  −
| of mathematics other words may be used.  Instead of writing
  −
|
  −
| source(f)  =  A,
  −
|
  −
| target(f)  =  B,
  −
|                                  f
  −
| one often writes f : A -> B or A ---> B.  We shall
  −
| look at graphs with additional structure which are
  −
| of interest in logic.
  −
</pre>
     −
===Deductive System===
+
                  t(A)
 +
    F(A) o------------------>o G(A)
 +
          |                  |
 +
          |                  |
 +
    F(f) |                  | G(f)
 +
          |                  |
 +
          v                  v
 +
    F(B) o------------------>o G(B)
 +
                  t(B)
   −
<pre>
  −
| A 'deductive system' is a graph with a specified arrow
  −
|
  −
|          1_A
  −
| R1a.  A -----> A,
  −
|
  −
| and a binary operation on arrows ('composition')
  −
|
  −
|          f          g
  −
|        A ---> B    B ---> C
  −
| R1b.  ----------------------
  −
|                gf
  −
|              A ----> C
   
</pre>
 
</pre>
   −
===Conjunction Calculus===
+
<p>that is to say, such that</p>
 
+
|-
<pre>
  −
| A 'conjunction calculus' is a deductive system dealing with truth and
  −
| conjunction.  Thus we assume that there is given a formula 'T' (= true)
  −
| and a binary operation '&' (= and) for forming the conjunction A & B of
  −
| two given formulas A and B.  Moreover, we specify the following additional
  −
| arrows and rules of inference:
   
|
 
|
|          O_A
+
<p><math>G(f)t(A) = t(B)F(f).\!</math></p>
| R2.    A -----> T,
+
|-
 
|
 
|
|              p1_A,B
+
<p>{Lambek & Scott, 8).</p>
| R3a.  A & B --------> A,
+
|}
|
  −
|              p2_A,B
  −
| R3b.  A & B --------> B,
  −
|
  −
|          f          g
  −
|        C ---> A    C ---> B
  −
| R3c. ----------------------.
  −
|          <f, g>
  −
|       C --------> A & B
  −
</pre>
     −
===Positive Intuitionistic Propositional Calculus===
+
===Graph 2===
   −
<pre>
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
| A 'positive intuitionistic propositional calculus' is a conjunction calculus
  −
| with an additional binary operation '<=' (= if).  Thus, if A and B are formulas,
  −
| so are T, A & B, and A <= B.  (Yes, most people write B => A instead.)  We also
  −
| specify the following new arrow and rule of inference:
   
|
 
|
|                     !e!_A,B
+
<p>We recall &hellip; that, for categories, a ''graph'' consists of two classes and two mappings between them:</p>
| R4a.  (A <= B) & B ---------> A,
+
 
 +
<center><pre>
 +
 
 +
o--------------o      source      o--------------o
 +
|              | ----------------> |              |
 +
|  Arrows    |                  |  Objects    |
 +
|             | ----------------> |              |
 +
o--------------o      target      o--------------o
 +
 
 +
</pre></center>
 +
 
 +
<p>In graph theory the arrows are usually called ''oriented edges'' and the objects ''nodes'' or ''vertices'', but in various branches of mathematics other words may be used.  Instead of writing</p>
 +
|-
 
|
 
|
|              h
+
::<p><math>\operatorname{source}(f) = A, \quad \operatorname{target}(f)  = B,</math></p>
|        C & B ---> A
+
|-
| R4b. ----------------.
  −
|          h*
  −
|       C ----> A <= B
   
|
 
|
</pre>
+
<p>one often writes <math>f : A \to B</math> or <math>A \xrightarrow{~f~} B.</math>  We shall look at graphs with additional structure which are of interest in logic.</p>
 +
 
 +
<p>(Lambek & Scott, 47).</p>
 +
|}
   −
===Intuitionistic Propositional Calculus===
+
===Deductive System 2===
   −
<pre>
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
| An 'intuitionistic propositional calculus' is more than a
  −
| positive one;  it requires also falsehood and disjunction,
  −
| that is, a formula 'F' (= false) and an operation 'v' (= or)
  −
| on formulas, together with the following additional arrows:
   
|
 
|
|          []_A
+
<p>A ''deductive system'' is a graph with a specified arrow</p>
| R5.    F ------> A,
+
|-
 
|
 
|
|          k1_A,B
+
<p><math>\text{R1a.} \quad A ~\xrightarrow{~1_A~}~ A,</math></p>
| R6a.  A --------> A v B,
+
|-
 
|
 
|
|          k2_A,B
+
<p>and a binary operation on arrows (''composition'')
| R6b.  B --------> A v B,
+
|-
 
|
 
|
|                            !z!^C_A,B
+
<p><math>\text{R1b.} \quad \dfrac{~ A ~\xrightarrow{~f~}~ B \quad B ~\xrightarrow{~g~}~ C ~}{A ~\xrightarrow{~gf~}~ C}.</math></p>
| R6c. (C <= A) & (C <= B) -----------> C <= (A v B).
+
|-
</pre>
  −
 
  −
===Classical Propositional Calculus===
  −
 
  −
<pre>
  −
| If we want 'classical' propositional logic, we must also require:
   
|
 
|
| R7.  F <= (F <= A) -> A.
+
<p>(Lambek & Scott, 47).</p>
</pre>
+
|}
   −
===Category (Review)===
+
===Conjunction Calculus===
   −
<pre>
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
| A 'category' is a deductive system in which
  −
| the following equations hold between proofs:
   
|
 
|
| E1f 1_A  f,
+
<p>A ''conjunction calculus'' is a deductive system dealing with truth and conjunctionThus we assume that there is given a formula <math>\operatorname{T}</math> (&nbsp;=&nbsp;true) and a binary operation <math>\land</math> (&nbsp;=&nbsp;and) for forming the conjunction <math>A \land B</math> of two given formulas <math>A\!</math> and <math>B.\!</math> Moreover, we specify the following additional arrows and rules of inference:</p>
 +
|-
 
|
 
|
|     1_B f f,
+
<p><math>\begin{array}{ll}
|
+
\text{R2.}  & A ~\xrightarrow{~\bigcirc_A~}~ \operatorname{T};
|     (hg)f = h(gf),
+
\\[8pt]
|
+
\text{R3a.} & A \land B ~\xrightarrow{~\pi_{A, B}~}~ A,
| for all f : A -> B, g : B -> C, h : C -> D.
+
\\[8pt]
</pre>
+
\text{R3b.} & A \land B ~\xrightarrow{~\pi'_{A, B}~}~ B,
 
+
\\[8pt]
===Cartesian Category===
+
\text{R3c.} & \dfrac{~ C ~\xrightarrow{~f~}~ A \quad C ~\xrightarrow{~g~}~ B ~}{C ~\xrightarrow{~\langle f, g \rangle~}~ A \land B}.
 
+
\end{array}</math></p>
<pre>
+
|-
| A 'cartesian category' is both a category
+
|
| and a conjunction calculus satisfying the
+
<p>(Lambek & Scott, 47&ndash;48).</p>
| additional equations:
+
|}
|
+
 
| E2.   f = O_A, for all f : A -> T.
+
===Positive Intuitionistic Propositional Calculus===
|
+
 
| E3a. p1_A,B <f, g= f,
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
|
+
|
| E3b. p2_A,B <f, g= g,
+
<p>A ''positive intuitionistic propositional calculus'' is a conjunction calculus with an additional binary operation <math>\Leftarrow</math> (&nbsp;=&nbsp;if).  Thus, if <math>A\!</math> and <math>B\!</math> are formulas, so are <math>\operatorname{T},</math> <math>A \land B,</math> and <math>A \Leftarrow B.</math>  (Yes, most people write <math>B \Rightarrow A</math> instead.)  We also specify the following new arrow and rule of inference.</p>
|
+
|-
| E3c. <p1_A,B h, p2_A,B h= h,
+
|
|
+
<p><math>\begin{array}{ll}
| for all f : C -> A, g : C -> B, h : C -> A & B.
+
\text{R4a.} & (A \Leftarrow B) \land B ~\xrightarrow{~\varepsilon_{A, B}~}~ A,
</pre>
+
\\[8pt]
 
+
\text{R4b.} & \dfrac{~ C \land B ~\xrightarrow{~h~}~ A ~}{~ C ~\xrightarrow{~h^*~}~ A \Leftarrow B ~}.
===Cartesian Closed Category===
+
\end{array}</math></p>
 
+
|-
<pre>
+
|
| A 'cartesian closed category' is a cartesian category $A$ with
+
<p>(Lambek & Scott, 48&ndash;49).</p>
| additional structure R4 satisfying the additional equations:
+
|}
|
+
 
| E4a.   !e!_A,B <h* p1_C,B, p2_C,B>    = h,
+
===Intuitionistic Propositional Calculus===
|
+
 
| E4b. (!e!_A,B <k p1_C,B, p2_C,B>)* = k,
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
|
+
|
| for all h : C & B -> Ak : C -> (A <= B).
+
<p>An ''intuitionistic propositional calculus'' is more than a positive one; it requires also falsehood and disjunction, that is, a formula <math>\bot</math> (&nbsp;=&nbsp;false) and an operation <math>\lor</math> (&nbsp;=&nbsp;or) on formulas, together with the following additional arrows:</p>
|
+
|-
| Thus, a cartesian closed category is
+
|
| a positive intuitionistic propositional
+
<p><math>\begin{array}{ll}
| calculus satisfying the equations E1 to E4.
+
\text{R5.} & \bot ~\xrightarrow{~\Box_A~}~ A;
| This illustrates the general principle that
+
\\[8pt]
| one may obtain interesting categories from
+
\text{R6a.} & A ~\xrightarrow{~\kappa_{A, B}~}~ A \lor B,
| deductive systems by imposing an appropriate
+
\\[8pt]
| equivalence relation on proofs.
+
\text{R6b.} & B ~\xrightarrow{~\kappa'_{A, B}~}~ A \lor B,
</pre>
+
\\[8pt]
 
+
\text{R6c.} & (C \Leftarrow A) \land (C \Leftarrow B) ~\xrightarrow{~\zeta^C_{A, B}~}~ C \Leftarrow (A \lor B).
==Document History==
+
\end{array}</math></p>
 
+
|-
===Inquiry List, Series A : Jun&ndash;Jul 2004===
+
|
 
+
<p>(Lambek & Scott, 49&ndash;50).</p>
* http://stderr.org/pipermail/inquiry/2004-June/thread.html#1643
+
|}
* http://stderr.org/pipermail/inquiry/2004-July/thread.html#1677
+
 
# http://stderr.org/pipermail/inquiry/2004-June/001643.html
+
===Classical Propositional Calculus===
# http://stderr.org/pipermail/inquiry/2004-June/001644.html
+
 
# http://stderr.org/pipermail/inquiry/2004-June/001645.html
+
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
# http://stderr.org/pipermail/inquiry/2004-June/001660.html
+
|
# http://stderr.org/pipermail/inquiry/2004-June/001648.html
+
<p>If we want ''classical'' propositional logic, we must also require:
 +
|-
 +
|
 +
<p><math>\begin{array}{ll}
 +
\text{R7.} & (\bot \Leftarrow (\bot \Leftarrow A)) \to A.
 +
\end{array}</math></p>
 +
|-
 +
|
 +
<p>(Lambek & Scott, 50).</p>
 +
|}
 +
 
 +
===Category 2===
 +
 
 +
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
 +
|
 +
<p>A ''category'' is a deductive system in which the following equations hold between proofs:</p>
 +
|-
 +
|
 +
<p><math>\begin{array}{ll}
 +
\text{E1.} & f 1_A = f, \qquad 1_B f = f, \qquad (hg)f = h(gf),
 +
\\[8pt]
 +
& \text{for all}~ f : A \to B, \quad g : B \to C, \quad h : C \to D.
 +
\end{array}</math></p>
 +
|-
 +
|
 +
<p>(Lambek & Scott, 52).</p>
 +
|}
 +
 
 +
===Cartesian Category===
 +
 
 +
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
 +
|
 +
<p>A ''cartesian category'' is both a category and a conjunction calculus satisfying the additional equations:</p>
 +
|-
 +
|
 +
<p><math>\begin{array}{ll}
 +
\text{E2.}  & f = \bigcirc_A, \quad \text{for all}~ f : A \to \operatorname{T};
 +
\\[8pt]
 +
\text{E3a.} & \pi^{}_{A,B} \langle f, g \rangle = f,
 +
\\[8pt]
 +
\text{E3b.} & \pi^\prime_{A,B} \langle f, g \rangle = g,
 +
\\[8pt]
 +
\text{E3c.} & \langle \pi^{}_{A,B} h, \pi^\prime_{A,B} h \rangle = h,
 +
\\[8pt]
 +
& \text{for all}~ f : C \to A, \quad g : C \to B, \quad h : C \to A \land B.
 +
\end{array}</math></p>
 +
|-
 +
|
 +
<p>(Lambek & Scott, 52).</p>
 +
|}
 +
 
 +
===Cartesian Closed Category===
 +
 
 +
{| align="center" cellpadding="8" width="90%" <!--QUOTE-->
 +
|
 +
<p>A ''cartesian closed category'' is a cartesian category <math>\mathcal{A}</math> with additional structure <math>\text{R4}\!</math> satisfying the additional equations:</p>
 +
|-
 +
|
 +
<p><math>\begin{array}{ll}
 +
\text{E4a.} & \varepsilon^{}_{A,B} \langle h^* \pi^{}_{C,B}, \pi^\prime_{C,B} \rangle = h,
 +
\\[8pt]
 +
\text{E4b.} & (\varepsilon^{}_{A,B} \langle k \pi^{}_{C,B}, \pi^\prime_{C,B} \rangle)^* = k,
 +
\\[8pt]
 +
& \text{for all}~ h : C \land B \to A \quad \text{and} \quad k : C \to (A \Leftarrow B).
 +
\end{array}</math></p>
 +
|-
 +
|
 +
<p>Thus, a cartesian closed category is a positive intuitionistic propositional calculus satisfying the equations <math>\text{E1}\!</math> to <math>\text{E4}.\!</math>  This illustrates the general principle that one may obtain interesting categories from deductive systems by imposing an appropriate equivalence relation on proofs.</p>
 +
 
 +
<p>(Lambek & Scott, 53).</p>
 +
|}
 +
 
 +
==Document History==
 +
 
 +
===Inquiry List, Series A : Jun&ndash;Jul 2004===
 +
 
 +
* http://stderr.org/pipermail/inquiry/2004-June/thread.html#1643
 +
* http://stderr.org/pipermail/inquiry/2004-July/thread.html#1677
 +
# http://stderr.org/pipermail/inquiry/2004-June/001643.html
 +
# http://stderr.org/pipermail/inquiry/2004-June/001644.html
 +
# http://stderr.org/pipermail/inquiry/2004-June/001645.html
 +
# http://stderr.org/pipermail/inquiry/2004-June/001660.html
 +
# http://stderr.org/pipermail/inquiry/2004-June/001648.html
 
# http://stderr.org/pipermail/inquiry/2004-June/001649.html
 
# http://stderr.org/pipermail/inquiry/2004-June/001649.html
 
# http://stderr.org/pipermail/inquiry/2004-June/001656.html
 
# http://stderr.org/pipermail/inquiry/2004-June/001656.html
Line 2,595: Line 2,609:  
# http://stderr.org/pipermail/inquiry/2005-July/002895.html
 
# http://stderr.org/pipermail/inquiry/2005-July/002895.html
 
# http://stderr.org/pipermail/inquiry/2005-July/002896.html
 
# http://stderr.org/pipermail/inquiry/2005-July/002896.html
 +
 +
[[Category:Combinator Calculus]]
 +
[[Category:Combinatory Logic]]
 +
[[Category:Computer Science]]
 +
[[Category:Graph Theory]]
 +
[[Category:Lambda Calculus]]
 +
[[Category:Logic]]
 +
[[Category:Logical Graphs]]
 +
[[Category:Mathematics]]
 +
[[Category:Programming Languages]]
 +
[[Category:Type Theory]]
12,080

edits

Navigation menu