\documentclass{article}
\usepackage{lineno,hyperref,bm,amsmath}

\usepackage[numbers]{natbib}

\usepackage{pdflscape} % provides the landscape environment

\usepackage{graphicx}  %	for images
\usepackage{subcaption}%	for subfigures
%\usepackage{braket}    %	for math set notation

\usepackage{titling}

\usepackage{minted}

\usepackage{geometry}
\geometry{letterpaper, margin=1.1in}

\usepackage{enumitem}

\setlength{\droptitle}{-10em}   % This is your set screw

%	begin footnote issues with hyperref
\newcommand{\footlabel}[2]{%
    \addtocounter{footnote}{1}%
    \footnotetext[\thefootnote]{%
        \addtocounter{footnote}{-1}%
        \refstepcounter{footnote}\label{#1}%
        #2%
    }%
    $^{\ref{#1}}$%
}

\newcommand{\footref}[1]{%
    $^{\ref{#1}}$%
}
%	end footnote issues with hyperref

%\bibliographystyle{plainnat}
\bibliographystyle{elsarticle-num-names}

%%	elsarticle-num-names breaks hyperref with dois, it's a bug, work arround
\makeatletter
\providecommand{\doi}[1]{%
  \begingroup
    \let\bibinfo\@secondoftwo
    \urlstyle{rm}%
    \href{http://dx.doi.org/#1}{%
      doi:\discretionary{}{}{}%
      \nolinkurl{#1}%
    }%
  \endgroup
}
\makeatother

\title{EML4930/EML6934 | Python Programming | Fall 2017 \\ 1 Credit | Thursday 10:40 - 11:30 |  Room: MAE-A 303}

\author{Instructor: Charles Jekel  |  cjekel@ufl.edu  |  \url{http://jekel.me} \\
 Office hours: Tuesday 9:00 - 11:00 or by appointment (MAE-A 224) \\ \\
 TA: Victor Lin | vlin@ufl.edu | Office hours: Thursday 1:30 - 3:30 pm (MAE-A 224) %	Your Company / University  \\
%	\and
%	The Other Dude \\
%	His Company / University \\
}

\date{\today}
% Hint: \title{what ever}, \author{who care} and \date{when ever} could stand
% before or after the \begin{document} command
% BUT the \maketitle command MUST come AFTER the \begin{document} command!
\begin{document}

\maketitle

\section{Course description}
Python is a general purpose programming language. Course covers the basics, linear algebra, plotting, and more to prepare students for solving numerical problems with Python. Python is a viable \textbf{free} and \textbf{open} alternative to MATLAB. Prerequisite: COP 2271 MATLAB or equivalent.

\section{Course prerequisites}
Students should have taken some type of intro to programming course before (COP 2271 MATLAB or equivalent).

\section{Required resources}
Computer and internet connection.

\section{Grading policy}
No late homework. Two homeworks dropped. A homework will be assigned at the end of every lecture related to the topic of the lecture.
\begin{itemize}
\item 12 out of 14 homework | 60~\% of final grade
\item 2 quizzes | 10~\% of final grade
\item 1 final exam | 30~\% of final grade
\end{itemize}

\begin{table}[h!]
\centering
%\caption{Letter grade scheme}
\begin{tabular}{ c l c }
\noalign{\smallskip}
 \% & Grade & Grade Points\\
\noalign{\smallskip}\hline\noalign{\smallskip}
93.4 - 100  & A  & 4.00 \\
90.0 - 93.3 & A- & 3.67 \\
86.7 - 89.9 & B+ & 3.33 \\
83.4 - 86.6 & B  & 3.00 \\
80.0 - 83.3 & B- & 2.67 \\
76.7 - 79.9 & C+ & 2.33 \\
73.4 - 76.6 & C  & 2.00 \\
70.0 - 73.3 & C- & 1.67 \\
66.7 - 69.9 & D+ & 1.33 \\
63.4 - 66.6 & D  & 1.00 \\
60.0 - 63.3 & D- & 0.67 \\
0.00 - 59.9 & E  & 0.00 \\
 \hline
\end{tabular}
\end{table}

\section{Tentative outline}
\setlist[enumerate,1]{start=0}
\begin{enumerate}
\item 08/24 About Python (2 vs 3), IDEs, IPython\footnote{IPython provides a rich architecture for interactive computing with Python. \url{https://ipython.org/}}, notebooks, and installation
\item 08/31 Basics: data types, math, loops
\item 09/07 Functions, classes, objects, namespace
\item 09/14 Python libraries and pip
\item 09/21 Numpy\footnote{NumPy is the fundamental package for scientific computing with Python. \url{http://www.numpy.org/}\label{note1}} and Matrix operations
\item 09/28 More Numpy\footref{note1} and Matplotlib\footnote{Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. \url{https://matplotlib.org/}\label{note3}} for 2D plots (\textbf{First quiz 15 mins before end of class})
\item 10/05 Contour plots, 3D plot, Histograms
\item 10/12 Statistical distributions and functions
\item 10/19 Optimization in Scipy\footnote{SciPy is a Python-based ecosystem of open-source software for mathematics, science, and engineering. \url{https://www.scipy.org/}\label{note2}}
\item 10/26 Python read and write: opening and modifying text/csv files
\item 11/02 Symbolic math with SymPy\footnote{SymPy is a Python library for symbolic mathematics. \url{http://www.sympy.org}}, DOE with pyDOE (\textbf{Second quiz 15 mins before end of class})
\item 11/09 Scikit-learn\footnote{Machine Learning in Python. \url{http://scikit-learn.org}\label{note4}} surrogate modeling
\item 11/16 Scikit-learn\footref{note4}: surrogate modeling and machine learning
\item 11/30 Pandas\footnote{\textit{pandas} is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. \url{http://pandas.pydata.org/}} and DataFrames / Review for final
\item 12/11 Final Exam (same time same room)
\end{enumerate}

\section{UF policy}
\textbf{UNIVERSITY POLICY ON ACCOMMODATING STUDENTS WITH DISABILITIES}: Students requesting accommodation for disabilities must first register with the Dean of Students Office (\url{http://www.dso.ufl.edu/drc/}). The Dean of Students Office will provide documentation to the student who must then provide this documentation to the instructor when requesting accommodation. You must submit this documentation prior to submitting assignments or taking the quizzes or exams. Accommodations are not retroactive, therefore, students should contact the office as soon as possible in the term for which they are seeking accommodations.

\textbf{UNIVERSITY POLICY ON ACADEMIC MISCONDUCT}:  Academic honesty and integrity are fundamental values of the University community. Students should be sure that they understand the UF Student Honor Code at \url{http://www.dso.ufl.edu/students.php}.

\textbf{COURSE EVALUATION}
Students are expected to provide feedback on the quality of instruction in this course by completing online evaluations at \url{https://evaluations.ufl.edu/evals}.  Evaluations are typically open during the last two or three weeks of the semester, but students will be given specific times when they are open. Summary results of these assessments are available to students at \url{https://evaluations.ufl.edu/results/}.

\textbf{STUDENT PRIVACY}
There are federal laws protecting your privacy with regards to grades earned in courses and on individual assignments.  For more information, please see:  \url{http://registrar.ufl.edu/catalog0910/policies/regulationferpa.html}

\section{Campus resources}
\textbf{U Matter, We Care:}
Your well-being is important to the University of Florida.  The U Matter, We Care initiative is committed to creating a culture of care on our campus by encouraging members of our community to look out for one another and to reach out for help if a member of our community is in need.  If you or a friend is in distress, please contact umatter@ufl.edu so that the U Matter, We Care Team can reach out to the student in distress.  A nighttime and weekend crisis counselor is available by phone at 352-392-1575.  The U Matter, We Care Team can help connect students to the many other helping resources available including, but not limited to, Victim Advocates, Housing staff, and the Counseling and Wellness Center.  Please remember that asking for help is a sign of strength.  In case of emergency, call 9-1-1.

\textbf{Counseling and Wellness Center:} \url{http://www.counseling.ufl.edu/cwc}, and  392-1575; and the University Police Department: 392-1111 or 9-1-1 for emergencies.

\textbf{Sexual Assault Recovery Services (SARS)}
Student Health Care Center, 392-1161.

\textbf{University Police Department} at 392-1111 (or 9-1-1 for emergencies), or http://www.police.ufl.edu/.

\section{Additional resources}
For those that would like a textbook to follow, I'd recommend Dr. Jake VanderPlas's \textit{Python Data Science Handbook: Essential Tools for Working with Data}. \url{http://shop.oreilly.com/product/0636920034919.do}. Dr. VanderPlas has made the textbook available for free in the form of Jupyter notebooks which can be viewed at \url{https://github.com/jakevdp/PythonDataScienceHandbook} or \url{http://nbviewer.jupyter.org/github/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/Index.ipynb}

\textit{A whirlwind Tour of Python} by Dr. VanderPlas is a short book to prepare users with the bare essentials for working with Python. It is also available for free at \url{http://www.oreilly.com/programming/free/files/a-whirlwind-tour-of-python.pdf} or \url{https://github.com/jakevdp/WhirlwindTourOfPython}

Important links:
\begin{itemize}
\item Python main website \url{https://Python.org}
\item Anaconda download \url{https://www.continuum.io/downloads}
\item Enthought Canopy download \url{https://store.enthought.com/downloads/}
\item Write Python 2.7 and 3.X code \url{http://python-future.org/imports.html}
\end{itemize}

If you are coming from MATLAB:
\begin{itemize}
\item \url{http://mathesaurus.sourceforge.net/matlab-numpy.html}
\item \url{https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html}
\end{itemize}

%The costs to run the course can be kept small. I'd be willing to run the lecture recording by myself In order to reduce the costs of the course

%Python is much more than a scripting language. With the inclusion of NumPy, SciPy, and Matplotlib Python becomes a powerful numerical analysis tool applicable to many researchers. Python can be used to perform matrix operations, numerical analysis, statistics, big data operations, regression, surrogate modeling, machine learning, and much more. The widespread popularity of Python has created a plethora of libraries that graduate students will find useful, ranging from commercial software APIs to the state-of-the-art deep learning libraries.

%\noindent
%I use Python extensively in my research because
%\begin{itemize}
%\item Python is a powerful programming language which I use
%\item a great alternative to Matlab for research because of
%\item has a beautiful simple syntax
%\end{itemize}
%%(a) it is a great scripting language that I use to … (b) I use it instead fo Matlab because it is free even when I am not connected to the university, I do not run into snags because of limited number of licenses as some of the grad students in a course I have taken had (c) ???
%
%\noindent
%I would like to teach a one-credit special graduate course on Python because
%\begin{itemize}
%\item I know that Python will help many other MAE grad students
%\item there are few alternative opportunities
%\item Learning a language is always easier with some guidance
%\item I would like to gain teaching experience
%\end{itemize}
%%: (a) I know that Python can help many other MAE grad students; (b) teaching is a great way to deepen my knowledge; (c) I would like to get teaching experience.
%
%\noindent
%The course will prepare students for
%\begin{itemize}
%\item Python installation and scientific libraries
%\item Basic syntax and data types
%\item Functions and objects
%\item Data manipulation
%\item Numerical and statistical analysis including: linear algebra, matrix operations, regression, and more
%\end{itemize}
%The course will cover the basic usage of Python. Students will learn how to use Python to perform basic numerical analysis. Various linear algebra problems and statistical problems will be solved throughout the duration of the course. The students will learn how to install and use new Python libraries.

%\section{Why Python?}
%
%Python is powerful scripting language, a complete object-oriented programming language, and extremely powerful for researches who perform numerical work. In 2016 IEEE SPECTRUM rated Python as the third most popular programming language, behind Java and C. However despite Python's popularity, there are zero courses being offered at UF in Fall 2017 with Python as a keyword or title. Additionally the overall knowledge and awareness of Python in the MAE department is sparse. The proposed course on numerical analysis with Python aims to fill a void in the MAE department by demonstrating to graduate students how they can take advantage of what Python has to offer.
%
%Python interfaces are provided by many software packaged that are popular within the MAE department. Notable software packages include the popular FEA program Abaqus or LAMMPS the popular molecular dynamics simulator. However there are many other software packages relevant to the MAE department that include tools for the Python language (HyperMesh, MSC Marc, and more). These Python interfaces and libraries may help streamline and automate many tedious research tasks for graduate students!
%
%Python is much more than a scripting language. With the inclusion of NumPy, SciPy, and Matplotlib Python becomes a powerful numerical analysis tool applicable to many researchers. Python can be used to perform matrix operations, numerical analysis, statistics, big data operations, regression, surrogate modeling, machine learning, and much more. The widespread popularity of Python has created a plethora of libraries that graduate students will find useful, ranging from commercial software APIs to the state-of-the-art deep learning libraries.
%
%The combination of Raspberry Pi's and Python provide a cheap personal computing experience that has never before existed. Students can use the combination to create custom prototypes and test benches for a variety of applications. Projects can include any custom hardware/software interaction with applications from facial detection, home automation, to mechanical/thermo fluid test benches.
%
%\section{Intended Audience}
%The intended audience will be Graduate students whose research involves the use of numerical and statistical analysis. Students will be expected to have a strong mathematical background in linear algebra, numerical methods, and statistics. Ideally the student is looking to incorporate Python into their research projects. The audience can be summarized by the following list:
%
%\begin{itemize}
%\item Graduate students with strong statistical and numerical background
%\item Programming experience (MATLAB preferred)
%\item Research or interest in: numerical and statistical analysis, regression, surrogate modeling, optimization, scripting, and machine learning
%\end{itemize}
%
%\section{Course Outline}
%
%The course will cover the basic usage of Python. Students will learn how to use Python to perform basic numerical analysis. Various linear algebra problems and statistical problems will be solved throughout the duration of the course. The students will learn how to install and use new Python libraries. The last topic of the course will include the installation and use of state-of-the-art deep learning libraries available in Python. The course will end with a four week individual student project, where the students will have an opportunity to apply their newly established understanding of Python to their own research problem. An estimated sixteen week course outline is provided below:
%\begin{enumerate}
%\item Python installation and basics
%\item Ways to use Python: IDEs, iPython, notebooks
%\item Basics: data types, loops, classes, objects
%\item Python read and write: opening and modifying text/csv files
%\item Numpy, Scipy, and Matplotlib
%\item Matrix operations
%\item Linear regression
%\item Statistical distributions and functions
%\item Optimization
%\item Python libraries and pip
%\item Sci-kit learn: surrogate modeling
%\item Keras: Deep-learning with Theano or TensorFlow
%\item Student project
%\item Student project
%\item Student project
%\item Student project
%\end{enumerate}
%
%\section{Expected Outcomes}
%
%It is expected that the student will learn a basic understanding of the Python programming language and be capable of implementing Python into their research. Students will become familiar with popular Python numerical and statistical libraries. An important aspect of Python is the numerous libraries available, and it will be expected that student know how to install libraries, read documentation, and implement Python libraries. The summarized outcomes include:
%\begin{itemize}
%\item Basic understanding of Python language
%\item Apply Python to solve numerical analysis, statistical, and linear algebra problems
%\item Independently install and apply new Python libraries
%\end{itemize}
%
%\section{About the instructor}
%Charles (CJ) Jekel is a PhD Student who does everything in Python. His research looks at using statistical and numerical methods to better calibrate parameters for highly complex flexible composite/membrane materials. CJ's Python experiences include creating automated FE meshers, running expensive HPC non-linear FE optimizations, various regression modeling, twitter bots, and even hacking his own online dating profile. His motivation for creating this course is simply to demonstrate how Python can be useful in the research of fellow graduate students.

\end{document}


% % % % % % % %
% % % % % % % %
%IMPORTANT
%compiles with
%pdflatex -shell-escape
%IMPORTANT
% % % % % % % %
% % % % % % % %
%On windows: comment out the line \input{../system-specific-config-Ubuntu-texlive}
\documentclass%
[handout]%
{beamer}
%IMPORTANT: the following line selects the current lecture. Change number to select a different lecture.
\newcommand{\currentLecture}{3}
\newcommand{\semester}{Summer 2017}
\input{../example-templates}
\input{../system-specific-config-Ubuntu-texlive} %
\input{../pstricks-commands}
\usepackage{truncate}
\renewcommand{\Arcsin}{\arcsin}
\renewcommand{\Arccos}{\arccos}
\renewcommand{\Arctan}{\arctan}
\renewcommand{\Arccot}{\text{arccot\hspace{0.03cm}}}
\renewcommand{\Arcsec}{\text{arcsec\hspace{0.03cm}}}
\renewcommand{\Arccsc}{\text{arccsc\hspace{0.03cm}}}

\mode<presentation>
{
\useinnertheme{rounded}
\useoutertheme{infolines}
\usecolortheme{orchid}
\usecolortheme{whale}
}
%\setbeamertemplate{footline}{%
%  \raisebox{5pt}{\makebox[\paperwidth]{\hfill\makebox[10pt]{\scriptsize\insertframenumber}}}}

% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.

\graphicspath{{../../modules/}}

\newcommand{\lect}[4]{
\ifnum#3=\currentLecture
  \date{#1}
  \lecture[#1]{#2}{#3}
#4
\else
%include nothing
\fi
}

\setbeamertemplate{headline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}{\insertsectionhead}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}{\insertsubsectionhead}
  \end{beamercolorbox}%
\begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,center]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertframenumber/\inserttotalframenumber
  \end{beamercolorbox}
}
}
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}
  \end{beamercolorbox}}%
  \vskip0pt%
}

\setbeamertemplate{navigation symbols}{}

% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

%\pgfdeclareimage[height=0.8cm]{logo}{bluelogo}
%\logo{\pgfuseimage{logo}}

\AtBeginLecture{%

\title[\textbf{\color{green}{\insertlecture}}]{\hspace{-1.3cm} {\raisebox{-0.7cm}[0cm][0cm]{ \includegraphics[height =1.2cm]{../University-Logos/UMass-logo-blue.png}}} Math 141, Calculus II \\ \textbf{\color{green}{ \insertlecture}} }

\author[\raisebox{-0.115cm}{\includegraphics[height=0.4cm]{../University-Logos/UMass-logo-blue.png}} Todor Milev]{\Large \\
\normalsize Reference Lectures\\Todor Milev\\
\url{https://github.com/tmilev/freecalc}
}

\date{\insertshortlecture}
\begin{frame}
\titlepage
\end{frame}
\input{../../modules/lecture-frequently-encountered-elements/table-of-contents-and-license}
}

\begin{document}
% begin lecture
\lect{\semester}{Lecture (not covered in class)}{0}{
%DesiredLectureName: Exponentials_Review_Not_Covered_In_Class

\section{Exponential Functions and logarithms, Review}
\input{../../modules/exponential-functions/exponential-function-def}
\input{../../modules/exponential-functions/exponential-function-graphs}
\section{Derivatives of Exponential Functions}
\input{../../modules/exponential-functions/exponential-function-derivative}
\subsection{Natural Exponent}
\input{../../modules/exponential-functions/natural-exponential-intro}
%\input{../../modules/exponential-functions/e-def}
\input{../../modules/exponential-functions/natural-exponential-def}
\section{A More Advanced Approach to Exponents}
\input{../../modules/exponential-functions/exponential-function-def-various-approaches}
\subsection{Derivative using series definition}
\input{../../modules/derivatives-computation-understanding/exponent-derivative-from-taylor-series}
\section{Logarithmic Functions, Review}
\input{../../modules/logarithms/logarithm-def}
\input{../../modules/logarithms/logarithm-def-ex1}
\input{../../modules/logarithms/log-and-exp}
\input{../../modules/logarithms/logarithm-graphs}
\subsection{Natural Logarithms}
\input{../../modules/logarithms/natural-logarithm-def}
\input{../../modules/logarithms/logarithm-properties}
%\input{../../modules/logarithms/natural-logarithm-def-ex8}
%\input{../../modules/inverse-functions/inverse-function-solve-for-ex2-freeCalc}
\section{Derivatives of Logarithms, Review}
\subsection{The Natural Logarithm}
\input{../../modules/logarithms/natural-logarithm-derivative}
\input{../../modules/logarithms/natural-logarithm-derivative-ex1}
\subsection{The Number $e$ as a Limit}
\input{../../modules/logarithms/e-limit}
\input{../../modules/logarithms/e-limit-problems-ex1}
\subsection{Derivatives of Exponents with Arbitrary Base}
\input{../../modules/logarithms/general-exponential-derivative}
\input{../../modules/logarithms/general-exponential-derivative-ex13}
\subsection{Derivatives of Arbitrary Exponents with Arbitrary Base}
\input{../../modules/logarithms/arbitrary-base-arbitrary-exponent-derivative-ex1}
\input{../../modules/logarithms/arbitrary-base-arbitrary-exponent-derivative}
} %end lecture

% begin lecture
\lect{\semester}{Lecture  1}{1}{
%DesiredLectureName: Trigonometry_Review_Inverse_Trigonometry

\section{Review of trigonometry}
\subsection{The Trigonometric Functions}
\input{../../modules/trigonometry/trig-functions-unit-circle}
\subsection{Trigonometric Identities}
\input{../../modules/trigonometry/trig-identity-definition}
\input{../../modules/trigonometry/trig-identities-pythagorean}
\input{../../modules/trigonometry/trig-identities-angle-sum-summary}
\input{../../modules/trigonometry/trig-functions-even-odd}
\input{../../modules/trigonometry/trig-functions-periodicity}
\subsection{Trigonometric Identities and Complex Numbers}
\youWillNotBeTested
\input{../../modules/complex-numbers/complex-numbers-definition}
\youWillNotBeTested
\input{../../modules/trigonometry/trig-Euler-formula}
\youWillNotBeTested
\input{../../modules/trigonometry/trig-using-euler-formula}
\subsection{Graphs of the Trigonometric Functions}
\input{../../modules/trigonometry/graphs-sin-and-cos}
\input{../../modules/trigonometry/graphs-tan-and-cot}
\input{../../modules/trigonometry/graphs-sec-and-csc}
\section{Inverse Trigonometric Functions}
\input{../../modules/inverse-trig/arcsin-def}
\input{../../modules/inverse-trig/arcsin-ex1}
\input{../../modules/inverse-trig/arcsin-sin-ex1}
\input{../../modules/inverse-trig/arcsin-sin-ex2}
\input{../../modules/inverse-trig/arcsin-derivative}
\input{../../modules/inverse-trig/arcsin-properties}
\input{../../modules/inverse-trig/arccos-def}
\input{../../modules/inverse-trig/arccos-properties}
\input{../../modules/inverse-trig/trig-applied-to-inverse-trig-ex1}
\input{../../modules/inverse-trig/trig-applied-to-inverse-trig-ex2}
\input{../../modules/inverse-trig/arctan-def}
\input{../../modules/inverse-trig/arctan-ex3}
\input{../../modules/inverse-trig/arctan-ex4}
\input{../../modules/inverse-trig/arctan-derivative}
\input{../../modules/inverse-trig/arcsec-intro}
\input{../../modules/inverse-trig/arcsec-def}
\input{../../modules/inverse-trig/inverse-trig-derivatives-summary}
\input{../../modules/inverse-trig/arcsin-ex5}
\input{../../modules/inverse-trig/inverse-trig-reminder}
}% end lecture

%begin lecture
\lect{\semester}{Lecture 2}{2}{
%DesiredLectureName: Integration_Basics_Review
\section{Integration, Review}
\subsection{The Evaluation Theorem (FTC part 2)}
\input{../../modules/antiderivatives/antiderivative-def}
\input{../../modules/integration/FTC-part2}
\input{../../modules/integration/indefinite-integral-intro}
\section{Integration Techniques from Calc I, Review}
\subsection{Differential Forms, Review}
\input{../../modules/differentials/differential-def-version2}
\input{../../modules/differentials/differentials-integration-connection-intro}
\input{../../modules/differentials/differentials-integration-rules}
\section{Integration and Logarithms, Review}
\input{../../modules/logarithms/power-rule-minus-one}
} % end lecture

% begin lecture
\lect{\semester}{Lecture  3}{3}{
%DesiredLectureName: Integration_By_Parts

\section{Integration by Parts}
\input{../../modules/integration-by-parts/integration-by-parts-intro-version2}
\input{../../modules/integration-by-parts/integration-by-parts-LIPET-mnemonic}
\input{../../modules/integration-by-parts/integration-by-parts-ex1-version2}
\input{../../modules/integration-by-parts/integration-by-parts-ex2-version2}
\input{../../modules/integration-by-parts/integration-by-parts-ex3-version2}
\input{../../modules/integration-by-parts/integration-by-parts-ex4-version2}
\input{../../modules/integration-by-parts/integration-by-parts-ex5-version2}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 4}{4}{
%DesiredLectureName: Integration_Rational_Functions_Bulding_Blocks

\section{Integration of Rational Functions}
\subsection{Building block integrals}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-intro}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-the-3-types}
\input{../../modules/partial-fractions/partial-fractions-building-block-1a}
\input{../../modules/partial-fractions/partial-fractions-building-block-1b}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-2a-and-3a-intro}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-2a-quadratic-no-lin-term}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-3a-quadratic-no-lin-term}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-2a-and-3a-quadratic-no-real-roots-intro}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-2a-and-3a-quadratic-no-real-roots-ex1}

\input{../../modules/partial-fractions/partial-fractions-building-block-2b}
\input{../../modules/partial-fractions/partial-fractions-building-block-3b-example-n-equals-2}
\input{../../modules/partial-fractions/partial-fractions-building-block-3b}
\input{../../modules/partial-fractions/partial-fractions-building-blocks-linear-substitutions-summary}
}

\lect{\semester}{Lecture 5}{5}{
%DesiredLectureName: Integration_Rational_Functions_Partial_Fractions

\section{Integration of Rational Functions}
\subsection{Partial fractions}
\input{../../modules/partial-fractions/from-building-blocks-to-complete-algorithm-intro}
\input{../../modules/partial-fractions/partial-fractions-definition}
\input{../../modules/partial-fractions/partial-fractions-long-division}
\input{../../modules/partial-fractions/partial-fractions-long-division-ex1}
\input{../../modules/partial-fractions/rational-functions-to-partial-fractions}
\input{../../modules/partial-fractions/partial-fractions-case1}
\input{../../modules/partial-fractions/partial-fractions-case1-ex2}
\input{../../modules/partial-fractions/partial-fractions-case1-quick-trick}
\input{../../modules/partial-fractions/partial-fractions-case2}
\input{../../modules/partial-fractions/partial-fractions-case2-ex4}
\input{../../modules/partial-fractions/partial-fractions-case3}
\input{../../modules/partial-fractions/partial-fractions-case3-ex5}
\input{../../modules/partial-fractions/partial-fractions-case4}
\input{../../modules/partial-fractions/partial-fractions-case4-ex7}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 6}{6}{
%DesiredLectureName: Trig_Integrals

\section{Trigonometric Integrals}
\subsection{Integrating rational trigonometric integrals}
\input{../../modules/trig-integrals/trig-integrals-rationalizing-substitution}
\input{../../modules/trig-integrals/trig-integrals-rationalizing-substitution-ex1}
\input{../../modules/trig-integrals/trig-integrals-rationalizing-substitution-integral-of-sec}
\subsection{Ad hoc methods for trigonometric integrals}
\input{../../modules/trig-integrals/trig-integrals-without-rationalizing-substitution}
\input{../../modules/trig-integrals/trig-integrals-ex9}
\input{../../modules/trig-integrals/trig-integrals-ex10}
\input{../../modules/trig-integrals/trig-integrals-sin-cos-version2}
\input{../../modules/trig-integrals/trig-integrals-ex11}
%\input{../../modules/trig-integrals/trig-integrals-ex5}
%\input{../../modules/trig-integrals/trig-integrals-ex6}
\input{../../modules/trig-integrals/trig-integrals-ex12}
\input{../../modules/trig-integrals/trig-integrals-ex13}
\input{../../modules/trig-integrals/trig-integrals-tann-secm-strategy}

\input{../../modules/trig-integrals/trig-integrals-tan-sec}
\input{../../modules/trig-integrals/trig-integrals-ex7}
%\input{../../modules/trig-integrals/trig-integrals-ex8}
\input{../../modules/trig-integrals/trig-integrals-ex8-version2}
\input{../../modules/trig-integrals/trig-integrals-sinm-cosn}
\input{../../modules/trig-integrals/trig-integrals-sinm-cosn-ex9}
}% end lecture

\lect{\semester}{Lecture 7}{7}{
%DesiredLectureName: Integration_Radicals_Of_Quadratics

\section{Integrals of form $\int R(x,\sqrt{ax^2+bx+c}) \diff x$, $R$ - rational function}
\input{../../modules/trig-substitution/quadratic-radicals-integrals-intro}
\input{../../modules/trig-substitution/trig-substitutions-intro}
\subsection{Transforming to the forms $\sqrt{x^2+1}, \sqrt{-x^2+1}, \sqrt{x^2-1} $}
\input{../../modules/trig-substitution/quadratic-radicals-linear-substitution-preparation-ex1}
\input{../../modules/trig-substitution/quadratic-radicals-linear-substitution-preparation-ex2}

\subsection{Table of Euler and trig substitutions}
\input{../../modules/trig-substitution/trig-substitutions-euler-substitutions-table}

\subsection{The case $\sqrt{x^2+1}$}
\input{../../modules/trig-substitution/trig-substitution-case-1-cot}
\input{../../modules/trig-substitution/trig-substitutions-ex1-freecalc}
%\input{../../modules/trig-substitution/trig-substitutions-ex3}
\input{../../modules/trig-substitution/Euler-substitution-case-1-cot}

\input{../../modules/trig-substitution/integral-radical-x-squared-plus-one}
\input{../../modules/trig-substitution/area-under-hyperbola-ex1}
\input{../../modules/trig-substitution/trig-substitutions-ex4}

\subsection{The case $\sqrt{-x^2+1}$}
\input{../../modules/trig-substitution/trig-substitution-case-2-cos}
\input{../../modules/trig-substitution/trig-substitutions-ex1}
\input{../../modules/trig-substitution/trig-substitutions-ex2}
\input{../../modules/trig-substitution/trig-substitutions-ex7}
\input{../../modules/trig-substitution/Euler-substitution-case-2-cos}

\subsection{The case $\sqrt{x^2-1}$}
\input{../../modules/trig-substitution/trig-substitution-case-3-sec}
\input{../../modules/trig-substitution/trig-substitutions-ex5}
\input{../../modules/trig-substitution/trig-substitutions-ex1-Euler-sub}
\input{../../modules/trig-substitution/Euler-substitution-case-3-sec}

\section{Rationalizing Substitutions}
\input{../../modules/partial-fractions/partial-fractions-rationalize-intro}
\input{../../modules/partial-fractions/partial-fractions-rationalize-ex9}
} %end lecture

% begin lecture
\lect{\semester}{Lecture  8}{8}{
%DesiredLectureName: LHospitals_Rule

\section{Indeterminate Forms and L'Hospital's Rule}
\input{../../modules/lhospital/lhospital-intro}
\input{../../modules/lhospital/lhospital-statement}
\input{../../modules/lhospital/lhospital-ex1}
\input{../../modules/lhospital/lhospital-ex2}
\subsection{Indeterminate Products}
\input{../../modules/lhospital/indeterminate-products-def}
\input{../../modules/lhospital/indeterminate-products-ex6}
\subsection{Indeterminate Differences}
\input{../../modules/lhospital/indeterminate-differences-def}
\input{../../modules/lhospital/indeterminate-differences-ex8}
\subsection{Indeterminate Powers}
\input{../../modules/lhospital/indeterminate-powers-def}
\input{../../modules/lhospital/indeterminate-powers-ex10}
\input{../../modules/lhospital/e-power-k-limit-by-lhospital-rule}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 9}{9}{
%DesiredLectureName: Improper_Integrals

\section{Improper Integrals}
\input{../../modules/improper-integrals/improper-integral-def}
\subsection{Type I: Infinite Intervals}
\input{../../modules/improper-integrals/improper-integral-geometry}
\input{../../modules/improper-integrals/improper-integral-type1}
\input{../../modules/improper-integrals/improper-integral-type1-ex1}
\input{../../modules/improper-integrals/improper-integral-type1-ex3}
\input{../../modules/improper-integrals/improper-integral-type1-ex4}
\subsection{Type II: Discontinuous Integrands}
\input{../../modules/improper-integrals/improper-integral-type2}
\input{../../modules/improper-integrals/improper-integral-type2-ex5}
\input{../../modules/improper-integrals/improper-integral-type2-ex7}
\subsection{A Comparison Test for Improper Integrals}
\input{../../modules/improper-integrals/improper-integral-comparison}
\input{../../modules/improper-integrals/improper-integral-comparison-ex9}
\input{../../modules/improper-integrals/improper-integral-comparison-ex10}
\input{../../modules/improper-integrals/improper-integral-type1-arctan-geometric-interpretation}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 10}{10}{
%DesiredLectureName: Polar_Coordinates

\section{Polar Coordinates}
\input{../../modules/polar-coordinates/polar-intro}
\input{../../modules/polar-coordinates/polar-questions}
\input{../../modules/polar-coordinates/polar-many-representations}
\input{../../modules/polar-coordinates/polar-two-points-coincide-iff}
\input{../../modules/polar-coordinates/polar-to-cartesian}
\input{../../modules/polar-coordinates/polar-to-cartesian-ex2}
\input{../../modules/polar-coordinates/polar-to-cartesian-ex3}
} %end lecture

% begin lecture
\lect{\semester}{Lecture 11}{11}{
%DesiredLectureName: Curves_Polar_Curves_Basics

\section{Curves}
\input{../../modules/parametric-curves/parametric-intro}
\input{../../modules/parametric-curves/parametric-curve-definition}
\input{../../modules/parametric-curves/curve-image-definition-intro}
\input{../../modules/parametric-curves/curve-image-definition}
\input{../../modules/parametric-curves/parametric-curve-vs-curve-image-terminology}
\input{../../modules/parametric-curves/graphs-of-functions-as-curves}
\input{../../modules/parametric-curves/eliminate-parameter-ex}
\input{../../modules/parametric-curves/implicit-vs-explicit-parametrization}
\input{../../modules/parametric-curves/parametric-ex2}
\input{../../modules/parametric-curves/parametric-ex4}
\subsection{The Cycloid}
\input{../../modules/parametric-curves/cycloid-def}
\input{../../modules/parametric-curves/cycloid-equations-ex7}
\subsection{Polar Curves}
\input{../../modules/polar-curves/polar-curve-definition}
\input{../../modules/polar-curves/polar-curve-ex4}
\input{../../modules/polar-curves/polar-curve-ex6}
\input{../../modules/polar-curves/cardioid-ex7}
\input{../../modules/polar-curves/polar-curve-ex8}
\input{../../modules/polar-curves/polar-symmetry}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 12}{12}{
%DesiredLectureName: Tangents_To_Curves_Arc_Length

\section{Tangents to Curves}
\input{../../modules/parametric-curves/parametric-tangents-definition}
\input{../../modules/parametric-curves/parametric-tangents-ex0}
\input{../../modules/parametric-curves/parametric-tangents-to-function-graphs}
\input{../../modules/parametric-curves/parametric-tangents-ex1}
\input{../../modules/parametric-curves/cycloid-tangents-ex2}
\subsection{Tangents to Polar Curves}
\input{../../modules/polar-curves/polar-tangents}
\input{../../modules/polar-curves/cardioid-tangents-ex9}
\section{Arc Length}
\input{../../modules/arc-length/arc-length-intro}
\input{../../modules/arc-length/arc-length-derivation-parametric}
\input{../../modules/arc-length/arc-length-def-parametric}
\input{../../modules/arc-length/arc-length-does-not-depend-on-parametrization-when-one-to-one}
\input{../../modules/arc-length/arc-length-function-graph-from-parametric-curve-length}
\input{../../modules/arc-length/arc-length-def}
\input{../../modules/arc-length/arc-length-ex1}
\input{../../modules/arc-length/arc-length-parabola-length}
\input{../../modules/arc-length/arc-length-parametric-curve-ex1}
%\input{../../modules/arc-length/arc-length-flip-xy}
%\input{../../modules/arc-length/arc-length-flip-xy-ex2}
% WARNING: This section needs an example in which y' = (a - b)^2 with 2ab = .5
\input{../../modules/arc-length/arc-length-half-ex}
\input{../../modules/parametric-curves/cycloid-arc-length-ex5}
\subsection{Arc Length in Polar Coordinates}
\input{../../modules/polar-curves/polar-arc-length-formula}
\input{../../modules/polar-curves/cardioid-arc-length-ex4}
}

%end lecture
\lect{\semester}{Lecture 13}{13}{
%DesiredLectureName: Area_Locked_By_Curve

\section{Areas Locked by Curves}
\input{../../modules/parametric-curves/parametric-area-formula}
\input{../../modules/parametric-curves/cycloid-area-ex3}
\section{Areas in Polar Coordinates}
\input{../../modules/polar-curves/polar-area-intro}
\input{../../modules/polar-curves/polar-area-justification}
\input{../../modules/polar-curves/polar-area-ex1}
\input{../../modules/polar-curves/polar-intersection-ex3}
\input{../../modules/polar-curves/polar-area-ex2}
}% end lecture

\lect{\semester}{Lecture 14}{14}{
%DesiredLectureName: Surface_Area_Solid_of_Revolution
\section{Surface area of solid of revolution}
\input{../../modules/surface-area/surface-area-surface-of-revolution-about-x-axis-motivation}
%\input{../../modules/surface-area/surface-area-surface-of-revolution-about-x-axis}
\input{../../modules/surface-area/surface-area-surface-of-revolution-about-x-axis-example-1}
\input{../../modules/surface-area/surface-area-surface-of-revolution-about-x-axis-example-2}
\input{../../modules/surface-area/surface-area-surface-of-revolution-about-y-axis-example-1}
}

% begin lecture
\lect{\semester}{Lecture 15}{15}{
%DesiredLectureName: Sequences

\section{Sequences}
\input{../../modules/sequences/sequence-intro}
\input{../../modules/sequences/notation}
\input{../../modules/sequences/notation-examples}
\input{../../modules/sequences/sequence-def-version2}
\input{../../modules/sequences/ways-to-define-sequences}
\input{../../modules/sequences/sequence-ex1}
\input{../../modules/sequences/find-terms}

\input{../../modules/sequences/sequence-find-formula-ex1}
\input{../../modules/sequences/sequence-find-formula-ex2}
\input{../../modules/sequences/sequence-find-formula-warning}
\input{../../modules/sequences/sequence-ex2}

\input{../../modules/sequences/arithmetic-def}
\input{../../modules/sequences/arithmetic-ex}
\input{../../modules/sequences/geometric-def}
\input{../../modules/sequences/geometric-ex}

\input{../../modules/sequences/sequence-plotting}
\input{../../modules/sequences/sequence-limit-def}
\input{../../modules/sequences/sequence-limit-function}
\input{../../modules/sequences/sequence-ex4}
\input{../../modules/sequences/sequence-limit-infinite}
\input{../../modules/sequences/sequence-limit-laws}
\input{../../modules/sequences/sequence-ex5}
\input{../../modules/sequences/sequence-ex6}
\input{../../modules/sequences/sequence-squeeze-theorem}
\input{../../modules/sequences/sequence-ex7}
\input{../../modules/sequences/sequence-function-composition}
\input{../../modules/sequences/sequence-function-composition-ex8}
\input{../../modules/sequences/sequence-ex9}
\input{../../modules/sequences/sequence-geometric-ex10}
\input{../../modules/sequences/sequence-geometric-theorem}
\input{../../modules/sequences/sequence-monotonic-def}
\input{../../modules/sequences/sequence-monotonic-ex}
\input{../../modules/sequences/sequence-bounded-def}
\input{../../modules/sequences/monotonic-sequence-theorem}
% WARNING: You need an example of the monotonic sequence theorem in use.
% Try using alternating convergents in the continued fraction expansion
% of some irrational number (the golden mean will work well).
}% end lecture

% begin lecture
\lect{\semester}{Lecture 16}{16}{
%DesiredLectureName: Series

\section{Series}
\input{../../modules/series/formal-series-def}
\input{../../modules/series/notation-through-example-1}
%\input{../../modules/series/notation}
%\input{../../modules/series/series-def-example}
\input{../../modules/series/arithmetic-sum}
\input{../../modules/series/arithmetic-sum-theorem}
\input{../../modules/series/geometric-sum}

\input{../../modules/series/series-convergence}
\input{../../modules/series/series-geometric-ex1}
\input{../../modules/series/series-geometric-theorem}
\input{../../modules/series/series-geometric-ex}
\input{../../modules/series/series-geometric-ex4}
\input{../../modules/series/series-telescoping-ex6}
\input{../../modules/series/series-harmonic-ex7}
}

\lect{\semester}{Lecture 17}{17}{
%DesiredLectureName: Basic_Divergence_Test_Integral_Test_Comparison_Test

\section{Basic divergence tests}
\input{../../modules/series/series-divergence-test}
\input{../../modules/series/series-divergence-test-ex8}
\section{The Integral Test and Estimates of Sums}
\subsection{The Integral Test}
\input{../../modules/series/integral-test-intro}
\input{../../modules/series/integral-test-above}
\input{../../modules/series/integral-test-below}
\input{../../modules/series/integral-test-def}
\input{../../modules/series/integral-test-ex1}
\input{../../modules/series/integral-test-ex2}
\input{../../modules/series/p-series}
\input{../../modules/series/integral-test-ex4}
\subsection{Estimating Sums}
\input{../../modules/series/integral-test-estimate}
\input{../../modules/series/integral-test-estimate-ex5}
\input{../../modules/series/integral-test-estimate-improvement}
\section{The Comparison Test}
\input{../../modules/series/comparison-intro}
\input{../../modules/series/comparison-theorem}
\input{../../modules/series/comparison-ex1}
\input{../../modules/series/comparison-ex2}
\input{../../modules/series/limit-comparison-intro}
\input{../../modules/series/limit-comparison-theorem}
\input{../../modules/series/limit-comparison-ex3}
\input{../../modules/series/limit-comparison-ex4}
}

\lect{\semester}{Lecture 18}{18}{
%DesiredLectureName: Alternating_Series_Absolute_Convergence_Ratio_Root_Tests

\section{Alternating Series}
\input{../../modules/series/alternating-def}
\input{../../modules/series/alternating-theorem}
\input{../../modules/series/alternating-ex1}
\input{../../modules/series/alternating-ex2}
\subsection{Estimating Sums}
\input{../../modules/series/alternating-estimate}
\input{../../modules/series/alternating-estimate-ex4}
\input{../../modules/series/absolute-convergence-intro}
\subsection{Absolute Convergence}
\input{../../modules/series/absolute-convergence-def}
\input{../../modules/series/absolute-convergence-ex1}
\input{../../modules/series/absolute-convergence-ex2}
\input{../../modules/series/conditional-convergence-def}
% WARNING:  I lack a proof of the fact that absolute convergence
% implies convergence.  I should add it to this next module.
\input{../../modules/series/absolute-implies-convergence}
\input{../../modules/series/absolute-convergence-ex3}
\section{Absolute Convergence and the Ratio and Root Tests}
\subsection{The Ratio Test}
\input{../../modules/series/ratio-test}
\input{../../modules/series/ratio-test-inconclusive}
\input{../../modules/series/ratio-test-ex4}
\input{../../modules/series/ratio-test-ex5}
\subsection{The Root Test}
\input{../../modules/series/root-test}
\input{../../modules/series/root-test-ex6}
}% end lecture

% begin lecture
\lect{\semester}{Lecture 19}{19}{
%DesiredLectureName: Power_Series

\section{Power Series}
\input{../../modules/power-series/power-series-def}
\input{../../modules/power-series/power-series-ex1}
\input{../../modules/power-series/power-series-ex2}
\input{../../modules/power-series/power-series-ex3}
\input{../../modules/power-series/radius-of-convergence}
\input{../../modules/power-series/interval-of-convergence-endpoints}
% WARNING: I'm missing the table that compiles radius and interval
% of convergence for the previous three examples.
% ALSO: Change the order of the examples so it agrees with the order in the theorem.
\input{../../modules/power-series/power-series-ex4}
\section{Power Series as Functions}
\input{../../modules/power-series/power-series-as-function-intro}
\input{../../modules/power-series/power-series-as-function-ex1}
\input{../../modules/power-series/power-series-as-function-ex2}
\input{../../modules/power-series/power-series-as-function-ex3}
\subsection{Differentiation and Integration of Power Series}
\input{../../modules/power-series/power-series-calculus}
\input{../../modules/power-series/power-series-calculus-ex4}
\input{../../modules/power-series/power-series-calculus-ex6}
\input{../../modules/power-series/power-series-calculus-ex7}
% WARNING: I want to include some integral approximation questions here.
\section{Taylor and Maclaurin Series}
\input{../../modules/power-series/taylor-series-intro}
\input{../../modules/power-series/taylor-series-def}
\input{../../modules/power-series/maclaurin-series-def}
\input{../../modules/power-series/maclaurin-series-ex1}
%\input{../../modules/power-series/taylor-series-representation}
\input{../../modules/power-series/maclaurin-series-e-ex}
\input{../../modules/power-series/taylor-series-ex3}
\input{../../modules/power-series/maclaurin-series-ex4}
\input{../../modules/power-series/maclaurin-series-sin-ex}
\input{../../modules/power-series/maclaurin-series-ex5}
\input{../../modules/power-series/maclaurin-series-ex6}
\input{../../modules/power-series/maclaurin-series-list}
\input{../../modules/power-series/maclaurin-series-ex11}
\input{../../modules/power-series/maclaurin-series-limit-ex}
}% end lecture

\lect{\semester}{Lecture 20}{20}{
%DesiredLectureName: A_Bit_Of_Differential_Equations

\section{Modeling with Differential Equations}
\input{../../modules/diff-eq-models/diff-eq-def}
\subsection{Models of Population Growth}
\input{../../modules/diff-eq-models/diff-eq-natural-growth}
\input{../../modules/diff-eq-models/diff-eq-natural-growth-solution}
\input{../../modules/diff-eq-models/diff-eq-logistic}
\input{../../modules/diff-eq-models/diff-eq-logistic-graph}
\subsection{A Model for the Motion of a Spring}
\input{../../modules/diff-eq-models/diff-eq-spring}
\subsection{General Differential Equations}
\input{../../modules/diff-eq-models/diff-eq-terminology}
\input{../../modules/diff-eq-models/diff-eq-ex1}
\input{../../modules/diff-eq-models/diff-eq-initial-condition}
\input{../../modules/diff-eq-models/diff-eq-initial-condition-ex2}
\section{Direction Fields and Euler's Method}
\input{../../modules/diff-eq-direction-fields/direction-fields-intro}
\subsection{Direction Fields}
\input{../../modules/diff-eq-direction-fields/direction-fields-procedure}
\section{Separable Equations}
\input{../../modules/diff-eq-separable/diff-eq-separable-def}
\input{../../modules/diff-eq-separable/diff-eq-separable-solution}
\input{../../modules/diff-eq-separable/diff-eq-separable-ex1}
\input{../../modules/diff-eq-separable/diff-eq-separable-ex3}
\subsection{Orthogonal Trajectories}
\input{../../modules/diff-eq-separable/orthogonal-trajectory-def}
\input{../../modules/diff-eq-separable/orthogonal-trajectory-ex5}
\subsection{Mixing Problems}
\input{../../modules/diff-eq-separable/mixing-problem-intro}
\input{../../modules/diff-eq-separable/mixing-problem-ex6}
\section{Models for Population Growth}
\subsection{The Law of Natural Growth}
\input{../../modules/diff-eq-models/natural-growth-reminder}
\input{../../modules/diff-eq-models/natural-growth-solution}
\subsection{The Logistic Model}
\input{../../modules/diff-eq-models/logistic-reminder}
\input{../../modules/diff-eq-models/logistic-solution}
\input{../../modules/diff-eq-models/logistic-ex2}
}% end lecture

\lect{\semester}{Lecture 21}{21}{
%DesiredLectureName: Complex_Numbers

\section{Complex numbers}
\input{../../modules/complex-numbers/complex-numbers-definition}
\input{../../modules/complex-numbers/complex-numbers-terminology}
\input{../../modules/complex-numbers/complex-numbers-addition-multiplication-example-1}
\input{../../modules/complex-numbers/complex-conjugation}
\input{../../modules/complex-numbers/complex-conjugation-is-field-hmm}
\input{../../modules/complex-numbers/complex-numbers-division-example-1}
\input{../../modules/complex-numbers/complex-numbers-division}
\input{../../modules/complex-numbers/product-of-exponents-is-exponent-of-sum}
\input{../../modules/complex-numbers/complex-exponent-def}
\input{../../modules/trigonometry/trig-Euler-formula}
\input{../../modules/complex-numbers/complex-numbers-polar-form}
\input{../../modules/complex-numbers/complex-numbers-polar-form-example-1}
\input{../../modules/complex-numbers/complex-numbers-polar-form-example-2}
\input{../../modules/complex-numbers/complex-numbers-exponent-definition1-multiplication-angles-add}
\input{../../modules/complex-numbers/complex-numbers-exponent-definition2-multiplication-angles-add}
\input{../../modules/complex-numbers/complex-numbers-multiplication-arguments-add}
\input{../../modules/complex-numbers/complex-numbers-de-Moivre-formula}
\input{../../modules/complex-numbers/complex-numbers-de-Moivre-formula-example}
\input{../../modules/complex-numbers/complex-roots-example-1}
\input{../../modules/complex-numbers/complex-roots-example-2}
}
%\section{(Appendix G) Complex Numbers}
% WARNING:  Appendix G is missing here.
% end lecture
\end{document}


These notes are a short presentation of the material presented in my
lecture. They follow the notes by Rannacher (Numerik 1 in German)
as well as the books by Hairer, Nørsett, and
Wanner~\cite{HairerNorsettWanner93} and Hairer and
Wanner~\cite{HairerWanner10}. Furthermore, I used the book by
Deuflhard and Hohmann~\cite{DeuflhardBornemann08}. Historical remarks
are in part taken from the article by Butcher~\cite{Butcher96}.

I am always thankful for hints and errata. But please verify that you
have the latest version, which is available on github.

My thanks go to Dörte Jando, Markus Schubert, Lukas Schubotz, and David Stronczek for their help
with writing and editing these notes.

\clearpage
\section*{Index for shortcuts}
\begin{tabular}{ll}
  IVP & Initial value problem, s. definition~\ref{Definition:IVP} on page~\pageref{Definition:IVP}\\
  BDF & Backward differencing formula, s. example~\ref{ex:lmm:3} on page~\pageref{ex:lmm:3}\\
  ODE & Ordinary differential equation\\
  DIRK & Diagonal implicit Runge-Kutta method\\
  ERK & Explicit Runge-Kutta method\\
  IRK & Implicit Runge-Kutta method\\
  LMM & Linear multistep method, s. Definition~\ref{Definition:lmm} on
  page~\pageref{ex:lmm:1}\\
  VIE & Volterra integral equation, s. Remark~\vref{remark:volterra}
\end{tabular}

\section*{Index for symbols}
\begin{tabular}{lp{10cm}}
  $\C$ & The set of complex numbers\\
  $e_i$ & The unit vector of $\C^d$ in direction $d$\\
  $\Re$ & Real part of a complex number\\
  $\R$ & The set of real numbers\\
  $\R^d$ & The $d$-dimensional vectorspace of the real $d$-tuple\\
  $u$ & The exact solution of an ODE or IVP\\
  $u_k$ & The exact solution at time step $t_k$\\
  $y_k$ & The discrete solution at time step $t_k$\\
  $\scal(x,y)$ & The Euclidean scalar product in the space $\R^d$ or
  $\C^d$\\
  $\abs{x}$ & The absolute value of a real number, the modulus of a
  complex number, or the Euclidean norm in $\R^d$ or $\C^d$, depending
  on its argument\\
  $\norm{u}$ & A norm in a vector space (with exception of the special
  cases covered by $\abs{x}$)
\end{tabular}

\cleardoublepage

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "notes"
%%% End:


\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[transitional, mathfont, colors]{classnotes}

\title{Using the Classnotes Package}
\author{Neil Rathi}

\begin{document}\thispagestyle{empty}

\maketitle

\tableofcontents

\newpage

\section{Introduction}
The \texttt{classnotes.sty} package is a package designed mostly for taking lecture notes, as the name suggests. It comes with multiple pre-loaded packages useful for typesetting notes in various subjects, including math, chemistry, linguistics, and physics. I created this package mostly because I realized that my preambles were getting way too long for a normal document, and decided to standardize to use just one package when taking notes. It's simple to create a document using the package, which does most of the important formatting automatically.

The default font is Computer Modern Serif. You can optionally pass the \texttt{human}, \texttt{gara}, \texttt{transitional}, \texttt{dido}, \texttt{mech}, \texttt{sans}, or \texttt{cms} options. The first five correspond to their Vox-ATypI classifications, the second to last is Latin Modern Sans, and the last is Computer Modern Sans. This guide uses the \verb|transitional| option. You can also use the \verb|mathfont| option to change the font in math mode from default CMS to match the style of the selected font (I used it here to demonstrate, but I recommend not). For this guide, I passed in the \texttt{colors} option to make theorem boxes colorful.

\subsection{About this Guide}
The purpose of this document isn't to give a comprehensive list of every feature in the package. Instead, it provides an overview of some of the most fundamental pieces of the package, and also shows what the package actually looks like in use.

I also used this guide while I was editing and creating the package to ensure that everything was working smoothly. To see the entire list of features, go to the \texttt{README.md} file in the github repository (\url{https://github.com/neilrathi/classnotes}).

\section{Mathematics}
The package has multiple pre-loaded packages for math, including \texttt{amsmath}, \texttt{amssymb}, \texttt{amsthm}, and \texttt{mathtools}. In addition, there are a few important and useful shorthand commands.

\subsection{Theorems}
The most prominent feature of the package is in the newly defined environments. The package uses \texttt{mdframed} and \texttt{thmtools} to create theorem boxes that clearly stand out from the surrounding text, and draw the readers attention. In the standard package, all of the boxes are gray with a thin border, and the \texttt{color} option makes the boxes colorful and even more prominent. As an example, we can write the following theorem using \verb|\begin{thrm}| and \verb|\end{thrm}|.
\begin{thrm}[Fermat's Last Theorem]
	There are no three integers $x,y,z > 0$ such that
	\[x^n + y^n = z^n\]
	for any $n > 2 \in \ZZ$.
\end{thrm}
We can then follow any theorem with a \verb|proof| (which is really the same as the \texttt{amsthm} one, but with a \verb|\blacksquare|).

\begin{proof}
	We show that the equation is satisfied for $n = 1$ and $n = 2$. For the first case, note that this reduces to
	\[x + y = z,\]
	which obviously holds. The second case is again trivial, with the equation being
	\[x^2 + y^2 = z^2.\]
	This is, of course, the Pythagorean theorem. The proof of $n > 2$ is trivial and is left as an exercise to the reader. See \cite{wiles1995} for more.
\end{proof}

There are also other useful environments which often appear during lectures or classes. These environments share the same visual aesthetic as the theorem environment, but with different header styles. For example (pun intended), we have the \verb|example| environment, which mirrors the theorem environment.
\begin{example}[2005 Putnam A5]
	Evaluate the integral
	\[\int_0^1 \frac{\ln(x+1)}{x^2+1} \dd x\]
\end{example}
Sometimes, an example like the one above may be very challenging, so the instructor or textbook will give a \verb|hint|, like the one below.
\begin{hint}
	Prove that for a function $f: \RR \to \RR$,
	\[\int_0^a f(x) \dd x = \int_0^a f(a-x) \dd x\]
	where $a$ is a real number.
\end{hint}
Of course, examples don't necessarily have \textit{proofs}, they have solutions. The package provides a \verb|solution| environment identical to the \verb|proof| environment, but with the italicized word changed.
\begin{solution}
	We take the hint as a given and leave the proof to the reader. Substituting $x$ with $\tant$, we have
	\begin{equation}
		I = \int_0^{\pi/4} \ln(1+\tant)\dd\theta.
	\end{equation}
	Using the identity provided in the hint, we have
	\begin{align}
		I &= \int_0^{\pi/4} \ln\left(1+\tan\left(\frac{\pi}{4}-\theta\right)\right)	\dd\theta \\
		&= \int_0^{\pi/4} \ln\left(\frac{2}{1+\tant}\right)\dd\theta.
	\end{align}
	Adding the equations (2.1) and (2.3) together yields
	\begin{align}
		2I &= \int_0^{\pi/4} \ln(2)\dd\theta \\
		&= \frac{\pi\ln2}{4}
	\end{align}
	so $I = \boxed{\dfrac{\pi\ln2}{8}}$.
\end{solution}

The final important boxed environment is the \verb|defn| environment, used for definitions, which is in the same style as the \verb|example| environment.
\begin{defn}[Entropy]
	The \textit{entropy}, or average information, of a discrete random variable $X$ with outcomes $x_1...x_n$ each which have probability $P(x_1)...P(x_n)$, respectively, is
	\[H[X] = -\sum_{i=1}^n P(x_i)\log P(x_i),\]
	it's average information \cite{shannon1948}.
\end{defn}
In total, there are three different classes of theorem environment, \verb|thm|, \verb|defn|, and \verb|comment|. Each of the environments belongs to one of these three stylistic groups. The last main environment is the \verb|problem| environment, ideal for end-of-chapter problems. Unlike the above environments, these are less clearly separated from the text.
\begin{problem}
	Evaluate the expression $1 + 1$
\end{problem}
\begin{problem}[AMC 12 \#17]
	Seven cubes, whose volumes are 1, 8, 27, 64, 125, 216, and 343 cubic units, are stacked vertically to form a tower in which the volumes of the cubes decrease from bottom to top. Except for the bottom cube, the bottom face of each cube lies completely on top of the cube below it. What is the total surface area of the tower (including the bottom) in square units?
\end{problem}
\begin{problem}
	Prove whether or not there are infinitely many primes $p$ such that $p + 2$ or $p-2$ is prime.
\end{problem}

\subsection{Shorthand Commands}
The other feature of the mathematics section is simple shorthand commands for common functions which are either not defined or take too long to type quickly.

The \texttt{amsfont} package provides various useful fonts for math, including the \verb|\mathcal{}| font. The \texttt{classnotes} package creates the shorthand \verb|\mc| for \verb|\mathcal{}|, so that \verb|$\mcP$| becomes $\mcP$. There's also the blackboard bold \verb|\mathbb{}| font, which is encoded as \verb|$\ZZ$| for $\ZZ$.
Typing \verb|\left\lfloor x\right\rfloor| every time I wrote floor operations proved to be annoying, so the command \verb|\floor{x}| writes
\[\floor{\sum_{i=1}^{\infty} \frac{1}{i^2}} = 0.\]
The same applies for \verb|\ceil{x}|, \verb|\p{x}| (parenthesis), and for \verb|\bvec{x}| (bracketed vectors). The delimiters are automatically adjusted for size.

For trigonometry, a few helpful commands are provided. The \verb|\inv| command allows you to write \verb|\sin\inv| instead of \verb|\sin^{-1}|. For \verb|\sin\theta| and \verb|\sin x|, there are additionally the \verb|\sint| and \verb|\sinx| commands, which output $\sint$ and $\sinx$ (this is also enabled for the other 5 trig functions). Additionally, inverse trig functions of $\theta$ and $x$ have \verb|\sinit| and \verb|\sinix|. Finally, the much-needed \verb|\cis| operator is provided.

For mathematical logic, some shorthands are provided such as \verb|\is| instead of \verb|\equiv| ($\is$), \verb|\isE| instead of \verb|\exists| ($\isE$), and \verb|\xor| instead of \verb|\oplus| ($\xor$). The package has things like \verb|\Hom|, \verb|\Gal|, and \verb|\Aut| for algebra. The command \verb|\modop{a}{b}{c}| outputs $\modop{a}{b}{c}$. Various summations are also provided, like \verb|\cycsum|.

\subsection{Computer Science}
The pre-loaded packages for computer science are \texttt{algorithm2e}, \texttt{listings}, and \texttt{stmaryrd}. The basic shorthand commands are \verb|\defas|, which is the same as \verb|\coloneqq| ($\defas$), \verb|\setto|, a leftwards arrow ($\setto$), and \verb|\bigo|, a \texttt{mathcal} O for big-O notation ($\bigo$).

Another \texttt{thm} class environment is the \texttt{algo} environment, as seen below (using algorithm2e to typeset the algorithm itself)
\begin{algo}[Euclidean Algorithm]
	Given two nonnegative integers, recursively finds their greatest common divisor.

	\begin{algorithm}[H]
    	Euclid$(a,b)$:

    	\eIf{$b=0$}
      	{
        	return $a$
      	}
      	{
        	return Euclid$(b,a\mod b)$
      	}
	\end{algorithm}
\end{algo}
In addition to pseudocode algorithms, the package comes with three predefined styles for listings using \texttt{listings} (Python, Java, and C/C++). You can use \verb|\lststyle{pystyle}| to define the style, as below.

\lststyle{pystyle}
\begin{lstlisting}[caption=Extended Euclidean Algorithm in Python]
def euclid(a, b):
    # base
    if a == 0 :
        return b, 0, 1
    # recursive step
    gcd, x1, y1 = euclid(b%a, a)
    x = y1 - (b//a) * x1
    y = x1
    return gcd, x, y
\end{lstlisting}
Thankfully, \texttt{stmaryrd} provides most symbols for theoretical CS, so there aren't any other redefined symbols.

\section{Linguistics}
The package pre-loads the \texttt{tipa}, \texttt{phonrule}, \texttt{ot-tableau}, \texttt{tikz-dependency}, \texttt{forest}, and \texttt{linguex}. I chose to use \texttt{linguex} rather than \texttt{gb4e} because gb4e runs into an error with math mode.

\subsection{Phonetics and Phonology}
With tipa, I've included a few extra commands. The \verb|\ipa{}| command is a replacement for \verb|\textipa{}|. You can use \verb|\up| instead of \verb|\super| for superscripts in an IPA environment. For example, we can say \verb|\ipa{/DIs Iz t\up haIpt In "leItEk/}| to say \ipa{/DIs Iz t\up haIpt In "leItEk/}.

I've also created basic phonetic rule environments not provided by phonrule. The command \verb|\phonss{p}{t}{k}| outputs \phonss{p}{t}{k}, while the \verb|\phonsb{p}{t}{k}| command outputs \phonsb{p}{t}{k}. In general, \verb|s| means ``slashes" and \verb|b| means ``brackets". I also redefined the \verb|\ips{}| and \verb|\ipb{}| commands from \texttt{ot-tableau} using \texttt{tipa}:

\begin{center}
	\begin{tableau}{c|c|c|c|c|c}
	\inp{\ips{t-n-ak-ol}} \const{Ident-IO} \const{*[+low]} \const{*[+round]} \const{*[-back]} \const{Cor-high} \const{*[+high]}
	\cand{t@.na.g0l} \vio{} \vio{*} \vio{*} \vio{} \vio{**!} \vio{}
	\cand[\Optimal]{t1.na.g0l} \vio{} \vio{*} \vio{*} \vio{} \vio{*} \vio{*}
	\cand{ti.na.g0l} \vio{} \vio{*} \vio{*} \vio{*!} \vio{*} \vio{*}
	\cand{tu.na.g0l} \vio{} \vio{*} \vio{**!} \vio{} \vio{*} \vio{*}
	\cand{ta.na.g0l} \vio{} \vio{**!} \vio{*} \vio{} \vio{**} \vio{}
	\cand{t1.n1.g@l} \vio{*!*} \vio{} \vio{} \vio{} \vio{} \vio{**}
	\end{tableau}
\end{center}

\subsection{Syntax and Semantics}
I used forest over qtree because it's simpler and easier to use. However, both packages present a problem when writing semantics trees, since using square brackets already has another function. The \verb|\lb| command fixes this by placing brackets in math mode. In addition, the \verb|\lam| command outputs a math-mode \lam.
\begin{center}
\begin{forest}
	[S
		[NP [N [Alice]]]
		[VP
			[V [uses]]
			[NP [N [LaTeX]]]
		]
	]
\end{forest}
\qquad
\begin{forest}
	[\lb{A uses L}
		[NP [\lb{A} [Alice]]]
		[\lb{\lam y.y uses L}
			[\lb{\lam xy.y uses x} [uses]]
			[N [\lb{L} [LaTeX]]]
		]
	]
\end{forest}
\end{center}
Along with trees, there's support for semantic denotations, given by the \verb|\denot[]{}| command. For example, \verb|\denot[\alpha]{Alice}| yields \denot[\alpha]{Alice}. Denotations can also wrap larger objects. For trees, use the \verb|\denotree[]{}| command \cite{heim1998}
\begin{center}
\denotree{\begin{forest} [S [NP [N [Alice]]] [VP [V [runs]]]] \end{forest}} = \denot{runs}(\denot{Alice})
\end{center}
For logicians, the packages \texttt{bussproofs} and \texttt{frege} are also provided. The bussproofs package is for natural deduction and sequent proofs:
\begin{prooftree}
\Axiom$\Gamma, A, B\ \fCenter\ B$
\UnaryInf$\Gamma, A\ \fCenter\ (B \to C)$
\UnaryInf$\Gamma\ \fCenter\ (A \to (B \to C))$
\end{prooftree}
The frege package allows for typesetting \textit{Begriffsschrift}, like
\[\Fconditional[\Facontent]{\Fcontent \Fcontent A}{\Fcontent\Fconditional
{\Fcontent B}{\Fcontent C}}\]

\section{Natural Sciences}
The pre-loaded natural science packages are \texttt{siunitx}, \texttt{chemfig} and \texttt{mhchem} for chemistry, and \texttt{physics}, \texttt{tensor}, and \texttt{circuitikz} (with the \texttt{american} option) for physics.

Some non-SI units have been added, like \verb|\mile| and \verb|\atm|. If a unit isn't covered by the package or by \texttt{siunitx}, you can use the \verb|\unt{UNIT}| command, which writes the unit preceded by a space, and is ideal for boxing answers in math mode, like $\boxed{-3.14\unt{N}}$.

Science notes will usually not require the theorem environment, but the two following environments may be useful. The \verb|eqn| environment is a \verb|thm| class environment which can be used for any important equations, like
\begin{eqn}[Gibbs Free Energy \cite{gibbs1873}]
	The change in Gibbs Free Energy of a reaction with change in Enthalpy $\Delta H$, temperature $T$, and change in entropy $\Delta S$ is
	\[\Delta G\degr = \Delta H\degr - T\Delta S\degr.\]
\end{eqn}
The other useful environment is the \verb|law| environment, used for describing mathematical and scientific laws, such as
\begin{law}[Newton's Second Law]
	The net force on an object with mass $m$ is
	\[\Sigma F = ma,\]
	where $a$ is its acceleration \cite{newton1687}.
\end{law}
Sometimes, it may be helpful to box diagrams as well. This can be done with the \verb|diagram| environment (a \texttt{thm} class environment)
\begin{diagram}[Glucose]
The below diagram is a glucose molecule
\begin{center}
	\chemfig{[:-30]HO--[:30](<[2]OH)-(<:[6]OH)
-[:30](<:[2]OH)-(<:[6]OH)-[:30](=[2]O)-H}
\end{center}
\end{diagram}

\newpage

\section{Acknowledgements and References}
Much of my knowledge about how to create and use packages is from various Overleaf tutorials and \TeX{} StackExchange posts. I also learned about using mdframed and thmtools from Evan Chen's \texttt{evan.sty} package.

\bibliographystyle{plain}
\bibliography{classnotescite.bib}

\end{document}


%% ---------------------------------------------------
%% Notice that we use the "report" class instead of "article"
%% ---------------------------------------------------
\documentclass{report}

\title{Project 6}
\author{\textbf{Jinhao Wei}}
\date{\textbf{27 February 2019}}

%% ---------------------------------------------------
%% CSBDformat specifies the format of our reports
%% ---------------------------------------------------
\usepackage{634format}

%% ---------------------------------------------------
%% enumerate
%% ---------------------------------------------------
\usepackage{enumerate}

%% ---------------------------------------------------
%% listings is used for including our source code in reports
%% ---------------------------------------------------
\usepackage{listings}
\usepackage{textcomp}

%% ---------------------------------------------------
%% Packages for math environments
%% ---------------------------------------------------
\usepackage{amsmath}

%% ---------------------------------------------------
%% Packages for URLs and hotlinks in the table of contents
%% and symbolic cross references using \ref
%% ---------------------------------------------------
\usepackage{hyperref}

%% ---------------------------------------------------
%% Packages for using HOL-generated macros and displays
%% ---------------------------------------------------
\usepackage{holtex}
\usepackage{holtexbasic}
\input{commands}

\begin{document}

\input{../HOL/HOLReports/HOLexerciseNine}
\input{../HOL/HOLReports/HOLexerciseOneZero}

%% --------------------------------------------------- the listings
%% parameter "language" is set to "ML"
%% ---------------------------------------------------
\lstset{language=ML,breaklines}

\maketitle{}

\begin{abstract}
  This report is a summary on my solutions of problem \emph{9.5.1}, \emph{9.5.2}, \emph{9.5.3}, \emph{10.4.1}, \emph{10.4.2} and \emph{10.4.3}. In these problems, we used \emph{HOL} to prove theorems and used \emph{EmitTex} to do pretty prints. Our works are contained in two folders respectively named \emph{LaTeX} and \emph{HOL}. In folder \emph{LaTeX}, we provided files that are used to produce this project report. In folder \emph{HOL}, we put all the proofs into two seperate files named \emph{exercise9Script.sml} and \emph{exercise10Script.sml}. We also used some other helper files to generate HOL reports named \emph{exercise9Report.pdf} and \emph{exercise10Report.pdf}.
\end{abstract}

\begin{acknowledgments}
  This project follows the format and structure of \emph{sampleTheory} provided by Professor Shiu-Kai Chin. To make it more accurate, this project mostly followed the format of my last project, which is project 5, and project 5 followed the sturcture of Professor Shiu-Kai Chin's \emph{sampleTheory} project. Besides, my friend Yihao Sun helped me in solving problem \emph{10.4.2}. It was by his hint that I realized how this problem should be solved.
\end{acknowledgments}

\tableofcontents{}

\chapter{Executive Summary}
\label{cha:executive-summary1}

\textbf{This is a late submission}
Due to my incompentence on HOL's tactic-based proof techniques, this is a late submission.
\\

\textbf{All requirements for this project are satisfied}.  In
particular, we proved all the theorems in this project, pretty printed the HOL theories,
and made use of the \emph{EmitTeX} structure to typeset HOL theorems
in this report.

The following theorems are proved and their corresponding \LaTeX{}
macros used in this report.
\begin{quote}
  \HOLexerciseNineTheorems
  \HOLexerciseOneZeroTheorems
\end{quote}

\chapter{Proof of absorptionRule}

\section{Problem Statement}

Our task is to prove the theorem \HOLexerciseNineTheoremsabsorptionRule without using \texttt{PROVE_TAC}.

\section{HOL Code Proving absorptionRule}

\begin{lstlisting}[frame=trBL]
val absorptionRule =
TAC_PROOF(
([], ``!p q.(p ==> q) ==> p ==> (p /\ q)``),
( REPEAT STRIP_TAC THEN
  RES_TAC THEN
  ASM_REWRITE_TAC [])
);

\end{lstlisting}

\section{Session Transcript}
\label{sec:session-transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # # # # # # val absorptionRule =
    [] |- !(p :bool) (q :bool). (p ==> q) ==> p ==> p /\ q:
   thm
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of constructiveDilemmaRule}
\label{cha:proof-prob1theorem}

\section{Problem Statement}
\label{sec:problem-statement}
Our task is to prove the theorem \HOLexerciseNineTheoremsconstructiveDilemmaRule without using \texttt{PROVE_TAC}.

\section{HOL Code Proving constructiveDilemmaRule}
\label{sec:hol-code-proving}

\begin{lstlisting}[frame=trBL]
val constructiveDilemmaRule =
TAC_PROOF(
([], ``!p q r s. (p==>q)/\(r==>s) ==> p\/r ==> q\/s``),
REPEAT STRIP_TAC THENL
[(DISJ1_TAC THEN RES_TAC) , (DISJ2_TAC THEN RES_TAC)]
);
\end{lstlisting}

\section{Session Transcript}
\label{sec:session-transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # # # # # val constructiveDilemmaRule =
    []
|- !(p :bool) (q :bool) (r :bool) (s :bool).
     (p ==> q) /\ (r ==> s) ==> p \/ r ==> q \/ s:
   thm
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of absorptionRule2}

\section{Problem Statement}
Our task is to prove the theorem \HOLexerciseNineTheoremsabsorptionRuleTwo using \texttt{PROVE_TAC}.

\section{HOL Code Proving absorptionRule2}

\begin{lstlisting}[frame=trBL]
val absorptionRule2 =
TAC_PROOF(([], ``!p q.(p ==> q) ==> p ==> (p /\ q)``),PROVE_TAC[]);
\end{lstlisting}

\section{Session Transcript}
\label{sec:session-transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # Meson search level: ........
val absorptionRule2 =
    [] |- !(p :bool) (q :bool). (p ==> q) ==> p ==> p /\ q:
   thm
>
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of constructiveDilemmaRule2}

\section{Problem Statement}

Our task is to prove the following theorem using \texttt{PROVE_TAC}.

\HOLexerciseNineTheoremsconstructiveDilemmaRuleTwo

\section{HOL Code Proving constructiveDilemmaRule2}

\begin{lstlisting}[frame=trBL]
val constructiveDilemmaRule2 =
TAC_PROOF(
([], ``!p q r s. (p==>q)/\(r==>s) ==> p\/r ==> q\/s``),
PROVE_TAC[]
);
\end{lstlisting}

\section{Session Transcript}
\label{sec:session-transcript-1}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # # # # Meson search level: ................
val constructiveDilemmaRule2 =
    []
|- !(p :bool) (q :bool) (r :bool) (s :bool).
     (p ==> q) /\ (r ==> s) ==> p \/ r ==> q \/ s:
   thm
>
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of problem1_thm}

\section{Problem Statement}

Our task is to prove the following theorem without using \texttt{PROVE_TAC}.

\HOLexerciseOneZeroTheoremsproblemOneXXthm

\section{HOL Code Proving problem1_thm}

\begin{lstlisting}[frame=trBL]
val problem1_thm =
TAC_PROOF(
([``!x:'a. P(x)==>M(x)``, ``(P:'a->bool)(s:'a)``], ``(M:'a->bool)(s:'a)``),
RES_TAC
);
\end{lstlisting}

\section{Session Transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # # # # val problem1_thm =

[(P :'a -> bool) (s :'a),
 !(x :'a). (P :'a -> bool) x ==> (M :'a -> bool) x]
|- (M :'a -> bool) (s :'a):
   thm
>
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of problem2_thm}

\section{Problem Statement}

Our task is to prove the following theorem without using \texttt{PROVE_TAC}.

\HOLexerciseOneZeroTheoremsproblemTwoXXthm

\section{HOL Code Proving problem1_thm}

\begin{lstlisting}[frame=trBL]
val problem2_thm =
TAC_PROOF(
([``p/\q ==> r``, ``r==>s``, ``~s``], ``p==>~q``),
REPEAT STRIP_TAC THEN
REPEAT RES_TAC
);
\end{lstlisting}

\section{Session Transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> # # # # # val problem2_thm =

[~(s :bool), (r :bool) ==> (s :bool),
 (p :bool) /\ (q :bool) ==> (r :bool)] |- (p :bool) ==> ~(q :bool):
   thm
\end{verbatim}
  \end{scriptsize}
\end{session}

\chapter{Proof of problem3_thm}

\section{Problem Statement}

Our task is to prove the following theorem without using \texttt{PROVE_TAC}.

\HOLexerciseOneZeroTheoremsproblemThreeXXthm

\section{HOL Code Proving problem3_thm}

\begin{lstlisting}[frame=trBL]
val problem3_thm =
TAC_PROOF(
([``~(p/\q)``, ``~p ==> r``, ``~q ==> s``],``r\/s``),

PAT_ASSUM ``~(p/\q)`` (fn th => (ASSUME_TAC (REWRITE_RULE [DE_MORGAN_THM] th))) THEN

PAT_ASSUM ``~p\/~q`` (fn th => ASSUME_TAC (REWRITE_RULE [] (DISJ_IMP th))) THEN

ASSUME_TAC(IMP_TRANS(ASSUME ``p==>~q``)(ASSUME ``~q==>s``)) THEN

PAT_ASSUM ``~p==>r`` (fn th => ASSUME_TAC (REWRITE_RULE [] (DISJ_IMP (ONCE_REWRITE_RULE [DISJ_SYM] (IMP_ELIM th))))) THEN

ASSUME_TAC(IMP_TRANS(ASSUME ``~r==>p``)(ASSUME ``p==>s``)) THEN

ASSUME_TAC (REWRITE_RULE [] (IMP_ELIM (ASSUME ``~r==>s``))) THEN

ASM_REWRITE_TAC []
);
\end{lstlisting}

\section{Session Transcript}

\setcounter{sessioncount}{0}
\begin{session}
  \begin{scriptsize}
\begin{verbatim}

> val problem3_thm =

[~((p :bool) /\ (q :bool)), ~(p :bool) ==> (r :bool),
 ~(q :bool) ==> (s :bool)] |- (r :bool) \/ (s :bool):
   thm
val it = (): unit
>
\end{verbatim}
  \end{scriptsize}
\end{session}

%% ------------------------------------------
%% Change to letters for appendix
%% ------------------------------------------

%% ------------------------------------------
%% this restarts the section numbering
%% ------------------------------------------
\appendix{}

%% ------------------------------------------
% label using capital letters
%% ------------------------------------------
\renewcommand{\thechapter}{\Alph{chapter}}

\chapter{Source Code for exercise9Script}
\label{cha:source-code-sample}

The following code is from \emph{exercise9Script.sml}, which is located
in directory "../HOL/"
\lstinputlisting{../HOL/exercise9Script.sml}

\chapter{Source Code for exercise10Script}
\label{cha:source-code-sample}

The following code is from \emph{exercise10Script.sml}, which is located
in directory "../HOL/"
\lstinputlisting{../HOL/exercise10Script.sml}

\end{document}