Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
% (find-angg "LATEX/2008typesystems.tex")
% (find-dn4ex "edrx08.sty")
% (find-angg ".emacs.templates" "s2008a")
% (defun c () (interactive) (find-zsh "cd ~/LATEX/ && ~/dednat4/dednat41 2008typesystems.tex && latex    2008typesystems.tex"))
% (defun c () (interactive) (find-zsh "cd ~/LATEX/ && ~/dednat4/dednat41 2008typesystems.tex && pdflatex 2008typesystems.tex"))
% (eev "cd ~/LATEX/ && Scp 2008typesystems.{dvi,pdf} edrx@angg.twu.net:slow_html/LATEX/")
% (find-dvipage "~/LATEX/2008typesystems.dvi")
% (find-pspage  "~/LATEX/2008typesystems.pdf")
% (find-zsh0 "cd ~/LATEX/ && dvips -D 300 -o 2008typesystems.ps 2008typesystems.dvi")
% (find-pspage  "~/LATEX/2008typesystems.ps")
% (find-zsh0 "cd ~/LATEX/ && dvips -D 300 -o tmp.ps tmp.dvi")
% (find-pspage  "~/LATEX/tmp.ps")

% TODO: borrow more from:
% (find-LATEX    "2002fmcs.tex")
% (find-LATEXdvi "2002fmcs.dvi")

% «.intro-to-bhk»		(to "intro-to-bhk")
% «.witnesses-vs-proofs»	(to "witnesses-vs-proofs")
% «.intro-to-ptss»		(to "intro-to-ptss")
% «.notation-space-of»		(to "notation-space-of")
% «.dependent-types»		(to "dependent-types")
% «.spaces-of-witnesses-set»	(to "spaces-of-witnesses-set")
% «.typing-categories-1»	(to "typing-categories-1")
% «.typing-categories-2»	(to "typing-categories-2")
% «.typing-categories-3»	(to "typing-categories-3")

\usepackage{edrx08}       % (find-dn4ex "edrx08.sty")
%L process "edrx08.sty"  -- (find-dn4ex "edrx08.sty")
\input edrxheadfoot.tex   % (find-dn4ex "edrxheadfoot.tex")

\input 2008typesystems.dnt

% (eedn4-51-bounded)

Index of the slides:
% To update the list of slides uncomment this line:
% then rerun LaTeX on this file, and insert the contents of "tmp.los"
% below, by hand (i.e., with "insert-file"):
% (find-fline "tmp.los")
% (insert-file "tmp.los")
\tocline {Introduction to BHK} {2}
\tocline {Spaces of witnesses as spaces of proofs, collapsed} {3}
\tocline {Pure Type Systems} {4}
\tocline {Notation (temporary) for ``the space of''} {5}
\tocline {Dependent types} {6}
\tocline {Spaces of witnesses in Set} {7}
\tocline {Typing categories (1)} {8}
\tocline {Typing categories (2)} {9}
\tocline {Typing categories (3)} {10}


% --------------------
% «intro-to-bhk»  (to ".intro-to-bhk")
% (s "Introduction to BHK" "intro-to-bhk")
\myslide {Introduction to BHK} {intro-to-bhk}

Suppose that for atomic propositions P, Q, R(4,2), etc,
we know how to characterize what constitutes a ``proof''
of P, Q, R(4,2), etc.

Write W[P] for the ``space of proofs of P'',
W[R(4,2)] for the ``space of proofs of R(4,2)'',
and so on.

The BHK (Brouwer-Heyting-Kolmogorov) interpretation
tells us how to build the ``spaces of (constructive)
proofs'' for all (bigger) formulas whose atomic
formulas are just P, Q, R(4,2), etc... the rules are:

  W[P&Q] := W[P]×W[Q]
  W[P⊃Q] := W[P]->W[Q]
  W[P∨Q] := {0}×W[P]  {1}×W[Q]
    W[] := {*}
    W[] := \emptyset
  W[aA.P(a)] := åaA.W[P(a)]
  W[aA.P(a)] := ÆaA.W[P(a)]

Note that this is different from just saying that
``the space of witnesses of P is a singleton when
P is true, and the empty set when P is false'' -
because W[∨] = {(0,*),(1,*)}
and W[n\N.] = {(0,*),(1,*),(2,*),...} -
`∨' and `' take us out of the realm of sets
of size 0/1.

