perkee's blog

I heard you like science. tags
Jun 15
Permalink

Semantic Set Theory in #LaTeX

So I’m all done with my math course and its notes. The following is a file I call settheory.sty which I invoke with \usepackage{settheory} and it works pretty well for me. The gist of it is that I don’t have to describe what a symbol looks like, rather what it means. Also, it means that later, when you are writing the stuff out by hand you aren’t saying “A-cup-B” in your head when you really mean “A-union-B”

%%%%%%This is where I put in math commands
\let\Implies\implies
%\renewcommand{\implies}{\ensuremath{\to}}%the normal implies arrow is double width, so this makes it thinner
%particular sets
\newcommand{\algebraics}{\ensuremath{\mathbb{A}}}
\newcommand{\naturals}{\ensuremath{\mathbb{N}}}
\newcommand{\integers}{\ensuremath{\mathbb{Z}}}
\newcommand{\rationals}{\ensuremath{\mathbb{Q}}}
\newcommand{\reals}{\ensuremath{\mathbb{R}}}
%words
\renewcommand{\iff}{\ensuremath{\operatorname{\ iff\ }}}
\DeclareMathOperator{\st}{\ s.t.\ }
%logic
\newcommand{\nd}{\ensuremath{\operatorname{and}}}
\newcommand{\ro}{\ensuremath{\operatorname{or}}}
\DeclareMathOperator{\then}{then}
\DeclareMathOperator{\but}{but}
%set operators
%	Relations between sets
\let\propsubset\subset
\renewcommand{\subset}{\subseteq}
\let\propsupset\supset
\renewcommand{\supset}{\supseteq}
%	Operations on sets
\newcommand{\cartesian}{\ensuremath{\times}}
\newcommand{\intersect}{\cap}
\newcommand{\union}{\cup}
\newcommand{\symdif}{\vartriangle}

%highly semantic anal retentive perkee at your service stuff
\newcommand{\maps}{\ensuremath{:}}
\newcommand{\bjto}{\ensuremath{\xrightarrow[\text{onto}]{1\text{--}1}}}
\newcommand{\approaches}{\to}
\newcommand{\comp}{\circ}
\newcommand{\nimplies}{\implies\mkern-30mu\not{}\quad\ }
\newcommand{\tet}[2]{\prescript{#2}{}{#1}}
\newcommand{\collection}[1]{\mathscr #1}
%\let\Prime\prime
%\renewcommand{\prime}[1]{#1^\Prime}
%\newcommand{\pprime}[1]{#1^{\Prime\Prime}}
%stuff that puts in brackets
\newcommand{\seq}[1]{\langle #1 \rangle}
\newcommand{\absolute}[1]{\left| #1 \right|}
%\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand\eq[1]{\left[#1\right]}
\newcommand{\ordered}[1]{\left(#1\right)}
\newcommand{\sine}[1]{\sin\left(#1\right)}
\newcommand{\cosine}[1]{\cos\left(#1\right)}
\usepackage{ifthen}
\newcommand{\interval}[3][n]%prints neither, left, right, or both as brackets instead of parentheses
{%
\ifthenelse{\equal{#1}{n}}{\left( #2,#3 \right)}{}%
\ifthenelse{\equal{#1}{l}}{\left[ #2,#3 \right)}{}%
\ifthenelse{\equal{#1}{r}}{\left( #2,#3 \right]}{}%
\ifthenelse{\equal{#1}{b}}{\left[ #2,#3 \right]}{}%
}

%functions
\newcommand{\funct}	[2]{#1\!\left(#2\right)}
\newcommand{\inv}		[1]{#1^{-1}}
\newcommand{\inverse}	[2]{\funct{\inv{#1}}{#2}}
\newcommand{\allf}		[2]{\funct{\mathscr F}{#1,#2}}
%	Operations on one set
\newcommand{\complementset}	[2][]{\ensuremath{\funct{\mathscr{C}_{#1}}{#2}}}
\newcommand{\powerset}			[1]{\ensuremath{\funct{\mathscr P}{#1}}}
\newcommand{\id}				[1]{I_#1}
%characters that needed better spacing
\let\oldexists\exists
\renewcommand{\exists}{\ \oldexists}
\let\oldforall\forall
\renewcommand{\forall}{\ \oldforall}
%%derivatives
%\newcommand\od[3][]{\frac{\mathrm d^{#1}#2}{\mathrm d{#3}^{#1}}}

%%underbraces
\let\underbrace\LaTeXunderbrace 
\let\overbrace\LaTeXoverbrace 
 
Comments (View)
blog comments powered by Disqus