% nsa/mac.tex

% FONTS
\font\bigrm=cmr7 scaled \magstep4
\font\eightrm=cmr8
\font\eightsl=cmsl8
\font\eightbf=cmbx8
\font\ninerm=cmr9
\font\ninei=cmmi9
\font\ninesy=cmsy9
\font\ninebf=cmbx9
\font\nineit=cmti9
\font\sixrm=cmr6
\font\sixi=cmmi6
\font\sixsy=cmsy6
\font\sixbf=cmbx6
\def\tenpoint{\def\rm{\fam0\tenrm}%
   \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
   \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
   \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
   \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
   \textfont\itfam=\tenit \def\it{\fam\itfam\tenit}%
   \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
    \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam\tenbf}%
   \normalbaselineskip=12pt
   \setbox\strutbox=\hbox{\vrule height8.5pt depth 3.5pt width0pt}%
   \let\big=\tenbig \normalbaselines\rm}
\def\ninepoint{\def\rm{\fam0\ninerm}%
   \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
   \textfont1=\ninei \scriptfont1=\sixi \scriptscriptfont1=\fivei
   \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
   \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
   \textfont\itfam=\nineit \def\it{\fam\itfam\nineit}%
   \textfont\bffam=\ninebf \scriptfont\bffam=\sixbf
    \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam\ninebf}%
   \normalbaselineskip=11pt
   \setbox\strutbox=\hbox{\vrule height8pt depth 3pt width0pt}%
   \let\big=\ninebig \normalbaselines\rm}
\catcode`@=11
%\def\hexnumber@#1{\ifnum#1<10 \number#1\else
% \ifnum#1=10 A\else\ifnum#1=11 B\else\ifnum#1=12 C\else
% \ifnum#1=13 D\else\ifnum#1=14 E\else\ifnum#1=15 F\fi\fi\fi\fi\fi\fi\fi}
%\font\tenmsx=msxm10
%\font\sevenmsx=msxm7
%\font\fivemsx=msxm5
%\font\tenmsy=msym10
%\font\sevenmsy=msym7
%\font\fivemsy=msym5
%\newfam\msxfam
%\newfam\msyfam
%\textfont\msxfam=\tenmsx
%\scriptfont\msxfam=\sevenmsx
%\scriptscriptfont\msxfam=\fivemsx
%\textfont\msyfam=\tenmsy
%\scriptfont\msyfam=\sevenmsy
%\scriptscriptfont\msyfam=\fivemsy
%\def\msx@{\hexnumber@\msxfam}
%\def\msy@{\hexnumber@\msyfam}
%\mathchardef\square="0\msx@03     
\def\tenbig#1{{\hbox{$\left#1\vbox to8.5pt{}\right.\n@space$}}}
\def\ninebig#1{{\hbox{$\textfont0=\tenrm\textfont2=\tensy
  \left#1\vbox to7.25pt{}\right.\n@space$}}}
\catcode`@=12

% REGISTERS
\newcount\chapno
\newcount\sectno
\newcount\thmno
\newcount\equatno
\newcount\firstpage
\newcount\footno
\newcount\ansno
\newtoks\chaptername
\newtoks\sectionname
\newtoks\1
\newwrite\raw
\newwrite\tabcon
\newif\ifindexmode

% FORMATING 
\magnification=\magstep1
\hsize=11cm
\vsize=17.5cm
\voffset=2\baselineskip
\hoffset=1.7truecm
\headline={\Headline}
\footline={\Footline}
\def\Headline{\ifnum\firstpage=\pageno \hfil \else\ifodd\pageno%
   \righthead\else\lefthead\fi\fi}
\def\Footline{\ifnum\firstpage=\pageno \hss\tenrm\folio\hss \else{}\fi}
\def\lefthead{\tenrm\folio\hfil{\eightrm CHAPTER \the\chapno.%
   \quad\uppercase\expandafter{\the\chaptername}\hfil}}
\def\righthead{\hfil{\eightrm\uppercase\expandafter{\botmark}}%
   \hfil\tenrm\folio}