% --------------------
% «witnesses-vs-proofs»  (to ".witnesses-vs-proofs")
% (s "Spaces of witnesses as spaces of proofs, collapsed" "witnesses-vs-proofs")
\myslide {Spaces of witnesses as spaces of proofs, collapsed} {witnesses-vs-proofs}

Our (archetypical) space of truth-values:
   = {0, 1} = {{}, {*}}
A ``space of witnesses'' for us is a set
that is ``at most a singleton'' (size=0/1).

  a:A:     A is a set, a is an element of A
  P:Ï[P]:  Ï[P] is a space of witnesses,
            P is a witness for the proposition P.

Interpreting BHK categorically is hard, and uncommon
(see Palmgren 2002; it refers to Makkai/Reyes 1977).
Interpreting propositions using this 
(like BHK, but collapsing the spaces of proofs into
sets that are ``at most singletons'') is easy,
and that's what we will do.

In BHK we start from W[P], W[Q], W[R(4,2)], ...
and we build all the spaces of proofs for propostions
whose atomic propositions are just these.

Here we will also start from spaces of witnesses
for the atomic propositions, and build all other
spaces of witnesses from them.

In the archetypical model - Set - these spaces of
witnesses will be exactly what we expect
(classical logic).

In some toposes the logic will be intuitionistic,
not classical - for example, we may have
Ï[P] \subsetneq Ï[P].

% --------------------
% «intro-to-ptss»  (to ".intro-to-ptss")
% (s "Pure Type Systems" "intro-to-ptss")
\myslide {Pure Type Systems} {intro-to-ptss}

PTSs generalize the type system for -calculus
that we've seen (``1'') and other systems that
we will see.

We have supposed that we knew sets A, B, C
to derive:


In a PTS we don't have any constants besides the
``sorts'', that typically are ::ñ, whose intended
semantics are, VERY roughly:

  ñ   (the class of all) classes
     (the class of all) sets
     the set of truth-values
      ( has two elements, ``true'' and ``false'')

Constants - like:


can be added later, as ``impurities''.

The idea is that Pure Type Systems are flexible enough
to let us declare the constants that we need as
variables in the beginning of a context.

