% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% NOTE: This copy of mymacros.sty is included in this folder ONLY *
% 		so that LaTeX_for_Undergraduates.tex will compile without *
% 		having to first install the mymacros package. 			  *
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

% mymacros.sty	 1.0   2021/04/06
% Andrew Lounsbury

% This package and the accompanying paper, LaTeX_for_Undergraduates.tex, can be 
% found on the website of Tennessee Technological University's math department. 

% This file was not generated from source code. 
% This software is contributed to the public domain. 
% It is not maintained.  

% Marking this file as a package
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mymacros}[2021/04/06 1.0 miscellaneous commands]

% This allows commands that use things from these packages to work even if we 
% haven't put them in \usepackage{} in the preamble. 
\RequirePackage{forloop, mathrsfs, mathtools, nicefrac, xcolor}
% Otherwise, we could list packages we often use to avoid having to include them 
% in the preamble of our tex files. 
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% In other words, the use of \usepackage{} for packages other than mymacros at the  *
% beginning of latexTutorial.tex is merely there for the sake of example. 		    *
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
\RequirePackage{amsmath, amsfonts, amssymb, amsthm, cancel, graphicx, verbatim}

% GENERAL COMMANDS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For <...> options in LaTeX_for_Undergraduates.tex
\newcommand*{\option}[1]{$\langle$\textit{#1}$\rangle$}

% Troubleshooting
\newcommand{\ee}{\end{enumerate}}
\newcommand{\ed}{\end{document}}

% LaTeX Workshop autocompletes \par to \paragraph{}, which gets annoying. 
\newcommand{\p}{\par}

% Horizontal separator with option to add label
\newcommand*{\hl}[1][\unskip]{%
	\noindent\textbf{#1} \\%
	\makebox{%
		\rule[1.5ex]{0.75\paperwidth}{0.8pt}%
	}%
}

% For nested environments with nothing on the first line of the outer environment
\newcommand*{\blankline}[1][1]{~\\\vspace{-#1\baselineskip}}

% \renewcommand overrides a command that has already been defined. 
% In the proof environment, \qedsymbol defaults to a white square. 
% I prefer a black square, so I change it here. 
\renewcommand{\qedsymbol}{$\blacksquare$}
% but these allow me to easily change it to other things
\newcommand{\whiteqed}{\renewcommand{\qedsymbol}{$\square$}}
\newcommand{\noqed}{\renewcommand{\qedsymbol}{}}

% Environments -----------------------------------------------------------------
% Creating \begin{...} \end{...} environments with a few defaults provided by 
% \newtheorem
% * removes numbering
% The first {} contains the name of the environment. 
% The second {} contains what will be displayed. 
\newtheorem{claim}{Claim} 	% numbered
\newtheorem*{claim*}{Claim} % not numbered
\newtheorem*{conjecture*}{Conjecture}
\newtheorem{corollary}{Corollary}
\newtheorem*{corollary*}{Corollary}
\newtheorem{lemma}{Lemma}
\newtheorem*{lemma*}{Lemma}
\newtheorem{note}{Note}
\newtheorem{problem}{Problem}
\newtheorem{proposition}{Proposition}
\newtheorem*{proposition*}{Proposition}
\newtheorem{theorem}{Theorem}
\newtheorem*{theorem*}{Theorem}

\theoremstyle{definition} 	% removes italics from the following
\newtheorem{case}{Case}
\newtheorem{definition}{Definition}
\newtheorem*{definition*}{Definition}
\newtheorem{example}{Example}
\newtheorem*{example*}{Example}
\newtheorem{nonexample}{Non-Example}
\newtheorem*{nonexample*}{Non-Example}
\newtheorem*{fact*}{Fact}
\newtheorem{notation}{Notation}
\newtheorem*{notation*}{Notation}

\theoremstyle{remark}		% italicized title, upright text for the following
\newtheorem{remark}{Remark}
% Proof environments with the technique specified
\newtheorem*{pfca}{Proof by Cases}
\newtheorem*{pfcd}{Proof by Contradiction}
\newtheorem*{pfco}{Proof (Combinatorial)}
\newtheorem*{pfcp}{Proof by Contrapositive}
\newtheorem*{pfd}{Proof (Direct)}
\newtheorem*{pfi}{Proof by Induction}

% Color-coded environments
\definecolor{darkpastelgreen}{rgb}{0.01, 0.75, 0.24}

\theoremstyle{plain} % adds italics to the following
\newtheorem*{cconjecture*}{\colorbox{orange}{Conjecture}}
\newtheorem{ccorollary}{\colorbox{orange}{Corollary}}
\newtheorem*{ccorollary*}{\colorbox{orange}{Corollary}}
\newtheorem{clemma}{\colorbox{orange}{Lemma}}
\newtheorem*{clemma*}{\colorbox{orange}{Lemma}}
\newtheorem{cnote}{\colorbox{blue}{Note}}
\newtheorem{cproposition}{\colorbox{pink}{Proposition}}
\newtheorem*{cproposition*}{\colorbox{pink}{Proposition}}
\newtheorem{ctheorem}{\colorbox{pink}{Theorem}}
\newtheorem*{ctheorem*}{\colorbox{pink}{Theorem}}

\theoremstyle{definition} % removes italics from the following
\newtheorem{ccase}{Case}
\newtheorem*{cfact*}{\colorbox{cyan}{Fact}}
\newtheorem{cexample}{\colorbox{darkpastelgreen}{Example}}
\newtheorem*{cexample*}{\colorbox{darkpastelgreen}{Example}}
\newtheorem{cnonexample}{\colorbox{darkpastelgreen}{Non-Example}}
\newtheorem*{cnonexample*}{\colorbox{red}{Non-Example}}
\newtheorem*{cremark*}{\colorbox{cyan}{Remark}}
%-------------------------------------------------------------------------------

% For inductive proof and recursive definitions
\newcommand{\bc}{\textbf{\underline{Base case}: }}
\newcommand{\ind}{\textbf{\underline{Induction step}: }}
\newcommand{\basis}{\textbf{\underline{Basis}: }}
\newcommand{\rec}{\textbf{\underline{Recursive step}: }}

% Ways to avoid \text{} in display-math
\newcommand{\as}{\text{ as}\ }
\newcommand{\countable}{\text{ countable}\ }
\newcommand{\each}{\text{ each}\ }
\newcommand{\et}{\text{ and}\ }
\newcommand{\for}{\text{ for}\ }
\newcommand{\some}{\text{ some}\ }
\newcommand{\fs}{\text{ for some}\ }
\newcommand{\on}{\text{ on}\ }
\newcommand{\ona}{\text{ on a}\ }
\newcommand{\ow}{\text{o/w}\ }			% otherwise
\newcommand{\st}{\text{s.t.}\ }			% such that
\newcommand{\mst}{\text{ s.t.}\ }		% math such that
\newcommand{\ou}{\text{ or}\ }
\renewcommand{\over}{\text{ over}\ }
\newcommand{\tms}{\text{ times}\ } 		% for \underbrace{...}_{n times}
\newcommand{\undef}{\text{undef.}\ }
\newcommand{\with}{\text{ with}\ }
\newcommand{\where}{\text{ where}\ }
\newcommand{\wrt}{\text{ with respect to}\ }

% Things to stack on =, <, \le, etc. 
\newcommand{\lh}{\stackrel{\text{\tiny L'H}}}	% L'Hôpital's Rule
\newcommand{\pf}{\stackrel{\text{\tiny PF}}}	% Pascal's Formula
\newcommand{\ti}{\stackrel{\text{\tiny TI}}}	% Triangle Inequality

% Black-board bold
\newcommand{\C}{\mathbb{C}} 	% complex numbers
\newcommand{\F}{\mathbf{F}}		% bold F
\newcommand{\N}{\mathbb{N}} 	% natural numbers
\newcommand{\bP}{\mathbb{P}}
\newcommand{\Q}{\mathbb{Q}} 	% etc.
\newcommand{\R}{\mathbb{R}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\Z}{\mathbb{Z}}

% Miscellaneous
\newcommand{\bs}{\boldsymbol}
\newcommand{\f}{\frac}			% \f{numerator}{denominator}
\newcommand{\inv}{^{-1}}
\newcommand*{\lcm}[1]{\mathrm{lcm}\left\{#1\right\}}	% least common multiple
\newcommand{\mbf}{\mathbf} 								% math bold face
\newcommand*{\ol}[1]{\overline{#1}}
\newcommand*{\ul}[1]{\underline{#1}}
\newcommand{\vn}{\varnothing}
\newcommand{\wt}{\widetilde}

% My notations
\newcommand*{\msum}[3]{\sum\limits_{#1=#2}^{#3}} 		% my sum
\newcommand*{\mprod}[3]{\prod\limits_{#1=#2}^{#3}}		% my prod
\newcommand*{\mcap}[3]{\cap_{#1=#2}^{#3}}				% etc.
\newcommand*{\mcup}[3]{\cup_{#1=#2}^{#3}}
\newcommand*{\mbcap}[3]{\bigcap\limits_{#1=#2}^{#3}}
\newcommand*{\mbcup}[3]{\bigcup\limits_{#1=#2}^{#3}}
\newcommand*{\mset}[4]{\left\{#1\right\}_{#2=#3}^{#4}}
% Default infinity for the upper bounds
\newcommand*{\msumi}[2]{\msum{#1}{#2}{\infty}}
\newcommand*{\mprodi}[2]{\mprod{#1}{#2}{\infty}}
\newcommand*{\mcapi}[2]{\mcap{#1}{#2}{\infty}}
\newcommand*{\mcupi}[2]{\mcup{#1}{#2}{\infty}}
\newcommand*{\mbcapi}[2]{\mbcap{#1}{#2}{\infty}}
\newcommand*{\mbcupi}[2]{\mbcup{#1}{#2}{\infty}}
\newcommand*{\mseti}[3]{\mset{#1}{#2}{#3}{\infty}}

\newcommand{\bcup}{\bigcup\limits}
\newcommand{\bcap}{\bigcap\limits}
\newcommand{\Int}{\int\limits}
\newcommand{\Prod}{\prod\limits}
\newcommand{\Sum}{\sum\limits}

% Package-specific
\newcommand{\nf}{\nicefrac} 				% nicefrac
\newcommand*{\cb}[2]{\colorbox{#1}{#2}} 	% xcolor
\newcommand*{\cbr}[1]{\colorbox{red}{#1}}
\newcommand{\cbg}{\cb{darkpastelgreen}}
\newcommand*{\cby}[1]{\colorbox{yellow}{#1}}
\newcommand*{\tc}[2]{\textcolor{#1}{#2}}
\newcommand*{\tcb}[1]{\textcolor{blue}{#1}}
\newcommand{\tcg}{\tc{darkpastelgreen}}
\newcommand*{\tcr}[1]{\textcolor{red}{#1}}
% math mode
\newcommand*{\mcb}[2]{\colorbox{#1}{$#2$}}
\newcommand*{\mcbr}[1]{\colorbox{red}{$#1$}}
\newcommand*{\mcby}[1]{\colorbox{yellow}{$#1$}}
\newcommand*{\mtc}[2]{\textcolor{#1}{$#2$}}
\newcommand*{\mtcb}[1]{\textcolor{blue}{$#1$}}
\newcommand*{\mtcr}[1]{\textcolor{red}{$#1$}}

%--------------------------------------------------------------------------
% Polish notation for responsive block delimiters
\newcommand*{\abs}[1]{\left\lvert#1\right\rvert}		% absolute value
\newcommand*{\ceil}[1]{\left\lceil#1\right\rceil}		% ceiling
\newcommand*{\floor}[1]{\left\lfloor#1\right\rfloor}	% floor
\newcommand*{\mang}[1]{\left<#1\right>} 				% my angle bracket
\newcommand*{\mbrack}[1]{\left[#1\right]}				% my bracket
\newcommand*{\mpar}[1]{\left(#1\right)}					% my parentheses
\newcommand*{\norm}[1]{\left\lVert#1\right\rVert}		% norm

% \Mid is a very useful extensible \mid from the mathtools documentation 
% (originally \given)
% just to make sure it exists
\providecommand\Mid{}
% can be useful to refer to this outside \set
\newcommand\SetSymbol[1][]{%
	\nonscript\:#1\vert%
	\allowbreak%
	\nonscript\:%
	\mathopen{}%
}
\DeclarePairedDelimiterX{\set}[1]\{\}{%
	\renewcommand\Mid{\SetSymbol[\delimsize]}%
	#1%
}
%-------------------------------------------------------------------------

% ALGEBRAIC GEOMETRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\V}{\mathbf{V}}
\newcommand{\I}{\mathbf{I}}
\newcommand{\Va}{\V_a}
\newcommand{\Ia}{\I_a}
\newcommand*{\VaI}[1]{\V_a(\I(#1))}
\newcommand*{\IaV}[1]{\I_a(\V(#1))}
\newcommand*{\VI}[1]{\V(\I(#1))}
\newcommand*{\IV}[1]{\I(\V(#1))}

% Polynomial rings
\newcommand{\kx}{k[x]}
\newcommand{\ky}{k[y]}
\newcommand{\kz}{k[z]}
\newcommand{\kxy}{k[x,y]}
\newcommand{\kxz}{k[x,z]}
\newcommand{\kyz}{k[y,z]}
\newcommand{\kxyz}{k[x,y,z]}
\newcommand{\ring}{k[x_1,\dots,x_n]}
\newcommand{\ringz}{k[x_0,\dots,x_n]}
\newcommand{\Izero}{\left<x_0,\dots,x_n\right>}

% Polynomial rings over projective space
\newcommand*{\pring}[2]{\bP^{#1}(#2)}
\newcommand{\ptwok}{\bP^2(k)}
\newcommand{\pnk}{\bP^n(k)}
\newcommand{\poner}{\bP^1(\R)}
\newcommand{\ptwor}{\bP^2(\R)}
\newcommand{\pthr}{\bP^3(\R)}
\newcommand{\pnr}{\bP^n(\R)}

\newcommand{\gln}{\mathrm{GL}(n,k)}
\newcommand{\lm}{\mathrm{LM}}		% leading monomial
\newcommand{\lt}{\mathrm{LT}}		% leading term
\newcommand{\lc}{\mathrm{LC}}		% leading coefficient
\newcommand{\md}{\mathrm{multideg}}	% degree for multivariate polynomial

% CALCULUS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\A}{\mathscr{A}}			% an algebra of functions
\newcommand{\va}{\scalebox{1.5}{$a$}} 	% variation of \A
\newcommand{\B}{\mathcal{B}}
\newcommand{\ab}{[a,b]}
\newcommand{\oo}{[0,1]}
\newcommand{\ar}{\mathscr{R}}
\newcommand{\ara}{\mathscr{R}(\alpha)}
\newcommand{\bdd}{bounded\ }
\newcommand{\diam}{\mathrm{diam}\ }
\newcommand{\ef}{\mathscr{F}}
\newcommand{\fsc}{finite subcover\ }
\renewcommand{\L}{\mathscr{L}}
\newcommand{\U}{\mathscr{U}}
\newcommand{\stanset}{\mseti{f_n(x)}{n}{1}}

% Linear algebra
\newcommand{\boldf}{\bs{\mathrm{f}}}
\newcommand{\Cdot}{\bs{\cdot}}
\newcommand*{\mvec}[1]{\bs{\mathrm{#1}}}	% my vector
\newcommand{\e}{\bs{\mathrm{e}}}
\newcommand{\h}{\bs{\mathrm{h}}}
\newcommand{\x}{\bs{\mathrm{x}}}
\newcommand{\y}{\bs{\mathrm{y}}}
\newcommand{\z}{\bs{\mathrm{z}}}
\newcommand{\vf}{\vec{f}}
\newcommand{\vfp}{\vec{f'}}
\newcommand{\vphi}{\vec{\phi}}

% Greek letters
\renewcommand{\a}{\alpha}
\renewcommand{\b}{\beta}
\newcommand{\D}{\Delta}
\newcommand{\Da}{\Delta\alpha}
\newcommand{\Dx}{\Delta x}
\newcommand{\ve}{\varepsilon}
\newcommand{\vp}{\varphi}

% Limits
\newcommand*{\mlim}[1]{\lim\limits_{#1}} 	% my limit
\newcommand{\Lim}{\lim\limits}
\newcommand{\limi}{\ul{\Lim}\ } 			% liminf
\newcommand{\lims}{\ol\Lim\ } 				% limsup
\newcommand{\Max}{\max\limits}
\newcommand{\Min}{\min\limits}

\newcommand{\Inf}{\inf\limits}
\newcommand{\Sup}{\sup\limits}
\newcommand*{\minf}[1]{\Inf_{#1}}
\newcommand*{\msup}[1]{\Sup_{#1}}

\newcommand*{\mto}[2]{#1\to#2} 				% my to
\newcommand*{\mtoi}[1]{\mto{#1}{\infty}}
\newcommand{\nti}{\mtoi{n}}
\newcommand{\ttx}{\mto{t}{x}}
\newcommand{\xti}{\mtoi{x}}

\newcommand{\pto}{\xrightarrow{\text{\tiny PW}}} 	% pointwise convergence
\newcommand{\uto}{\xrightarrow{\text{unif}}} 		% uniform convergence

% Derivatives
\newcommand{\sd}{\partial} 		% stylized (cursive) d

\newcommand*{\dif}[1]{\,d#1}
\newcommand{\da}{\,d\alpha}
\newcommand{\dx}{\,dx}
\newcommand{\dy}{\,dy}
\newcommand{\dz}{\,dz}
\newcommand{\dxy}{\,dxdy}
\newcommand{\dxz}{\,dxdz}
\newcommand{\dyz}{\,dydz}
\newcommand{\dxyz}{\,dxdydz}
\newcommand{\dt}{\,dt}
\newcommand{\du}{\,du}
\newcommand{\dv}{\,dv}

\newcommand*{\dd}[2]{\f{d#1}{d#2}}
\newcommand*{\mdd}[2]{\f{d^{#1}}{d#2^{#1}}}
\newcommand{\ddx}{\f{d}{dx}}
\newcommand{\ddy}{\f{d}{dy}}
\newcommand{\ddz}{\f{d}{dz}}
\newcommand{\del}{\partial}
\newcommand*{\mpart}[2]{\f{\partial#1}{\partial#2}}
\newcommand*{\partx}[1]{\f{\partial#1}{\parial x}}
\newcommand*{\party}[1]{\f{\partial#1}{\partial y}}
\newcommand*{\partz}[1]{\f{\partial#1}{\partial z}}
\newcommand{\Del}{\nabla}

% Integrals
\newcommand*{\mint}[2]{\int\limits_{#1}^{#2}} 		% my integral
\newcommand{\mab}{\mint{a}{b}}
\newcommand*{\lint}[2]{\mint{\underline{#1}}{#2}} 	% lower Rieman integral
\newcommand{\lab}{\lint{a}{b}}
\newcommand*{\uint}[2]{\mint{#1}{\ol{#2}}} 			% upper
\newcommand{\uab}{\uint{a}{b}}

\newcommand*{\dint}[2]{\displaystyle\int_{#1}^{#2}} % display integral (no \limits)
\newcommand{\dab}{\dint{a}{b}}
\newcommand*{\dlint}[2]{\dint{\underline{#1}}{#2}}
\newcommand{\dlab}{\dlint{a}{b}}
\newcommand*{\duint}[2]{\dint{#1}{\ol{#2}}}
\newcommand{\duab}{\duint{a}{b}}

\newcommand*{\Lint}[2]{\int\limits_{\underline{#1}}^{#2}}
\newcommand{\Lab}{\Lint{a}{b}}
\newcommand*{\Uint}[2]{\int\limits_{#1}^{\ol{#2}}}
\newcommand{\Uab}{\Uint{a}{b}}

% Default upper bound of infinity
\newcommand*{\dinti}[1]{\dint{#1}{\infty}} 		% display integral (no \limits)
\newcommand*{\minti}[1]{\mint{#1}{\infty}}

\newcommand{\pint}{\mint{0}{1}} 				% probability integral
\newcommand{\piint}{\mint{0}{1}\mint{0}{1}}
\newcommand{\piiint}{\mint{0}{1}\mint{0}{1}\mint{0}{1}}
\newcommand{\dpint}{\dint{0}{1}}
\newcommand{\dpiint}{\dint{0}{1}\dint{0}{1}}
\newcommand{\dpiiint}{\dint{0}{1}\dint{0}{1}\dint{0}{1}}

% GEOMETRY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\ang}{\measuredangle}
\newcommand{\dg}{^\circ}
\newcommand{\lin}[1]{\overleftrightarrow{#1}}
\newcommand{\ray}[1]{\overrightarrow{#1}}
\newcommand{\seg}[1]{\overline{#1}}
\newcommand{\sq}{\square}
\newcommand{\tr}[1]{\triangle{#1}}

% LINEAR ALGEBRA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Col}{\mathrm{Col}}
\newcommand{\Ell}{\mathcal{L}}
\newcommand{\Null}{\mathrm{Null}}
\newcommand{\Pol}{\mathcal{P}}
\newcommand{\rank}{\mathrm{rank}}
\newcommand{\Row}{\mathrm{Row}}
\newcommand{\spn}{\mathrm{span}}
% row vectors
\newcommand*{\onevec}[1]{\left[\begin{matrix}\hfill#1\end{matrix}\right]}
\newcommand*{\twovec}[2]{\left[\begin{matrix}\hfill#1\\\hfill#2\end{matrix}\right]}
\newcommand*{\threevec}[3]{\left[\begin{matrix}\hfill#1\\\hfill#2\\\hfill#3\end{matrix}\right]}
\newcommand*{\fourvec}[4]{\left[\begin{array}{c}#1\\#2\\#3\\#4\end{array}\right]}
\newcommand*{\fivevec}[5]{\left[\begin{matrix}\hfill#1\\\hfill#2\\\hfill#3\\\hfill#4\\\hfill#5\end{matrix}\right]}
\newcommand*{\twovecex}[2]{\left[\begin{matrix}\hfill#1\\[0.5ex]\hfill#2\end{matrix}\right]}
\newcommand*{\threevecex}[3]{\left[\begin{matrix}\hfill#1\\[0.5ex]\hfill#2\\[0.5ex]\hfill#3\end{matrix}\right]}
\newcommand*{\fourvecex}[4]{\left[\begin{matrix}\hfill#1\\[0.5ex]\hfill#2\\[0.5ex]\hfill#3\\[0.5ex]\hfill#4\end{matrix}\right]}
% centered column vectors
\newcommand*{\onevecc}[1]{\left[\begin{matrix}#1\end{matrix}\right]}
\newcommand*{\twovecc}[2]{\left[\begin{matrix}#1\\#2\end{matrix}\right]}
\newcommand*{\threevecc}[3]{\left[\begin{matrix}#1\\#2\\#3\end{matrix}\right]}
\newcommand*{\fourvecc}[4]{\left[\begin{matrix}#1\\#2\\#3\\#4\end{matrix}\right]}
\newcommand*{\fivevecc}[5]{\left[\begin{matrix}#1\\#2\\#3\\#4\\#5\end{matrix}\right]}
\newcommand*{\threeveccex}[3]{\left[\begin{matrix}#1\\[0.5ex]#2\\[0.5ex]#3\end{matrix}\right]}
\newcommand*{\fourveccex}[4]{\left[\begin{matrix}#1\\[0.5ex]#2\\[0.5ex]#3\\[0.5ex]#4\end{matrix}\right]}
% row vectors
\newcommand*{\onerowvec}[1]{\left[\begin{matrix}\hfill#1\end{matrix}\right]}
\newcommand*{\tworowvec}[2]{\left[\begin{matrix}\hfill#1&\hfill#2\end{matrix}\right]}
\newcommand*{\threerowvec}[3]{\left[\begin{matrix}\hfill#1&\hfill#2&\hfill#3\end{matrix}\right]}
\newcommand*{\fourrowvec}[4]{\left[\begin{matrix}\hfill#1&\hfill#2&\hfill#3&\hfill#4\end{matrix}\right]}
\newcommand*{\fiverowvec}[5]{\left[\begin{matrix}\hfill#1&\hfill#2&\hfill#3&\hfill#4&\hfill#5\end{matrix}\right]}
% n-tuples
\newcommand*{\onetuple}[1]{(#1)}
\newcommand*{\twotuple}[2]{(#1,#2)}
\newcommand*{\threetuple}[3]{(#1,#2,#3)}
\newcommand*{\fourtuple}[4]{(#1,#2,#3,#4)}
\newcommand*{\fivetuple}[5]{(#1,#2,#3,#4,#5)}
\newcommand*{\ntuple}[2]{(#1_1,\ldots,#1_#2)}
\newcommand*{\listz}[2]{#1_0,\ldots,#1_#2}
\newcommand*{\listo}[2]{#1_1,\ldots,#1_#2}
% square numeric matrices
\newcommand*{\onebyone}[1]{\left[\begin{matrix}\hfill#1\end{matrix}\right]}
\newcommand*{\twobytwo}[4]{\left[\begin{matrix}\hfill#1&\hfill#2\\\hfill#3&\hfill#4\end{matrix}\right]}
\newcommand*{\threebythree}[9]{\left[\begin{matrix}\hfill#1&\hfill#2&\hfill#3\\\hfill#4&\hfill#5&\hfill#6\\\hfill#7&\hfill#8&\hfill#9\end{matrix}\right]}
% square numeric determinants
\newcommand*{\onebyonev}[1]{\begin{vmatrix}#1\end{vmatrix}}
\newcommand*{\twobytwov}[4]{\begin{vmatrix}#1&#2\\#3&#4\end{vmatrix}}
\newcommand*{\threebythreev}[9]{\begin{vmatrix}#1&#2&#3\\#4&#5&#6\\#7&#8&#9\end{vmatrix}}
% augmented matrices
\newcommand*{\augmented}[2]{\left[#1\mid#2\right]}
\newcommand*{\augtwo}[2]{\left[\begin{array}{r|r}#1&#2\end{array}\right]}
% \newcommand*{\augtwo}[2]{\left[#1\mid#2\right]}
\newcommand*{\augthree}[3]{\left[\begin{array}{r|r|r}#1&#2&#3\end{array}\right]}
\newcommand*{\augfour}[4]{\left[\begin{array}{r|r|r|r}#1&#2&#3&#4\end{array}\right]}
%--------------------------------------------------------------------------
% column vectors with row separation
\newcommand*{\fourvectorchline}[4]{\left[\begin{array}{ccc}&#1&\\[0.5ex]\hline&#2&\\[0.5ex]\hline&#3&\\[0.5ex]\hline&#4\end{array}\right]}

% LOGIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% contradiction
\newcommand{\contra}{\ensuremath{\rightarrow\mspace{-2.5mu}\leftarrow}}
\newcommand{\ex}{\exists}
\newcommand{\fa}{\;\forall}
% forward implication
\newcommand{\fim}{%
	$\bs(%
		\mspace{-10.5mu}%
			\bs\implies%
		\mspace{-12mu}%
	\bs)$\ %
}
% backward implication
\newcommand{\bim}{$\bs(\mspace{-12mu}\bs\impliedby\mspace{-10.5mu}\bs)$\ }
\newcommand{\sland}{\;\land\;} 		% space logical and
\newcommand{\slor}{\,\lor\, }		% space logical or
\newcommand{\tf}{\therefore\,}		% I sometimes prefer a little space after this. 

\newcommand{\bij}{\leftrightarrow}		% bijection
\newcommand{\varbij}{\hookrightarrow\hspace{-8pt}\rightarrow}
\newcommand{\inj}{\rightarrowtail}		% one-to-one
\newcommand{\varinj}{\hookrightarrow}
\newcommand{\onto}{\twoheadrightarrow}
\newcommand{\Ra}{\Rightarrow}		% short implies
\newcommand{\ra}{\rightarrow}		% alternate implication

\newcommand*{\mneg}[1][1]{			% my (alternative) negation
	\mspace{-5mu}% 
	\setcounter{i}{0}%
	\forloop{i}{0}{\value{i}<#1}%
	{%
		\sim%
	}%
	\mspace{-5mu}%
}
\newcommand{\n}{\neg}				% negation
\newcommand{\s}{\sim\mspace{-5mu}}	% alternative negation
\newcommand{\vd}{\vdash}			% proves
\newcommand{\vdd}{\vDash}			% satisfies

\newcommand{\nec}{\scalebox{0.75}{$\square$}}		% necessarily
\newcommand{\poss}{\scalebox{1.25}{$\diamond$}}		% possibly

\newcommand{\fA}{\mathfrak{A}}
\newcommand{\fB}{\mathfrak{B}}
\newcommand{\fN}{\mathfrak{N}}
\newcommand{\is}{\text{ is }}
\newcommand{\isnt}{\text{ is not }}
\newcommand{\IFF}{\text{ iff }}
\newcommand{\sbar}{\ol{s}}

% Ditto marks and for loops
%====================================================================================
% ditto
\newcommand{\dit}{%
	\quad\scalebox{0.75}{\ensuremath{\prime\prime}}\quad%
}
\newcommand{\ditt}{\dit\dit}
\newcommand{\dittt}{\ditt\dit}
\newcommand{\ditttt}{\ditt\ditt}
% sparse ditto
\newcommand{\sdit}{\qquad\scalebox{0.75}{\ensuremath{\prime\prime}}\qquad}
\newcommand{\sditt}{\sdit\sdit}
\newcommand{\sdittt}{\sditt\sdit}
\newcommand{\sditttt}{\sditt\sditt}
% dense ditto
\newcommand{\ddit}{$\mspace{9mu}$\scalebox{0.75}{\ensuremath{\prime\prime}}$\mspace{9mu}$}
\newcommand{\dditt}{\ddit\ddit}
\newcommand{\ddittt}{\dditt\ddit}
\newcommand{\dditttt}{\dditt\dditt}

\newcounter{i}
\newcommand*{\mdit}[1][1]{% my ditto; invoked as \mdit[n] for n ditto marks
	\forloop{i}{0}{\value{i} < #1}%
	{%
		\dit%
	}%
}
% my sparse ditto
\newcommand*{\msdit}[1][1]{\forloop{i}{0}{\value{i}<#1}{\sdit}}
% my dense ditto
\newcommand*{\mddit}[1][1]{\forloop{i}{0}{\value{i}<#1}{\ddit}}

% VERSE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\attrib}[1]{\nopagebreak{\raggedleft\footnotesize #1\par}}