├── latexmkrc ├── mathpartir.sty ├── transcription-note.tex ├── cartmell-style.tex ├── .gitignore ├── README.md ├── cartmell-thesis.tex ├── status.md ├── 0-preface.tex ├── cartmell-macros.tex ├── cartmell-bib.bib ├── lumsdaine-biblatex-misc.sty ├── amsalphaurlmod.bst └── 3-mltt.tex /latexmkrc: -------------------------------------------------------------------------------- 1 | @default_files = ('cartmell-thesis.tex'); -------------------------------------------------------------------------------- /mathpartir.sty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peterlefanulumsdaine/cartmell-thesis/HEAD/mathpartir.sty -------------------------------------------------------------------------------- /transcription-note.tex: -------------------------------------------------------------------------------- 1 | The present \LaTeX{} version was prepared collaboratively in 2014--\placeholder{20??} by the contributors listed below. 2 | % 3 | The OCR software \placeholder{details?} was of great assistance during in the process. 4 | 5 | Contributors: 6 | Peter LeFanu Lumsdaine, 7 | Riccardo Borsetto, 8 | Nathan Guermond, 9 | James Leslie. 10 | 11 | \comment{For now this is in rough order of contribution amount — maybe alphabetical would be better?} -------------------------------------------------------------------------------- /cartmell-style.tex: -------------------------------------------------------------------------------- 1 | %%%% 2 | % Geometry and layout 3 | %%%% 4 | 5 | \geometry{b5paper, hmargin=2.5cm, vmargin=3cm} 6 | % B5, 12pt, traditional book/journal textblock, comfortable margins 7 | 8 | %%%% 9 | % TOC, section headings, etc 10 | %%%% 11 | 12 | \setcounter{tocdepth}{1} 13 | \setcounter{secnumdepth}{2} 14 | 15 | %%%% 16 | % Theorem-type environments 17 | %%%% 18 | 19 | \theoremstyle{plain} 20 | \newtheorem{theorem}[paragraph]{Theorem} 21 | \newtheorem{proposition}[paragraph]{Proposition} 22 | \newtheorem{lemma}[paragraph]{Lemma} 23 | \newtheorem{corollary}[paragraph]{Corollary} 24 | \newtheorem{scholium}[paragraph]{Scholium} 25 | \newtheorem{conjecture}[paragraph]{Conjecture} 26 | 27 | \theoremstyle{definition} 28 | \newtheorem{definition}[paragraph]{Definition} 29 | \newtheorem{exercise}[paragraph]{Exercise} 30 | 31 | \theoremstyle{remark} 32 | \newtheorem{remark}[paragraph]{Remark} 33 | \newtheorem{remarks}[paragraph]{Remarks} 34 | \newtheorem{notation}[paragraph]{Notations} 35 | \newtheorem{example}[paragraph]{Example} 36 | \newtheorem{examples}[paragraph]{Examples} 37 | 38 | 39 | %%% Local Variables: 40 | %%% mode: latex 41 | %%% TeX-master: "cartmell-thesis" 42 | %%% End: -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | 10 | ## Intermediate documents: 11 | *.dvi 12 | # *.ps 13 | # *.eps 14 | *.pdf 15 | 16 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 17 | *.bbl 18 | *.bcf 19 | *.blg 20 | *-blx.aux 21 | *-blx.bib 22 | *.run.xml 23 | 24 | ## Build tool auxiliary files: 25 | *.fdb_latexmk 26 | *.synctex.gz 27 | *.synctex.gz(busy) 28 | *.pdfsync 29 | 30 | ## Auxiliary and intermediate files from other packages: 31 | 32 | # algorithms 33 | *.alg 34 | *.loa 35 | 36 | # amsthm 37 | *.thm 38 | 39 | # beamer 40 | *.nav 41 | *.snm 42 | *.vrb 43 | 44 | # glossaries 45 | *.acn 46 | *.acr 47 | *.glg 48 | *.glo 49 | *.gls 50 | 51 | # hyperref 52 | *.brf 53 | 54 | # listings 55 | *.lol 56 | 57 | # makeidx 58 | *.idx 59 | *.ilg 60 | *.ind 61 | *.ist 62 | 63 | # minitoc 64 | *.maf 65 | *.mtc 66 | *.mtc0 67 | 68 | # minted 69 | *.pyg 70 | 71 | # nomencl 72 | *.nlo 73 | 74 | # sagetex 75 | *.sagetex.sage 76 | *.sagetex.py 77 | *.sagetex.scmd 78 | 79 | # sympy 80 | *.sout 81 | *.sympy 82 | sympy-plots-for-*.tex/ 83 | 84 | # todonotes 85 | *.tdo 86 | 87 | # xindy 88 | *.xdy 89 | 90 | ## Non-LaTeX rules 91 | 92 | # Mac OS directory settings files 93 | .DS_Store 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cartmell-thesis 2 | =============== 3 | 4 | A collaborative project to TeXify Cartmell's PhD thesis “Generalised Algebraic Theories and Contextual Categories” — an important paper that’s currently not very accessible. 5 | 6 | The scanned original is available from http://peterlefanulumsdaine.com/files/cartmell-1978-phd-thesis.pdf. 7 | 8 | # General project notes 9 | 10 | ## Contributing 11 | 12 | - Please read and adhere to the conventions agreed on below! But feel free to make judgment calls as needed. 13 | - Use the [status file](status.md) to monitor + record progress, and reserve sections you’re currently working on. 14 | - New contributors: please fork and issue pull requests to contribute. 15 | 16 | # Conventions 17 | 18 | ## Faithfulness to original 19 | 20 | - General layout + formatting: stick roughly to original, but no need to bend over bakcwards. 21 | - Typos: correct unambiguous typos; if in doubt, leave unchanged but add comment for proofreaders. 22 | - Punctuation etc: stick closely to Cartmell's (sometimes idiosyncratic), except when inconsistent to the extent of being a typo. 23 | - Accents: add where missing. (Notably `Martin-L\"o{}f`). 24 | - Bibliography: probably modernise bibliography style; for now keep citation style unchanged (i.e. numeric), possibly change to a more reader-friendly style (e.g. alphabetical). 25 | 26 | ## General LaTeX style 27 | 28 | - Within a paragraph, separate sentences by blank-except-percent lines, e.g. 29 | 30 | This makes diffs clearer. 31 | % 32 | I learned this style from Andrej Bauer. 33 | 34 | - Mark page breaks of the source like follows: 35 | 36 | The source pdf is not searchable. 37 | % 38 | % source p2.17 39 | % 40 | Page numbers thus help navigation. 41 | 42 | - Labels/references: not fully decided yet, template `\ref{sec:source-1-8}` seems robust in this situation, and means one can input them from the link text without having to break flow and flip ahead to the linked section. Possibly change later to more semantic text though? 43 | 44 | - Cartmell often uses un-bulleted but line-broken lists (e.g. bottom of source p 1.4). For now, do as `itemize`? 45 | 46 | - Cartmell often uses inline numbered lists: do these with environment `enumerate*` 47 | 48 | ## Macros 49 | 50 | - ALWAYS use semantic macros! (How far to take this, though?) 51 | 52 | - Commands denoting syntax of object theories: all begin `\syn`, eg `\synHom` in discussing the theory of categories 53 | 54 | - single letter commands: undecided, but at least for now, keep descriptive, eg `\catC` for a *C* denoting a category, `\varV` for *V* denoting a set of variables, etc. 55 | 56 | 57 | -------------------------------------------------------------------------------- /cartmell-thesis.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{amsbook} 2 | 3 | %% Font/output handling 4 | \usepackage[T1]{fontenc} 5 | \usepackage{microtype} 6 | 7 | %% General math packages 8 | \usepackage{amsmath} 9 | \usepackage{stmaryrd} 10 | \usepackage{mathpartir} 11 | \usepackage{tikz-cd} 12 | 13 | %% Bibliography 14 | \usepackage[style=numeric]{biblatex} 15 | \usepackage{lumsdaine-biblatex-misc} 16 | \addbibresource{cartmell-bib.bib} 17 | 18 | %% Geometry adjustment 19 | \usepackage{geometry} 20 | 21 | %% General style packages 22 | \usepackage{xcolor} 23 | \definecolor{darkgreen}{rgb}{0,0.45,0} 24 | \definecolor{darkred}{rgb}{0.75,0,0} 25 | \definecolor{darkblue}{rgb}{0,0,0.6} 26 | \usepackage[colorlinks,citecolor=darkgreen,linkcolor=darkred,urlcolor=darkblue]{hyperref} 27 | \usepackage[shortlabels,inline]{enumitem} 28 | \usepackage{caption} 29 | \usepackage{subcaption} 30 | \usepackage{lipsum} 31 | 32 | 33 | \input{cartmell-style} 34 | \input{cartmell-macros} 35 | 36 | %% 37 | %% PDF metadata 38 | %% Can add /CreationDate, /Creator, /Subject, /Keywords 39 | %% 40 | \ifpdf 41 | \pdfinfo{ 42 | /Author (J. W. Cartmell) 43 | /Title (Generalised Algebraic Theories and Contextual Categories (PhD Thesis)) 44 | } 45 | \fi 46 | 47 | 48 | \begin{document} 49 | 50 | 51 | \frontmatter 52 | 53 | %% TITLE INFORMATION 54 | 55 | \title{Generalised Algebraic Theories and Contextual Categories} 56 | 57 | \author{J. W. Cartmell} 58 | 59 | \thispagestyle{empty} 60 | 61 | \begin{center} 62 | ~ \\ 63 | \vspace{3cm} 64 | {\Large\textsc{Generalised Algebraic Theories \\ and \\ Contextual Categories \\ ~ }} \\ 65 | \vspace{3cm} 66 | by \\ J. W. Cartmell \\ 67 | \vspace{7cm} 68 | Submitted for the degree of D.Phil.\\ Oxford University \\ 1978 \\ 69 | \end{center} 70 | 71 | \newpage 72 | 73 | \thispagestyle{empty} 74 | \begin{center} 75 | \textbf{Acknowledgement} \\ 76 | I am indebted to Professor Dana Scott \\ for supervision, criticism and direction. \\ 77 | \vspace{15cm} 78 | \LaTeX{} version in preparation \\ \url{https://github.com/peterlefanulumsdaine/cartmell-thesis} \\ Compiled \today 79 | \end{center} 80 | 81 | \clearpage 82 | 83 | \tableofcontents 84 | 85 | \chapter*{Preface} 86 | \label{ch:preface} 87 | \input{0-preface} 88 | 89 | \mainmatter 90 | 91 | % Main Matter 92 | 93 | \chapter{Generalised algebraic theories} 94 | \label{ch:gats} 95 | \input{1-gats} 96 | 97 | \chapter{Contextual categories} 98 | \label{ch:cxl-cats} 99 | \input{2-cxl-cats} 100 | 101 | \chapter{The algebraic semantics of Martin-Löf type theory} 102 | \label{ch:mltt} 103 | \input{3-mltt} 104 | 105 | \backmatter 106 | 107 | \chapter*{Transcription note} 108 | \input{transcription-note.tex} 109 | 110 | %% Bibliography Info 111 | 112 | \nocite{*} 113 | 114 | \printbibliography 115 | 116 | \end{document} 117 | 118 | -------------------------------------------------------------------------------- /status.md: -------------------------------------------------------------------------------- 1 | Status overview, contribution sign-up, and to-do list 2 | ==== 3 | 4 | # Status overview 5 | 6 | The list below gives a section-by-section overview of the draft status. Some expected statuses are 7 | - *none* 8 | - *OCR* (first draft automatically populated from OCR, not yet human-edited) 9 | - *BOOKED [name]* (*name* is intending to work on section) 10 | - *IN PROGRESS [name]* (*name* has started working on section) 11 | - *ROUGH [name(s)]* (rough human-edited draft complete, but significant formatting or other issues still outstanding) 12 | - *DONE [name(s)]* (good draft done, modulo final proofreading + consistency checks) 13 | 14 | Of course this is all flexible — anything self-explanatory is fine, really. 15 | 16 | Once a section is *DONE* or *POLISHED*, anyone who has carefully read it can add *PROOFED [nameX]*, so we can ensure that (if possible) each section gets proofread by at least one additional person. 17 | 18 | Suggestion: to start with, leave space for people to work in contiguous blocks. E.g. if person A has just done sections 1.1–1.5 and has 1.6 booked, then person B should not book 1.7 or 1.8; person B should start contributing at, say, 1.10 or 2.1. Of course, once we are nearly done and filling in smaller gaps, this no longer make sense. 19 | 20 | - Preface: DONE [pll] 21 | - 1.0 DONE [pll] 22 | - 1.1 ROUGH [pll] 23 | - 1.2 ROUGH [pll] 24 | - 1.3 DONE [pll] 25 | - 1.4 DONE [pll] 26 | - 1.5 ROUGH [nathan guermond] 27 | - 1.6 ROUGH [nathan] 28 | - 1.7 ROUGH [nathan] 29 | - 1.8 ROUGH [nathan] 30 | - 1.9 ROUGH [nathan] 31 | - 1.10 ROUGH [nathan] 32 | - 1.11 ROUGH [nathan] 33 | - 1.12 OCR 34 | - 1.13 OCR 35 | - 1.14 OCR 36 | - 2.1 ROUGH [JL] 37 | - 2.2 ROUGH [JL] 38 | - 2.3 IN PROGRESS [JL] 39 | - 2.4 OCR 40 | - 2.5 OCR 41 | - 3.0 OCR 42 | - 3.1 OCR 43 | - 3.2 OCR 44 | - 3.3 OCR 45 | - 3.4 OCR 46 | - 3.5 OCR 47 | 48 | # Todo list 49 | 50 | ## Infrastructure/organisation improvement 51 | 52 | - reduce font size in margin notes 53 | - add macro for inline transcription notes 54 | - improve/rationalise layout on title/dedication pages, and consider moving transcription statement to main title page 55 | - fix theorem numbering to follow C’s practice: most un-numbered, numbered items following e.g. “Lemma 1, Lemma 2, Corollary 3” within each chapter 56 | - add zref-clever for better internal links, and set up to match C’s style 57 | - set up alignment/spacing of enumerate/itemize globally (to look decent and roughly match C’s style) 58 | - consider setting up chapter/section headings to better match C’s style 59 | 60 | ## Content tasks 61 | 62 | (besides the implicit ones of going through content to get each section to “DONE” status above) 63 | 64 | - finish adding bib info for all items 65 | - (once all bib info added) check bib info for style consistency 66 | 67 | ## Consistency sweeps 68 | 69 | These should *not* be removed, as they may need re-checking periodically for new content 70 | 71 | - overful hboxes 72 | - spellchecking -------------------------------------------------------------------------------- /0-preface.tex: -------------------------------------------------------------------------------- 1 | 2 | % source p(i) 3 | 4 | A notion of equational theory is introduced; more general than previous notions, equal in descriptive power to the essentially algebraic theories of Freyd \cite{5:freyd}, and hence to the logic of left exact categories, we call the theories generalised algebraic. 5 | % 6 | The extra generality of these equational theories is achieved by the introduction of sort structures more general than those usually considered in that sorts may denote sets as is usual or else they may denote families of sets, families of families of sets and the like. 7 | % 8 | This acceptance of variable types at the level of syntax (the idea and the form of syntax is taken directly from Martin-Löf type theory) makes the theories particularly suited to the description of the structures that occur in category theory. 9 | % 10 | The basic example being the theory of categories, in which $\synOb$ appears as a sort to be interpreted as a set whereas $\synHom$ appears as a sort to be interpreted as a family of sets indexed by $\synOb \times \synOb$. 11 | % 12 | $\synHom(x,y)$ appears in the syntax as a variable type. 13 | 14 | The definition of the most general or algebraic semantics for generalised algebraic theories necessitates the introduction of the notion of a contextual category. 15 | % 16 | So called because we shall see that the objects of a contextual category should be thought of as contexts. 17 | 18 | The theory of contextual categories is seen as an algebraic description of the structure imposed on certain classes of term and type expressions by the operation of substitution of correctly typed term variables. 19 | % 20 | Now this is something one might also say of the theory of categories. 21 | % 22 | % source p(ii) 23 | % 24 | However the theory of contextual categories captures the structure of substitution at work in a more general situation, it is the structure of substitution as found in the generalised algebraic theories but not in algebraic theories, as found originally in Martin-Löf type theory but not in theories of the typed $\lambda$-calculus. 25 | 26 | It is proved that the category of contextual categories is equivalent to the category of generalised algebraic theories and equivalence classes of interpretations. 27 | % 28 | Thus we say that we have the most general possible semantics. 29 | % 30 | This result is a generalisation of the result implicit in Lawvere \cite{11:lawvere} that the old syntactic notion of algebraic theory (i.e.\ one sorted equational) and Lawvere's algebraic notion are both one and the same (i.e.\ equivalent categories). 31 | 32 | This thesis developed from a desire to develop the model theory of Martin-Löf type theory. 33 | % 34 | The model theory rests on the notions of generalised algebraic theory and contextual category. 35 | % 36 | It is only in these terms that we can define the notion model of Martin-Löf type theory. 37 | % 38 | We also give the definition of model for a strengthened version of Martin-Löf type theory, this definition can be reworked algebraically into a hyperdoctrinal format. 39 | % 40 | We briefly describe a new model of the type theory in which types are interpreted as limit spaces. 41 | 42 | The model theory of the strengthened version of Martin-Löf type theory is a generalisation of the well known correspondence of the typed $\lambda$-calculus with cartesian closed categories. 43 | 44 | %%% Local Variables: 45 | %%% mode: latex 46 | %%% TeX-master: "cartmell-thesis" 47 | %%% End: -------------------------------------------------------------------------------- /cartmell-macros.tex: -------------------------------------------------------------------------------- 1 | % Contents: 2 | % 3 | % - Binary relations 4 | % - Category names 5 | % - Single letters 6 | 7 | %%%% 8 | % Semantic markers for text 9 | %%%% 10 | 11 | \newcommand{\defemph}{\emph} % (possibly) emphasise a definiendum 12 | 13 | %%%% 14 | % Binary relations, operators 15 | %%%% 16 | 17 | %%%% 18 | % Single styled characters (or almost single) and character-like symbols 19 | %%%% 20 | 21 | \newcommand{\catTwo}{\mathbf{2}} % used for the arrow category 22 | 23 | \newcommand{\catA}{\catletter{A}} 24 | \newcommand{\catB}{\catletter{B}} 25 | \newcommand{\catC}{\catletter{C}} 26 | \newcommand{\catD}{\catletter{D}} 27 | \newcommand{\modM}{\mathcal{M}} 28 | \newcommand{\varsV}{\mathcal{V}} 29 | \newcommand{\thU}{\mathcal{U}} 30 | 31 | %%%% 32 | % Styled words: general 33 | %%%% 34 | 35 | % Categories 36 | \newcommand{\catletter}[1]{\mathbf{#1}} % single-letter categories 37 | \newcommand{\catword}[1]{\mathbf{#1}} % long-named categories 38 | 39 | \newcommand{\catCat}{\catword{Cat}} 40 | \newcommand{\catFam}{\catword{Fam}} 41 | \newcommand{\catGAT}{\catword{GAT}} 42 | \newcommand{\catSet}{\catword{Set}} 43 | \newcommand{\catLEX}{\catword{LEX}} 44 | \newcommand{\catCon}{\catword{Con}} 45 | 46 | \newcommand{\catalg}[1]{#1\text{-}\synalg} 47 | 48 | \DeclareMathOperator{\proj}{proj} 49 | %%%% 50 | % Styled words: type theory syntax 51 | %%%% 52 | 53 | \newcommand{\syn}[1]{\mathsf{#1}} 54 | 55 | % Standard environment for specifying a theory 56 | \newenvironment{theoryspec} 57 | {\begin{tabular}{ll} Symbol. & Introductory Rule. \\} 58 | {\end{tabular}} 59 | \newcommand{\axioms}{ \multicolumn{2}{l}{Axioms.} \\ } 60 | \newcommand{\oneaxiom}{ \multicolumn{2}{l}{Axiom.} \\ } 61 | \newcommand{\noaxioms}{ \multicolumn{2}{l}{Axioms---None.} \\ } 62 | \newcommand{\axiom}[1]{\multicolumn{2}{l}{#1} \\} 63 | 64 | % Parts of judgements 65 | \newcommand{\isatype}{\text{ is a type}} 66 | 67 | % Variables and metavariables: just use normal math font. 68 | 69 | % Constants of specific theories 70 | 71 | % Extensions by disjoint unions 72 | \newcommand{\synSum}{\mathop{\Sigma}\displaylimits} % TODO: sans serif sigma? 73 | \newcommand{\synPr}{\syn{Pr}} 74 | 75 | % Extensions by equality predicates 76 | \newcommand{\synEq}{\syn{Eq}} 77 | \newcommand{\synr}{\syn{r}} 78 | 79 | % Categories and functors 80 | \newcommand{\synOb}{\syn{Ob}} 81 | \newcommand{\synHom}{\syn{Hom}} 82 | \newcommand{\synid}{\syn{id}} 83 | \newcommand{\syno}{\syn{o}} 84 | \newcommand{\synF}{\syn{F}} 85 | \newcommand{\synMorph}{\syn{Morph}} 86 | \newcommand{\syncod}{\syn{cod}} 87 | \newcommand{\syndom}{\syn{dom}} 88 | %opposite category 89 | \newcommand{\synop}{\syn{op}} 90 | 91 | %%%% 92 | % Other operators 93 | %%%% 94 | 95 | \newcommand{\lhs}{\text{LHS}} 96 | \newcommand{\rhs}{\text{RHS}} 97 | 98 | %% for algebras 99 | \newcommand{\synalg}{\syn{alg}} 100 | 101 | %%%% 102 | % Chapter 2-3 macros (contextual categories, M-L type theory) 103 | %%%% 104 | 105 | % Pullback S operator (note: \S is reserved for section symbol §) 106 | \newcommand{\Sop}{\syn{S}} 107 | 108 | % Contextual category structure 109 | \newcommand{\synAtt}{\syn{Att}} % Attributes 110 | \newcommand{\synp}{\syn{p}} % Projection map 111 | \newcommand{\synq}{\syn{q}} % Canonical section 112 | 113 | % Type formers 114 | \newcommand{\synPi}{\mathop{\Pi}\displaylimits} % Pi type 115 | 116 | % Reindexing maps 117 | \newcommand{\syngamma}{\gamma} % Canonical isomorphism γ 118 | \newcommand{\synrho}{\rho} % ρ map 119 | 120 | % Base category 121 | \newcommand{\synBase}{\syn{Base}} % Base category functor 122 | 123 | \newcommand{\tuple}[1]{\langle #1 \rangle} 124 | \newcommand{\disjointunion}{\mathop{\dot{\bigcup}}} 125 | \newcommand{\Hom}{\operatorname{Hom}} 126 | 127 | %%%% 128 | % Other symbols 129 | %%%% 130 | 131 | \newcommand{\suchthat}{\ |\ } % for use in set comprehensions: \{ x \suchthat P(x) \} 132 | 133 | % Arrows 134 | \newcommand{\imp}{\leftrightarrow} % logical implication 135 | 136 | %%%% 137 | % Editing notes 138 | %%%% 139 | 140 | \newcommand{\comment}[1]{\marginpar{\textcolor{red}{#1}}} 141 | \newcommand{\placeholder}[1]{\textcolor{red}{#1}} 142 | 143 | %%% Local Variables: 144 | %%% mode: latex 145 | %%% TeX-master: "cartmell-thesis" 146 | %%% End: -------------------------------------------------------------------------------- /cartmell-bib.bib: -------------------------------------------------------------------------------- 1 | 2 | @phdthesis{1:barendregt, 3 | author = {Barendregt, H. P.}, 4 | title = {Some extensional models for combinatory logics and $\lambda$-calculus}, 5 | year = {1971}, 6 | institution = {Utrecht}, 7 | note = {\placeholder{TODO: complete details}} 8 | } 9 | 10 | @misc{2:benabou, 11 | author = {Bénabou, J.}, 12 | note = {\placeholder{Cartmell [2]. TODO: add details}} 13 | } 14 | 15 | @misc{3:birkhoff-lipson, 16 | author = {Birkoff, G. and Lipson, J. D.}, 17 | note = {\placeholder{Cartmell [3]. TODO: add details}} 18 | } 19 | 20 | @phdthesis{4:fourman, 21 | author = {Fourman, M.}, 22 | title = {Higher order intuitionistic logic and topoi}, 23 | year = {1974}, 24 | institution = {Oxford}, 25 | note = {\placeholder{TODO: complete details}} 26 | } 27 | 28 | @article{5:freyd, 29 | author = {Freyd, Peter}, 30 | title = {Aspects of topoi}, 31 | fjournal = {Bulletin of the Australian Mathematical Society}, 32 | journal = {Bull. Aust. Math. Soc.}, 33 | issn = {0004-9727}, 34 | volume = {7}, 35 | number = {1}, 36 | pages = {1--76}, 37 | year = {1972}, 38 | language = {English}, 39 | doi = {10.1017/S0004972700044828}, 40 | keywords = {18A15,18C10,18E20}, 41 | zbMATH = {3397715}, 42 | Zbl = {0252.18001} 43 | } 44 | 45 | @misc{6:hyland, 46 | author = {Hyland, J. M. E.}, 47 | note = {\placeholder{Cartmell [6]. TODO: add details}} 48 | } 49 | 50 | @misc{7:gray, 51 | author = {Gray, J. W.}, 52 | note = {\placeholder{Cartmell [7]. TODO: add details}} 53 | } 54 | 55 | @misc{8:gray, 56 | author = {Gray, J. W.}, 57 | note = {\placeholder{Cartmell [8]. TODO: add details}} 58 | } 59 | 60 | @misc{9:kelly, 61 | author = {Kelly, G. M.}, 62 | note = {\placeholder{Cartmell [9]. TODO: add details}} 63 | } 64 | 65 | @misc{10:kelly-street, 66 | author = {Kelly, G. M. and Street, R.}, 67 | note = {\placeholder{Cartmell [10]. TODO: add details}} 68 | } 69 | 70 | @article{11:lawvere, 71 | sortkey = {Laawvere-11}, 72 | AUTHOR = {Lawvere, F. William}, 73 | TITLE = {Functorial semantics of algebraic theories}, 74 | JOURNAL = {Proc. Nat. Acad. Sci. U.S.A.}, 75 | FJOURNAL = {Proceedings of the National Academy of Sciences of the United 76 | States of America}, 77 | VOLUME = {50}, 78 | YEAR = {1963}, 79 | PAGES = {869--872}, 80 | ISSN = {0027-8424}, 81 | MRCLASS = {18.10}, 82 | MRNUMBER = {158921}, 83 | MRREVIEWER = {M. Artin}, 84 | DOI = {10.1073/pnas.50.5.869}, 85 | URL = {https://doi.org/10.1073/pnas.50.5.869}, 86 | } 87 | 88 | @misc{12:lawvere, 89 | sortkey = {Laawvere-12}, 90 | AUTHOR = {Lawvere, F. William}, 91 | note = {\placeholder{Cartmell [12]. TODO: add details}} 92 | } 93 | 94 | @misc{13:lawvere, 95 | sortkey = {Laawvere-13}, 96 | AUTHOR = {Lawvere, F. William}, 97 | note = {\placeholder{Cartmell [13]. TODO: add details}} 98 | } 99 | 100 | @misc{14:lawvere, 101 | sortkey = {Laawvere-14}, 102 | AUTHOR = {Lawvere, F. William}, 103 | note = {\placeholder{Cartmell [14]. TODO: add details}} 104 | } 105 | 106 | @misc{15:lawvere, 107 | sortkey = {Laawvere-15}, 108 | AUTHOR = {Lawvere, F. William}, 109 | note = {\placeholder{Cartmell [15]. TODO: add details}} 110 | } 111 | 112 | @misc{16:lawvere, 113 | sortkey = {Laawvere-16}, 114 | AUTHOR = {Lawvere, F. William}, 115 | note = {\placeholder{Cartmell [16]. TODO: add details}} 116 | } 117 | 118 | @incollection{17:lawvere, 119 | sortkey = {Laawvere-17}, 120 | author = {Lawvere, F. William}, 121 | title = {Introduction to Part I}, 122 | year = {1975}, 123 | language = {English}, 124 | BOOKTITLE = {Model theory and topoi}, 125 | editor={Lawvere, F. William and Maurer, Christian and Wraith, Gavin C.}, 126 | series = {Lecture Notes in Mathematics}, 127 | volume = {445}, 128 | publisher = {Springer}, 129 | address="Berlin, Heidelberg", 130 | isbn="978-3-540-37495-4", 131 | pages = {3--14}, 132 | doi = {10.1007/BFb0061291} 133 | } 134 | } 135 | 136 | @article{18:lambek, 137 | author = {Lambek, J.}, 138 | title = {Deductive systems and categories. {I}: {Syntactic} calculus and residuated categories}, 139 | fjournal = {Mathematical Systems Theory}, 140 | journal = {Math. Syst. Theory}, 141 | issn = {0025-5661}, 142 | volume = {2}, 143 | pages = {287--318}, 144 | year = {1968}, 145 | language = {English}, 146 | doi = {10.1007/BF01703261}, 147 | zbMATH = {3281750}, 148 | Zbl = {0176.28901} 149 | } 150 | 151 | @misc{19:lambek, 152 | author = {Lambek, Joachim}, 153 | title = {Deductive systems and categories. {II}: {Standard} constructions and closed categories}, 154 | year = {1969}, 155 | language = {English}, 156 | howpublished = {Category {Theory} {Homology} {Theory} {Appl}., {Proc}. {Conf}. {Seattle} {Res}. {Center} {Battelle} {Mem}. {Inst}. 1968, {Vol}. 1, {Lect}. {Notes} {Math}. 86, 76-122 (1969).}, 157 | keywords = {18-XX}, 158 | zbMATH = {3316072}, 159 | Zbl = {0198.33701} 160 | } 161 | 162 | @misc{20:lambek, 163 | author = {Lambek, Joachim}, 164 | title = {Deductive systems and categories. {III}. {Cartesian} closed categories, intuitionist propositional calculus, and combinatory logic}, 165 | year = {1972}, 166 | language = {English}, 167 | howpublished = {Toposes, algebraic {Geometry} and {Logic}, {Dalhousie} {Univ}. {Halifax} 1971, {Lect}. {Notes} {Math}. 274, 57-82 (1972).}, 168 | keywords = {18D15,03B40,03F55,03B55,18A15}, 169 | zbMATH = {3385865}, 170 | Zbl = {0244.18006} 171 | } 172 | 173 | @misc{21:linton, 174 | author = {Linton, F. E. J.}, 175 | note = {\placeholder{Cartmell [21]. TODO: add details}} 176 | } 177 | 178 | @misc{22:linton, 179 | author = {Linton, F. E. J.}, 180 | note = {\placeholder{Cartmell [22]. TODO: add details}} 181 | } 182 | 183 | @misc{23:mac-lane, 184 | author = {Mac Lane, S.}, 185 | note = {\placeholder{Cartmell [23]. TODO: add details}} 186 | } 187 | 188 | @misc{24:mac-lane, 189 | author = {Mac Lane, S.}, 190 | note = {\placeholder{Cartmell [24]. TODO: add details}} 191 | } 192 | 193 | @misc{25:martin-lof, 194 | author = {Martin-Löf, P.}, 195 | note = {\placeholder{Cartmell [25]. TODO: add details}} 196 | } 197 | 198 | @phdthesis{26:myers, 199 | author = {Myers, A.}, 200 | title = {Cartesian closed categories and $\lambda$-calculus}, 201 | year = {1974}, 202 | institution = {Bristol}, 203 | note = {\placeholder{TODO: complete details}} 204 | } 205 | 206 | @misc{27:pareigis, 207 | author = {Pareigis, B.}, 208 | note = {\placeholder{Cartmell [27]. TODO: add details}} 209 | } 210 | 211 | @article{28:reyes, 212 | author = {Reyes, Gonzalo E.}, 213 | title = {Sheaves and concepts: {A} modeltheoretic interpretation of {Grothendieck} topoi}, 214 | fjournal = {Cahiers de Topologie et G{\'e}om{\'e}trie Diff{\'e}rentielle Cat{\'e}goriques}, 215 | journal = {Cah. Topologie G{\'e}om. Diff{\'e}r. Cat{\'e}goriques}, 216 | issn = {0008-0004}, 217 | volume = {18}, 218 | pages = {105--137}, 219 | year = {1977}, 220 | language = {English}, 221 | keywords = {18B25,18F20,18A15,18F10,03C65}, 222 | url = {https://eudml.org/doc/91182}, 223 | zbMATH = {3614984}, 224 | Zbl = {0396.18002}, 225 | note = {Still “to appear” at Cartmell’s time of writing.} 226 | } 227 | 228 | @misc{29:szabo, 229 | author = {Szabó, M. E.}, 230 | note = {\placeholder{Cartmell [29]. TODO: add details}} 231 | } 232 | -------------------------------------------------------------------------------- /lumsdaine-biblatex-misc.sty: -------------------------------------------------------------------------------- 1 | 2 | % This file provides several miscellaneous minor enhancements for biblatex: 3 | % 4 | % - [always] conditional url: don’t print the url if it’s redundant with the doi or eprint 5 | % - [only on option “concisebib”] concise citation style, useful for slides 6 | % - [always] typeset parentheses journal issue number in parens, “25 (2)” instead of default “25.2” 7 | % - command \concisecite for short human-readable citations 8 | 9 | % TODO: planned extra additions: 10 | % - add penalty to mildly discourage linebreak after “url:”, “doi:”, etc 11 | % - allow linebreaks in doi 12 | % - take eprinttype to be arxiv if not otherwise specified; or (better) autodetect; or at least give error message? 13 | % - add author annotation functionality 14 | % - ensure “note” is correctly sentence-cased + puntuated? 15 | % - move date sooner; in particular, to precede “note” for unpublished items. 16 | 17 | % TODO: improve option handling using keyvals, package kvoptions https://tex.stackexchange.com/questions/61487/ — make all items optiona, just with different defaults 18 | 19 | \NeedsTeXFormat{LaTeX2e} 20 | \ProvidesPackage{lumsdaine-biblatex-misc}[2025-05-06 Peter LeFanu Lumsdaine’s miscellaneous biblatex tweaks] 21 | 22 | \RequirePackage{biblatex} 23 | 24 | \newif\iflum@concisebib \lum@concisebibfalse 25 | 26 | \newif\iflum@numberparens \lum@numberparenstrue 27 | 28 | \DeclareOption{concisebib}{\lum@concisebibtrue} 29 | 30 | \DeclareOption*{\PackageWarning{lumsdaine-biblatex-tweaks}{Unknown ‘\CurrentOption’}} 31 | 32 | \ProcessOptions 33 | 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | %% CONDITIONAL URL 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | % Ensures that if the url of a bib-item is the same as its eprint or doi, 39 | % then only one of these is printed in the bibliography; 40 | % see https://tex.stackexchange.com/questions/5660/redundancy-in-bib-file-conditionally-suppress-url-if-same-as-doi 41 | % 42 | % The url for any reference can also be manually excluded by issuing \entrydropurl{melville:moby-dick} anywhere in the tex file. 43 | 44 | % Internal logic: 45 | % If an entry’s specified url is auto-generated from the doi/eprint, and that will be printed, 46 | % then we can don’t need to print the url separately, nor the urldate 47 | % (since doi/eprint links are “archival-quality” — same reason biblatex doesn’t expect “eprintdate”, “doidate”). 48 | % TODO: perhaps reconsider this: should we assume that if urldate provided, then it’s desired? 49 | % 50 | % If the doi is generated from the eprint, then we still print both (readers may want either), 51 | % but we provide a test for this anyhow. 52 | 53 | % Note: aims to catch several standard doi-urls (variants like http/https), 54 | % but not too open-ended, to avoid false positives for e.g. journal urls including doi as internal identifier 55 | 56 | \RequirePackage{xstring} 57 | 58 | \protected\long\def\iffieldcontainsstr#1#2{% 59 | \blx@imc@iffieldundef{#1} 60 | {\@secondoftwo} 61 | {\expandafter\expandafter\expandafter\IfSubStr 62 | \expandafter\expandafter\expandafter{% 63 | \csname abx@field@#1\endcsname}{#2}}} 64 | 65 | \DeclareBibliographyCategory{dropurl} 66 | \newcommand{\entrydropurl}[1]{\addtocategory{dropurl}{#1}} 67 | 68 | \protected\long\def\ifDOIsubsumesURL{% 69 | \iftoggle{bbx:doi} 70 | {\iffieldundef{doi}% 71 | {\@secondoftwo}% 72 | {\edef\doiurlcore{\detokenize{doi.org/}\thefield{doi}}% 73 | \iffieldcontainsstr{url}{\doiurlcore}% 74 | {\@firstoftwo}% 75 | {\@secondoftwo}% 76 | }% 77 | }% 78 | {\@secondoftwo}% 79 | } 80 | 81 | % note: similar logic to \ifDOIsubsumesURL 82 | % note: assumes eprinttype=arxiv. TODO: generalise? 83 | \protected\long\def\ifeprintsubsumesURL{% 84 | \iftoggle{bbx:eprint} 85 | {\iffieldundef{eprint}% 86 | {\@secondoftwo}% 87 | {\edef\eprinturlcore{\detokenize{arxiv.org/}}% 88 | \iffieldcontainsstr{url}{\eprinturlcore}% 89 | {\iffieldcontainsstr{url}{\thefield{eprint}}% 90 | {\@firstoftwo}% 91 | {\@secondoftwo}% 92 | }% 93 | {\@secondoftwo}% 94 | }% 95 | }% 96 | {\@secondoftwo}% 97 | } 98 | 99 | \protected\long\def\ifeprintsubsumesDOI{% 100 | \iftoggle{bbx:eprint} 101 | {\iffieldundef{eprint}% 102 | {\@secondoftwo}% 103 | {\iffieldcontainsstr{doi}{\thefield{eprint}}% 104 | {\@firstoftwo}% 105 | {\@secondoftwo}% 106 | }% 107 | }% 108 | {\@secondoftwo}% 109 | } 110 | 111 | \renewbibmacro*{doi+eprint+url}{% 112 | \iftoggle{bbx:doi} 113 | {\printfield{doi}} 114 | {} 115 | \newunit\newblock 116 | \iftoggle{bbx:eprint} 117 | {\usebibmacro{eprint}} 118 | {} 119 | \newunit\newblock 120 | \iftoggle{bbx:url} 121 | {\ifeprintsubsumesURL 122 | {} 123 | {\ifDOIsubsumesURL 124 | {} 125 | {\usebibmacro{url+urldate}} 126 | } 127 | } 128 | {} 129 | } 130 | 131 | \renewbibmacro*{url+urldate}{% 132 | \ifcategory{dropurl} 133 | {} 134 | {\printfield{url}% 135 | \iffieldundef{urlyear} 136 | {} 137 | {\setunit*{\addspace}% 138 | \printurldate}} 139 | } 140 | 141 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 142 | %% CONCISE BIBLIOGRAPHY STYLE 143 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 144 | 145 | \iflum@concisebib 146 | 147 | \DeclareBibliographyDriver{article}{% 148 | \usebibmacro{bibindex}% 149 | \usebibmacro{begentry}% 150 | \usebibmacro{author/translator+others}% 151 | \setunit{\printdelim{nametitledelim}}\newblock 152 | \usebibmacro{title}% 153 | \newunit\newblock 154 | \printfield{note}% 155 | \newunit\newblock 156 | \usebibmacro{doi+eprint+url}% 157 | \setunit{\bibpagerefpunct}\newblock 158 | \usebibmacro{pageref}% 159 | \newunit\newblock 160 | \iftoggle{bbx:related} 161 | {\usebibmacro{related:init}% 162 | \usebibmacro{related}} 163 | {}% 164 | \usebibmacro{finentry}} 165 | 166 | \DeclareBibliographyDriver{book}{% 167 | \usebibmacro{bibindex}% 168 | \usebibmacro{begentry}% 169 | \usebibmacro{author/editor+others/translator+others}% 170 | \setunit{\printdelim{nametitledelim}}\newblock 171 | \usebibmacro{maintitle+title}% 172 | \newunit\newblock 173 | \printfield{note}% 174 | \newunit\newblock 175 | \usebibmacro{doi+eprint+url}% 176 | \setunit{\bibpagerefpunct}\newblock 177 | \usebibmacro{pageref}% 178 | \newunit\newblock 179 | \iftoggle{bbx:related} 180 | {\usebibmacro{related:init}% 181 | \usebibmacro{related}} 182 | {}% 183 | \usebibmacro{finentry}} 184 | 185 | \DeclareBibliographyDriver{incollection}{% 186 | \usebibmacro{bibindex}% 187 | \usebibmacro{begentry}% 188 | \usebibmacro{author/translator+others}% 189 | \setunit{\printdelim{nametitledelim}}\newblock 190 | \usebibmacro{title}% 191 | \newunit\newblock 192 | \printfield{note}% 193 | \newunit\newblock 194 | \usebibmacro{doi+eprint+url}% 195 | \setunit{\bibpagerefpunct}\newblock 196 | \usebibmacro{pageref}% 197 | \newunit\newblock 198 | \iftoggle{bbx:related} 199 | {\usebibmacro{related:init}% 200 | \usebibmacro{related}} 201 | {}% 202 | \usebibmacro{finentry}} 203 | 204 | \DeclareBibliographyDriver{inproceedings}{% 205 | \usebibmacro{bibindex}% 206 | \usebibmacro{begentry}% 207 | \usebibmacro{author/translator+others}% 208 | \setunit{\printdelim{nametitledelim}}\newblock 209 | \usebibmacro{title}% 210 | \newunit\newblock 211 | \printfield{note}% 212 | \newunit\newblock 213 | \usebibmacro{doi+eprint+url}% 214 | \setunit{\bibpagerefpunct}\newblock 215 | \usebibmacro{pageref}% 216 | \newunit\newblock 217 | \iftoggle{bbx:related} 218 | {\usebibmacro{related:init}% 219 | \usebibmacro{related}} 220 | {}% 221 | \usebibmacro{finentry}} 222 | 223 | \DeclareBibliographyDriver{thesis}{% 224 | \usebibmacro{bibindex}% 225 | \usebibmacro{begentry}% 226 | \usebibmacro{author}% 227 | \setunit{\printdelim{nametitledelim}}\newblock 228 | \usebibmacro{title}% 229 | \newunit\newblock 230 | \printfield{note}% 231 | \newunit\newblock 232 | \printfield{type}% 233 | \newunit\newblock 234 | \usebibmacro{doi+eprint+url}% 235 | \setunit{\bibpagerefpunct}\newblock 236 | \usebibmacro{pageref}% 237 | \newunit\newblock 238 | \iftoggle{bbx:related} 239 | {\usebibmacro{related:init}% 240 | \usebibmacro{related}} 241 | {}% 242 | \usebibmacro{finentry}} 243 | 244 | \fi 245 | 246 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 247 | %% CONCISE FULL CITATIONS 248 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 249 | 250 | % “concise full citation” commands: 251 | % aim is to be more detailed/self-contained than a \cite command in most citation styles, but shorter than a \fullcite in most bibstyles 252 | % 253 | % typical output: Authors Year, title. 254 | % 255 | % TODO: make this a bit more principled with the concise bibstyle provided above? 256 | 257 | \newbibmacro{concisecitecontent} 258 | {\printtext{% 259 | \printnames[family]{labelname}% 260 | \setunit{\addspace}}% 261 | \printtext{% 262 | \printdate% 263 | \setunit{\addcomma\space}} 264 | \printtext{% 265 | \printfield{title}}} 266 | 267 | \DeclareCiteCommand{\parenconcisecite} 268 | [\mkbibparens] 269 | {\usebibmacro{prenote}} 270 | {\usebibmacro{concisecitecontent}} 271 | {\multicitedelim} 272 | {\usebibmacro{postnote}} 273 | 274 | \DeclareCiteCommand{\concisecite} 275 | {\usebibmacro{prenote}} 276 | {\usebibmacro{concisecitecontent}} 277 | {\multicitedelim} 278 | {\usebibmacro{postnote}} 279 | 280 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 281 | %% PARENTHESES FOR ISSUE NUMBER 282 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 283 | 284 | % based on answer by user “lockstep” at TeX-LaTeX Stack Exchange, https://tex.stackexchange.com/a/81573/1635 285 | 286 | \iflum@numberparens 287 | 288 | \DeclareFieldFormat[article]{number}{\mkbibparens{#1}} 289 | 290 | \renewbibmacro*{volume+number+eid}{% 291 | \printfield{volume}% 292 | % \setunit*{\addnbthinspace}% NEW (optional) nonbreakingspace 293 | \printfield{number}% 294 | \setunit{\addcomma\space}% 295 | \printfield{eid}} 296 | 297 | \fi -------------------------------------------------------------------------------- /amsalphaurlmod.bst: -------------------------------------------------------------------------------- 1 | %%% Originally based on "amsalpha.bst"; modified automatically by urlbst; modified further by hand by PLL: 2 | %%% - 2010-12: corrected DOI/URL formatting as per question on tex.stackexchange.com 3 | %%% - 2012-02: removed MR from the fields typeset. 4 | %%% - 2012-10: actually removed MR from the fields typeset. 5 | %%% - 2014-10: removed “purify” from calc.label, to allow special characters in year. 6 | 7 | %%% Modification of BibTeX style file /usr/local/texlive/2008/texmf-dist/bibtex/bst/ams/amsalpha.bst 8 | %%% ... by urlbst, version 0.6 (marked with "% urlbst") 9 | %%% See 10 | %%% Added webpage entry type, and url and lastchecked fields. 11 | %%% Added eprint support. 12 | %%% Added DOI support. 13 | %%% Added hyperref support. 14 | %%% Original headers follow... 15 | 16 | %%% ==================================================================== 17 | %%% @BibTeX-style-file{ 18 | %%% filename = "amsalpha.bst", 19 | %%% version = "2.0", 20 | %%% date = "2000/03/27", 21 | %%% time = "13:49:36 EST", 22 | %%% checksum = "00166 1404 4124 29978", 23 | %%% author = "American Mathematical Society", 24 | %%% address = "American Mathematical Society, 25 | %%% Technical Support, 26 | %%% Electronic Products and Services, 27 | %%% P. O. Box 6248, 28 | %%% Providence, RI 02940, 29 | %%% USA", 30 | %%% telephone = "401-455-4080 or (in the USA and Canada) 31 | %%% 800-321-4AMS (321-4267)", 32 | %%% FAX = "401-331-3842", 33 | %%% email = "tech-support@ams.org (Internet)", 34 | %%% copyright = "Copyright 1995 American Mathematical Society, 35 | %%% all rights reserved. Copying of this file is 36 | %%% authorized only if either: 37 | %%% (1) you make absolutely no changes to your copy, 38 | %%% including name; OR 39 | %%% (2) if you do make changes, you first rename it 40 | %%% to some other name.", 41 | %%% codetable = "ISO/ASCII", 42 | %%% keywords = "bibtex, bibliography, amslatex, ams-latex", 43 | %%% supported = "yes", 44 | %%% abstract = "BibTeX bibliography style `amsalpha' for BibTeX 45 | %%% versions 0.99a or later and LaTeX version 2e. 46 | %%% Produces alphabetic-label bibliography items in 47 | %%% a form typical for American Mathematical Society 48 | %%% publications.", 49 | %%% docstring = "The checksum field above contains a CRC-16 50 | %%% checksum as the first value, followed by the 51 | %%% equivalent of the standard UNIX wc (word 52 | %%% count) utility output of lines, words, and 53 | %%% characters. This is produced by Robert 54 | %%% Solovay's checksum utility.", 55 | %%% } 56 | %%% ==================================================================== 57 | 58 | % See the file btxbst.doc for extra documentation other than 59 | % what is included here. And see btxhak.tex for a description 60 | % of the BibTeX language and how to use it. 61 | 62 | % This defines the types of fields that can occur in a database entry 63 | % for this particular bibliography style. Except for `language', 64 | % this is the standard list from alpha.bst. 65 | 66 | %% Types of entries currently allowed in a BibTeX file: 67 | %% 68 | %% ARTICLE -- An article from a journal or magazine. 69 | %% 70 | %% BOOK -- A book with an explicit publisher. 71 | %% 72 | %% BOOKLET -- A work that is printed and bound, 73 | %% but without a named publisher or sponsoring institution. 74 | %% 75 | %% CONFERENCE -- The same as INPROCEEDINGS, 76 | %% included for Scribe compatibility. 77 | %% 78 | %% INBOOK -- A part of a book, 79 | %% which may be a chapter (or section or whatever) and/or a range of pages. 80 | %% 81 | %% INCOLLECTION -- A part of a book having its own title. 82 | %% 83 | %% INPROCEEDINGS -- An article in a conference proceedings. 84 | %% 85 | %% MANUAL -- Technical documentation. 86 | %% 87 | %% MASTERSTHESIS -- A Master's thesis. 88 | %% 89 | %% MISC -- Use this type when nothing else fits. 90 | %% 91 | %% PHDTHESIS -- A PhD thesis. 92 | %% 93 | %% PROCEEDINGS -- The proceedings of a conference. 94 | %% 95 | %% TECHREPORT -- A report published by a school or other institution, 96 | %% usually numbered within a series. 97 | %% 98 | %% UNPUBLISHED -- A document having an author and title, but not formally 99 | %% published. 100 | 101 | ENTRY 102 | { address 103 | author 104 | booktitle 105 | chapter 106 | edition 107 | editor 108 | howpublished 109 | institution 110 | journal 111 | key 112 | language 113 | month 114 | mrnumber 115 | note 116 | number 117 | organization 118 | pages 119 | publisher 120 | school 121 | series 122 | title 123 | type 124 | volume 125 | year 126 | eprint % urlbst 127 | doi % urlbst 128 | url % urlbst 129 | urltext % allows the typeset text to differ from the actual link target; intended just for discretionary linebreaks 130 | lastchecked % urlbst 131 | } 132 | {} 133 | { label extra.label sort.label bysame } 134 | 135 | % Removed after.sentence, after.block---not needed. 136 | 137 | INTEGERS { output.state before.all mid.sentence } 138 | 139 | STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl openinlinelink closeinlinelink } % urlbst... 140 | INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver } 141 | % Following constants may be adjusted by hand, if desired 142 | FUNCTION {init.urlbst.variables} 143 | { 144 | "" 'urlintro := % prefix before URL 145 | "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref 146 | "arXiv:" 'eprintprefix := % text prefix printed before eprint ref 147 | "https://doi.org/" 'doiurl := % prefix to make URL from DOI 148 | "doi:" 'doiprefix := % text prefix printed before DOI ref 149 | #1 'addeprints := % 0=no eprints; 1=include eprints 150 | #1 'adddoiresolver := % 0=no DOI resolver; 1=include it 151 | #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs 152 | #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles 153 | % the following are internal state variables, not config constants 154 | #0 'makeinlinelink := % state variable managed by setup.inlinelink 155 | "" 'openinlinelink := % ditto 156 | "" 'closeinlinelink := % ditto 157 | } 158 | INTEGERS { 159 | bracket.state 160 | outside.brackets 161 | open.brackets 162 | within.brackets 163 | close.brackets 164 | } 165 | % ...urlbst to here 166 | FUNCTION {init.state.consts} 167 | { #0 'outside.brackets := % urlbst 168 | #1 'open.brackets := 169 | #2 'within.brackets := 170 | #3 'close.brackets := 171 | 172 | #0 'before.all := 173 | #1 'mid.sentence := 174 | } 175 | 176 | % Scratch variables: 177 | 178 | STRINGS { s t } 179 | 180 | % Utility functions 181 | 182 | FUNCTION {shows} 183 | { duplicate$ ":::: `" swap$ * "'" * top$ 184 | } 185 | 186 | FUNCTION {showstack} 187 | {"STACK=====================================================================" 188 | top$ 189 | stack$ 190 | "ENDSTACK==================================================================" 191 | top$ 192 | } 193 | 194 | FUNCTION {not} 195 | { { #0 } 196 | { #1 } 197 | if$ 198 | } 199 | 200 | FUNCTION {and} 201 | { 'skip$ 202 | { pop$ #0 } 203 | if$ 204 | } 205 | 206 | FUNCTION {or} 207 | { { pop$ #1 } 208 | 'skip$ 209 | if$ 210 | } 211 | 212 | % functions string.length, endswith 213 | % added from https://tex.stackexchange.com/a/119689/1635 214 | INTEGERS{ l } 215 | FUNCTION{ string.length } 216 | { 217 | #1 'l := 218 | {duplicate$ duplicate$ #1 l substring$ = not} 219 | { l #1 + 'l :=} 220 | while$ 221 | pop$ l 222 | } 223 | 224 | INTEGERS {find.length find.startpos} 225 | STRINGS {find.string find.pattern} 226 | FUNCTION {endswith} 227 | { 228 | 'find.pattern := 229 | 'find.string := 230 | find.pattern string.length 'find.length := 231 | find.string string.length find.length - #1 + 'find.startpos := 232 | find.string find.startpos find.length substring$ find.pattern = 233 | } 234 | % end added section 235 | 236 | FUNCTION {field.or.null} 237 | { duplicate$ empty$ 238 | { pop$ "" } 239 | 'skip$ 240 | if$ 241 | } 242 | 243 | FUNCTION {emphasize} 244 | { duplicate$ empty$ 245 | { pop$ "" } 246 | { "\emph{" swap$ * "}" * } 247 | if$ 248 | } 249 | 250 | % n.dashify is used to make sure page ranges get the TeX code 251 | % (two hyphens) for en-dashes. 252 | 253 | FUNCTION {n.dashify} 254 | { 't := 255 | "" 256 | { t empty$ not } 257 | { t #1 #1 substring$ "-" = 258 | { t #1 #2 substring$ "--" = not 259 | { "--" * 260 | t #2 global.max$ substring$ 't := 261 | } 262 | { { t #1 #1 substring$ "-" = } 263 | { "-" * 264 | t #2 global.max$ substring$ 't := 265 | } 266 | while$ 267 | } 268 | if$ 269 | } 270 | { t #1 #1 substring$ * 271 | t #2 global.max$ substring$ 't := 272 | } 273 | if$ 274 | } 275 | while$ 276 | } 277 | 278 | % tie.or.space.connect connects two items with a ~ if the 279 | % second item is less than 3 letters long, otherwise it just puts an 280 | % ordinary space. 281 | 282 | FUNCTION {tie.or.space.connect} 283 | { duplicate$ text.length$ #3 < 284 | { "~" } 285 | { " " } 286 | if$ 287 | swap$ * * 288 | } 289 | 290 | FUNCTION {add.space.if.necessary} 291 | { duplicate$ "" = 292 | 'skip$ 293 | { " " * } 294 | if$ 295 | } 296 | 297 | % either.or.check gives a warning if two mutually exclusive fields 298 | % were used in the database. 299 | 300 | FUNCTION {either.or.check} 301 | { empty$ 302 | 'pop$ 303 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 304 | if$ 305 | } 306 | 307 | % output.nonnull is called by output. 308 | 309 | % urlbst 310 | FUNCTION {output.nonnull.original} 311 | % remove the top item from the stack because it's in the way. 312 | { 's := 313 | output.state mid.sentence = 314 | % If we're in mid-sentence, add a comma to the new top item and write it 315 | { ", " * write$ } 316 | % Otherwise, if we're at the beginning of a bibitem, 317 | { output.state before.all = 318 | % just write out the top item from the stack; 319 | 'write$ 320 | % and the last alternative is that we're at the end of the current 321 | % bibitem, so we add a period to the top stack item and write it out. 322 | { add.period$ " " * write$ } 323 | if$ 324 | mid.sentence 'output.state := 325 | } 326 | if$ 327 | % Put the top item back on the stack that we removed earlier. 328 | s 329 | } 330 | 331 | % urlbst... 332 | % The following three functions are for handling inlinelink. They wrap 333 | % a block of text which is potentially output with write$ by multiple 334 | % other functions, so we don't know the content a priori. 335 | % They communicate between each other using the variables makeinlinelink 336 | % (which is true if a link should be made), and closeinlinelink (which holds 337 | % the string which should close any current link. They can be called 338 | % at any time, but start.inlinelink will be a no-op unless something has 339 | % previously set makeinlinelink true, and the two ...end.inlinelink functions 340 | % will only do their stuff if start.inlinelink has previously set 341 | % closeinlinelink to be non-empty. 342 | FUNCTION {setup.inlinelink} 343 | { makeinlinelink 344 | { hrefform #1 = % hypertex 345 | { "\special {html: }{" * 'openinlinelink := 346 | "\special {html:}" 'closeinlinelink := 347 | } 348 | { hrefform #2 = % hyperref 349 | { "\href{" url * "}{" * 'openinlinelink := 350 | "}" 'closeinlinelink := 351 | } 352 | 'skip$ 353 | if$ % hrefform #2 = 354 | } 355 | if$ % hrefform #1 = 356 | #0 'makeinlinelink := 357 | } 358 | 'skip$ 359 | if$ % makeinlinelink 360 | } 361 | FUNCTION {add.inlinelink} 362 | { openinlinelink empty$ 363 | 'skip$ 364 | { openinlinelink swap$ * closeinlinelink * 365 | "" 'openinlinelink := 366 | } 367 | if$ 368 | } 369 | FUNCTION {output.nonnull} 370 | { % Save the thing we've been asked to output 371 | 's := 372 | % If the bracket-state is close.brackets, then add a close-bracket to 373 | % what is currently at the top of the stack, and set bracket.state 374 | % to outside.brackets 375 | bracket.state close.brackets = 376 | { "]" * 377 | outside.brackets 'bracket.state := 378 | } 379 | 'skip$ 380 | if$ 381 | bracket.state outside.brackets = 382 | { % We're outside all brackets -- this is the normal situation. 383 | % Write out what's currently at the top of the stack, using the 384 | % original output.nonnull function. 385 | s 386 | add.inlinelink 387 | output.nonnull.original % invoke the original output.nonnull 388 | } 389 | { % Still in brackets. Add open-bracket or (continuation) comma, add the 390 | % new text (in s) to the top of the stack, and move to the close-brackets 391 | % state, ready for next time (unless inbrackets resets it). If we come 392 | % into this branch, then output.state is carefully undisturbed. 393 | bracket.state open.brackets = 394 | { " [" * } 395 | { ", " * } % bracket.state will be within.brackets 396 | if$ 397 | s * 398 | close.brackets 'bracket.state := 399 | } 400 | if$ 401 | } 402 | 403 | % Call this function just before adding something which should be presented in 404 | % brackets. bracket.state is handled specially within output.nonnull. 405 | FUNCTION {inbrackets} 406 | { bracket.state close.brackets = 407 | { within.brackets 'bracket.state := } % reset the state: not open nor closed 408 | { open.brackets 'bracket.state := } 409 | if$ 410 | } 411 | 412 | FUNCTION {format.lastchecked} 413 | { lastchecked empty$ 414 | { "" } 415 | { inbrackets "cited " lastchecked * } 416 | if$ 417 | } 418 | % ...urlbst to here 419 | 420 | % Output checks to see if the stack top is empty; if not, it 421 | % calls output.nonnull to write it out. 422 | 423 | FUNCTION {output} 424 | { duplicate$ empty$ 425 | 'pop$ 426 | 'output.nonnull 427 | if$ 428 | } 429 | 430 | % Standard warning message for a missing or empty field. For the user 431 | % we call any such field `missing' without respect to the distinction 432 | % made by BibTeX between missing and empty. 433 | 434 | FUNCTION {missing.warning} 435 | { "missing " swap$ * " in " * cite$ * warning$ } 436 | 437 | % Output.check is like output except that it gives a warning on-screen 438 | % if the given field in the database entry is empty. t is the field 439 | % name. 440 | 441 | FUNCTION {output.check} 442 | { 't := 443 | duplicate$ empty$ 444 | { pop$ t missing.warning } 445 | 'output.nonnull 446 | if$ 447 | } 448 | 449 | FUNCTION {output.bibitem.original} 450 | { newline$ 451 | "\bibitem[" write$ 452 | label write$ 453 | "]{" write$ 454 | cite$ write$ 455 | "}" write$ 456 | newline$ 457 | % This empty string is the first thing that will be written 458 | % the next time write$ is called. Done this way because each 459 | % item is saved on the stack until we find out what punctuation 460 | % should be added after it. Therefore we need an empty first item. 461 | "" 462 | before.all 'output.state := 463 | } 464 | 465 | FUNCTION {output.nonempty.mrnumber} 466 | { duplicate$ missing$ 467 | { pop$ "" } 468 | 'skip$ 469 | if$ 470 | duplicate$ empty$ 471 | 'pop$ 472 | { " \MR{" swap$ * "}" * write$ } 473 | if$ 474 | } 475 | 476 | FUNCTION {fin.entry.original} 477 | { add.period$ 478 | write$ 479 | % mrnumber output.nonempty.mrnumber 480 | newline$ 481 | } 482 | 483 | % Removed new.block, new.block.checka, new.block.checkb, new.sentence, 484 | % new.sentence.checka, and new.sentence.checkb functions here, since they 485 | % don't seem to be needed in the AMS style. Also moved some real 486 | % basic functions like `and' and 'or' earlier in the file. 487 | 488 | INTEGERS { nameptr namesleft numnames } 489 | 490 | % The extra section to write out a language field was added 491 | % for AMSPLAIN.BST. Not present in plain.bst. 492 | 493 | FUNCTION {format.language} 494 | { language empty$ 495 | { "" } 496 | { " (" language * ")" * } 497 | if$ 498 | } 499 | 500 | % This version of format.names puts names in the format 501 | % 502 | % First von Last, Jr. 503 | % 504 | % (i.e., first name first, no abbreviating to initials). 505 | 506 | FUNCTION {format.names} 507 | { 's := 508 | #1 'nameptr := 509 | s num.names$ 'numnames := 510 | numnames 'namesleft := 511 | { namesleft #0 > } 512 | { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := 513 | nameptr #1 > 514 | { namesleft #1 > 515 | { ", " * t * } 516 | { numnames #2 > 517 | { "," * } 518 | 'skip$ 519 | if$ 520 | t "others" = 521 | { " et~al." * } 522 | { " and " * t * } 523 | if$ 524 | } 525 | if$ 526 | } 527 | 't 528 | if$ 529 | nameptr #1 + 'nameptr := 530 | namesleft #1 - 'namesleft := 531 | } 532 | while$ 533 | } 534 | 535 | FUNCTION {format.authors} 536 | { author empty$ 537 | { "" } 538 | { bysame "\bysame" = 539 | { bysame } 540 | { author format.names } 541 | if$ 542 | } 543 | if$ 544 | } 545 | 546 | FUNCTION {format.editors} 547 | { editor empty$ 548 | { "" } 549 | { editor format.names 550 | editor num.names$ #1 > 551 | { " (eds.)" * } 552 | { " (ed.)" * } 553 | if$ 554 | } 555 | if$ 556 | } 557 | 558 | FUNCTION {format.nonauthor.editors} 559 | { editor empty$ 560 | { "" } 561 | { editor format.names 562 | editor num.names$ #1 > 563 | { ", eds." * } 564 | { ", ed." * } 565 | if$ 566 | } 567 | if$ 568 | } 569 | 570 | FUNCTION {format.title} 571 | { title empty$ 572 | { "" } 573 | { title "t" change.case$ emphasize } 574 | if$ 575 | } 576 | 577 | FUNCTION {format.journal.vol.year} 578 | { journal empty$ 579 | { "" "journal name" missing.warning } 580 | { journal 581 | volume empty$ 582 | 'skip$ 583 | { " \textbf{" * volume * "}" * } 584 | if$ 585 | year empty$ 586 | { "year" missing.warning } 587 | { " (" * year * ")" * } 588 | if$ 589 | } 590 | if$ 591 | } 592 | 593 | % For formatting the issue number for a journal article. 594 | 595 | FUNCTION {format.number} 596 | { number empty$ 597 | { "" } 598 | { "no.~" number * } 599 | if$ 600 | } 601 | 602 | % For formatting miscellaneous dates 603 | 604 | FUNCTION {format.date} 605 | { year empty$ 606 | { month empty$ 607 | { "" } 608 | { "there's a month but no year in " cite$ * warning$ 609 | month 610 | } 611 | if$ 612 | } 613 | { month empty$ 614 | 'year 615 | { month " " * year * } 616 | if$ 617 | } 618 | if$ 619 | } 620 | 621 | %% The volume, series and number information is sort of tricky. 622 | %% This code handles it as follows: 623 | %% If the series is present, and the volume, but not the number, 624 | %% then we do "\emph{Book title}, Series Name, vol. 000" 625 | %% If the series is present, and the number, but not the volume, 626 | %% then we do "\emph{Book title}, Series Name, no. 000" 627 | %% If the series is present, and both number and volume, 628 | %% then we do "\emph{Book title}, vol. XX, Series Name, no. 000" 629 | %% Finally, if the series is absent, 630 | %% then we do "\emph{Book title}, vol. XX" 631 | %% or "\emph{Book title}, no. 000" 632 | %% and if both volume and number are present, give a warning message. 633 | 634 | FUNCTION {format.bookvolume.series.number} 635 | { volume empty$ 636 | { "" % Push the empty string as a placeholder in case everything else 637 | % is empty too. 638 | series empty$ 639 | 'skip$ 640 | { pop$ series } % if series is not empty put in stack 641 | if$ 642 | number empty$ 643 | 'skip$ 644 | { duplicate$ empty$ % if no preceding material, 645 | 'skip$ % do nothing, otherwise 646 | { ", " * } % add a comma and space to separate. 647 | if$ 648 | "no." number tie.or.space.connect * % add the number information 649 | } 650 | if$ 651 | } 652 | %% If the volume is NOT EMPTY: 653 | { "vol." volume tie.or.space.connect % vol. XX 654 | number empty$ 655 | { series empty$ 656 | 'skip$ 657 | { series ", " * swap$ *} % Series Name, vol. XX 658 | if$ 659 | } 660 | { series empty$ 661 | { "can't use both volume and number if series info is missing" 662 | warning$ 663 | "in BibTeX entry type `" type$ * "'" * top$ 664 | } 665 | { ", " * series * ", no." * number tie.or.space.connect } 666 | if$ 667 | } 668 | if$ 669 | } 670 | if$ 671 | 672 | } % end of format.bookvolume.series.number 673 | 674 | %% format.inproc.title.where.editors is used by inproceedings entry types 675 | 676 | %% No case changing or emphasizing for the title. We want initial 677 | %% caps, roman. 678 | %% We add parentheses around the address (place where conference 679 | %% was held). 680 | %% Likewise we add parentheses around the editors' names. 681 | 682 | FUNCTION {format.inproc.title.address.editors} 683 | { booktitle empty$ 684 | { "" } 685 | { booktitle 686 | address empty$ 687 | 'skip$ 688 | { add.space.if.necessary "(" * address * ")" * } 689 | if$ 690 | editor empty$ 691 | 'skip$ 692 | { add.space.if.necessary "(" * format.nonauthor.editors * ")" * } 693 | if$ 694 | } 695 | if$ 696 | } 697 | 698 | %% format.incoll.title.editors is similar to format.inproc... but 699 | %% omits the address. For collections that are not proceedings volumes. 700 | 701 | FUNCTION {format.incoll.title.editors} 702 | { booktitle empty$ 703 | { "" } 704 | { editor empty$ 705 | { booktitle } 706 | { booktitle 707 | add.space.if.necessary "(" * format.nonauthor.editors * ")" * 708 | } 709 | if$ 710 | } 711 | if$ 712 | } 713 | 714 | FUNCTION {format.edition} 715 | { edition empty$ 716 | { "" } 717 | { output.state mid.sentence = 718 | { edition "l" change.case$ " ed." * } 719 | { edition "t" change.case$ " ed." * } 720 | if$ 721 | } 722 | if$ 723 | } 724 | 725 | INTEGERS { multiresult } 726 | 727 | FUNCTION {multi.page.check} 728 | { 't := 729 | #0 'multiresult := 730 | { multiresult not 731 | t empty$ not 732 | and 733 | } 734 | { t #1 #1 substring$ 735 | duplicate$ "-" = 736 | swap$ duplicate$ "," = 737 | swap$ "+" = 738 | or or 739 | { #1 'multiresult := } 740 | { t #2 global.max$ substring$ 't := } 741 | if$ 742 | } 743 | while$ 744 | multiresult 745 | } 746 | 747 | FUNCTION {format.pages} 748 | { pages empty$ 749 | { "" } 750 | { pages n.dashify } 751 | if$ 752 | } 753 | 754 | FUNCTION {format.book.pages} 755 | { pages empty$ 756 | { "" } 757 | { pages multi.page.check 758 | { "pp.~" pages n.dashify * } 759 | { "p.~" pages * } 760 | if$ 761 | } 762 | if$ 763 | } 764 | 765 | FUNCTION {format.chapter.pages} 766 | { chapter empty$ 767 | 'format.book.pages 768 | { type empty$ 769 | { "ch.~" } 770 | { type "l" change.case$ " " * } 771 | if$ 772 | chapter * 773 | pages empty$ 774 | 'skip$ 775 | { ", " * format.book.pages * } 776 | if$ 777 | } 778 | if$ 779 | } 780 | 781 | FUNCTION {empty.misc.check} 782 | { author empty$ title empty$ howpublished empty$ 783 | month empty$ year empty$ note empty$ 784 | and and and and and 785 | key empty$ not and 786 | { "all relevant fields are empty in " cite$ * warning$ } 787 | 'skip$ 788 | if$ 789 | } 790 | 791 | FUNCTION {format.thesis.type} 792 | { type empty$ 793 | 'skip$ 794 | { pop$ 795 | type "t" change.case$ 796 | } 797 | if$ 798 | } 799 | 800 | FUNCTION {format.tr.number} 801 | { type empty$ 802 | { "Tech. Report" } 803 | 'type 804 | if$ 805 | number empty$ 806 | { "t" change.case$ } 807 | { number tie.or.space.connect } 808 | if$ 809 | } 810 | 811 | % The format.crossref functions haven't been paid much attention 812 | % at the present time (June 1990) and could probably use some 813 | % work. MJD 814 | 815 | FUNCTION {format.article.crossref} 816 | { key empty$ 817 | { journal empty$ 818 | { "need key or journal for " cite$ * " to crossref " * crossref * 819 | warning$ 820 | "" 821 | } 822 | { "in " journal * } 823 | if$ 824 | } 825 | { "in " key * } 826 | if$ 827 | " \cite{" * crossref * "}" * 828 | } 829 | 830 | FUNCTION {format.crossref.editor} 831 | { editor #1 "{vv~}{ll}" format.name$ 832 | editor num.names$ duplicate$ 833 | #2 > 834 | { pop$ " et~al." * } 835 | { #2 < 836 | 'skip$ 837 | { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 838 | { " et~al." * } 839 | { " and " * editor #2 "{vv~}{ll}" format.name$ * } 840 | if$ 841 | } 842 | if$ 843 | } 844 | if$ 845 | } 846 | 847 | FUNCTION {format.book.crossref} 848 | { volume empty$ 849 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ 850 | "in " 851 | } 852 | { "vol." volume tie.or.space.connect 853 | " of " * 854 | } 855 | if$ 856 | editor empty$ 857 | editor field.or.null author field.or.null = 858 | or 859 | { key empty$ 860 | { series empty$ 861 | { "need editor, key, or series for " cite$ * " to crossref " * 862 | crossref * warning$ 863 | "" * 864 | } 865 | { series * } 866 | if$ 867 | } 868 | { key * } 869 | if$ 870 | } 871 | { format.crossref.editor * } 872 | if$ 873 | " \cite{" * crossref * "}" * 874 | } 875 | 876 | FUNCTION {format.incoll.inproc.crossref} 877 | { editor empty$ 878 | editor field.or.null author field.or.null = 879 | or 880 | { key empty$ 881 | { booktitle empty$ 882 | { "need editor, key, or booktitle for " cite$ * " to crossref " * 883 | crossref * warning$ 884 | "" 885 | } 886 | { "in \emph{" booktitle * "}" * } 887 | if$ 888 | } 889 | { "in " key * } 890 | if$ 891 | } 892 | { "in " format.crossref.editor * } 893 | if$ 894 | " \cite{" * crossref * "}" * 895 | } 896 | 897 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 898 | 899 | % The main functions for each entry type. 900 | 901 | % journal, vol and year are formatted together because they are 902 | % not separated by commas. 903 | 904 | % urlbst... 905 | FUNCTION {new.block} % dummy new.block function 906 | { 907 | % empty 908 | } 909 | 910 | % Functions for making hypertext links. 911 | % In all cases, the stack has (link-text href-url) 912 | % 913 | % make 'null' specials 914 | FUNCTION {make.href.null} 915 | { 916 | pop$ 917 | } 918 | % make hypertex specials 919 | FUNCTION {make.href.hypertex} 920 | { 921 | "\special {html: }" * swap$ * 923 | "\special {html:}" * 924 | } 925 | % make hyperref specials 926 | FUNCTION {make.href.hyperref} 927 | { 928 | "\href {" swap$ * "} {\path{" * swap$ * "}}" * 929 | } 930 | FUNCTION {make.href} 931 | { hrefform #2 = 932 | 'make.href.hyperref % hrefform = 2 933 | { hrefform #1 = 934 | 'make.href.hypertex % hrefform = 1 935 | 'make.href.null % hrefform = 0 (or anything else) 936 | if$ 937 | } 938 | if$ 939 | } 940 | 941 | % If inlinelinks is true, then format.url should be a no-op, since it's 942 | % (a) redundant, and (b) could end up as a link-within-a-link. 943 | FUNCTION {format.url} 944 | { inlinelinks #1 = url empty$ or 945 | { "" } 946 | { hrefform #1 = 947 | { % special case -- add HyperTeX specials 948 | urlintro "\url{" url * "}" * url make.href.hypertex * } 949 | { urltext empty$ 950 | {urlintro "\url{" * url * "}" *} 951 | {urlintro "\href{" * url * "}{\nolinkurl{" * urltext * "}}" *} 952 | if$ 953 | } 954 | if$ 955 | } 956 | if$ 957 | } 958 | 959 | FUNCTION {format.eprint} 960 | { eprint empty$ 961 | { "" } 962 | { eprintprefix eprint * eprinturl eprint * make.href } 963 | if$ 964 | } 965 | 966 | FUNCTION {format.doi} 967 | { doi empty$ 968 | { "" } 969 | { doiprefix doi * doiurl doi * make.href } 970 | if$ 971 | } 972 | 973 | % Output a URL. We can't use the more normal idiom (something like 974 | % `format.url output'), because the `inbrackets' within 975 | % format.lastchecked applies to everything between calls to `output', 976 | % so that `format.url format.lastchecked * output' ends up with both 977 | % the URL and the lastchecked in brackets. 978 | FUNCTION {output.url} 979 | { url empty$ 980 | 'skip$ 981 | { new.block 982 | format.url output 983 | format.lastchecked output 984 | } 985 | if$ 986 | } 987 | 988 | FUNCTION {output.web.refs} 989 | { 990 | new.block 991 | addeprints eprint empty$ not and 992 | { format.eprint output.nonnull } 993 | 'skip$ 994 | if$ 995 | adddoiresolver doi empty$ not and 996 | { 997 | url empty$ 998 | { format.doi output.nonnull } 999 | { 1000 | url doi endswith 1001 | { format.doi output.nonnull } 1002 | { format.doi output.nonnull output.url } 1003 | if$ 1004 | } 1005 | if$ 1006 | } 1007 | { output.url } 1008 | if$ 1009 | } 1010 | 1011 | % Wrapper for output.bibitem.original. 1012 | % If the URL field is not empty, set makeinlinelink to be true, 1013 | % so that an inline link will be started at the next opportunity 1014 | FUNCTION {output.bibitem} 1015 | { outside.brackets 'bracket.state := 1016 | output.bibitem.original 1017 | inlinelinks url empty$ not and 1018 | { #1 'makeinlinelink := } 1019 | { #0 'makeinlinelink := } 1020 | if$ 1021 | } 1022 | 1023 | % Wrapper for fin.entry.original 1024 | FUNCTION {fin.entry} 1025 | { output.web.refs % urlbst 1026 | makeinlinelink % ooops, it appears we didn't have a title for inlinelink 1027 | { setup.inlinelink % add some artificial link text here, as a fallback 1028 | "[link]" output.nonnull } 1029 | 'skip$ 1030 | if$ 1031 | bracket.state close.brackets = % urlbst 1032 | { "]" * } 1033 | 'skip$ 1034 | if$ 1035 | fin.entry.original 1036 | } 1037 | 1038 | % Webpage entry type. 1039 | % Title and url fields required; 1040 | % author, note, year, month, and lastchecked fields optional 1041 | % See references 1042 | % ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm 1043 | % http://www.classroom.net/classroom/CitingNetResources.html 1044 | % http://neal.ctstateu.edu/history/cite.html 1045 | % http://www.cas.usf.edu/english/walker/mla.html 1046 | % for citation formats for web pages. 1047 | FUNCTION {webpage} 1048 | { output.bibitem 1049 | author empty$ 1050 | { editor empty$ 1051 | 'skip$ % author and editor both optional 1052 | { format.editors output.nonnull } 1053 | if$ 1054 | } 1055 | { editor empty$ 1056 | { format.authors output.nonnull } 1057 | { "can't use both author and editor fields in " cite$ * warning$ } 1058 | if$ 1059 | } 1060 | if$ 1061 | new.block 1062 | title empty$ 'skip$ 'setup.inlinelink if$ 1063 | format.title "title" output.check 1064 | inbrackets "online" output 1065 | new.block 1066 | year empty$ 1067 | 'skip$ 1068 | { format.date "year" output.check } 1069 | if$ 1070 | % We don't need to output the URL details ('lastchecked' and 'url'), 1071 | % because fin.entry does that for us, using output.web.refs. The only 1072 | % reason we would want to put them here is if we were to decide that 1073 | % they should go in front of the rather miscellaneous information in 'note'. 1074 | new.block 1075 | note output 1076 | fin.entry 1077 | } 1078 | % ...urlbst to here 1079 | 1080 | 1081 | FUNCTION {article} 1082 | { output.bibitem 1083 | format.authors "author" output.check 1084 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1085 | format.title "title" output.check 1086 | crossref missing$ 1087 | { format.journal.vol.year "journal, volume, and year" output.check 1088 | format.number output 1089 | format.pages "pages" output.check 1090 | } 1091 | { format.article.crossref output.nonnull 1092 | format.pages "pages" output.check 1093 | } 1094 | if$ 1095 | format.language * 1096 | note output 1097 | fin.entry 1098 | } 1099 | 1100 | FUNCTION {book} 1101 | { output.bibitem 1102 | author empty$ 1103 | { format.editors "author and editor" output.check } 1104 | { format.authors output.nonnull 1105 | crossref missing$ 1106 | { "author and editor" editor either.or.check } 1107 | 'skip$ 1108 | if$ 1109 | } 1110 | if$ 1111 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1112 | format.title "title" output.check 1113 | format.edition output 1114 | crossref missing$ 1115 | { format.bookvolume.series.number output 1116 | publisher "publisher" output.check 1117 | address output 1118 | } 1119 | { format.book.crossref output.nonnull 1120 | } 1121 | if$ 1122 | format.date "year" output.check 1123 | format.language * 1124 | note output 1125 | fin.entry 1126 | } 1127 | 1128 | FUNCTION {booklet} 1129 | { output.bibitem 1130 | format.authors output 1131 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1132 | format.title "title" output.check 1133 | howpublished output 1134 | address output 1135 | format.date output 1136 | note output 1137 | fin.entry 1138 | } 1139 | 1140 | FUNCTION {inbook} 1141 | { output.bibitem 1142 | author empty$ 1143 | { format.editors "author and editor" output.check } 1144 | { format.authors output.nonnull 1145 | crossref missing$ 1146 | { "author and editor" editor either.or.check } 1147 | 'skip$ 1148 | if$ 1149 | } 1150 | if$ 1151 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1152 | format.title "title" output.check 1153 | format.edition output 1154 | crossref missing$ 1155 | { format.bookvolume.series.number output 1156 | format.chapter.pages "chapter and pages" output.check 1157 | publisher "publisher" output.check 1158 | address output 1159 | } 1160 | { format.chapter.pages "chapter and pages" output.check 1161 | format.book.crossref output.nonnull 1162 | } 1163 | if$ 1164 | format.date "year" output.check 1165 | format.language * 1166 | note output 1167 | fin.entry 1168 | } 1169 | 1170 | FUNCTION {incollection} 1171 | { output.bibitem 1172 | format.authors "author" output.check 1173 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1174 | format.title "title" output.check 1175 | crossref missing$ 1176 | { format.incoll.title.editors "booktitle" output.check 1177 | format.bookvolume.series.number output 1178 | publisher "publisher" output.check 1179 | address output 1180 | format.edition output 1181 | format.date "year" output.check 1182 | } 1183 | { format.incoll.inproc.crossref output.nonnull 1184 | } 1185 | if$ 1186 | note output 1187 | format.book.pages output 1188 | format.language * 1189 | fin.entry 1190 | } 1191 | 1192 | FUNCTION {inproceedings} 1193 | { output.bibitem 1194 | format.authors "author" output.check 1195 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1196 | format.title "title" output.check 1197 | crossref missing$ 1198 | { format.inproc.title.address.editors "booktitle" output.check 1199 | format.bookvolume.series.number output 1200 | organization output 1201 | publisher output 1202 | format.date "year" output.check 1203 | } 1204 | { format.incoll.inproc.crossref output.nonnull 1205 | } 1206 | if$ 1207 | note output 1208 | format.book.pages output 1209 | format.language * 1210 | fin.entry 1211 | } 1212 | 1213 | FUNCTION {conference} { inproceedings } 1214 | 1215 | FUNCTION {manual} 1216 | { output.bibitem 1217 | author empty$ 1218 | { organization empty$ 1219 | 'skip$ 1220 | { organization output.nonnull 1221 | address output 1222 | } 1223 | if$ 1224 | } 1225 | { format.authors output.nonnull } 1226 | if$ 1227 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1228 | format.title "title" output.check 1229 | author empty$ 1230 | { organization empty$ 1231 | { address output } 1232 | 'skip$ 1233 | if$ 1234 | } 1235 | { organization output 1236 | address output 1237 | } 1238 | if$ 1239 | format.edition output 1240 | format.date output 1241 | note output 1242 | fin.entry 1243 | } 1244 | 1245 | FUNCTION {mastersthesis} 1246 | { output.bibitem 1247 | format.authors "author" output.check 1248 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1249 | format.title "title" output.check 1250 | "Master's thesis" format.thesis.type output.nonnull 1251 | school "school" output.check 1252 | address output 1253 | format.date "year" output.check 1254 | note output 1255 | format.book.pages output 1256 | fin.entry 1257 | } 1258 | 1259 | FUNCTION {misc} 1260 | { output.bibitem 1261 | format.authors output 1262 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1263 | format.title output 1264 | howpublished output 1265 | format.date output 1266 | note output 1267 | format.book.pages output 1268 | fin.entry 1269 | empty.misc.check 1270 | } 1271 | 1272 | FUNCTION {phdthesis} 1273 | { output.bibitem 1274 | format.authors "author" output.check 1275 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1276 | format.title "title" output.check 1277 | "Ph.D. thesis" format.thesis.type output.nonnull 1278 | school "school" output.check 1279 | address output 1280 | format.date "year" output.check 1281 | note output 1282 | format.book.pages output 1283 | fin.entry 1284 | } 1285 | 1286 | FUNCTION {proceedings} 1287 | { output.bibitem 1288 | editor empty$ 1289 | { organization output } 1290 | { format.editors output.nonnull } 1291 | if$ 1292 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1293 | format.title "title" output.check 1294 | format.bookvolume.series.number output 1295 | address empty$ 1296 | { editor empty$ 1297 | 'skip$ 1298 | { organization output } 1299 | if$ 1300 | publisher output 1301 | format.date "year" output.check 1302 | } 1303 | { address output.nonnull 1304 | editor empty$ 1305 | 'skip$ 1306 | { organization output } 1307 | if$ 1308 | publisher output 1309 | format.date "year" output.check 1310 | } 1311 | if$ 1312 | note output 1313 | fin.entry 1314 | } 1315 | 1316 | FUNCTION {techreport} 1317 | { output.bibitem 1318 | format.authors "author" output.check 1319 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1320 | format.title "title" output.check 1321 | format.tr.number output.nonnull 1322 | institution "institution" output.check 1323 | address output 1324 | format.date "year" output.check 1325 | note output 1326 | fin.entry 1327 | } 1328 | 1329 | FUNCTION {unpublished} 1330 | { output.bibitem 1331 | format.authors "author" output.check 1332 | title empty$ 'skip$ 'setup.inlinelink if$ % urlbst 1333 | format.title "title" output.check 1334 | note "note" output.check 1335 | format.date output 1336 | fin.entry 1337 | } 1338 | 1339 | FUNCTION {default.type} { misc } 1340 | 1341 | MACRO {jan} {"January"} 1342 | 1343 | MACRO {feb} {"February"} 1344 | 1345 | MACRO {mar} {"March"} 1346 | 1347 | MACRO {apr} {"April"} 1348 | 1349 | MACRO {may} {"May"} 1350 | 1351 | MACRO {jun} {"June"} 1352 | 1353 | MACRO {jul} {"July"} 1354 | 1355 | MACRO {aug} {"August"} 1356 | 1357 | MACRO {sep} {"September"} 1358 | 1359 | MACRO {oct} {"October"} 1360 | 1361 | MACRO {nov} {"November"} 1362 | 1363 | MACRO {dec} {"December"} 1364 | 1365 | READ 1366 | 1367 | FUNCTION {sortify} 1368 | { purify$ 1369 | "l" change.case$ 1370 | } 1371 | 1372 | INTEGERS { len } 1373 | 1374 | FUNCTION {chop.word} 1375 | { 's := 1376 | 'len := 1377 | s #1 len substring$ = 1378 | { s len #1 + global.max$ substring$ } 1379 | 's 1380 | if$ 1381 | } 1382 | 1383 | INTEGERS { et.al.char.used } 1384 | 1385 | FUNCTION {initialize.et.al.char.used} 1386 | { #0 'et.al.char.used := 1387 | } 1388 | 1389 | EXECUTE {initialize.et.al.char.used} 1390 | 1391 | FUNCTION {format.lab.names} 1392 | { 's := 1393 | s num.names$ 'numnames := 1394 | numnames #1 > 1395 | { numnames #4 > 1396 | { #3 'namesleft := } 1397 | { numnames 'namesleft := } 1398 | if$ 1399 | #1 'nameptr := 1400 | "" 1401 | { namesleft #0 > } 1402 | { nameptr numnames = 1403 | { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = 1404 | { "{\etalchar{+}}" * 1405 | #1 'et.al.char.used := 1406 | } 1407 | { s nameptr "{v{}}{l{}}" format.name$ * } 1408 | if$ 1409 | } 1410 | { s nameptr "{v{}}{l{}}" format.name$ * } 1411 | if$ 1412 | nameptr #1 + 'nameptr := 1413 | namesleft #1 - 'namesleft := 1414 | } 1415 | while$ 1416 | numnames #4 > 1417 | { "{\etalchar{+}}" * 1418 | #1 'et.al.char.used := 1419 | } 1420 | 'skip$ 1421 | if$ 1422 | } 1423 | { s #1 "{v{}}{l{}}" format.name$ 1424 | duplicate$ text.length$ #2 < 1425 | { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } 1426 | 'skip$ 1427 | if$ 1428 | } 1429 | if$ 1430 | } 1431 | 1432 | FUNCTION {author.key.label} 1433 | { author empty$ 1434 | { key empty$ 1435 | { cite$ #1 #3 substring$ } 1436 | { key #3 text.prefix$ } 1437 | if$ 1438 | } 1439 | { author format.lab.names } 1440 | if$ 1441 | } 1442 | 1443 | FUNCTION {author.editor.key.label} 1444 | { author empty$ 1445 | { editor empty$ 1446 | { key empty$ 1447 | { cite$ #1 #3 substring$ } 1448 | { key #3 text.prefix$ } 1449 | if$ 1450 | } 1451 | { editor format.lab.names } 1452 | if$ 1453 | } 1454 | { author format.lab.names } 1455 | if$ 1456 | } 1457 | 1458 | FUNCTION {author.key.organization.label} 1459 | { author empty$ 1460 | { key empty$ 1461 | { organization empty$ 1462 | { cite$ #1 #3 substring$ } 1463 | { "The " #4 organization chop.word #3 text.prefix$ } 1464 | if$ 1465 | } 1466 | { key #3 text.prefix$ } 1467 | if$ 1468 | } 1469 | { author format.lab.names } 1470 | if$ 1471 | } 1472 | 1473 | FUNCTION {editor.key.organization.label} 1474 | { editor empty$ 1475 | { key empty$ 1476 | { organization empty$ 1477 | { cite$ #1 #3 substring$ } 1478 | { "The " #4 organization chop.word #3 text.prefix$ } 1479 | if$ 1480 | } 1481 | { key #3 text.prefix$ } 1482 | if$ 1483 | } 1484 | { editor format.lab.names } 1485 | if$ 1486 | } 1487 | 1488 | FUNCTION {calc.label} 1489 | { type$ "book" = 1490 | type$ "inbook" = 1491 | or 1492 | 'author.editor.key.label 1493 | { type$ "proceedings" = 1494 | 'editor.key.organization.label 1495 | { type$ "manual" = 1496 | 'author.key.organization.label 1497 | 'author.key.label 1498 | if$ 1499 | } 1500 | if$ 1501 | } 1502 | if$ 1503 | duplicate$ 1504 | year field.or.null purify$ #-1 #2 substring$ 1505 | * 1506 | 'label := 1507 | year field.or.null purify$ #-1 #4 substring$ 1508 | * 1509 | sortify 'sort.label := 1510 | } 1511 | 1512 | FUNCTION {sort.format.names} 1513 | { 's := 1514 | #1 'nameptr := 1515 | "" 1516 | s num.names$ 'numnames := 1517 | numnames 'namesleft := 1518 | { namesleft #0 > } 1519 | { nameptr #1 > 1520 | { " " * } 1521 | 'skip$ 1522 | if$ 1523 | s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := 1524 | nameptr numnames = t "others" = and 1525 | { "et al" * } 1526 | { t sortify * } 1527 | if$ 1528 | nameptr #1 + 'nameptr := 1529 | namesleft #1 - 'namesleft := 1530 | } 1531 | while$ 1532 | } 1533 | 1534 | FUNCTION {sort.format.title} 1535 | { 't := 1536 | "A " #2 1537 | "An " #3 1538 | "The " #4 t chop.word 1539 | chop.word 1540 | chop.word 1541 | sortify 1542 | #1 global.max$ substring$ 1543 | } 1544 | 1545 | FUNCTION {author.sort} 1546 | { author empty$ 1547 | { key empty$ 1548 | { "to sort, need author or key in " cite$ * warning$ 1549 | "" 1550 | } 1551 | { key sortify } 1552 | if$ 1553 | } 1554 | { author sort.format.names } 1555 | if$ 1556 | } 1557 | 1558 | FUNCTION {author.editor.sort} 1559 | { author empty$ 1560 | { editor empty$ 1561 | { key empty$ 1562 | { "to sort, need author, editor, or key in " cite$ * warning$ 1563 | "" 1564 | } 1565 | { key sortify } 1566 | if$ 1567 | } 1568 | { editor sort.format.names } 1569 | if$ 1570 | } 1571 | { author sort.format.names } 1572 | if$ 1573 | } 1574 | 1575 | FUNCTION {author.organization.sort} 1576 | { author empty$ 1577 | { organization empty$ 1578 | { key empty$ 1579 | { "to sort, need author, organization, or key in " cite$ * warning$ 1580 | "" 1581 | } 1582 | { key sortify } 1583 | if$ 1584 | } 1585 | { "The " #4 organization chop.word sortify } 1586 | if$ 1587 | } 1588 | { author sort.format.names } 1589 | if$ 1590 | } 1591 | 1592 | FUNCTION {editor.organization.sort} 1593 | { editor empty$ 1594 | { organization empty$ 1595 | { key empty$ 1596 | { "to sort, need editor, organization, or key in " cite$ * warning$ 1597 | "" 1598 | } 1599 | { key sortify } 1600 | if$ 1601 | } 1602 | { "The " #4 organization chop.word sortify } 1603 | if$ 1604 | } 1605 | { editor sort.format.names } 1606 | if$ 1607 | } 1608 | 1609 | FUNCTION {presort} 1610 | { calc.label 1611 | sort.label 1612 | " " 1613 | * 1614 | type$ "book" = 1615 | type$ "inbook" = 1616 | or 1617 | 'author.editor.sort 1618 | { type$ "proceedings" = 1619 | 'editor.organization.sort 1620 | { type$ "manual" = 1621 | 'author.organization.sort 1622 | 'author.sort 1623 | if$ 1624 | } 1625 | if$ 1626 | } 1627 | if$ 1628 | * 1629 | " " 1630 | * 1631 | year field.or.null sortify 1632 | * 1633 | " " 1634 | * 1635 | title field.or.null 1636 | sort.format.title 1637 | * 1638 | #1 entry.max$ substring$ 1639 | 'sort.key$ := 1640 | } 1641 | 1642 | ITERATE {presort} 1643 | 1644 | SORT 1645 | 1646 | STRINGS { 1647 | longest.label last.sort.label next.extra prev.author this.author 1648 | } 1649 | 1650 | INTEGERS { longest.label.width last.extra.num } 1651 | 1652 | FUNCTION {initialize.longest.label} 1653 | { "" 'longest.label := 1654 | #0 int.to.chr$ 'last.sort.label := 1655 | "" 'next.extra := 1656 | #0 'longest.label.width := 1657 | #0 'last.extra.num := 1658 | "abcxyz" 'prev.author := 1659 | "" 'this.author := 1660 | } 1661 | 1662 | FUNCTION {forward.pass} 1663 | { last.sort.label sort.label = 1664 | { last.extra.num #1 + 'last.extra.num := 1665 | last.extra.num int.to.chr$ 'extra.label := 1666 | } 1667 | { "a" chr.to.int$ 'last.extra.num := 1668 | "" 'extra.label := 1669 | sort.label 'last.sort.label := 1670 | } 1671 | if$ 1672 | author empty$ { editor empty$ { "" } 'editor if$ } 'author if$ 1673 | 'this.author := 1674 | this.author prev.author = 1675 | { "\bysame" 'bysame := } 1676 | { "" 'bysame := 1677 | this.author "" = 1678 | { "abcxyz" } 1679 | 'this.author 1680 | if$ 1681 | 'prev.author := 1682 | } 1683 | if$ 1684 | } 1685 | 1686 | FUNCTION {reverse.pass} 1687 | { next.extra "b" = 1688 | { "a" 'extra.label := } 1689 | 'skip$ 1690 | if$ 1691 | label extra.label * 'label := 1692 | label width$ longest.label.width > 1693 | { label 'longest.label := 1694 | label width$ 'longest.label.width := 1695 | } 1696 | 'skip$ 1697 | if$ 1698 | extra.label 'next.extra := 1699 | } 1700 | 1701 | EXECUTE {initialize.longest.label} 1702 | 1703 | ITERATE {forward.pass} 1704 | 1705 | REVERSE {reverse.pass} 1706 | 1707 | FUNCTION {begin.bib} 1708 | { et.al.char.used 1709 | { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ } 1710 | 'skip$ 1711 | if$ 1712 | preamble$ empty$ 1713 | 'skip$ 1714 | { preamble$ write$ newline$ } 1715 | if$ 1716 | "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}" 1717 | write$ newline$ 1718 | "\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }" 1719 | write$ newline$ 1720 | "% \MRhref is called by the amsart/book/proc definition of \MR." 1721 | write$ newline$ 1722 | "\providecommand{\MRhref}[2]{%" 1723 | write$ newline$ 1724 | " \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}" 1725 | write$ newline$ 1726 | "}" 1727 | write$ newline$ 1728 | "\providecommand{\href}[2]{#2}" 1729 | write$ newline$ 1730 | "\begin{thebibliography}{" longest.label * "}" * 1731 | write$ newline$ 1732 | } 1733 | 1734 | EXECUTE {begin.bib} 1735 | 1736 | EXECUTE {init.urlbst.variables} 1737 | EXECUTE {init.state.consts} 1738 | 1739 | ITERATE {call.type$} 1740 | 1741 | FUNCTION {end.bib} 1742 | { newline$ 1743 | "\end{thebibliography}" write$ newline$ 1744 | } 1745 | 1746 | EXECUTE {end.bib} 1747 | %% \CharacterTable 1748 | %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z 1749 | %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z 1750 | %% Digits \0\1\2\3\4\5\6\7\8\9 1751 | %% Exclamation \! Double quote \" Hash (number) \# 1752 | %% Dollar \$ Percent \% Ampersand \& 1753 | %% Acute accent \' Left paren \( Right paren \) 1754 | %% Asterisk \* Plus \+ Comma \, 1755 | %% Minus \- Point \. Solidus \/ 1756 | %% Colon \: Semicolon \; Less than \< 1757 | %% Equals \= Greater than \> Question mark \? 1758 | %% Commercial at \@ Left bracket \[ Backslash \\ 1759 | %% Right bracket \] Circumflex \^ Underscore \_ 1760 | %% Grave accent \` Left brace \{ Vertical bar \| 1761 | %% Right brace \} Tilde \~} 1762 | -------------------------------------------------------------------------------- /3-mltt.tex: -------------------------------------------------------------------------------- 1 | % source p3.1 2 | 3 | We say what it is for a contextual category to have disjoint unions and a singleton object (comparable with a category with finite products and terminal object). The category of these structures is denoted \(\underline{\Sigma\text{-}\mathbf{Con}}\). 4 | 5 | We then introduce a new notion of structure---the notion of a category with attributes. The category of these structures is denoted \(\underline{\mathbf{Attcat}}\). We show that the category \(\underline{\Sigma\text{-}\mathbf{Con}}\) and the category \(\underline{\mathbf{Attcat}}\) are equivalent categories. 6 | 7 | In \S 1.5 we alluded to a contextual category of categories, category indexed families of categories and so on. The well known fibration construction induces a structure of disjoint unions on this contextual category. We use the \(\underline{\mathbf{Attcat}}\), \(\underline{\Sigma\text{-}\mathbf{Con}}\) equivalence to give a fairly brief description of this structure. This is in \S 3.3. 8 | 9 | \S 3.4 contains the definition of M-L structure intended as the model theory of a strengthened M-L type theory. 10 | 11 | Also in \S 3.4 an equivalent notion of structure, based on the \(\underline{\mathbf{Attcat}}\), \(\underline{\Sigma\text{-}\mathbf{Con}}\) equivalence, is put forward. Then in \S 3.5 we can briefly describe a new model of M-L type theory, we refer to it as the limit space model. 12 | 13 | % source p3.2 14 | \section{Disjoint unions and singleton object} \label{sec:source-3-1} 15 | 16 | A \underline{contextual category with disjoint unions} \(\tuple{\mathbb{C}, \Sigma, \alpha}\) consists of a contextual category \(\mathbb{C}\) and for every \(Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\), an object \(\Sigma B\) of \(\mathbb{C}\) and a morphism \(\alpha(B)\) of \(\mathbb{C}\) such that \(Q \triangleleft \Sigma B\) in \(\mathbb{C}\), such that \(\alpha(B)\) is an isomorphism in \(\mathbb{C}\), \(\alpha(B): B \to \Sigma B\) such that the diagram 17 | \begin{center} 18 | \begin{tikzcd} 19 | & B \arrow[d, "\alpha(B)"] \arrow[dl, "p(B)"'] \\ 20 | A \arrow[r, "p(A)"'] & \Sigma B \arrow[d, "p(\Sigma B)"] \\ 21 | & Q 22 | \end{tikzcd} 23 | \end{center} 24 | commutes, 25 | 26 | subject to the condition: If \(f: Q \to Q'\) in \(\mathbb{C}\) and if \(Q' \triangleleft A \triangleleft B\) then \(f^* \Sigma B = \Sigma f^* B\) and \(f^*(\alpha(B)) = \alpha(f^*B)\). 27 | 28 | The category of contextual categories with disjoint unions has as morphisms \(F: \tuple{\mathbb{C}, \Sigma, \alpha} \to \tuple{\mathbb{C}', \Sigma', \alpha'}\) those contextual functors \(F: \mathbb{C} \to \mathbb{C}'\) such that for all \(Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\), \(F(\Sigma B) = \Sigma' F(B)\) and \(F(\alpha(B)) = \alpha'(F(B))\). 29 | 30 | It follows that if \(\tuple{\mathbb{C}, \Sigma, \alpha}\) is a contextual category with disjoint unions and if \(f: A \to A'\) in \(\mathbb{C}\) then \(\mathbb{C}_f: \tuple{\mathbb{C}_{A'}, \Sigma, \alpha} \to \tuple{\mathbb{C}_A, \Sigma, \alpha}\) is a morphism of contextual categories with disjoint unions. 31 | 32 | Actual disjoint unions of families of sets induce the structure of contextual category with disjoint unions on the contextual category \(\underline{\mathbf{Fam}}\) of sets, families of sets and so on. This is as follows. 33 | 34 | If \(1 \triangleleft Q_1 \dots \triangleleft Q_n \triangleleft A \triangleleft B\) in \(\underline{\mathbf{Fam}}\) then define \(\Sigma B\), such that \(Q_n \triangleleft \Sigma B\) in \(\underline{\mathbf{Fam}}\), by defining \(\Sigma B(r_1, \dots, r_n) = \{ \tuple{a,b} \mid a \in A(r_1, \dots, r_n) \text{ and } b \in B(r_1, \dots, r_n, a) \}\) whenever \(r_1 \in Q_1, \dots, r_n \in Q_n(r_1, \dots, r_{n-1})\). Define \(\alpha(B) : B \to \Sigma B\) in \(\underline{\mathbf{Fam}}\) by defining \(\alpha(B) = \tuple{f_1, \dots, f_n, g}\) where \(f_i, 1 \le i \le n\) is defined by \(f_i(r_1, \dots, r_n, a, b) = r_i\) whenever \(r_1 \in Q_1, \dots, r_n \in Q_n(r_1, \dots, r_{n-1}), a \in A(r_1, \dots, r_n)\) and \(b \in B(r_1, \dots, r_n, a)\), and where \(g\) is defined by \(g(r_1, \dots, r_n, a, b) = \tuple{a, b}\). 35 | 36 | It is easy to see that \(\alpha(B)\) has inverse \(\alpha^{-1}(B)\) given by \(\tuple{L_1, \dots, L_n, k_1, k_2}\) where \(L_i, 1 \le i \le n\), is the operator given by \(L_i(r_1, \dots, r_n, c) = r_i\) whenever \(r_1 \in Q_1, \dots, r_n \in Q_n(r_1, \dots, r_{n-1})\) and \(c \in \Sigma B(r_1, \dots, r_n)\), and where \(k_1\) and \(k_2\) are given by \(k_i(r_1, \dots, r_n, c) =\) the \(i\)th component of the ordered pair \(c\). The conditions \(f^* \Sigma B = \Sigma f^* B\) and \(f^*(\alpha(B)) = \alpha(f^*B)\) are automatically satisfied. Even without these conditions it is clear that the definition characterises disjoint unions in \(\underline{\mathbf{Fam}}\) up to isomorphism. 37 | 38 | \begin{lemma} 39 | If \(\tuple{\mathbb{C}, \Sigma, \alpha}\) is a contextual category with disjoint unions then \(\mathrm{Base}(\mathbb{C})\) is a category with products of pairs (and hence has finite products). 40 | \end{lemma} 41 | 42 | \begin{proof} 43 | Suppose that \(A\) and \(A'\) are objects of \(\mathrm{Base}(\mathbb{C})\). That is to say suppose \(1 \triangleleft A\) and \(1 \triangleleft A'\) in \(\mathbb{C}\). 44 | 45 | In any category, pulling back over the terminal object yields a product diagram. Since 46 | \begin{center} 47 | \begin{tikzcd} 48 | p(A)^*A' \arrow[r, "q(p(A){,} A')"] \arrow[d, "p(A)^*A'"] & A' \arrow[d, "p(A')"] \\ 49 | A \arrow[r, "p(A)"] & 1 50 | \end{tikzcd} 51 | \end{center} 52 | is a pullback diagram in \(\mathbb{C}\), 53 | \begin{center} 54 | \begin{tikzcd} 55 | & p(A)^*A' \arrow[dl, "p(p(A)^*A')"'] \arrow[dr, "q(p(A){,} A')"] & \\ 56 | A & & A' 57 | \end{tikzcd} 58 | \end{center} 59 | is a product diagram in \(\mathbb{C}\). 60 | 61 | Since \(\alpha(p(A)^*A') : p(A)^*A' \to \Sigma p(A)^*A'\) is an isomorphism 62 | \begin{center} 63 | \begin{tikzcd} 64 | & \Sigma p(A)^*A' \arrow[dl, "p(p(A)^*A') \circ \alpha^{-1}(p(A)^*A')"'] \arrow[dr, "q(p(A){,} A') \circ \alpha^{-1}(p(A)^*A')"] & \\ 65 | A & & A' 66 | \end{tikzcd} 67 | \end{center} 68 | is a product diagram in \(\mathbb{C}\). \(1 \triangleleft \Sigma p(A)^*A'\) in \(\mathbb{C}\) and so this diagram is a product diagram in \(\mathrm{Base}(\mathbb{C})\). 69 | \end{proof} 70 | 71 | If this proof is interpreted in \(\mathbb{C} = \underline{\mathbf{Fam}}\) then we have \(\mathrm{Base}(\mathbb{C}) = \underline{\mathbf{Set}}\), the category of sets and functions. If \(A\) and \(A'\) are sets then \(p(A)^*A'\) is the constant \(A\)-indexed family with value \(A'\). Thus \(A \times A'\) in \(\underline{\mathbf{Set}}\) is given by \(\Sigma p(A)^*A'\) in \(\underline{\mathbf{Fam}}\) which in turn is just \(\{ \tuple{a, a'} \mid a \in A \text{ and } a' \in A' \}\). All is as it should be. 72 | 73 | A \underline{singleton object} of the contextual category \(\mathbb{C}\) is defined to be an object of \(\mathrm{Base}(\mathbb{C})\) that is terminal in \(\mathbb{C}\). Equivalently it is an object of \(\mathrm{Base}(\mathbb{C})\) that is isomorphic in \(\mathbb{C}\) to the terminal object \(1\). The singleton object, if there is one, will usually be denoted \(\{ \cdot \}\). The unique morphism \(1 \to \{ \cdot \}\) in \(\mathbb{C}\) will be denoted \(e\). Thus a contextual category with singleton object \(\tuple{\mathbb{C}, \{ \cdot \}, e}\) consists of a contextual category \(\mathbb{C}\), an object \(\{ \cdot \}\) of \(\mathbb{C}\) such that \(1 \triangleleft \{ \cdot \}\) in \(\mathbb{C}\) and a morphism \(e : 1 \to \{ \cdot \}\) such that \(p(\{ \cdot \}) \circ e = id_{\{ \cdot \}}\). The morphisms between contextual categories with singleton objects are taken to be those contextual functors which preserve the singleton object. 74 | 75 | It is not difficult to see that if \(U\) is a generalised algebraic theory then the contextual category \(\mathbb{C}(U)\) has a singleton object iff there exists expressions \(t\) and \(\Delta\) of \(U\) such that \(x \in \Delta : t = x \in \Delta\) is a derived rule of \(U\). 76 | 77 | \begin{lemma} 78 | If \(\mathbb{C}\) is a contextual category with singleton object \(\{ \cdot \}\) and if \(F: \mathbb{C} \to \mathbb{D}\) is a contextual functor then \(F(\{ \cdot \})\) is a singleton object of \(\mathbb{D}\). 79 | \end{lemma} 80 | 81 | \begin{proof} 82 | \(F\) is a functor, hence \(F\) preserves isomorphisms. Thus \(1 \triangleleft F(\{ \cdot \})\) and \(F(\{ \cdot \}) \cong 1\) in \(\mathbb{D}\). 83 | \end{proof} 84 | 85 | \begin{lemma} 86 | If \(\tuple{\mathbb{C}, \{ \cdot \}}\) is a contextual category with singleton object and if \(A\) is an object of \(\mathbb{C}\) then \(\tuple{\mathbb{C}_A, p(A,1)^* \{ \cdot \}}\) is a contextual category with singleton object. If \(f: A \to A'\) in \(\mathbb{C}\) then \(\mathbb{C}_f : \tuple{\mathbb{C}_{A'}, p(A',1)^* \{ \cdot \}} \to \tuple{\mathbb{C}_A, p(A,1)^* \{ \cdot \}}\) is a morphism of contextual categories with singleton objects. 87 | \end{lemma} 88 | 89 | \begin{proof} 90 | If \(A\) is an object of \(\mathbb{C}\) then \(p(A,1) : A \to 1\) in \(\mathbb{C}\). Hence \(p(A,1)^* : \mathbb{C}_1 \to \mathbb{C}_A\). Thus by lemma 2 \(\tuple{\mathbb{C}_A, p(A,1)^* \{ \cdot \}}\) is a contextual category with singleton object. Now if \(f: A \to A'\) in \(\mathbb{C}\) then \(\mathbb{C}_f : \mathbb{C}_{A'} \to \mathbb{C}_A\) and \(\mathbb{C}_f(p(A',1)^* \{ \cdot \}) = f^* p(A',1)^* \{ \cdot \} = (p(A',1) \circ f)^* \{ \cdot \} = p(A,1)^* \{ \cdot \}\). Thus \(\mathbb{C}_f : \mathbb{C}_{A'} \to \mathbb{C}_A\) and preserves the singleton object. 91 | \end{proof} 92 | 93 | The category of contextual categories with disjoint unions and singleton objects is denoted \(\underline{\Sigma\text{-}\mathbf{Con}}\). 94 | 95 | The point is that in a contextual category with disjoint unions and singleton object there is a lot of repetition of structure. For example if in such a structure \(Q \triangleleft A \triangleleft B\) then \(\mathbb{C}_{\alpha(B)}\) is an isomorphism of \(\mathbb{C}_B\) with \(\mathbb{C}_{\Sigma B}\). Thus the structure of \(\mathbb{C}\) above \(B\) is isomorphic to the structure of \(\mathbb{C}\) above \(\Sigma B\) and because \(\Sigma B\) is at a lower level than \(B\) it turns out that the whole structure of \(\mathbb{C}\) is coded up as structure at a very low level. This leads to the notion of a category with attributes. We must first introduce some new notation. 96 | 97 | For the remainder of this section we suppose \(\tuple{\mathbb{C}, \Sigma, \alpha, \{ \cdot \}}\) to be a contextual category with disjoint unions and singleton object. 98 | 99 | \begin{lemma} 100 | If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{C})\) and if \(A' \triangleleft B \triangleleft D\) in \(\mathbb{C}\) then the diagram 101 | \begin{center} 102 | \begin{tikzcd} 103 | f^*D \arrow[r, "q(f{,}D)"] \arrow[d, "\alpha(f^*D)"'] & D \arrow[d, "\alpha(D)"] \\ 104 | f^* \Sigma D \arrow[r, "q(f{,} \Sigma D)"] & \Sigma D 105 | \end{tikzcd} 106 | \end{center} 107 | commutes. 108 | \end{lemma} 109 | 110 | \begin{proof} 111 | Since \(f: A \to A'\) and \(A' \triangleleft B \triangleleft D\) we have by definition that \(f^* \Sigma D = \Sigma f^* D\) and \(f^*(\alpha(D)) = \alpha(f^*D)\). But \(f^*(\alpha(D))\) is defined to be the unique map: \(f^*D \to f^* \Sigma D\) such that the diagrams 112 | \begin{center} 113 | \begin{minipage}{0.4\textwidth} 114 | \begin{tikzcd} 115 | f^*D \arrow[r, "q(f{,}D)"] \arrow[d] & D \arrow[d, "p(D)"] \\ 116 | f^*B \arrow[r, "q(f{,}B)"] & B 117 | \end{tikzcd} 118 | \end{minipage} 119 | and 120 | \begin{minipage}{0.4\textwidth} 121 | \begin{tikzcd} 122 | f^*D \arrow[r, "q(f{,}D)"] \arrow[d, "f^*(\alpha(D))"'] & D \arrow[d, "\alpha(D)"] \\ 123 | f^* \Sigma D \arrow[r, "q(f{,} \Sigma D)"] & \Sigma D 124 | \end{tikzcd} 125 | \end{minipage} 126 | \end{center} 127 | commute. Thus the statement of the lemma is a restatement of the condition \(f^*(\alpha(D)) = \alpha(f^*D)\). 128 | \end{proof} 129 | 130 | If \(1 \triangleleft A \triangleleft B\) in \(\underline{\mathbf{Fam}}\) then we let \(\rho(B) : \Sigma B \to A\) be the 1st projection function from \(\{ \tuple{a,b} \mid a \in A, b \in B(a) \}\) to \(A\). More generally if \(Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\) then define \(\rho(B) : \Sigma B \to A\) to be \(\alpha^{-1}(B) \circ p(B)\). 131 | \begin{center} 132 | \begin{tikzcd} 133 | & B \arrow[dl, "\alpha(B)"'] \arrow[d, "p(B)"] \\ 134 | \Sigma B \arrow[r, "\rho(B)"] & A 135 | \end{tikzcd} 136 | \end{center} 137 | 138 | Now suppose \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{C})\) and \(A' \triangleleft B\) in \(\mathbb{C}\), define \(\xi(f,B) : \Sigma f^*B \to \Sigma B\) to be the morphism \(\alpha^{-1}(f^*B) \circ q(f,B) \circ \alpha(B)\). 139 | 140 | \begin{lemma} 141 | If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{C})\) and if \(A' \triangleleft B\) in \(\mathbb{C}\) then 142 | \begin{center} 143 | \begin{tikzcd} 144 | \Sigma f^*B \arrow[r, "\xi(f{,}B)"] \arrow[d, "\rho(f^*B)"] & \Sigma B \arrow[d, "\rho(B)"] \\ 145 | A \arrow[r, "f"] & A' 146 | \end{tikzcd} 147 | \end{center} 148 | is a pullback diagram in \(\mathrm{Base}(\mathbb{C})\). 149 | \end{lemma} 150 | 151 | \begin{proof} 152 | Just because 153 | \begin{center} 154 | \begin{tikzcd} 155 | f^*B \arrow[r, "q(f{,}B)"] \arrow[d, "p(f^*B)"] & B \arrow[d, "p(B)"] \\ 156 | A \arrow[r, "f"] & A' 157 | \end{tikzcd} 158 | \end{center} 159 | is a pullback diagram in \(\mathbb{C}\) and \(\alpha(f^*B)\) and \(\alpha(B)\) are isomorphisms. 160 | \end{proof} 161 | 162 | Note that these pullback diagrams fit together in the sense that if \(A \xrightarrow{f} A' \xrightarrow{f'} A''\) in \(\mathbb{C}\) then \(f^*f'^*B = (ff')^*B\) and \(\xi(f, f'^*B) \circ \xi(f', B) = \xi(ff', B)\). We are at this moment collapsing the structure of \(\mathbb{C}\) into \(\mathrm{Base}(\mathbb{C})\). 163 | 164 | We now introduce the \(\#, \gamma\) notation. We have to think of this as a reflection at a low level of \(\mathbb{C}\), structure at higher levels. 165 | 166 | \begin{lemma} 167 | If \(f: A \to A'\) is an isomorphism in \(\mathbb{C}\) and if \(A' \triangleleft B\) then \(q(f,B) : f^*B \to B\) is an isomorphism with inverse \(q(f^{-1}, f^*B) : B \to f^*B\) in \(\mathbb{C}\). 168 | \end{lemma} 169 | 170 | \begin{proof} 171 | \(q(f^{-1}, f^*B): B \to f^*B\) in \(\mathbb{C}\) because \(f^{-1*} f^*B = B\). 172 | \(q(f^{-1}, f^*B) \circ q(f,B) = q(f^{-1} \circ f, B) = q(id_{A'}, B) = id_B\). 173 | \(q(f,B) \circ q(f^{-1}, f^*B) = q(f \circ f^{-1}, f^*B) = q(ff^{-1}, f^*B) = q(id_A, f^*B) = id_{f^*B}\). 174 | \end{proof} 175 | 176 | In future if \(1 \triangleleft A \triangleleft B\) in \(\mathbb{C}\) and \(\Sigma B \triangleleft C\) then the object \(\Sigma \alpha(B)^*C\) will be denoted \(\# C\). Thus \(A \triangleleft \# C\) in \(\mathbb{C}\). By lemma 6 \(\alpha(B)^*C \cong C\). The composite isomorphism \(C \xrightarrow{\alpha(B)} \alpha(B)^*C \xrightarrow{\alpha(\alpha(B)^*C)} \Sigma \alpha(B)^*C\) will be denoted \(\sigma(C)\). Thus \(\sigma(C) = q(\alpha(B)^{-1}, \alpha(B)^*C) \circ \alpha(\alpha(B)^*C)\). 177 | Finally we define \(\gamma(C) : \Sigma C \to \Sigma \# C\) to be the isomorphism \(\alpha^{-1}(C) \circ \sigma(C) \circ \alpha(\# C)\). 178 | 179 | \begin{center} 180 | \begin{tikzcd} 181 | C \arrow[r, "{q(\alpha(B)^{-1}{,}\alpha(B)^*C)}"] \arrow[d, "\alpha^{-1}(C)"'] \arrow[drr, "\sigma(C)", bend left] & \alpha(B)^*C \arrow[r, "\alpha(\alpha(B)^*C)"] & \Sigma \alpha(B)^*C = \# C \arrow[d, "\alpha(\# C)"] \\ 182 | \Sigma C \arrow[rr, "\gamma(C)"] & & \Sigma \# C 183 | \end{tikzcd} 184 | \end{center} 185 | 186 | \begin{lemma} 187 | If \(1 \triangleleft A \triangleleft B\) and \(\Sigma B \triangleleft C\) in \(\mathbb{C}\) then the diagram 188 | \begin{center} 189 | \begin{tikzcd} 190 | \Sigma C \arrow[r, "\gamma(C)"] \arrow[d, "\rho(C)"] & \Sigma \# C \arrow[d, "\rho(\# C)"] \\ 191 | \Sigma B \arrow[d, "\rho(B)"] & \Sigma \alpha(B)^*C \arrow[dl] \\ 192 | A & 193 | \end{tikzcd} 194 | \end{center} 195 | commutes in \(\mathrm{Base}(\mathbb{C})\). 196 | \end{lemma} 197 | 198 | \begin{proof} 199 | Use the definition of \(\rho\) and \(\gamma\) plus the commutativity of the diagrams 200 | \begin{center} 201 | \begin{minipage}{0.45\textwidth} 202 | \begin{tikzcd} 203 | C \arrow[r, "{q(\alpha^{-1}(B){,} \alpha(B)^*C)}"] \arrow[d, "p(C)"] & \alpha(B)^*C \arrow[d] \\ 204 | \Sigma B \arrow[r, "\alpha^{-1}(B)"] & B 205 | \end{tikzcd} 206 | \end{minipage} 207 | and 208 | \begin{minipage}{0.45\textwidth} 209 | \begin{tikzcd} 210 | \alpha(B)^*C \arrow[r, "\alpha(\alpha(B)^*C)"] \arrow[d] & \Sigma \alpha(B)^*C = \# C \\ 211 | B \arrow[d, "p(B)"] & \\ 212 | A & 213 | \end{tikzcd} 214 | \end{minipage} 215 | \end{center} 216 | (The first diagram commutes because it is a pullback diagram, the second by definition of disjoint unions). 217 | \end{proof} 218 | 219 | \begin{lemma} 220 | If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{C})\) and if \(A' \triangleleft B\), \(\Sigma B \triangleleft C\) in \(\mathbb{C}\) then \(\#(\xi(f,B)^*C) = f^* \# C\) and the diagram 221 | \begin{center} 222 | \begin{tikzcd} 223 | \Sigma \xi(f{,}B)^*C \arrow[r, "\xi(\xi(f{,}B){,} C)"] \arrow[d, "\gamma(\xi(f{,}B)^*C)"] & \Sigma C \arrow[d, "\gamma(C)"] \\ 224 | \Sigma f^* \# C \arrow[r, "\xi(f{,} \# C)"] & \Sigma \# C 225 | \end{tikzcd} 226 | \end{center} 227 | commutes. 228 | \end{lemma} 229 | 230 | \begin{proof} 231 | The situation: 232 | \begin{center} 233 | \begin{tikzcd} 234 | \xi(f{,}B)^*C \arrow[d, "\alpha(f^*B)"] & f^*B \arrow[d, "\alpha(f^*B)"] \arrow[r, "q(f{,}B)"] & B \arrow[d, "\alpha(B)"] & C \arrow[d, "\alpha(B)"] \\ 235 | \Sigma f^* B & A \arrow[r, "f"] & A' & \Sigma B 236 | \end{tikzcd} 237 | \end{center} 238 | 239 | The identity \(\#(\xi(f,B)^*C) = f^*B\) holds as follows: 240 | \(\#(\xi(f,B)^*C) = \Sigma(\alpha(f^*B)^* \xi(f,B)^* C)\) by def.\ of \(\#\). 241 | \(= \Sigma(\alpha(f^*B)^* (\alpha^{-1}(f^*B) \circ q(f,B) \circ \alpha(B))^* C)\) by def.\ of \(\xi\). 242 | \(= \Sigma(q(f,B)^* \alpha(B)^* C)\) 243 | \(= \Sigma(f^* \alpha(B)^* C)\) * notation -- see lemma 1 of 2.3. Since \(A' \triangleleft B \triangleleft \alpha(B)^*\) and \(f: A \to A'\) in \(\mathbb{C}\). 244 | \(= f^* \Sigma(\alpha(B)^* C)\) 245 | \(= f^* \# C\) by def.\ of \(\#\). 246 | 247 | Now if we take the diagram that we wish to show commutes and use the definitions of \(\gamma\) and \(\xi\) we see that we wish to show that the outer rectangle of the diagram 248 | \begin{center} 249 | \begin{tikzcd} 250 | \Sigma \xi(f{,}B)^*C \arrow[r, "\alpha^{-1}(\xi(f{,}B)^*C)"] \arrow[ddr] & \xi(f{,}B)^*C \arrow[r, "q(\xi(f{,}B){,} C)"] & C \arrow[r, "\alpha(C)"] \arrow[d, "\sigma(C)"] & \Sigma C \arrow[dd, "\alpha^{-1}"] \\ 251 | & & \# C \arrow[d, "\alpha"] & \\ 252 | & \# \xi(f{,}B)^*C \arrow[r] & f^* \# C \arrow[r, "q(f{,} \# C)"] & \Sigma \# C 253 | \end{tikzcd} 254 | \end{center} 255 | commutes. 256 | 257 | Thus it suffices to show that the diagram 258 | \begin{center} 259 | \begin{tikzcd} 260 | \xi(f{,}B)^*C \arrow[r, "q(\xi(f{,}B){,} C)"] \arrow[d, "\sigma(\xi(f{,}B)^*C)"] & C \arrow[d, "\sigma(C)"] \\ 261 | f^* \# C = \#(\xi(f{,}B)^*C) \arrow[r, "q(f{,} \# C)"] & \# C 262 | \end{tikzcd} 263 | \end{center} 264 | commutes. 265 | 266 | Now \(\sigma(C)\) is defined to be \(q(\alpha^{-1}(B), \alpha(B)^*C) \circ \alpha(\alpha(B)^*C)\) 267 | and \(\sigma(\xi(f,B)^*C) = q(\alpha^{-1}(f^*B), \alpha(f^*B)^* \xi(f,B)^*C) \circ \alpha(\alpha(f^*B)^* \xi(f,B)^*C) = q(\alpha^{-1}(f^*B), f^* \alpha(B)^* C) \circ \alpha(f^* \alpha(B)^* C)\), by definition of \(\xi\). Thus we wish to show that the outer rectangle of the diagram 268 | \begin{center} 269 | \begin{tikzcd} 270 | \xi(f{,}B)^*C \arrow[r, "q(\xi(f{,}B){,} C)"] \arrow[d] & C \arrow[d] \\ 271 | f^* \alpha(B)^* C \arrow[r, "q(f{,} \alpha(B)^*C)"] \arrow[d] & \alpha(B)^* C \arrow[d] \\ 272 | f^* \# C \arrow[r, "q(f{,} \# C)"] & \# C 273 | \end{tikzcd} 274 | \end{center} 275 | commutes. 276 | 277 | Well the lower rectangle commutes by lemma 4 of this section. To show that the upper rectangle commutes we replace the extended \(^*, q\) notation (i.e.\ use lemma 1 of \S 2.3), use the fact that pullbacks fit together and use the definition of \(\xi\). This is as follows 278 | \(q(\alpha^{-1}(f^*B), f^* \alpha(B)^* C) \circ q(f, \alpha(B)^* C) =\) 279 | \(q(\alpha^{-1}(f^*B), q(f, B)^* \alpha(B)^* C) \circ q(q(f,B), \alpha(B)^* C) =\) 280 | \(q(\alpha^{-1}(f^*B) \circ q(f,B), \alpha(B)^* C) = q(\xi(f,B) \circ \alpha^{-1}(B), \alpha(B)^* C) =\) 281 | \(q(\xi(f,B), \alpha^{-1}(B)^* \alpha(B)^* C) \circ q(\alpha^{-1}(B), \alpha(B)^* C) =\) 282 | \(q(\xi(f,B), C) \circ q(\alpha^{-1}(B), \alpha(B)^* C)\), as required. 283 | \end{proof} 284 | 285 | If \(A \in |\mathrm{Base}(\mathbb{C})|\) then \(p(\{ \cdot \})^* A \cong A\) because \(p(\{ \cdot \}) : \{ \cdot \} \to 1\) is an isomorphism. Hence \(\Sigma p(\{ \cdot \})^* A \cong A\). We denote \(p(\{ \cdot \})^* A\) by \(L(A)\) and the isomorphism of \(\Sigma L(A)\) with \(A\) by \(\Theta(A)\). Thus \(\Theta(A) : \Sigma L(A) \to A\) is defined by \(\Theta(A) = \alpha^{-1}(p(\{ \cdot \})^* A) \circ q(p(\{ \cdot \}), A)\). 286 | 287 | \begin{lemma} 288 | If \(1 \triangleleft A \triangleleft B\) in \(\mathbb{C}\) then \(L(\Sigma B) = \#(\Theta(A)^* B)\) and the diagram 289 | \begin{center} 290 | \begin{tikzcd} 291 | \Sigma B \arrow[d, "\Theta(\Sigma B)"] & \Sigma L(\Sigma B) \arrow[l, "\xi(\Theta(A){,} B)"'] \arrow[d, "\gamma(\Theta(A)^* B)"] \\ 292 | \Sigma L \Sigma B & \Sigma \# \Theta(A)^* B \arrow[l, "\Theta(\Sigma B)"] 293 | \end{tikzcd} 294 | \end{center} 295 | commutes. 296 | \end{lemma} 297 | 298 | \begin{proof} 299 | \(\#((\alpha^{-1}(p(\{ \cdot \})^* A) \circ q(p(\{ \cdot \}), A))^* B = \Sigma q(p(\{ \cdot \}), A)^* B\) by definition of \(\#\), \(= \Sigma p(\{ \cdot \})^* B\), by replacing extended \(^*, q\) notation, \(= p(\{ \cdot \})^* \Sigma B\). That is \(\# \Theta(A)^* B = L(\Sigma B)\). 300 | 301 | As for the commuting triangle, if we cancel out the \(\rho\)'s and \(\alpha^{-1}\)'s, after substituting in for \(\Theta, \gamma\) and \(\xi\), then we see that we want to show that the diagram 302 | \begin{center} 303 | \begin{tikzcd} 304 | q(p(\{ \cdot \}), \Sigma B) \arrow[d] & \Sigma B \arrow[l] \arrow[d] \\ 305 | p(\{ \cdot \})^* \Sigma B \arrow[r, equal] & \# \Theta(A)^* B 306 | \end{tikzcd} 307 | \end{center} 308 | commutes. Now \(q(\Theta(A), B) \circ \alpha(B) = q(\alpha^{-1}(p(\{ \cdot \})^* A) \circ q(p(\{ \cdot \}), A), B) \circ \alpha(B)\) 309 | \(q(\alpha^{-1}(p(\{ \cdot \})^* A), p(\{ \cdot \})^* B) \circ q(p(\{ \cdot \}), B) \circ \alpha(B)\). Whereas 310 | \(\sigma(\Theta(A)^* B) = q(\alpha^{-1}(p(\{ \cdot \})^* A), p(\{ \cdot \})^* B) \circ \alpha(p(\{ \cdot \})^* B)\). Thus we must just show that the diagram 311 | \begin{center} 312 | \begin{tikzcd} 313 | p(\{ \cdot \})^* B \arrow[r, "q(p(\{ \cdot \}){,} B)"] \arrow[d, "\alpha(p(\{ \cdot \})^* B)"] & B \arrow[d, "\alpha(B)"] \\ 314 | \Sigma p(\{ \cdot \})^* B \arrow[r, "q(p(\{ \cdot \}){,} \Sigma B)"] & \Sigma B 315 | \end{tikzcd} 316 | \end{center} 317 | commutes. But this commutes by lemma 4. 318 | \end{proof} 319 | 320 | % source p3.14 321 | \section{Categories with attributes} \label{sec:source-3-2} 322 | 323 | A \underline{category with attributes} \(\tuple{\mathbb{C}, Att, 1_{\mathbb{C}}, \Sigma, p, \cdot, \Sop, \#, \gamma, L, \Theta}\) consists of 324 | 325 | \begin{enumerate} 326 | \item A category \(\mathbb{C}\) with terminal object \(1_{\mathbb{C}}\). Said to be the \underline{base category}. 327 | 328 | \item For every object \(A\) of \(\mathbb{C}\), a set \(Att(A)\). The set of attributes of type \(A\). 329 | 330 | \item For every object \(A\) of \(\mathbb{C}\), for every \(B \in Att(A)\), an object \(\Sigma B\) of \(\mathbb{C}\) and a morphism \(p(B) : \Sigma B \to A\) in \(\mathbb{C}\). 331 | 332 | \item For every morphism \(f : A \to A'\) in \(\mathbb{C}\), for every \(B \in Att(A')\), an attribute \(f^*B \in Att(A)\) and a morphism \(\Sop(f,B) : \Sigma f^*B \to \Sigma B\) in \(\mathbb{C}\) such that the diagram 333 | \begin{center} 334 | \begin{tikzcd} 335 | \Sigma f^*B \arrow[r, "{\Sop(f,B)}"] \arrow[d, "p(f^*B)"'] & \Sigma B \arrow[d, "p(B)"] \\ 336 | A \arrow[r, "f"] & A' 337 | \end{tikzcd} 338 | \end{center} 339 | is a pullback diagram in \(\mathbb{C}\). 340 | 341 | \item For every object \(A\) of \(\mathbb{C}\), for every \(B \in Att(A)\), for every \(C \in Att(\Sigma B)\), an attribute \(\# C \in Att(A)\) and an isomorphism \(\gamma(C) : \Sigma C \to \Sigma \# C\) in \(\mathbb{C}\) such that the diagram 342 | \begin{center} 343 | \begin{tikzcd} 344 | \Sigma C \arrow[rr, "\gamma(C)"] \arrow[dr, "p(C)"'] & & \Sigma \# C \arrow[dl, "p(\# C)"] \\ 345 | & \Sigma B \arrow[d, "p(B)"] & \\ 346 | & A & 347 | \end{tikzcd} 348 | \end{center} 349 | commutes. 350 | 351 | \item For every object \(A\) of \(\mathbb{C}\), an attribute \(L(A) \in Att(1_{\mathbb{C}})\) and an isomorphism \(\Theta(A) : \Sigma L(A) \to A\) in \(\mathbb{C}\). Such that \(L\) as a function \(L : |\mathbb{C}| \to Att(1_{\mathbb{C}})\) is an isomorphism of sets. 352 | \end{enumerate} 353 | 354 | Subject to the conditions: 355 | 356 | \begin{enumerate} 357 | \item[I.] If \(A\) is an object of \(\mathbb{C}\) and if \(B \in Att(A)\) then \(id_A^* B = B\) and \(\Sop(id_A, B) = id_{\Sigma B}\). 358 | 359 | \item[II.] If \(A \xrightarrow{f} A' \xrightarrow{f'} A''\) in \(\mathbb{C}\) and if \(B \in Att(A'')\) then \(f^* f'^* B = (ff')^* B\) and \(\Sop(f, f'^*B) \circ \Sop(f', B) = \Sop(ff', B)\). 360 | 361 | \item[III.] If \(f : A \to A'\) in \(\mathbb{C}\) and if \(B \in Att(A')\) and \(C \in Att(\Sigma B)\) then \(\#(\Sop(f,B)^*C) = f^* \# C\) and the diagram 362 | \begin{center} 363 | \begin{tikzcd} 364 | \Sigma \Sop(f,B)^*C \arrow[r, "{\Sop(\Sop(f{,}B){,} C)}"] \arrow[d, "{\gamma(\Sop(f{,}B)^*C)}"'] & \Sigma C \arrow[d, "\gamma(C)"] \\ 365 | \Sigma f^* \# C \arrow[r, "{\Sop(f{,} \# C)}"] & \Sigma \# C 366 | \end{tikzcd} 367 | \end{center} 368 | commutes. 369 | 370 | \item[IV.] If \(A\) is an object of \(\mathbb{C}\) and if \(B \in Att(A)\) then \(L \Sigma B = \# \Theta(A)^* B\) and the diagram 371 | \begin{center} 372 | \begin{tikzcd} 373 | \Sigma B \arrow[d, "\Theta(\Sigma B)"] & \Sigma L(\Sigma B) \arrow[l, "{\Sop(\Theta(A){,} B)}"'] \arrow[d, "{\gamma(\Theta(A)^* B)}"] \\ 374 | \Sigma L \Sigma B & \Sigma \# \Theta(A)^* B \arrow[l, "\Theta(\Sigma B)"] 375 | \end{tikzcd} 376 | \end{center} 377 | commutes. 378 | \end{enumerate} 379 | 380 | The category of categories with attributes is denoted \(\underline{\mathbf{Attcat}}\). A morphism \(F : \tuple{\mathbb{C}, Att, \dots} \to \tuple{\mathbb{C}', Att', \dots}\) consists of a functor \(F : \mathbb{C} \to \mathbb{C}'\) preserving the terminal object and for each object \(A\) of \(\mathbb{C}\) a function, also called \(F\), \(F : Att(A) \to Att'(F(A))\) such that \(F\), as a whole, preserves all the structure \(\Sigma, p, {}^*, \Sop, \#, \gamma, L\) and \(\Theta\). 381 | 382 | In this section we prove that the category \(\underline{\mathbf{Attcat}}\) is equivalent to the category \(\underline{\Sigma\text{-}\mathbf{Con}}\) of contextual categories with disjoint unions and singleton object. Part of this work has been done in \S 3.1 where we did, in effect, prove that every \(\mathbb{D} \in |\underline{\Sigma\text{-}\mathbf{Con}}|\) induces a category with attributes now to be called \(\Phi(\mathbb{D})\). \(\Phi(\mathbb{D})\) has as base category the category \(\mathrm{Base}(\mathbb{D})\). If \(A \in \mathrm{Base}(\mathbb{D})\) then \(Att_{\Phi(\mathbb{D})}(A)\) is taken to be \(\{ B \in |\mathbb{D}| \mid A \triangleleft B \text{ in } \mathbb{D} \}\). \(\Sigma, p, {}^*, \Sop, \#, L\) and \(\Theta\) are then defined in \(\Phi(\mathbb{D})\) as defined in \S 3.1. Lemmas of that section then ensure that \(\Phi(\mathbb{D})\) so defined is a category with attributes. 383 | 384 | Since any morphism \(F : \mathbb{D} \to \mathbb{D}'\) in \(\underline{\Sigma\text{-}\mathbf{Con}}\) completely preserves the disjoint union and singleton object structure as well as contextual structure and since \(\Phi(\mathbb{D})\) and \(\Phi(\mathbb{D}')\) are defined entirely in terms of this structure it follows that such an \(F\) induces a morphism \(\Phi(F) : \Phi(\mathbb{D}) \to \Phi(\mathbb{D}')\) in \(\underline{\mathbf{Attcat}}\). The functoriality of \(\Phi : \underline{\Sigma\text{-}\mathbf{Con}} \to \underline{\mathbf{Attcat}}\) is immediate. We wish to show that \(\Phi\) is an equivalence of categories. This involves the definition of a functor \(\Psi : \underline{\mathbf{Attcat}} \to \underline{\Sigma\text{-}\mathbf{Con}}\). 385 | Then we show that for all \(\mathbb{D} \in |\underline{\Sigma\text{-}\mathbf{Con}}|\), \(\Psi(\Phi(\mathbb{D}))\) is, upto isomorphism of structures, the structure \(\mathbb{D}\) recovered from \(\Phi(\mathbb{D})\). 386 | 387 | If \(\mathbb{E}\) is a category with attributes write \(\mathrm{Base}(\mathbb{E})\) for the base category of \(\mathbb{E}\) and write \(Att_{\mathbb{E}}(A)\) for attributes of \(A\) when \(A \in |\mathrm{Base}(\mathbb{E})|\). 388 | 389 | \textbf{Construction.} If \(\mathbb{E}\) is a category with attributes then define a contextual category \(\Psi(\mathbb{E})\) as follows: 390 | 391 | \textbf{Step 1.} The objects of \(\Psi(\mathbb{E})\) will be defined in such a way that each object is an ordered pair \(\tuple{n, A}\) where \(n\) is a natural number and \(A\) is an attribute in \(\mathbb{E}\). 392 | 393 | The tree of objects of \(\Psi(\mathbb{E})\) is defined inductively. The least element of the tree is taken to be the ordered pair \(\tuple{0, L(1_{\mathbb{E}})}\), where \(1_{\mathbb{E}}\) is the terminal object of \(\mathrm{Base}(\mathbb{E})\). Then if \(\tuple{n, A}\) is an object of \(\Psi(\mathbb{E})\) define the set of objects of \(\Psi(\mathbb{E})\) succeeding \(\tuple{n, A}\) to be the set \(\{ \tuple{n+1, B} \mid B \in Att_{\mathbb{E}}(\Sigma A) \}\). 394 | 395 | Thus an arbitrary path up through \(\Psi(\mathbb{E})\) is a path of the form \(\tuple{0, L(1_{\mathbb{E}})} \triangleleft \tuple{1, A_1} \dots \triangleleft \tuple{n, A_n}\) where \(A_1 \in Att_{\mathbb{E}}(\Sigma L(1_{\mathbb{E}}))\) and for each \(i, 2 \le i \le n\), \(A_i \in Att_{\mathbb{E}}(\Sigma A_{i-1})\). 396 | 397 | \textbf{Step 2.} The morphisms of \(\Psi(\mathbb{E})\). Define \(\Hom_{\Psi(\mathbb{E})}(\tuple{n, A}, \tuple{m, A'}) = \{ \tuple{n, m, f} \mid f : \Sigma A \to \Sigma A' \text{ in Base}(\mathbb{E}) \}\). Define \(\tuple{n, m, f} \circ \tuple{m, l, g} = \tuple{n, l, fg}\). 398 | 399 | \textbf{Step 3.} Projections. If \(\tuple{n, A} \triangleleft \tuple{n+1, B}\) in \(\Psi(\mathbb{E})\) then \(B \in Att_{\mathbb{E}}(\Sigma A)\) so we can define \(p(\tuple{n+1, B}) = \tuple{n+1, n, p(B)}\). 400 | 401 | \textbf{Step 4.} Pullbacks. If \(\tuple{n, m, f} : \tuple{n, A} \to \tuple{m, A'}\) in \(\Psi(\mathbb{E})\) and if \(\tuple{m, A'} \triangleleft \tuple{m+1, B}\) then \(B \in Att_{\mathbb{E}}(\Sigma A')\) and \(f : \Sigma A \to \Sigma A'\) in \(\mathbb{E}\) so define \(\tuple{n, m, f}^* \tuple{m+1, B} = \tuple{n+1, f^*B}\) and define \(q(\tuple{n, m, f}, \tuple{m+1, B}) = \tuple{n+1, m+1, \Sop(f,B)}\). We must check that 402 | \begin{center} 403 | \begin{tikzcd} 404 | \tuple{n+1, f^*B} \arrow[r, "{\tuple{n+1{,} m+1{,} \Sop(f{,}B)}}"] \arrow[d] & \tuple{m+1, B} \arrow[d] \\ 405 | \tuple{n, A} \arrow[r, "{\tuple{n{,} m{,} f}}"] & \tuple{m, A'} 406 | \end{tikzcd} 407 | \end{center} 408 | is a pullback diagram in \(\Psi(\mathbb{E})\). This is easily checked using the fact that 409 | \begin{center} 410 | \begin{tikzcd} 411 | \Sigma f^*B \arrow[r, "{\Sop(f,B)}"] \arrow[d, "p(f^*B)"'] & \Sigma B \arrow[d, "p(B)"] \\ 412 | \Sigma A \arrow[r, "f"] & \Sigma A' 413 | \end{tikzcd} 414 | \end{center} 415 | is a pullback diagram in \(\mathrm{Base}(\mathbb{E})\). 416 | 417 | Similarly the pullbacks in \(\Psi(\mathbb{E})\) fit together because the corresponding pullbacks in \(\mathrm{Base}(\mathbb{E})\) fit together. 418 | 419 | \textbf{Step 4.} \(\Sigma\) and \(\alpha\). Suppose that \(\tuple{n, A} \triangleleft \tuple{n+1, B} \triangleleft \tuple{n+2, C}\) in \(\Psi(\mathbb{E})\). Then \(C \in Att_{\mathbb{E}}(\Sigma B)\) and \(B \in Att_{\mathbb{E}}(\Sigma A)\) hence \(\# C \in Att_{\mathbb{E}}(\Sigma A)\) and \(\gamma(C) : \Sigma C \to \Sigma \# C\) in \(\mathrm{Base}(\mathbb{E})\). Thus we can define \(\Sigma \tuple{n+2, C} = \tuple{n+1, \# C}\) and \(\alpha(\tuple{n+2, C}) = \tuple{n+2, n+1, \gamma(C)}\). Then \(\alpha(\tuple{n+2, C})\) is an isomorphism because \(\gamma(C)\) is an isomorphism. 420 | 421 | The diagram 422 | \begin{center} 423 | \begin{tikzcd} 424 | \tuple{n+1, C} \arrow[r, "{\alpha(\tuple{n+2{,} C})}"] \arrow[dr] & \Sigma \tuple{n+2, C} \arrow[d] \\ 425 | & \tuple{n, A} 426 | \end{tikzcd} 427 | \end{center} 428 | commutes in \(\Psi(\mathbb{E})\) because the diagram 429 | \begin{center} 430 | \begin{tikzcd} 431 | \Sigma C \arrow[r, "\gamma(C)"] \arrow[d, "p(C)"'] & \Sigma \# C \arrow[d, "p(\# C)"] \\ 432 | \Sigma B \arrow[d, "p(B)"'] & \Sigma A \\ 433 | \Sigma A & 434 | \end{tikzcd} 435 | \end{center} 436 | commutes in \(\mathrm{Base}(\mathbb{E})\). 437 | 438 | Finally we must show that if \(\tuple{n, m, f} : \tuple{n, A} \to \tuple{m, A'}\) in \(\mathbb{C}\) and if \(\tuple{m, A'} \triangleleft \tuple{m+1, B} \triangleleft \tuple{m+2, C}\) then \(\tuple{n, m, f}^* \Sigma \tuple{m+2, C} = \Sigma \tuple{n, m, f}^* \tuple{m+2, C}\) and \(\tuple{n, m, f}^* \alpha(\tuple{m+2, C}) = \alpha(\tuple{n, m, f}^* \tuple{m+2, C})\). 439 | 440 | The first identity holds as follows: 441 | \(\tuple{n, m, f}^* \Sigma \tuple{m+2, C} = \tuple{n, m, f}^* \tuple{m+1, \# C} = \tuple{n+1, f^* \# C}\). 442 | Now by condition III of the definition of Attcat, \(f^* \# C = \# \Sop(f,B)^* C\). 443 | Hence \(\tuple{n+1, f^* \# C} = \tuple{n+1, \# \Sop(f,B)^* C} = \Sigma \tuple{n+2, \Sop(f,B)^* C} = \Sigma \tuple{n+1, m+1, \Sop(f,B)}^* \tuple{m+2, C} = \Sigma q(\tuple{n, m, f}, \tuple{m+1, B})^* \tuple{m+2, C} = \Sigma \tuple{n, m, f}^* \tuple{m+2, C}\) in the extended \({}^*\) notation. 444 | 445 | By lemma 4 of \S 3.1 the second identity is equivalent to the commutativity of 446 | \begin{center} 447 | \begin{tikzcd} 448 | \tuple{n, m, f}^* \tuple{m+2, C} \arrow[r, "q"] \arrow[d, "\alpha"] & \tuple{m+2, C} \arrow[d, "\alpha"] \\ 449 | \tuple{n, m, f}^* \Sigma \tuple{m+2, C} \arrow[r, "q"] & \Sigma \tuple{m+2, C} 450 | \end{tikzcd} 451 | \end{center} 452 | If in this diagram the extended \({}^*, q\) notation is replaced, thus \(q(\tuple{n, m, f}, \tuple{m+2, C}) = q(q(\tuple{n, m, f}, \tuple{m+1, B}), \tuple{m+2, C})\) and \(\tuple{n, m, f}^* \tuple{m+2, C} = q(\tuple{n, m, f}, \tuple{m+1, B})^* \tuple{m+2, C}\). If \({}^*, q, \Sigma\) and \(\alpha\) are evaluated then the diagram required to commute is 453 | \begin{center} 454 | \begin{tikzcd} 455 | \tuple{n+2, \Sop(f,B)^* C} \arrow[r, "{\tuple{n+2{,} m+2{,} \Sop(\Sop(f{,}B){,} C)}}"] \arrow[d, "{\tuple{n+2{,} n+1{,} \gamma(\Sop(f{,}B)^* C)}}"] & \tuple{m+2, C} \arrow[d, "{\tuple{m+2{,} m+1{,} \gamma(C)}}"] \\ 456 | \tuple{n+1, \# \Sop(f,B)^* C} \arrow[r, "{\tuple{n+1{,} m+1{,} \Sop(f{,} \# C)}}"] & \tuple{m+1, \# C} 457 | \end{tikzcd} 458 | \end{center} 459 | The commutativity of this diagram follows from the commutativity of the corresponding diagram in \(\mathrm{Base}(\mathbb{E})\) which commutes by condition III of the definition of Attcat. 460 | 461 | \textbf{Step 5.} Singleton object. Recall that in \(\mathbb{E}\) we have \(L(1_{\mathbb{E}}) \in Att_{\mathbb{E}}(1_{\mathbb{E}})\) and an isomorphism \(\Theta(1_{\mathbb{E}}) : \Sigma L(1_{\mathbb{E}}) \to 1_{\mathbb{E}}\) in \(\mathrm{Base}(\mathbb{E})\). It follows that \(\Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}}) \in Att_{\mathbb{E}}(\Sigma L(1_{\mathbb{E}}))\) and thus that \(\tuple{0, L(1_{\mathbb{E}})} \triangleleft \tuple{1, \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})}\) in \(\Psi(\mathbb{E})\). Also since \(\Theta(1_{\mathbb{E}})\) is an isomorphism in \(\mathrm{Base}(\mathbb{E})\) it follows that \(\Sigma \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})\) is isomorphic to \(\Sigma L(1_{\mathbb{E}})\). Thus \(\Sigma \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}}) \cong \Sigma L(1_{\mathbb{E}}) \cong 1_{\mathbb{E}}\). Thus \(\Sigma \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})\) is a terminal object of \(\mathrm{Base}(\mathbb{E})\). 462 | 463 | It now follows that \(\tuple{1, \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})}\) is a terminal object of \(\Psi(\mathbb{E})\). We can define the singleton object \(\{ \cdot \}\) of \(\Psi(\mathbb{E})\) to be \(\tuple{1, \Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})}\). 464 | 465 | This completes the description of the contextual category with disjoint unions and singleton object induced by a category with attributes \(\mathbb{E}\). Because the morphisms of the categories \(\underline{\mathbf{Attcat}}\) and \(\underline{\Sigma\text{-}\mathbf{Con}}\) are in both cases just the structure preserving functions it follows that the above construction is just the object part of a functor \(\Psi : \underline{\mathbf{Attcat}} \to \underline{\Sigma\text{-}\mathbf{Con}}\). 466 | 467 | \begin{lemma} 468 | If \(\mathbb{D}\) is a contextual category with disjoint unions and singleton object then \(\Psi(\Phi(\mathbb{D})) \cong \mathbb{D}\). 469 | \end{lemma} 470 | 471 | \begin{proof} 472 | Let \(S = \{ B \in |\mathbb{D}| \mid \text{there is a } D \text{ such that } 1 \triangleleft D \triangleleft B \text{ in } \mathbb{D} \}\). Now define a function \(K : |\mathbb{D}| \to S\) and simultaneously define a morphism \(\beta(A) : K(A) \to A\) in \(\mathbb{D}\), for each object \(A\) of \(\mathbb{D}\). 473 | 474 | \(K(A)\) and \(\beta(A)\) are defined by induction on the height of \(A\) in \(\mathbb{D}\). 475 | Define \(K(1) = p(\{ \cdot \})^* \{ \cdot \}\) and define \(\beta(1) = p(K(1), 1)\). 476 | 477 | If \(1 \triangleleft A_1 \dots \triangleleft A_n \triangleleft A_{n+1}\) in \(\mathbb{D}\) for some \(n \ge 0\) and if \(K(A_n)\) and \(\beta(A_n)\) have already been defined then define \(K(A_{n+1}) = \alpha^{-1}(K(A_n))^* \beta(A_n)^* A_{n+1}\) and define \(\beta(A_{n+1}) = q(\alpha^{-1}(K(A_n)) \circ \beta(A_n), A_{n+1})\). 478 | Thus \(\Sigma K(A_n) \triangleleft K(A_{n+1})\) and \(\beta(A_{n+1}) : K(A_{n+1}) \to A_{n+1}\) in \(\mathbb{D}\). 479 | 480 | It is easy to prove by induction that for each \(n\), \(\beta(A_n)\) is an isomorphism (using lemma 6 of \S 3.1, \(\beta^{-1}(A_{n+1}) = q(\beta^{-1}(A_n) \circ \alpha(K(A_n)), K(A_{n+1}))\)). 481 | 482 | Now define a functor \(M : \mathbb{D} \to \mathrm{Base}(\mathbb{D})\) by 483 | \[ 484 | M(f : A \to A') = \alpha^{-1}(K A') \circ \beta(A')^{-1} \circ f \circ \beta(A) \circ \alpha(K A). 485 | \] 486 | 487 | Finally define a would be contextual functor \(\mathbb{F} : \mathbb{D} \to \Psi(\Phi(\mathbb{D}))\) as follows: 488 | 489 | If \(1 \triangleleft A_1 \dots \triangleleft A_n\) in \(\mathbb{D}\) then \(\mathbb{F}(A_n) = \tuple{n, K(A_n)}\). 490 | If \(1 \triangleleft A_1 \dots \triangleleft A_n\) and \(1 \triangleleft B_1 \dots \triangleleft B_m\) in \(\mathbb{D}\) and if \(f : A_n \to B_m\) in \(\mathbb{D}\) then \(\mathbb{F}(f) = \tuple{n, m, M(f)}\). 491 | 492 | The result follows when we show that \(\mathbb{F}\) is a contextual functor, preserves disjoint unions and singleton object and is 1-1 and onto from objects and morphisms of \(\mathbb{D}\) to objects and morphisms of \(\Psi(\Phi(\mathbb{D}))\). We content ourselves with checking the bit about disjoint unions. If anything the other stuff is a bit easier to check. 493 | 494 | We show that whenever \(1 \triangleleft Q_1 \dots \triangleleft Q_n \triangleleft A \triangleleft B \triangleleft C\) in \(\mathbb{D}\) then \(\mathbb{F}(\Sigma C) = \Sigma \mathbb{F}(C)\) and \(\mathbb{F}(\alpha(C)) = \alpha(\mathbb{F}(C))\). 495 | \(\mathbb{F}(C) = \tuple{n+2, K(C)}\) hence by definition of \(\Psi\), \(\Sigma \mathbb{F}(C) = \tuple{n+1, \# K(C)}\) where \(\# K(C)\) is calculated in \(\Phi(\mathbb{D})\). 496 | But by definition of \(\Phi(\mathbb{D})\), \(\# K(C)\) is calculated in \(\mathbb{D}\), as in \S 3.1, and is given by \(\# K(C) = \Sigma(\alpha(K(B))^* K(C))\). Thus to show that \(\mathbb{F}(\Sigma C) = \Sigma \mathbb{F}(C)\) we must show just \(\Sigma \alpha(K(B))^* K(C) = K(\Sigma C)\). This is as follows: 497 | 498 | \(\Sigma \alpha(K(B))^* K(C) = \Sigma \alpha(K(B))^* (\alpha^{-1}(K(B)) \circ \beta(B))^* C\) by def.\ of \(K\) 499 | \(= \Sigma \beta(B)^* C\) 500 | \(= \Sigma q(\alpha^{-1}(K(A)) \circ \beta(A), B)^* C\) by def.\ of \(\beta\) 501 | \(= \Sigma (\alpha^{-1}(K(A)) \circ \beta(A))^* C\) replacing extended \({}^*\) notation 502 | \(= (\alpha^{-1}(K(A)) \circ \beta(A))^* \Sigma C\) Since \(\alpha^{-1}(K(A)) : \Sigma K A \to A\) and \(A \triangleleft \Sigma C\). 503 | \(= K(\Sigma C)\) by def.\ of \(K\). 504 | 505 | It remains to show that \(\mathbb{F}(\alpha(C)) = \alpha(\mathbb{F}(C))\). Well \(\mathbb{F}(\alpha(C))\) is just \(\tuple{n+2, n+1, M(\alpha(C))}\) and \(\alpha(\mathbb{F}(C)) = \alpha(\tuple{n+2, K(C)}) = \tuple{n+2, n+1, \gamma(K(C))}\) where \(\gamma(K(C))\) is calculated in \(\mathbb{D}\) as 506 | \(\alpha^{-1}(K(C)) \circ \sigma(K(C)) \circ \alpha(\# K(C))\). Thus we must just show that in \(\mathbb{D}\), \(M(\alpha(C)) = \alpha^{-1}(K(C)) \circ \sigma(K(C)) \circ \alpha(\# K(C))\). 507 | 508 | Well we have \(\alpha^{-1}(K(C)) \circ \sigma(K(C)) \circ \alpha(\# K(C)) = \alpha^{-1}(K(C)) \circ q(\alpha^{-1}(K(B)), \alpha(K(B))^* K(C)) \circ \alpha(\alpha(K(B))^* K(C)) \circ \alpha(\# K(C))\), (by definition of \(\sigma\)), \(= \alpha^{-1}(K(C)) \circ q(\alpha^{-1}(K(B)), \beta(B)^* C) \circ \alpha(\beta(B)^* C) \circ \alpha(K(\Sigma C))\), since as above \(\alpha(K(B))^* K(C) = \beta(B)^* C\) and \(\# K(C) = K(\Sigma C)\). 509 | 510 | And \(M(\alpha(C)) = \alpha^{-1}(K(\Sigma C)) \circ \beta(\Sigma C)^{-1} \circ \alpha(C) \circ \beta(C)^{-1} \circ (\Sigma C) \circ \alpha(K(\Sigma C))\) so we must check that \(\beta(C) \circ \alpha(C) \circ \beta^{-1}(\Sigma C) = q(\alpha^{-1}(K(B)), \beta(B)^* C) \circ \alpha(\beta(B)^* C)\). This is as follows: 511 | 512 | \(\beta(C) \circ \alpha(C) \circ \beta^{-1}(\Sigma C) = \beta(C) \circ \alpha(C) \circ q(\beta^{-1}(A) \circ \alpha(K(A)), (\alpha^{-1}(K(A)) \circ \beta(A))^* \Sigma C)\), by definition of \(\beta^{-1}\), \(= \beta(C) \circ \alpha((\beta^{-1}(A) \circ \alpha(K(A)))^* C) \circ q(\beta^{-1}(A) \circ \alpha(K(A)), (\alpha^{-1}(K(A)) \circ \beta(A))^* C) \circ \alpha((\alpha^{-1}(K(A)) \circ \beta(A))^* C)\), by lemma 4 of \S 3.1, \(= \beta(C) \circ q(\beta^{-1}(A) \circ \alpha(K(A)), \beta(B)^* C) \circ \alpha(q(\alpha^{-1}(K(A)) \circ \beta(A), B)^* C) = \beta(C) \circ q(q(\beta^{-1}(A) \circ \alpha(K(A)), K(B)), \beta(B)^* C) = \beta(C) \circ q(\beta^{-1}(B) \circ \alpha(K(B)), \beta(B)^* C) \circ \alpha(\beta(B)^* C) = q(\alpha^{-1}(K(B)) \circ \beta(B), C) \circ q(\beta^{-1}(B) \circ \alpha(K(B)), \beta(B)^* C) \circ \alpha(\beta(B)^* C) = q(\alpha^{-1}(K(B)), \beta(B)^* C) \circ \alpha(\beta(B)^* C)\) as required. 513 | \end{proof} 514 | 515 | \begin{lemma} 516 | If \(\mathbb{G} : \mathbb{D} \to \mathbb{D}'\) is a morphism in \(\underline{\Sigma\text{-}\mathbf{Con}}\) then the diagram 517 | \begin{center} 518 | \begin{tikzcd} 519 | \mathbb{D} \arrow[r, "\mathbb{F}_{\mathbb{D}}"] \arrow[d, "\mathbb{G}"] & \Psi(\Phi(\mathbb{D})) \arrow[d, "\Psi(\Phi(\mathbb{G}))"] \\ 520 | \mathbb{D}' \arrow[r, "\mathbb{F}_{\mathbb{D}'}"] & \Psi(\Phi(\mathbb{D}')) 521 | \end{tikzcd} 522 | \end{center} 523 | commutes in \(\underline{\Sigma\text{-}\mathbf{Con}}\). 524 | \end{lemma} 525 | 526 | \begin{proof} 527 | Reduces to showing that if \(A \in |\mathbb{D}|\) then \(\mathbb{G}(K(A)) = K(\mathbb{G}(A))\) and that if \(f: A \to A'\) in \(\mathbb{D}\) then \(M(\mathbb{G}(f)) = M(\mathbb{G}(f))\). But \(\mathbb{G}\) preserves the structure that \(K\) and \(M\) are defined in terms of. 528 | \end{proof} 529 | 530 | This completes the demonstration that \(\Phi \circ \Psi \cong id_{\underline{\Sigma\text{-}\mathbf{Con}}}\). 531 | 532 | For the remainder of this section we aim at proving that \(\Psi \circ \Phi \cong id_{\underline{\mathbf{Attcat}}}\) and thus that \(\underline{\Sigma\text{-}\mathbf{Con}}\) and \(\underline{\mathbf{Attcat}}\) are equivalent categories. Throughout we suppose that \(\mathbb{E}\) is a category with attributes. Eventually we show that \(\Phi(\Psi(\mathbb{E})) \cong \mathbb{E}\). 533 | 534 | If \(A \in |\mathrm{Base}(\mathbb{E})|\) then \(\Theta(1_{\mathbb{E}})^* L(A) \in \mathrm{Att}_{\mathbb{E}}(\Sigma L(1_{\mathbb{E}}))\) and \(\Sop(\Theta(1_{\mathbb{E}}), L(A)) \circ \Theta(A) : \Sigma \Theta(1_{\mathbb{E}})^* L(A) \to A\) is an isomorphism. We define \(J(A) = \Theta(1_{\mathbb{E}})^* L(A)\) and \(\Pi(A) = \Sop(\Theta(1_{\mathbb{E}}), L(A)) \circ \Theta(A)\) then for each \(A \in |\mathrm{Base}(\mathbb{E})|\), \(J(A) \in \mathrm{Att}_{\mathbb{E}}(\Sigma L(1_{\mathbb{E}}))\) and \(\Pi(A) : \Sigma J(A) \to A\) is an isomorphism in \(\mathrm{Base}(\mathbb{E})\). We can then define a functor \(M : \mathrm{Base}(\mathbb{E}) \to \mathrm{Base}(\mathbb{E})\) by 535 | \begin{center} 536 | \begin{tikzcd} 537 | A \arrow[d] \arrow[r, "M"] & \Sigma J A \arrow[d] \\ 538 | A' & \Sigma J A' 539 | \end{tikzcd} 540 | \end{center} 541 | \(M(A) \xrightarrow{f} M(A') = \Pi(A)^{-1} \circ f \circ \Pi(A')\). 542 | 543 | We shall eventually define an isomorphism \(\mathcal{J} : \mathbb{E} \to \Phi(\Psi(\mathbb{E}))\) in terms of \(M\) and \(\Pi\) but we will come back to that later. Lemmas 3--8 just function to show that \(\mathcal{J}\) once defined, is a morphism. 544 | 545 | \begin{lemma} 546 | If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) and if \(B \in \mathrm{Att}_{\mathbb{E}}(A)\) then 547 | \(\#(\Sop(\Theta(1_{\mathbb{E}}), L(A))^* \Theta(A)^* B) = \Theta(1_{\mathbb{E}})^* \#(\Theta(A)^* B)\) and 548 | \(\gamma(\Pi(A)^* B) \circ \Pi(\Sigma B) = \Sop(\Sop(\Theta(1_{\mathbb{E}}), L(A)), \Theta(A)^* B) \circ \gamma(\Theta(A)^* B)\) in \(\mathrm{Base}(\mathbb{E})\). 549 | \end{lemma} 550 | 551 | \begin{proof} 552 | This is just condition III of the definition of Attcat where \(A \to A'\), \(B\) and \(C\) are taken to be \(\Sigma L(1_{\mathbb{E}}) \to 1_{\mathbb{E}}\), \(L(A)\) and \(\Theta(A)^* B\). 553 | \end{proof} 554 | 555 | \begin{lemma} 556 | If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) and if \(B \in \mathrm{Att}_{\mathbb{E}}(A)\) then 557 | \(\gamma(\Pi(A)^* B) \circ \Pi(\Sigma B) = \Sop(\Pi(A), B)\). 558 | \end{lemma} 559 | 560 | \begin{proof} 561 | \(\gamma(\Pi(A)^* B) \circ \Pi(\Sigma B) = \gamma(\Pi(A)^* B) \circ \Sop(\Theta(1_{\mathbb{E}}), L \Sigma B) \circ \Theta(\Sigma B)\) by def of \(\Pi\) 562 | \(= \Sop(\Sop(\Theta(1_{\mathbb{E}}), L(A)), \Theta(A)^* B) \circ \gamma(\Theta(A)^* B) \circ \Theta(\Sigma B)\) by lemma 3. 563 | \(= \Sop(\Sop(\Theta(1_{\mathbb{E}}), L(A)), \Theta(A)^* B) \circ \Sop(\Theta(A), B)\) by condition IV of def of Attcat. 564 | \(= \Sop(\Sop(\Theta(1_{\mathbb{E}}), L(A)) \circ \Theta(A), B)\) 565 | \(= \Sop(\Pi(A), B)\) by def of \(\Pi\). 566 | \end{proof} 567 | 568 | \begin{lemma} 569 | If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) and if \(B \in \mathrm{Att}_{\mathbb{E}}(A)\) then 570 | \(J(\Sigma B) = \#(\Pi(A)^* B)\) 571 | and \(\Pi(\Sigma B) \circ p(B) \circ \Pi^{-1}(A) = \gamma^{-1}(\Pi(A)^* B) \circ p(\Pi(A)^* B)\). 572 | \end{lemma} 573 | 574 | \begin{proof} 575 | \(J(\Sigma B) = \Theta(1_{\mathbb{E}})^* L(\Sigma B)\) by def of \(J\) 576 | \(= \Theta(1_{\mathbb{E}})^* \# \Theta(A)^* B\) by condition IV 577 | \(= \# (\Sop(\Theta(1_{\mathbb{E}}), L(A))^* \Theta(A)^* B)\) by lemma 3 578 | \(= \# (\Pi(A)^* B)\) by definition. 579 | 580 | Which is the first identity. As for the second: 581 | \(\Pi(\Sigma B) \circ p(B) \circ \Pi^{-1}(A) = \gamma^{-1}(\Pi(A)^* B) \circ \Sop(\Pi(A), B) \circ p(B) \circ \Pi^{-1}(A)\) by lemma 4. 582 | \(= \gamma^{-1}(\Pi(A)^* B) \circ p(\Pi(A)^* B) \circ \Pi(A) \circ \Pi^{-1}(A)\) because of commutativity of the pullback diagram for \(\Sop\) along \(\Pi(A)\). 583 | \(= \gamma^{-1}(\Pi(A)^* B) \circ p(\Pi(A)^* B)\) as required. 584 | \end{proof} 585 | 586 | \begin{lemma} 587 | If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{E})\) and \(B \in \mathrm{Att}_{\mathbb{E}}(A')\) then 588 | \(\Pi(\Sigma f^* B) \circ \Sop(f,B) \circ \Pi^{-1}(\Sigma B) = \gamma^{-1}(\Pi(A)^* f^* B) \circ \Sop(\Pi(A) \circ f \circ \Pi^{-1}(A'), \Pi(A')^* B) \circ \gamma(\Pi(A')^* B)\). 589 | \end{lemma} 590 | 591 | \begin{lemma} 592 | If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) and if \(B \in \mathrm{Att}_{\mathbb{E}}(A)\) and \(C \in \mathrm{Att}_{\mathbb{E}}(\Sigma B)\) then \(\Pi(A)^* \# C = \# \gamma(\Pi(A)^* B)^* \Pi(\Sigma B)^* C\). 593 | \end{lemma} 594 | 595 | \begin{lemma} 596 | If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) then 597 | \(\Pi(\Sigma L A) \circ \Theta(A) \circ \Pi^{-1}(A) = \gamma^{-1}(p(\Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}}))^* L(A)) \circ \Sop(p(\Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})), \Theta(1_{\mathbb{E}})^* L(A))\). 598 | \end{lemma} 599 | 600 | \begin{lemma} 601 | If \(\mathbb{E}\) is a category with attributes then 602 | \begin{enumerate}[label=\roman*.] 603 | \item If \(\tuple{1, 1, f} : \tuple{1, A} \to \tuple{1, A'}\) and \(\tuple{1, A'} \triangleleft \tuple{2, B}\) in \(\Psi(\mathbb{E})\) then \(\Sop(\tuple{1, 1, f}, \tuple{2, B}) = \tuple{1, 1, \gamma^{-1}(f^* B) \circ \Sop(f, B) \circ \gamma(B)}\). 604 | \item If \(1 \triangleleft \tuple{1, A} \triangleleft \tuple{2, B}\) and \(\Sigma \tuple{2, B} \triangleleft \tuple{2, C}\) in \(\Psi(\mathbb{E})\) then \(\# \tuple{2, C} = \tuple{2, \# \gamma(B)^* C}\). 605 | \item If \(1 \triangleleft \tuple{1, A}\) in \(\Psi(\mathbb{E})\) then \(L(\tuple{1, A}) = \tuple{2, p(\Theta^{-1}(1_{\mathbb{E}})^* L(1_{\mathbb{E}}))^* A}\). 606 | \end{enumerate} 607 | \end{lemma} 608 | 609 | Given the definition of \(\Phi\) we can now give a complete description of \(\Phi(\Psi(\mathbb{E}))\): 610 | 611 | \(|\mathrm{Base}(\Phi(\Psi(\mathbb{E})))| = \{ \tuple{1, A} \mid A \in \mathrm{Att}_{\mathbb{E}}(\Sigma L(1_{\mathbb{E}})) \}\) 612 | 613 | \(\mathrm{Hom}_{\Phi(\Psi(\mathbb{E}))}(\tuple{1, A}, \tuple{1, A'}) = \{ \tuple{1, 1, f} \mid f: \Sigma A \to \Sigma A' \text{ in Base}(\mathbb{E}) \}\) 614 | 615 | \(\mathrm{Att}_{\Phi(\Psi(\mathbb{E}))}(\tuple{1, A}) = \{ \tuple{2, B} \mid B \in \mathrm{Att}_{\mathbb{E}}(\Sigma A) \}\) 616 | 617 | Define \(\mathcal{J} : \mathbb{E} \to \Phi(\Psi(\mathbb{E}))\) by: 618 | \begin{enumerate}[label=\roman*.] 619 | \item If \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\) then \(\mathcal{J}(A) = \tuple{1, \Theta(1_{\mathbb{E}})^* L(A)}\). 620 | \item If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{E})\) then \(\mathcal{J}(f) = \tuple{1, 1, \Pi(A) \circ f \circ \Pi^{-1}(A')}\). 621 | \item If \(B \in \mathrm{Att}_{\mathbb{E}}(A)\) then \(\mathcal{J}(B) = \tuple{2, \Pi(A)^* B}\). 622 | \end{enumerate} 623 | 624 | \(\mathcal{J}\) is easily seen to be 1-1 and onto from objects, morphisms and attributes of \(\mathbb{E}\) to objects, morphisms, respectively attributes of \(\Phi(\Psi(\mathbb{E}))\). \(\mathcal{J}\) preserves \(\Sigma\) and \(p\) by virtue of lemma 5. \({}^*\) is easily seen to be preserved. \(\Sop\) is preserved by \(\mathcal{J}\), use lemma 6. \(\#\) and \(\gamma\) are preserved, use lemma 7. 625 | Terminal object easily seen to be preserved. \(L\) preserved because \(1_{\mathbb{E}}\) terminal implies \((\Theta(1_{\mathbb{E}})^* L(1_{\mathbb{E}})) \circ \Theta(1_{\mathbb{E}}) = \Pi(1_{\mathbb{E}})\). \(\Theta\) preserved use lemma 8. 626 | 627 | Finally, the collection of isomorphisms \(\{ \mathcal{J}_{\mathbb{E}} \mid \mathbb{E} \in |\underline{\mathbf{Attcat}}| \}\) cannot help but be natural in \(\mathbb{E}\). Thus we have a natural isomorphism \(\Phi \circ \Psi \cong id_{\underline{\mathbf{Attcat}}}\), completing the proof that \(\underline{\Sigma\text{-}\mathbf{Con}} \cong \underline{\mathbf{Attcat}}\). 628 | 629 | % source p3.32 630 | \section{Categories and fibrations} \label{sec:source-3-3} 631 | 632 | In \S 1.5 we alluded to the contextual category of categories, category indexed families of categories, category indexed families of category indexed families of categories and so on. In fact this contextual category has disjoint unions and singleton object. 633 | 634 | By far the easiest way of describing the structure is by describing the corresponding category with attributes which is to be called \(\underline{\mathbf{Fib}}\). The significance of this structure is twofold. In the first place the most attractive notion of a category indexed family of categories does lead to a contextual category and thus generalised algebraic theories can be interpreted in this manner. 635 | 636 | Furthermore this notion is not reducible to any morphism with codomain notion and so there is no parallel interpretation of essentially algebraic theories. 637 | 638 | This was discussed in \S 1.5. On the other hand disjoint unions in this structure are calculated by taking fibrations. Thus we have a new way of looking at the fibration construction. This compares with the interpretation of Gray [7]. 639 | 640 | The category with attributes \(\underline{\mathbf{Fib}}\) of categories indexing categories is described as follows: 641 | 642 | \begin{enumerate} 643 | \item \(\mathrm{Base}(\underline{\mathbf{Fib}}) = \underline{\mathbf{Cat}}\), the category of all (small) categories. 644 | \item If \(A\) is a category then an attribute of type \(A\) is an \(A\)-indexed family of categories, i.e.\ is a functor \(B : A \to \underline{\mathbf{Cat}}\). 645 | \item If \(B \in Att_{\underline{\mathbf{Fib}}}(A)\), i.e.\ if \(B : A \to \underline{\mathbf{Cat}}\) is a functor, then \(\Sigma B\) is the category defined as follows: 646 | \[ |\Sigma B| = \{ \tuple{a,b} \mid a \in |A| \text{ and } b \in |B(a)| \}. \] 647 | \[ \Hom_{\Sigma B}(\tuple{a,b}, \tuple{a',b'}) = \{ \tuple{f,g} \mid f : a \to a' \text{ in } A \text{ and } g : B(f)(b) \to b' \text{ in } B(a') \}. \] 648 | If \(\tuple{a,b} \in |\Sigma B|\) then \(id_{\tuple{a,b}} = \tuple{id_a, id_b}\). 649 | If \(\tuple{a,b} \xrightarrow{\tuple{f,g}} \tuple{a',b'} \xrightarrow{\tuple{f',g'}} \tuple{a'',b''}\) in \(\Sigma B\) then \(\tuple{f,g} \circ \tuple{f',g'} = \tuple{f \circ f', B(f')(g) \circ g'}\). 650 | 651 | \(p(B) : \Sigma B \to A\) is defined to be the 1st projection functor. 652 | 653 | \item If \(F : A \to A'\) in \(\underline{\mathbf{Cat}}\) and if \(B \in Att_{\underline{\mathbf{Fib}}}(A')\) then \(F^*B \in Att_{\underline{\mathbf{Fib}}}(A)\) is defined to be the functor \(B \circ F : A \to \underline{\mathbf{Cat}}\). \(\Sop(F,B) : \Sigma F^*B \to \Sigma B\) is defined to be the functor ``Apply \(F\) to the 1st component leave other component unchanged''. For example, if \(\tuple{a,b} \in |\Sigma F^*B|\) then \(a \in |A|\) and \(b \in |B(F(a))|\), hence \(\tuple{F(a), b} \in |\Sigma B|\). Similarly on morphisms of \(\Sigma F^*B\). 654 | 655 | \item If \(B : A \to \underline{\mathbf{Cat}}\) and \(C : \Sigma B \to \underline{\mathbf{Cat}}\) then define \(\# C : A \to \underline{\mathbf{Cat}}\) as follows: 656 | If \(a \in |A|\) then \(\# C(a)\) is the category such that 657 | \[ |\# C(a)| = \{ \tuple{b,c} \mid b \in |B(a)| \text{ and } c \in |C(\tuple{a,b})| \} \] 658 | \[ \Hom_{\# C(a)}(\tuple{b,c}, \tuple{b',c'}) = \{ \tuple{g,h} \mid g : b \to b' \text{ in } B(a) \text{ and } h : C(\tuple{a,g})(c) \to c' \text{ in } C(\tuple{a,b'}) \}. \] 659 | 660 | If \(f : a \to a'\) in \(A\) then \(\# C(f)\) is the functor \(\# C(a) \to \# C(a')\) given by 661 | \begin{center} 662 | \begin{tikzcd} 663 | \tuple{b,c} \arrow[d, "{\tuple{g{,}h}}"'] \arrow[r, "\# C(f)"] & \tuple{B(f)(b), C(\tuple{f, id_{B(f)(b)}})(c)} \arrow[d, "{\tuple{B(f)(g){,} C(\tuple{f{,} id_{B(f)(b')}})(h)}}"] \\ 664 | \tuple{b',c'} \arrow[r] & \tuple{B(f)(b'), C(\tuple{f, id_{B(f)(b')}})(c')} 665 | \end{tikzcd} 666 | \end{center} 667 | 668 | Check that \(\Sigma C\) and \(\Sigma \# C\) are isomorphic. In fact the isomorphism \(\gamma(C) : \Sigma C \to \Sigma \# C\) is given by 669 | \[ \tuple{\tuple{a,b}, c} \mapsto \tuple{a, \tuple{b,c}} \] 670 | \[ \tuple{\tuple{f,g}, h} \mapsto \tuple{f, \tuple{g,h}} \] 671 | 672 | \item Choose \(1_{\underline{\mathbf{Fib}}}\) to be any terminal object of \(\underline{\mathbf{Cat}}\). If \(A\) is a category then \(L(A) \in Att_{\underline{\mathbf{Fib}}}(1)\) is taken to be the functor : \(1 \to \underline{\mathbf{Cat}}\) whose value at the unique object of \(1\) is \(A\). Then \(\Sigma L(A) = 1 \times A\). 673 | Define \(\Theta(A) : 1 \times A \to A\) to be the projection functor. 674 | \end{enumerate} 675 | 676 | That completes the description of \(\underline{\mathbf{Fib}}\). Checking that \(\underline{\mathbf{Fib}}\) is a category with attributes is very straightforward and rather tedious. 677 | 678 | % source p3.35 679 | \section{Martin-L\"of type theory} \label{sec:source-3-4} 680 | 681 | Martin-L\"of type theory is a generalisation of the typed \(\lambda\)-calculus. It is more general in that in the syntax there are variable types---the structure of substitution is of the general form. The algebraic semantics of Martin-L\"of type theory is thus provided by a extension of the theory of contextual categories. This extension we call the theory of weak M-L structures. Every weak M-L structure is a model of Martin-L\"of type theory. In fact the definition of weak M-L structure is a set theoretic definition of the notion `model of Martin-L\"of type theory'. It is the most general possible such definition. 682 | 683 | We need to explain that Martin-L\"of type theory generalises a weak version of the typed \(\lambda\)-calculus. The \(\eta\)-rule of \(\lambda\)-calculus, \(s = \lambda x . Ap(x,s)\), corresponding to the uniqueness of the term \(\lambda x.t\) subject to the condition \(Ap(x, \lambda x.t) = t\), is not assumed. Neither is the rule \(pr(p_1(z), p_2(z)) = z\) assumed where \(pr\) is the pairing function and \(p_1\) and \(p_2\) are the projections. On the other hand cartesian closed categories correspond to a strong version of the typed \(\lambda\)-calculus which includes these two rules. The effect of all this is that whereas cartesian closedness is definable in terms of universal arrows, weak M-L structure is defined in terms of weak universal arrows (the definition of weak universal arrow is like the definition of universal arrow except that the uniqueness condition is dropped). If we strengthen the definition of weak M-L structure by replacing weak universality by universality, then we can drop the adjective weak and call the structures strong M-L structures. The strong M-L structures provide us with the algebraic semantics of a strengthened version of M-L type theory, stronger just by the inclusion of a rule expressing the uniqueness of \(\lambda x.t\) subject to the condition \(Ap(x, \lambda x.t) = t\) and similar uniqueness conditions, one for each logical scheme. 684 | 685 | In the following definition of strong M-L structure we use the same notation as Martin-L\"of uses except in the case of notation for the type with precisely one element---Martin-L\"of uses the notation \(N_1\) for this type but we use the notation \(\{ \cdot \}\). Our use of \(\Sigma\) and \(\{ \cdot \}\) notation in this section will be consistent with our use of the same notation for disjoint unions and singleton object in previous sections. 686 | 687 | A \underline{strong M-L structure} \(\tuple{\mathbb{C}, \Sigma, pr, \Pi, Ap, Id, r, +, i, j, \{ \cdot \}, e, N, o, S}\) consists of a contextual category \(\mathbb{C}\) and the following additional structure: 688 | 689 | \begin{enumerate} 690 | \item[i.] Whenever \(Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\), an object \(\Sigma B\) of \(\mathbb{C}\) and a morphism \(pr(B)\) of \(\mathbb{C}\) such that \(Q \triangleleft \Sigma B\) in \(\mathbb{C}\) and \(pr(B) : B \to \Sigma B\) such that the diagram 691 | \begin{center} 692 | \begin{tikzcd} 693 | & B \arrow[d, "pr(B)"] \arrow[dl] \\ 694 | A \arrow[r] & \Sigma B \arrow[d] \\ 695 | & Q 696 | \end{tikzcd} 697 | \end{center} 698 | commutes and such that \(\Sigma B\) and \(pr(B)\) have the following property: for every object \(C\) of \(\mathbb{C}\) such that \(\Sigma B \le C\), for every morphism \(h : B \to C\) such that the diagram 699 | \begin{center} 700 | \begin{tikzcd} 701 | B \arrow[r, "h"] \arrow[d, "pr(B)"'] & C \arrow[d] \\ 702 | \Sigma B \arrow[r] & \Sigma B 703 | \end{tikzcd} 704 | \end{center} 705 | commutes, there exists a unique morphism \(g \in Arr_{\mathbb{C}}(C)\) such that the diagram 706 | \begin{center} 707 | \begin{tikzcd} 708 | B \arrow[r, "h"] \arrow[d, "pr(B)"'] & C \\ 709 | \Sigma B \arrow[ur, "g"'] & 710 | \end{tikzcd} 711 | \end{center} 712 | commutes. 713 | 714 | \item[ii.] Whenever \(Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\), an object \(\Pi B\) of \(\mathbb{C}\) such that \(Q \triangleleft \Pi B\) in \(\mathbb{C}\) and a morphism \(Ap(B) : p(A)^* \Pi B \to B\) in \(\mathbb{C}\) such that the diagram 715 | \begin{center} 716 | \begin{tikzcd} 717 | p(A)^* \Pi B \arrow[r, "Ap(B)"] \arrow[d] & B \arrow[d] \\ 718 | p(A)^* A & A 719 | \end{tikzcd} 720 | \end{center} 721 | commutes and such that \(\Pi B\) and \(Ap(B)\) have the following property: for every morphism \(h \in Arr_{\mathbb{C}}(B)\), there exists a unique morphism \(f \in Arr_{\mathbb{C}}(\Pi B)\) such that the diagram 722 | \begin{center} 723 | \begin{tikzcd} 724 | p(A)^* \Pi B \arrow[r, "Ap(B)"] & B \\ 725 | p(A)^* f \arrow[u] & A \arrow[u, "h"'] 726 | \end{tikzcd} 727 | \end{center} 728 | commutes. In future the unique morphism corresponding to \(h: A \to B\) will be denoted \(\lambda h\). Thus \(\lambda h \in Arr_{\mathbb{C}}(\Pi B)\) when \(h: A \to B\). 729 | 730 | \item[iii.] Whenever \(Q \triangleleft A\) in \(\mathbb{C}\), an object \(Id(A)\) of \(\mathbb{C}\) such that \(p(A)^* A \triangleleft Id(A)\) and a morphism \(r(A) : A \to Id(A)\) in \(\mathbb{C}\) such that the diagram 731 | \begin{center} 732 | \begin{tikzcd} 733 | & Id(A) \arrow[d] \\ 734 | A \arrow[ur, "r(A)"] & p(A)^* A \\ 735 | A \arrow[u, equal] \arrow[ur, "\delta(A)"'] & 736 | \end{tikzcd} 737 | \end{center} 738 | commutes and having the property as stated in the full definition. 739 | 740 | \item[iv.] Whenever \(Q \triangleleft A\) and \(Q \triangleleft B\) in \(\mathbb{C}\), an object \(A+B\) of \(\mathbb{C}\) such that \(Q \triangleleft A+B\) and morphisms \(i_{A,B} : A \to A+B\) and \(j_{A,B} : B \to A+B\) with the coproduct property. 741 | 742 | \item[v.] An object \(\{ \cdot \}\) of \(\mathbb{C}\) such that \(1 \triangleleft \{ \cdot \}\) and a morphism \(e : 1 \to \{ \cdot \}\) in \(\mathbb{C}\) with the singleton property. 743 | 744 | \item[vi.] An object \(N\) of \(\mathbb{C}\) such that \(1 \triangleleft N\) and morphisms \(o: 1 \to N\) and \(S: N \to N\) in \(\mathbb{C}\) with the natural number object property. 745 | \end{enumerate} 746 | 747 | Subject to the following conditions: If \(f: Q \to Q'\) in \(\mathbb{C}\), where \(1 \triangleleft Q\) and \(1 \triangleleft Q'\) in \(\mathbb{C}\), then 748 | \begin{itemize} 749 | \item if \(Q' \triangleleft A \triangleleft B\) then \(f^* \Sigma B = \Sigma f^* B\) and \(f^* pr(B) = pr(f^* B)\), 750 | \item if \(Q' \triangleleft A \triangleleft B\) then \(f^* \Pi B = \Pi f^* B\) and \(f^* Ap(B) = Ap(f^* B)\), 751 | \item if \(Q' \triangleleft A\) then \(f^* Id(A) = Id(f^* A)\) and \(f^* r(A) = r(f^* A)\), 752 | \item if \(Q' \triangleleft A\) and \(Q' \triangleleft B\) then \(f^*(A+B) = f^*A + f^*B\), \(f^* i_{A,B} = i_{f^*A, f^*B}\) and \(f^* j_{A,B} = j_{f^*A, f^*B}\). 753 | \end{itemize} 754 | 755 | Clauses i.\ \ldots\ vi.\ in the definition of strong M-L structure correspond to the schemes for \(\Sigma, \Pi, Id, +, N_1\) and \(N\) in Martin-L\"of type theory. If the word unique is dropped from any of these clauses then what remains is an exact rewriting of the corresponding Martin-L\"of scheme within the language of contextual categories. 756 | 757 | The final condition says that \(f^*\) always preserves \(\Sigma, pr, Ap\) etc. Thus it says that the contextual functor \(\mathbb{C}_f : \mathbb{C}_{Q'} \to \mathbb{C}_Q\) is a structure preserving morphism whenever \(f: Q \to Q'\) in \(\mathbb{C}\). It is, then, the `substitution is a homomorphism between algebras of terms' condition. This is an implicit property of syntactical substitution which must always be stated explicitly in any algebraic semantics. 758 | 759 | Not surprisingly the contextual category \(\underline{\mathbf{Fam}}\) of sets, families of sets and so on is in a natural way a strong M-L structure. \(\Sigma\) is calculated by taking actual disjoint unions of families of sets, \(\Pi\) calculated by taking cartesian products of families of sets. \(Id(A)\), when \(A\) is a set, is the characteristic family of the identity predicate on \(A\). \(+\) is interpreted by coproducts and \(N\) is taken to be the set of natural numbers. 760 | 761 | The definition of strong M-L structure can be simplified considerably. In the first place those parts of the definition that are about \(\Sigma, pr, \{ \cdot \}\) and \(e\) are equivalent to \(\tuple{\mathbb{C}, \Sigma, pr, \{ \cdot \}, e}\) being a contextual category with disjoint unions and singleton object. This leads to simplifications of the other clauses. Clause ii.\ can be used to simplify clause vi. It turns out, then, that the definition that we have given is equivalent to the following definition. 762 | 763 | A \textbf{strong M-L structure} \(\tuple{\mathbb{C}, \Sigma, pr, \Pi, Ap, Id, r, +, i, j, \{ \cdot \}, e, N, o, S}\) consists of a contextual category with disjoint unions and singleton object \(\tuple{\mathbb{C}, \Sigma, pr, \{ \cdot \}, e}\) and the following additional structure. 764 | 765 | \begin{enumerate} 766 | \item[ii'.] For all \(1 \triangleleft Q \triangleleft A \triangleleft B\) in \(\mathbb{C}\), an object \(\Pi B\) of \(\mathbb{C}\) such that \(Q \triangleleft \Pi B\) and a morphism \(Ap(B) : p(A)^* \Pi B \to B\) such that the diagram 767 | \begin{center} 768 | \begin{tikzcd} 769 | p(A)^* \Pi B \arrow[r, "Ap(B)"] \arrow[d] & B \arrow[d] \\ 770 | p(A)^* A & A 771 | \end{tikzcd} 772 | \end{center} 773 | commutes and having the property: for all \(h \in \mathrm{Arr}_{\mathbb{C}}(B)\), there exists a unique \(g \in \mathrm{Arr}_{\mathbb{C}}(\Pi B)\) such that the diagram 774 | \begin{center} 775 | \begin{tikzcd} 776 | p(A)^* \Pi B \arrow[r, "Ap(B)"] & B \\ 777 | p(A)^* g \arrow[u] & A \arrow[u, "h"'] 778 | \end{tikzcd} 779 | \end{center} 780 | commutes. 781 | 782 | \item[iii'.] For all \(1 \triangleleft Q \triangleleft A\) in \(\mathbb{C}\), an object \(Id(A)\) of \(\mathbb{C}\) such that \(p(A)^* A \triangleleft Id(A)\) and a morphism \(r(A) : A \to Id(A)\) in \(\mathbb{C}\) such that the diagram 783 | \begin{center} 784 | \begin{tikzcd} 785 | & Id(A) \arrow[d] \\ 786 | r(A) \arrow[ur] & p(A)^* A \\ 787 | A \arrow[ur, "\delta(A)"'] & 788 | \end{tikzcd} 789 | \end{center} 790 | commutes and having the property: for every object \(C\) of \(\mathbb{C}\) such that \(p(A)^* A \triangleleft C\), for every morphism \(h: A \to C\) such that the diagram 791 | \begin{center} 792 | \begin{tikzcd} 793 | & C \arrow[d] \\ 794 | h \arrow[ur] & Id(A) \\ 795 | A \arrow[ur, "r(A)"'] & 796 | \end{tikzcd} 797 | \end{center} 798 | commutes, there exists a unique \(g: Id(A) \to C\) such that 799 | \begin{center} 800 | \begin{tikzcd} 801 | Id(A) \arrow[r, "g"] \arrow[d] & C \arrow[d] \\ 802 | p(A)^* A & p(A)^* A 803 | \end{tikzcd} 804 | \end{center} 805 | and 806 | \begin{center} 807 | \begin{tikzcd} 808 | & C \\ 809 | h \arrow[ur] & g \arrow[u] \\ 810 | A \arrow[ur, "r(A)"'] & Id(A) \arrow[u] 811 | \end{tikzcd} 812 | \end{center} 813 | commute. 814 | 815 | \item[iv'.] For all \(1 \triangleleft Q \triangleleft A\) and \(1 \triangleleft Q \triangleleft B\) in \(\mathbb{C}\), an object \(A+B\) of \(\mathbb{C}\) such that \(Q \triangleleft A+B\) and morphisms \(i_{A,B}\) and \(j_{A,B}\) such that the diagram 816 | \(A \xrightarrow{i_{A,B}} A+B \xleftarrow{j_{A,B}} B\) is a coproduct diagram in \(\mathrm{Base}(\mathbb{C}_Q)\). 817 | 818 | \item[vi'.] An object \(N\) of \(\mathbb{C}\) such that \(1 \triangleleft N\) and morphisms \(o: 1 \to N\), \(S: N \to N\) such that \(\tuple{N, o, S}\) is a natural number object in \(\mathrm{AugBase}(\mathbb{C})\). (\(\tuple{N, o, S}\) is a natural number object in the category \(\mathcal{G}\) with terminal object \(1\) iff \(o: 1 \to N\) and \(S: N \to N\) and for all objects \(A\) of \(\mathcal{G}\), for all morphisms \(a: 1 \to A\) and \(b: N \to N\), there exists a unique morphism \(f: N \to A\) such that 819 | \begin{center} 820 | \begin{tikzcd} 821 | N \arrow[r, "f"] & A \\ 822 | o \arrow[u] & a \arrow[u] \\ 823 | 1 \arrow[u] & 1 \arrow[u] 824 | \end{tikzcd} 825 | \quad 826 | \begin{tikzcd} 827 | A \arrow[r, "b"] & A \\ 828 | N \arrow[u, "f"] \arrow[r, "S"] & N \arrow[u, "f"'] 829 | \end{tikzcd} 830 | \end{center} 831 | commute.) 832 | \end{enumerate} 833 | 834 | Subject to the condition: If \(f: Q \to Q'\) in \(\mathbb{C}\), where \(1 \triangleleft Q\) and \(1 \triangleleft Q'\) in \(\mathbb{C}\), then 835 | \begin{itemize} 836 | \item if \(Q' \triangleleft A \triangleleft B\) then \(f^* \Pi B = \Pi f^* B\) and \(f^* Ap(B) = Ap(f^* B)\), 837 | \item if \(Q' \triangleleft A\) then \(f^* Id(A) = Id(f^* A)\) and \(f^* r(A) = r(f^* A)\), 838 | \item if \(Q' \triangleleft A\) and \(Q' \triangleleft B\) then \(f^*(A+B) = f^*A + f^*B\), \(f^* i_{A,B} = i_{f^*A, f^*B}\) and \(f^* j_{A,B} = j_{f^*A, f^*B}\). 839 | \end{itemize} 840 | 841 | Finally, the definition of strong M-L structure can be rewritten in terms of categories with attributes: 842 | 843 | An \textbf{M-L Hyperdoctrine} \(\tuple{\mathbb{E}, \Sigma, \Pi, Id, r, +, i, j, N, o, S}\) consists of a category with attributes \(\mathbb{E}\) with the following additional structure: 844 | 845 | \begin{enumerate} 846 | \item[i.] For every object \(A\) of \(\mathrm{Base}(\mathbb{E})\), for every \(B \in \mathrm{Att}_{\mathbb{E}}(A)\), for every \(C \in \mathrm{Att}_{\mathbb{E}}(\Sigma B)\), an attribute \(\Pi C \in \mathrm{Att}_{\mathbb{E}}(A)\) and a morphism \(\tau(C) : \Sigma p(B)^* \Pi C \to \Sigma C\) in \(\mathrm{Base}(\mathbb{E})\) such that the diagram 847 | \begin{center} 848 | \begin{tikzcd} 849 | \Sigma p(B)^* \Pi C \arrow[r, "\tau(C)"] \arrow[dr, "p(p(B)^* \Pi C)"'] & \Sigma C \arrow[d, "p(C)"] \\ 850 | & \Sigma B 851 | \end{tikzcd} 852 | \end{center} 853 | commutes and having the property that for all morphisms \(f: \Sigma B \to \Sigma C\) in \(\mathrm{Base}(\mathbb{E})\) such that \(p(C) \circ f = id_{\Sigma B}\), there exists a unique \(g: A \to \Sigma \Pi C\) in \(\mathrm{Base}(\mathbb{E})\) such that \(p(\Pi C) \circ g = id_A\) and such that the diagram 854 | \begin{center} 855 | \begin{tikzcd} 856 | \Sigma p(B)^* \Pi C \arrow[r, "\tau(C)"] & \Sigma C \\ 857 | p(B)^* \Sigma C \arrow[u] & \Sigma B \arrow[u, "f"'] 858 | \end{tikzcd} 859 | \end{center} 860 | commutes. (Where \(p(B)^* g\) is defined to be the unique morphism \(h: \Sigma B \to \Sigma p(B)^* \Pi C\) such that \(p(p(B)^* \Pi C) \circ h = id_{\Sigma B}\) and \(p(\Pi C) \circ \Sop(p(B), \Pi C) \circ h = p(B) \circ g\).) 861 | 862 | \item[ii.] For all objects \(A\) of \(\mathrm{Base}(\mathbb{E})\), for all \(B \in \mathrm{Att}_{\mathbb{E}}(A)\), an attribute \(Id B \in \mathrm{Att}_{\mathbb{E}}(\Sigma p(B)^* B)\) and a morphism \(r(B): \Sigma B \to \Sigma Id B\) in \(\mathrm{Base}(\mathbb{E})\) such that the diagram 863 | \begin{center} 864 | \begin{tikzcd} 865 | \Sigma B \arrow[r, "r(B)"] \arrow[dr, "\Delta(B)"'] & \Sigma Id B \arrow[d, "p(Id B)"] \\ 866 | & \Sigma p(B)^* B 867 | \end{tikzcd} 868 | \end{center} 869 | commutes (where \(\Delta(B)\) is the unique morphism such that \(\Delta(B) \circ p(p(B)^* B) = id\) and \(\Delta(B) \circ \Sop(p(B), B) = id\)) and having the property that for all attributes \(C \in \mathrm{Att}_{\mathbb{E}}(\Sigma p(B)^* B)\) and for all morphisms \(h: \Sigma B \to \Sigma C\) such that the diagram 870 | \begin{center} 871 | \begin{tikzcd} 872 | \Sigma B \arrow[r, "h"] \arrow[dr, "\Delta(B)"'] & \Sigma C \arrow[d, "p(C)"] \\ 873 | & \Sigma p(B)^* B 874 | \end{tikzcd} 875 | \end{center} 876 | commutes, there exists a unique morphism \(g: \Sigma Id B \to \Sigma C\) such that the diagrams 877 | \begin{center} 878 | \begin{minipage}{0.4\textwidth} 879 | \begin{tikzcd} 880 | \Sigma Id B \arrow[dr, "p(Id B)"] \arrow[r, "g"] & \Sigma C \arrow[d, "p(C)"] \\ 881 | & \Sigma p(B)^* B 882 | \end{tikzcd} 883 | \end{minipage} 884 | \quad and \quad 885 | \begin{minipage}{0.4\textwidth} 886 | \begin{tikzcd} 887 | \Sigma B \arrow[r, "r(B)"] \arrow[dr, "h"'] & \Sigma Id B \arrow[d, "g"] \\ 888 | & \Sigma C 889 | \end{tikzcd} 890 | \end{minipage} 891 | \end{center} 892 | commute. 893 | 894 | \item[iii.] For all objects \(A\) of \(\mathrm{Base}(\mathbb{E})\), for all \(B_1, B_2 \in \mathrm{Att}(A)\), an object \(B_1+B_2 \in \mathrm{Att}(A)\) and morphisms \(i_{B_1, B_2} : \Sigma B_1 \to \Sigma(B_1+B_2)\) and \(j_{B_1, B_2} : \Sigma B_2 \to \Sigma(B_1+B_2)\) such that the diagrams 895 | \begin{center} 896 | \begin{minipage}{0.4\textwidth} 897 | \begin{tikzcd} 898 | \Sigma B_1 \arrow[r, "i"] \arrow[dr, "p(B_1)"'] & \Sigma(B_1+B_2) \arrow[d, "p(B_1+B_2)"] \\ 899 | & A 900 | \end{tikzcd} 901 | \end{minipage} 902 | \begin{minipage}{0.4\textwidth} 903 | \begin{tikzcd} 904 | \Sigma B_2 \arrow[r, "j"] \arrow[dr, "p(B_2)"'] & \Sigma(B_1+B_2) \arrow[d, "p(B_1+B_2)"] \\ 905 | & A 906 | \end{tikzcd} 907 | \end{minipage} 908 | \end{center} 909 | commute and having the property that for all \(C \in \mathrm{Att}_{\mathbb{E}}(A)\), for all pairs of morphisms \(h_1: \Sigma B_1 \to \Sigma C\) and \(h_2: \Sigma B_2 \to \Sigma C\) such that the diagrams 910 | \begin{center} 911 | \begin{minipage}{0.4\textwidth} 912 | \begin{tikzcd} 913 | \Sigma B_1 \arrow[r, "h_1"] \arrow[dr, "p(B_1)"'] & \Sigma C \arrow[d, "p(C)"] \\ 914 | & A 915 | \end{tikzcd} 916 | \end{minipage} 917 | \quad and \quad 918 | \begin{minipage}{0.4\textwidth} 919 | \begin{tikzcd} 920 | \Sigma B_2 \arrow[r, "h_2"] \arrow[dr, "p(B_2)"'] & \Sigma C \arrow[d, "p(C)"] \\ 921 | & A 922 | \end{tikzcd} 923 | \end{minipage} 924 | \end{center} 925 | commute, there exists a unique morphism \(g: \Sigma(B_1+B_2) \to \Sigma C\) such that 926 | \begin{center} 927 | \begin{tikzcd} 928 | \Sigma(B_1+B_2) \arrow[r, "g"] \arrow[dr, "p(B_1+B_2)"'] & \Sigma C \arrow[d, "p(C)"] \\ 929 | & A 930 | \end{tikzcd} 931 | \end{center} 932 | commutes and such that in the diagram 933 | \begin{center} 934 | \begin{tikzcd} 935 | \Sigma B_1 \arrow[r, "i"] \arrow[dr, "h_1"'] & \Sigma(B_1+B_2) \arrow[d, "g"] & \Sigma B_2 \arrow[l, "j"'] \arrow[dl, "h_2"] \\ 936 | & \Sigma C & 937 | \end{tikzcd} 938 | \end{center} 939 | both triangles commute. 940 | 941 | \item[iv.] An object \(N\) of \(\mathrm{Base}(\mathbb{E})\), morphisms \(o: 1 \to N\) and \(S: N \to N\) such that \(\tuple{N, o, S}\) is a natural number object in \(\mathrm{Base}(\mathbb{E})\). 942 | \end{enumerate} 943 | 944 | Subject to the conditions: If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{E})\), if \(B \in \mathrm{Att}_{\mathbb{E}}(A')\) and \(C \in \mathrm{Att}_{\mathbb{E}}(\Sigma B)\) then \(f^* \Pi C = \Pi \Sop(f,B)^* C\) and the diagram 945 | \begin{center} 946 | \begin{tikzcd} 947 | \Sigma p(f^*B)^* \Pi f^* \# C \arrow[r, "{\Sop(\Sop(f{,}B){,} p(B)^* \Pi C)}"] \arrow[d, "{\tau(\Sop(f{,}B)^* C)}"'] & \Sigma p(B)^* \Pi C \arrow[d, "\tau(C)"] \\ 948 | \Sigma \Sop(f,B)^* C \arrow[r, "{\Sop(\Sop(f{,}B){,} C)}"] & \Sigma C 949 | \end{tikzcd} 950 | \end{center} 951 | commutes. 952 | 953 | \begin{enumerate} 954 | \item[vi.] If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{E})\) and if \(B \in \mathrm{Att}_{\mathbb{E}}(A')\) then \(\Sop(\Sop(f,B), p(B)^* B)^* Id B = Id f^* B\) and the diagram 955 | \begin{center} 956 | \begin{tikzcd} 957 | \Sigma Id f^* B \arrow[r, "{\Sop(\Sop(\Sop(f{,}B){,} p(B)^* B){,} Id B)}"] & \Sigma Id B \\ 958 | \Sigma f^* B \arrow[u, "r(f^*B)"] \arrow[r, "{\Sop(f{,}B)}"] & \Sigma B \arrow[u, "r(B)"] 959 | \end{tikzcd} 960 | \end{center} 961 | commutes. 962 | 963 | \item[vii.] If \(f: A \to A'\) in \(\mathrm{Base}(\mathbb{E})\) and \(B_1, B_2 \in \mathrm{Att}_{\mathbb{E}}(A')\) then \(f^*(B_1+B_2) = f^*B_1 + f^*B_2\) and the diagrams 964 | \begin{center} 965 | \begin{minipage}{0.4\textwidth} 966 | \begin{tikzcd} 967 | \Sigma f^* B_1 \arrow[r, "{\Sop(f{,}B_1)}"] \arrow[d, "{i_{f^*B_1{,} f^*B_2}}"'] & \Sigma B_1 \arrow[d, "{i_{B_1{,} B_2}}"] \\ 968 | \Sigma f^*(B_1+B_2) \arrow[r, "{\Sop(f{,} B_1+B_2)}"] & \Sigma(B_1+B_2) 969 | \end{tikzcd} 970 | \end{minipage} 971 | \quad and \quad 972 | \begin{minipage}{0.4\textwidth} 973 | \begin{tikzcd} 974 | \Sigma f^* B_2 \arrow[r, "{\Sop(f{,}B_2)}"] \arrow[d, "{j_{f^*B_1{,} f^*B_2}}"'] & \Sigma B_2 \arrow[d, "{j_{B_1{,} B_2}}"] \\ 975 | \Sigma f^*(B_1+B_2) \arrow[r, "{\Sop(f{,} B_1+B_2)}"] & \Sigma(B_1+B_2) 976 | \end{tikzcd} 977 | \end{minipage} 978 | \end{center} 979 | commute. 980 | \end{enumerate} 981 | 982 | We are claiming, then, that the category of M-L structures and the category of M-L hyperdoctrines are equivalent. The proof of this result is an extension of the proof that \(\underline{\Sigma\text{-}\mathbf{Con}}\) and \(\underline{\mathbf{Attcat}}\) are equivalent categories. 983 | 984 | % source p3.15 985 | \section{Limit spaces---a model of M-L type theory} \label{sec:source-3-5} 986 | 987 | We wish to describe a model of Martin-L\"of type theory in which types are interpreted as limit spaces and in which families of types indexed by a type are, roughly speaking, interpreted as `morphisms with codomain' in the category of limit spaces. The model is described as an M-L hyperdoctrine with base category the category of limit spaces. If we first describe the M-L hyperdoctrine of sets and families of sets then the M-L hyperdoctrine of limit spaces can be described without much trouble. 988 | 989 | But first, two very useful and trivial lemmas: 990 | 991 | \begin{lemma} 992 | If \(\mathbb{E}\) is a category with attributes, if \(A\) is an object of \(\mathrm{Base}(\mathbb{E})\), if \(B \in Att_{\mathbb{E}}(A)\), if \(D \in Att_{\mathbb{E}}(\Sigma p(B)^* B)\) and if \(r: \Sigma B \to \Sigma D\) is an isomorphism in \(\mathrm{Base}(\mathbb{E})\) such that the diagram 993 | \begin{center} 994 | \begin{tikzcd} 995 | \Sigma B \arrow[r, "r"] \arrow[dr, "\Delta(B)"'] & \Sigma D \arrow[d, "p(D)"] \\ 996 | & \Sigma p(B)^* B 997 | \end{tikzcd} 998 | \end{center} 999 | commutes then \(\tuple{D, r}\) satisfies clause ii.\ of the definition of M-L hyperdoctrine. That is clause ii.\ is satisfied if \(Id(B)\) is taken to \(D\) and if \(r(B)\) is taken to be \(r\). 1000 | \end{lemma} 1001 | 1002 | \begin{lemma} 1003 | If \(\mathbb{E}\) is a category with attributes, if \(A\) is an object of \(\mathbb{E}\), if \(B_1, B_2 \in Att_{\mathbb{E}}(A)\), if \(C \in Att_{\mathbb{E}}(A)\) and if \(i: \Sigma B_1 \to \Sigma C\), \(j: \Sigma B_2 \to \Sigma C\) in \(\mathrm{Base}(\mathbb{E})\) such that the diagrams 1004 | \begin{center} 1005 | \begin{minipage}{0.4\textwidth} 1006 | \begin{tikzcd} 1007 | \Sigma B_1 \arrow[r, "i"] \arrow[dr, "p(B_1)"'] & \Sigma C \arrow[d, "p(C)"] \\ 1008 | & A 1009 | \end{tikzcd} 1010 | \end{minipage} 1011 | \quad and \quad 1012 | \begin{minipage}{0.4\textwidth} 1013 | \begin{tikzcd} 1014 | \Sigma B_2 \arrow[r, "j"] \arrow[dr, "p(B_2)"'] & \Sigma C \arrow[d, "p(C)"] \\ 1015 | & A 1016 | \end{tikzcd} 1017 | \end{minipage} 1018 | \end{center} 1019 | commute and if \(\Sigma B_1 \xrightarrow{i} \Sigma C \xleftarrow{j} \Sigma B_2\) is a coproduct diagram in \(\mathrm{Base}(\mathbb{E})\) then \(\tuple{C, i, j}\) satisfy clause iii.\ of the definition of M-L hyperdoctrine. 1020 | \end{lemma} 1021 | 1022 | The M-L hyperdoctrine \(\underline{\mathbf{Fam}}\) of sets and families of sets is as follows: 1023 | 1024 | \begin{enumerate} 1025 | \item \(\mathrm{Base}(\underline{\mathbf{Fam}}) = \underline{\mathbf{Set}}\). 1026 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\), i.e.\ if \(A\) is a set, then \(Att_{\underline{\mathbf{Fam}}}(A) = \{ A\text{-indexed families of sets} \}\). 1027 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\) and if \(B \in Att(A)\) then \(\Sigma B = \bigcup_{a \in A} B(a) = \{ \tuple{a,b} \mid a \in A \text{ and } b \in B(a) \}\). 1028 | \item If \(f: A \to A'\) in \(\mathrm{Base}(\underline{\mathbf{Fam}})\) and if \(B \in Att(A')\) then \(f^*B = \lambda a \in A . B(f(a))\). \(\Sop(f,B) : \Sigma f^*B \to \Sigma B\) is given by \(\Sop(f,B)(\tuple{a,b}) = \tuple{f(a), b}\). 1029 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\), if \(B \in Att(A)\), if \(C \in Att(\Sigma B)\) then \(\# C \in Att(A)\) is given by \(\# C(a) = \{ \tuple{b,c} \mid b \in B(a) \text{ and } c \in C(\tuple{a,b}) \}\). \(\gamma(C) : \Sigma \# C \to \Sigma C\) is given by \(\gamma(C)(\tuple{a, \tuple{b,c}}) = \tuple{\tuple{a,b}, c}\). 1030 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\) then \(L(A) = \lambda x \in \{ \cdot \} . A\). Then \(\Theta(A) : \Sigma L A \to A\) is given by \(\Theta(A)(\tuple{\cdot, a}) = a\). 1031 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\), if \(B \in Att(A)\), if \(C \in Att(\Sigma B)\) then define \(\Pi C \in Att(A)\) by 1032 | \[ \Pi C(a) = \prod_{x \in B(a)} C(\tuple{a,x}). \] 1033 | Define \(Ap(C) : \Sigma p(B)^* \Pi C \to \Sigma C\) by defining 1034 | \[ Ap(C)(\tuple{\tuple{a,b}, g}) = \tuple{\tuple{a,b}, Ap(b,g)}. \] 1035 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\) and if \(B \in Att(A)\) then define \(Id(B)\), \(r(B)\) by 1036 | \(Id(B)(\tuple{\tuple{a,b}, b'}) = \{ \cdot \}\) if \(b=b'\), \(= \emptyset\) otherwise. 1037 | \(r(B)(\tuple{a,b}) = \tuple{\tuple{\tuple{a,b}, b}, \cdot}\). 1038 | \item If \(A \in |\mathrm{Base}(\underline{\mathbf{Fam}})|\), if \(B_1, B_2 \in Att(A)\) then define \(B_1+B_2\) by \((B_1+B_2)(a) = B_1(a) + B_2(a)\). Then \(\Sigma(B_1+B_2) = \Sigma B_1 + \Sigma B_2\). Define \(i_{B_1, B_2}\) and \(j_{B_1, B_2}\) accordingly. 1039 | \item As is well known the set of natural numbers is a natural number object in the category \(\underline{\mathbf{Set}}\). 1040 | \end{enumerate} 1041 | 1042 | Completing the description of \(\underline{\mathbf{Fam}}\) as an M-L hyperdoctrine. 1043 | 1044 | \subsection{Limit spaces} 1045 | 1046 | The set of all filters on a set \(A\) ordered by inclusion is a lattice. The meets in this lattice are given by intersection of filters. If \(\Phi\) and \(\Psi\) are filters on \(A\) then \(\Phi \vee \Psi = \{ u \cap v \mid u \in \Phi \text{ and } v \in \Psi \}\). 1047 | 1048 | If \(A\) is a set then the ordered set of all filters on \(A\) will be denoted \(\mathcal{F}(A)\). 1049 | 1050 | If \(f: A \to A'\) is a function then define \(\mathcal{F}(f) : \mathcal{F}(A) \to \mathcal{F}(A')\) by \(\mathcal{F}(f)(\Phi) = \{ w \subseteq A' \mid \exists u \in \Phi \text{ s.t.\ } w \supseteq f(u) \}\). Then \(\mathcal{F}(f)\) is an order preserving map and it is easy to see that \(\mathcal{F}\) is functorial: \(\mathcal{F}(f \circ f') = \mathcal{F}(f) \circ \mathcal{F}(f')\) and \(\mathcal{F}(id_A) = id_{\mathcal{F}(A)}\). \(\mathcal{F}\) can be considered to be a functor from \(\underline{\mathbf{Set}}\) to the category of ordered sets. 1051 | 1052 | A \underline{limit space} \(\tuple{A, C}\) consists of a set \(A\) and for each \(a \in A\), a set \(C(a) \subseteq \mathcal{F}(A)\), said to be the set of filters converging to \(a\), and subject to the conditions: 1053 | 1054 | \begin{enumerate}[label=\roman*.] 1055 | \item If \(a \in A\) then \(\tuple{a} \in C(a)\), where \(\tuple{a}\) is the principle filter generated by \(a\). 1056 | 1057 | \item If \(a \in A\) and \(\Phi, \Psi \in C(a)\) then \(\Phi \cap \Psi \in C(a)\). 1058 | 1059 | \item If \(a \in A\) and \(\Phi \in C(a)\) and if \(\Phi \subseteq \Psi\) in \(\mathcal{F}(A)\) then \(\Psi \in C(a)\). 1060 | \end{enumerate} 1061 | 1062 | We usually say that \(\Phi \text{ conv } a\) in preference to \(\Phi \in C(a)\). 1063 | 1064 | A morphism of limit spaces \(f: \tuple{A, C} \to \tuple{A', C'}\) is a function \(f: A \to A'\) such that whenever \(\Phi \text{ conv } a\) in \(\tuple{A, C}\) then \(\mathcal{F}(f)(\Phi) \text{ conv } f(a)\) in \(\tuple{A', C'}\). 1065 | 1066 | The category of limit spaces will be denoted \(\underline{\mathbf{Limsp}}\). 1067 | 1068 | We shall make use of the fact that for every \(f: A \to A'\) in \(\underline{\mathbf{Set}}\), the morphism \(\mathcal{F}(f) : \mathcal{F}(A) \to \mathcal{F}(A')\) has a left adjoint. We define an order preserving morphism \(\check{\mathcal{F}}(f) : \mathcal{F}(A') \to \mathcal{F}(A)\) by \(\check{\mathcal{F}}(f)(\Phi) = \{ u \subseteq A \mid \exists w' \in \Phi \text{ s.t.\ } u \supseteq f^{-1}(w') \}\). 1069 | That \(\check{\mathcal{F}}(f) \text{ adj } \mathcal{F}(f)\) is expressed by Lemma 3: If \(\Theta \in \mathcal{F}(A)\) and if \(\Phi \in \mathcal{F}(A')\) and if \(f: A \to A'\) then \(\check{\mathcal{F}}(f)(\Phi) \subseteq \Theta\) iff \(\Phi \subseteq \mathcal{F}(f)(\Theta)\). 1070 | 1071 | \begin{corollary} 1072 | (a) \(\check{\mathcal{F}} : \underline{\mathbf{Set}}^{op} \to\) the category of ordered sets, is a functor. 1073 | (b) For each \(f: A \to A'\), \(\check{\mathcal{F}}(f) : \mathcal{F}(A') \to \mathcal{F}(A)\) preserves meets. 1074 | \end{corollary} 1075 | 1076 | The base category of the M-L hyperdoctrine of limit spaces is taken to be the category \(\underline{\mathbf{Limsp}}\). Then if \(\mathcal{A} \in |\underline{\mathbf{Limsp}}|\) and if \(\mathcal{A}\) has underlying set \(A\) then define \(Att(\mathcal{A}) = \{ \tuple{B, C} \mid B \text{ is an } A\text{-indexed family of sets and } C \text{ is such that } \tuple{\Sigma B, C} \text{ is a limit space such that } p(B) : \tuple{\Sigma B, C} \to \mathcal{A} \text{ is continuous} \}\). 1077 | 1078 | If \(\mathcal{B} \in Att(\mathcal{A})\) then define \(\Sigma \mathcal{B} = \tuple{\Sigma B, C}\), where \(B\) is the underlying family of sets associated with \(\mathcal{B}\). Define \(p(\mathcal{B}) = p(B)\). Thus every \(\mathcal{B} \in Att(\mathcal{A})\) is determined by an \(A\)-indexed family of sets \(B\) and a limit space \(\Sigma \mathcal{B}\) which has underlying set \(\Sigma B\) and which is such that \(p(B) : \Sigma \mathcal{B} \to \mathcal{A}\) is continuous. 1079 | 1080 | \textbf{Pullbacks.} If \(f: \mathcal{A} \to \mathcal{A}'\) and if \(\mathcal{B} \in Att(\mathcal{A}')\) then the underlying family of sets of \(f^* \mathcal{B}\) is taken to be \(f^*B\). Then \(\Sigma f^* \mathcal{B}\) is taken to be the unique limit space with underlying set \(\Sigma f^* B\) such that 1081 | \begin{center} 1082 | \begin{tikzcd} 1083 | \Sigma f^* \mathcal{B} \arrow[r, "{\Sop(f{,}B)}"] \arrow[d, "p(f^* \mathcal{B})"'] & \Sigma \mathcal{B} \arrow[d, "p(\mathcal{B})"] \\ 1084 | \mathcal{A} \arrow[r, "f"] & \mathcal{A}' 1085 | \end{tikzcd} 1086 | \end{center} 1087 | is a pullback diagram in \(\underline{\mathbf{Limsp}}\). 1088 | 1089 | Convergence in \(\Sigma f^* \mathcal{B}\) is given by \(\Theta \text{ conv } x\) iff \(\mathcal{F}(p(f^*B))(\Theta) \text{ conv } p(f^*B)(x)\) and \(\mathcal{F}(\Sop(f,B))(\Theta) \text{ conv } \Sop(f,B)(x)\). That the diagram is a pullback diagram follows immediately from the fact that the underlying diagram in \(\underline{\mathbf{Set}}\) is a pullback diagram. Uniqueness of this convergence relation subject to the diagram being a pullback diagram is the case because if \(X\) is a new limit space with underlying set \(\Sigma f^* B\) and such that the diagram is a pullback, then there exists an isomorphism \(g: \Sigma f^* \mathcal{B} \to X\) such that \(g \circ p(f^* \mathcal{B}) = p(f^* \mathcal{B})\) and \(g \circ \Sop(f,B) = \Sop(f,B)\). But then since the corresponding diagrams in \(\underline{\mathbf{Set}}\) are pullback diagrams so \(g = id_{\Sigma f^*B}\). So \(id_{\Sigma f^*B}\) is a morphism of limit spaces both ways, hence \(\Phi \text{ conv } x\) in \(\Sigma f^* \mathcal{B}\) iff \(\Phi \text{ conv } x\) in \(X\). Thus \(\Sigma f^* \mathcal{B}\) is unique. 1090 | 1091 | That pullbacks fit together follows from the fact that they fit together at the level of underlying sets and from the uniqueness of the pullbacks once underlying sets are decided. 1092 | 1093 | \textbf{\(\#\) and \(\gamma\).} If \(\mathcal{A} \in |\underline{\mathbf{Limsp}}|\), if \(\mathcal{B} \in Att(\mathcal{A})\) and if \(\mathcal{C} \in Att(\Sigma \mathcal{B})\) then the underlying family of \(\# \mathcal{C}\) is taken to be \(\# C\). The limit space \(\Sigma \# \mathcal{C}\) is then uniquely determined by the requirement that \(\gamma(C) : \Sigma \mathcal{C} \to \Sigma \# \mathcal{C}\) be an isomorphism of limit spaces. 1094 | 1095 | \textbf{\(L\) and \(\Theta\).} \(\underline{\mathbf{Limsp}}\) has a terminal object \(1\). If \(\mathcal{A} \in |\underline{\mathbf{Limsp}}|\) then \(L(\mathcal{A})\) is taken to have underlying family of sets \(L(A)\) and \(\Sigma L(\mathcal{A})\) is then determined by the requirement that \(\Theta(A) : \Sigma L(\mathcal{A}) \to \mathcal{A}\) be an isomorphism of limit spaces. 1096 | 1097 | \textbf{\(Id\), \(+\) and \(N\)} are all trivial to define. For \(Id\) and \(+\) lemmas 1 and 2 of this section can be used. 1098 | 1099 | \textbf{\(\Pi\) and \(Ap\).} The slightly non-trivial bit. If \(\mathcal{A} \in |\underline{\mathbf{Limsp}}|\), if \(\mathcal{B} \in Att(\mathcal{A})\) and if \(\mathcal{C} \in Att(\Sigma \mathcal{B})\) then define \(\Pi \mathcal{C}(a) = \{ f \in \prod_{x \in B(a)} C(\tuple{a,x}) \mid \text{the corresponding } f: a^* \mathcal{B} \to \Sop(a, \mathcal{B})^* \mathcal{C} \text{ is continuous} \}\). 1100 | \(Ap\) is taken to be application. \(\Sigma \Pi \mathcal{C}\) is topologised by \(\Phi \text{ conv } y\) in \(\Sigma \Pi \mathcal{C}\) iff \(\mathcal{F}(p(\Pi \mathcal{C}))(\Phi) \text{ conv } p(\Pi \mathcal{C})(y)\) and \(\forall x \in \Sop(p(\mathcal{B}), \Pi \mathcal{C})^{-1}(\{ y \})\), \(\forall \Psi \in \mathcal{F}(\Sigma \mathcal{B})\) s.t.\ \(\Psi \text{ conv } p(\mathcal{B})^* \Pi \mathcal{C}(x)\), \(\mathcal{F}(Ap)(\check{\mathcal{F}}(\Sop(p(\mathcal{B}), \Pi \mathcal{C}))(\Phi) \vee \Psi)(\rho(p(\mathcal{B})^* \Pi \mathcal{C}))(\Psi) \text{ conv } Ap(x)\). 1101 | 1102 | %%% Local Variables: 1103 | %%% mode: latex 1104 | %%% TeX-master: "cartmell-thesis" 1105 | %%% End: --------------------------------------------------------------------------------