\def\beginchap#1{\chaptername={#1} \firstpage=\pageno \thmno=0
   \equatno=0 \footno=0 \sectno=0 \advance\chapno by1 
   \hrule width0pt depth1.5cm
   \centerline{\tenrm CHAPTER\ \the\chapno}\vskip .45cm
   \centerline{\bigrm #1}\vskip 1cm \ifindexmode\write\tabcon%
   {\the\chapno\  #1 \the\count0}\fi\tenpoint}
\def\beginthm{\advance\thmno by1\medbreak%
    {\bf Theorem \the\thmno.}\enspace}
\def\endproc{\par\ifdim\lastskip<\medskipamount\removelastskip%
   \penalty55\medskip\fi}
\def\pf{{\bf Proof.}\enspace}
\def\equat#1{\global\advance\equatno by1 
   $$#1\eqno(\the\chapno.\the\equatno)$$}
\def\CR{\global\advance\equatno by1 %
   &(\the\chapno.\the\equatno)\cr}% FOR USE WITH \eqalignno
\def\Cr{\global\advance\equatno by1 %
   \hfil\llap{(\the\chapno.\the\equatno)}\hfilneg\cr}
                                  % FOR USE WITH \displaylines
\def\section#1{\global\advance\sectno by1 \tenpoint
  \bigbreak\centerline{\bf \the\chapno.\the\sectno\quad#1}%
  \mark{\S\the\chapno.\the\sectno\quad#1}
  \ifindexmode\write\tabcon{\the\chapno.\the\sectno\ #1, \the\count0}\fi
  \nobreak\bigskip}
\long\def\foot#1{\advance\footno by1 
  {\baselineskip=9pt 
   \setbox\strutbox=\hbox{\vrule height7pt depth2pt width0pt}%
   \def\textindent##1{\indent\llap{##1}}%
   \def\sl{\eightsl}\def\bf{\eightbf}\def\rm{\eightrm}%
   \frenchspacing\eightrm\footnote{$^{\the\footno}$}{#1}}}
\def\footnoterule{}
\skip\footins=\medskipamount
\def\poetry{\smallbreak\parindent=40pt \baselineskip=11pt
  \setbox\strutbox=\hbox{\vrule height8pt depth3pt width 0pt}%
   \obeylines\ninerm}% LEAVE BLANK LINE AND TYPE {\poetry <poem>
%                                                                 }
\def\exercises{\medbreak%
  \noindent\ninepoint{\bf Exercises for Section \the\chapno.\the\sectno}
  \nobreak\smallskip}
\def\ans{\ifnum0<\ansno\medbreak\fi\advance\ansno by1 
  \noindent\ninepoint{\bf Section \the\chapno.\the\ansno}%
  \nobreak\smallskip}
\def\endchap{\vfill\supereject}

% REFERENCING---REDEFINABLE IF REFERENCES GET MESSED UP
\def\th#1.{#1}
\def\EQ#1.#2.{(#1.#2)}

% INDEXING---WATCH OUT: LATER RUNS OVERWRITE FILE
   % WHEN CHAPTER n IS IN FINAL FORM, PUT IN ITS CONTROL FILE
   % AFTER \input mac THE COMMANDS
   % \indexmodetrue\immediate\openout\raw=indexn%
   % \immediate\openout\tabcon=contentsn
\def\ind#1{\ifindexmode\write\raw{#1, \the\count0 }#1\else#1\fi}
\def\sind#1{\ifindexmode\write\raw{#1, \the\count0 }\fi}
\def\ii#1.{\ifindexmode\write\raw{#1, \the\count0 }{\it#1}%
   \else{\it#1}\fi}
   % TYPE \ind{text} TO GET text AND INDEX IT
   % TYPE \sind{text} JUST TO INDEX IT
   % TYPE \ii text. TO GET {\it text} (WITHOUT .) AND INDEX IT

% TEXT MACROS
\def\tseq#1#2.{$#1_1$,~\dots,~$#1_{#2}$}
\def\TT{${\rm\widetilde{T}}$}
\def\TS{${\rm T^\#}$}
\def\ZFCt{ZFC$\!\widetilde{\phantom m}\!$}
\def\ZFCVt{ZFCV$\!\widetilde{\phantom m}\!$}
\def\GBt{GB$\!\widetilde{\phantom m}\!$}

% TEXT OR MATH MACROS
\def\T{{\rm T}}
\def\f{{\rm F}}
\def\ro#1{{\rm #1}}%FOR USE IN TEXT TYPE \ (space) AFTER IF NEEDED
\def\bull{\vrule height .9ex width .8ex depth -.1ex }
\def\bul{\vrule height .9ex width .6ex depth -.3ex }
\def\wtT{\hbox{$\rm\widetilde T$}}

% MATH MACROS
\def\'{\hbox{'}}
\def\Bbb#1{{\fam\msyfam#1}}
\def\set#1?{\{\,#1\,\}}
\def\lseq#1#2#3{#1_1#2\ldots#2#1_{#3}}
\def\cseq#1#2#3{#1_1#2\cdots#2#1_{#3}}
\def\lq#1.#2#3{\1={_1}#1#2\ldots\1={_#3}#1}
\def\cq#1.#2#3{\1={_1}#1#2\cdots\1={_#3}#1}
   % TYPE \cq x\1=y\1.\to\nu FOR x_1=y_1\to\cdots\to x_\nu=y_\nu
\def\down{^{\phantom\prime}}
\def\eps{\varepsilon}
\def\ass{\mathord{\vdash}}
\def\inn{\mathord{\raise.17ex\hbox{$\scriptstyle\in$}}}
\def\inp{\mathrel{{\in}\hbox{'}}}
\def\IN{\mathrel{\epsilon}}
\def\INN{\epsilon}
\def\amp{\mathrel{\&}}
\def\too{\leftrightarrow}
\def\as{\forall^{{\hskip.2ex\rm st}}}
\def\es{\exists^{{\rm st}}}
\def\ai{\forall^{{\hskip.2ex\rm int}}}
\def\ei{\exists^{{\rm int}}}
\def\asf{\forall^{\hskip.2ex{\rm st fin}}}
\def\esf{\exists^{{\rm st fin}}}  
\def\afin{\forall^{\hskip.2ex{\rm fin}}}
\def\efin{\exists^{{\rm fin}}}
\def\om{ordinary mathematics} 
\def\RR{{\bf R}}
\def\NN{{\bf N}}
\def\QQ{{\bf Q}}
\def\ZZ{{\bf Z}}
\def\VV{{\bf V}}
\def\UU{{\bf U}}
\def\II{{\bf I}}
\def\LL{{\bf L}}
\def\FF{{\bf F}}
\def\XX{{\hbox{$\cal X$}}}
\def\Ss{{\bf S}}
\def\SS{{}^{{\rm S}}\!}
\def\CIRC{{}^{\circ}\!}
\def\Tu{\tilde{u}}
\def\Tx{\tilde{x}}
\def\Ty{\tilde{y}}
\def\Tr{\tilde{r}}
\def\Tv{\tilde{v}}
\def\wt#1.{\widetilde{#1}}
\def\Lsim#1{\hbox{\ooalign{\hbox{$#1<$}\crcr%
   \lower4.5pt\hbox{$#1\sim$}}}}
\def\Gsim#1{\hbox{\ooalign{\hbox{$#1>$}\crcr%
   \lower4.5pt\hbox{$#1\sim$}}}}
\def\lsim{\mathrel{\mathpalette\Lsim{}}}
\def\gsim{\mathrel{\mathpalette\Gsim{}}}
\def\Df{{\rm Dom}(f)}
\def\^#1#2{\vphantom#2^{#1}#2}
\def\pt#1{\^{\textstyle.}#1}
\def\sr#1{\^{\textstyle{\ast}}#1}
\def\st#1{\^{\rm st}#1}
\let\wrigpea=\wp
\def\wp{{\raise2pt\hbox{$\wrigpea$}}}
\def\.{\cdot}
\def\wpf{\wp_{{\rm fin}}}
\def\Vt{\widetilde V}
\def\VVt{\widetilde\VV}
\def\Tt{$\rm\widetilde T$}
\def\type{\hbox{ type }}
\def\la{\langle}
\def\ra{\rangle}
\def\etaa{\mathrel{\overline{\in}}}
\def\eset{{\rm\ ^eset}}
\def\eZFCU{$\rm^e$ZFCU}
\def\ein{\mathrel{^{\rm e}\hskip-1pt{\in}}}
\def\eeq{\mathrel{^{\rm e}\hskip-.4pt{=}}}
\def\nein{\mathrel{^{\rm e}\hskip-1pt{\notin}}}
\def\neeq{\mathrel{^{\rm e}\hskip-.4pt{\ne}}}
\def\iff{\allowbreak\hskip8pt plus2pt minus2pt\mathrel{\hbox{$\leftrightarrow$}}\hskip8pt plus2pt minus2pt}
\def\imp{\allowbreak\hskip8pt plus2pt minus2pt\mathrel{\hbox{$\rightarrow$}}\hskip8pt plus2pt minus2pt}
\def\and{\allowbreak\hskip7pt plus2pt minus2pt\mathrel{\&}\hskip7pt plus2pt minus2pt}
\def\or{\allowbreak\hskip7pt plus2pt minus2pt\mathrel{\hbox{$\vee$}}\hskip7pt plus2pt minus2pt}
\def\Vn{\VV_{{\rm\!n}}}
\def\lee{{\scriptstyle\le}}
\def\ltt{{\scriptstyle<}}
\def\Eset{\Sigma_{\,\rm\scriptscriptstyle S}}
\def\Ein{\Sigma_{\scriptscriptstyle\in}}
\def\Eeq{\Sigma_{\scriptscriptstyle=}}
\def\e{\hbox{$\rm^e\!$}}
\def\Rank{{\rm Rank}\,}
\def\rank{{\rm rank}\,}
\def\pt#1{\widetilde{#1'}}
\def\TTT{{\bf t}}
\def\FFF{{\bf f}}
\def\o{\hbox{$^{\rm o}$}}
\def\i{\hbox{$^{\rm i}$}}
\def\lL{{\cal L}}
\def\vV{{\cal V}}
\def\dneg{\dot\neg}
\def\dvee{\dot{\vee}}
\def\damp{\dot\&}
\def\dexists{\dot\exists}
\def\dforall{\dot\forall}
\def\deq{\dot{=}}