In a PTS we can derive:

  A:,B:,C:,f:(B->C) |- (p:A×B.<p,f('p)>):A×B->A×C

which, in DNC notation, shrinks to:


% --------------------
% «notation-space-of»  (to ".notation-space-of")
% (s "Notation (temporary) for ``the space of''" "notation-space-of")
\myslide {Notation (temporary) for ``the space of''} {notation-space-of}

  {a,b|P(a,b)}          {a,b|P(a,b)}
       v                     v
       |       becomes:      |
       v                     v
      A×B                  {a,b}

We will write ``{a,b}'' for A×B.
``{a,b}'' will stand for ``the set of all
possible values for (a,b)''.

Note that this conflicts with the
set-theoretical usage - ``the set with
two elements, a and b''...

(I used to use \E[a,b] for {a,b}, but
many people felt that that was too weird...)

The same notation - {a,b} - will also work
for ``dependent types'' (next slides), where
a:A,b:B_a, and B_a depends on a...

% --------------------
% «dependent-types»  (to ".dependent-types")
% (s "Dependent types" "dependent-types")
\myslide {Dependent types} {dependent-types}

Suppose that we have:

  A              a set: the space of `a's
  (B_a)_{a:A}    a family of sets/spaces (of `b's)
  (C_a)_{a:A}    another family of sets
  (D_abc)_{(a,b,c):\{a,b,c\}}  another family

Note that

  {a:A,b:B_a,c:C_a} ----> {a:A,c:C_a}
          |     __|            |
          |                    |
          v                    v
     {a:A,b:B_a} ----------> {a:A}

is a pullback.

Alternative notations:

  {a,b,c} ----> {a,c}     a,b,c |----> a,c
     | __|        |         -  __|      -  
     |            |         |           |  
     v            v         v           v  
   {a,b} ------> {a}       a,b |------> a 

Maps (between ``contexts'') that just drop
the last variable - all but the top one in
the squares above - are called ``one-step

What are ``generalized projections''?
We will see that later...

% --------------------
% «spaces-of-witnesses-set»  (to ".spaces-of-witnesses-set")
% (s "Spaces of witnesses in Set" "spaces-of-witnesses-set")
\myslide {Spaces of witnesses in Set} {spaces-of-witnesses-set}

More families:

  (\P_ab)_{(a,b):\{a,b\}}      a family of spaces of witnesses,
  (\Q_a)_{a:A}                 another,
  (\R_ab)_{(a,b):\{a,b\}}      another.

We can use spaces of witnesses to represent propositions:
a proposition is false when its space of witnesses is empty,
true when it is non-empty.

  {a,b||P(a,b)} |---> {a||b.P(a,b)}
  {a,b||R(a,b)} |---> {a||b.R(a,b)}

% --------------------
% «typing-categories-1»  (to ".typing-categories-1")
% (s "Typing categories (1)" "typing-categories-1")
\myslide {Typing categories (1)} {typing-categories-1}

A category is a 7-uple,

  (Objs, Hom, id, , idL, idR, assoc)

where the first four components are ``structure''
and the last three are ``properties''.

They can by typed like this:
(this looks indirect, but can be formalized...
note that this is a locally small category -
its hom-sets are sets, not classes)



We are using some shorthands...
The constants that we are declaring are actually

  Hom(A,B) := (Hom) A B
  id_A     := (id) A
  (gf)    := () A B C f g
  idL_f    := (idL) A B f
  idR_f    := (idR) A B f
  assoc(f,g,h) := (assoc) A B C D f g h

and we are using ``identity types'':

      W[x=x'] := Eq X x x'

and we should imagine that we also have terms that
assert that this ``equality'' is reflexive, symmetric,
transitive, and stable by substitutions - but these
terms will not be used in the spefication of the
typing of a category.

% --------------------
% «typing-categories-2»  (to ".typing-categories-2")
% (s "Typing categories (2)" "typing-categories-2")
\myslide {Typing categories (2)} {typing-categories-2}

Let's make this typing less indirect.
Instead of:




The exact typing of (Hom), (id), (), etc is immaterial -
for example, (Hom) can be either :(Objs->(Objs->)) or
:(Objs×Objs->), it doesn't matter.

(1) The domains of these functions are too big.
(2) We need dependent types. 
Let's examine one particular case: \Set.




Some domains of functions are  - a class, not a set -
and, in (id) - the ``polymorphic identity'' -
the space where a:A.a lives - A->A - depends on A... 

% --------------------
% «typing-categories-3»  (to ".typing-categories-3")
% (s "Typing categories (3)" "typing-categories-3")
\myslide {Typing categories (3)} {typing-categories-3}

Some of these terms can only be declared after others have
been declared: (Hom) after Objs, (id) and () after Hom...

``Earlier'' terms and variables appear higher at
derivation trees than ``later'' terms and variables...
Here's a diagram showing the dependencies:

        /   \
       |    / \
     idL,idR   assoc

It is possible to build the ``space of all categories'',
but it will depend on the order that we will choose for
the components - and then we would define Objs, Hom, etc,
as certain components of these 7-uples...


(Actually the first `Æ' - ÆObjs:ñ._ - is problematic, as
it would require a sort above ñ - but this is not
important now)

% Add:
% Propositions as dependent types
%   Ï[P].P satisfiable
%   Ï[P].P⊃P tautology
%              (and theorem)
% Blob diagram
% (find-es "tex" "ovals")

% Doctrinal diagram
% Smashing operator

% PTSs with minimal contexts

% Category of contexts

% Projections form a preorder
% Products are pullbacks
% What are the conditions on sections?
%   They can only be added after their
%   inverses; they must commute with what?
% An a|->a,b says that a,b has as much information as a.
% Comparison with quotients (on HAs) and equations (a<->a,b)

% Display maps
% Projections, generalized projections, proper projections,
% one step projections; unit types; the formal way to see
% variables

% Diagram for a,b`->a,b,b',(b=b')
% A magic rule says that this is not just a section



% Local Variables:
% coding:           raw-text-unix
% ee-anchor-format: "«%s»"
% End: