%
% This is the LaTeX template file for preparing lecture notes for 
% courses taught by Neil Calkin.  When preparing 
% LaTeX notes for this class, please use this template.
%
% The body contains examples: study them, run 
%
%	pdflatex <yourfilename.tex>
%
% and see how they work.   View the output file with acrobat,
% or print it out to compare input and result.
%
%
%
%
%


\documentclass{article}
\usepackage{epsfig,amsmath,amssymb}
\usepackage{graphicx}
\usepackage{color}
\usepackage[myheadings]{fullpage}
%
% The following commands set up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number.
%
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

%
% The following macro is used to generate the header.
%
\newcommand{\lecture}[4]{
   \pagestyle{myheadings}
   \thispagestyle{plain}
   \newpage
   \setcounter{lecnum}{#1}
   \setcounter{page}{1}
   \noindent
   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf Combinatorial Analysis
                        \hfill Fall 2010} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Lecture #1: #2  \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it Lecturer: #3 \hfill Scribe: #4} }
      \vspace{2mm}}
   }
   \end{center}
   \markboth{Lecture #1: #2}{Lecture #1: #2}
   {\bf Disclaimer}: {\it These notes are intended for students in the class
listed above: they are not guaranteed to be complete or even necessarily
correct.  They may only be redistributed with permission, which you may
expect will be liberally granted.  Ask first, please.} \vspace*{4mm}
}

%
% Convention for citations is authors' initials followed by the year.
% For example, to cite a paper by Leighton and Maggs you would type
% \cite{LM89}, and to cite a paper by Strassen you would type \cite{S69}.
% (To avoid bibliography problems, for now we redefine the \cite command.)
% Also commands that create a suitable format for the reference list.
\renewcommand{\cite}[1]{[#1]}
\def\beginrefs{\begin{list}%
        {[\arabic{equation}]}{\usecounter{equation}
         \setlength{\leftmargin}{2.0truecm}\setlength{\labelsep}{0.4truecm}%
         \setlength{\labelwidth}{1.6truecm}}}
\def\endrefs{\end{list}}
\def\bibentry#1{\item[\hbox{[#1]}]}

%Use this command for a figure; it puts a figure in wherever you want it.
%usage: \fig{NUMBER}{SPACE-IN-INCHES}{CAPTION}
\newcommand{\fig}[3]{
			\vspace{#2}
			\begin{center}
			Figure \thelecnum.#1:~#3
			\end{center}
	}
% Use these for theorems, lemmas, proofs, etc.
\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{{\bf Proof:}}{\hfill\rule{2mm}{2mm}}


\def\Z{\hbox{$\mathbb Z$}}
\def\Q{\hbox{$\mathbb Q$}}
\def\R{\hbox{$\mathbb R$}}
\def\N{\hbox{$\mathbb N$}}
\def\C{\hbox{$\mathbb C$}}



% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, PUT THEM HERE:
\allowdisplaybreaks

\def\e{\hbox{$\mathcal E$}}
\def\o{\hbox{$\mathcal O$}}

\def\bea{\begin{eqnarray*}}
\def\eea{\end{eqnarray*}}

\def\lp{\left(}
\def\rp{\right)}
\def\A{\hbox{$\mathcal A$}}
\def\B{\hbox{$\mathcal B$}}



\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{8}{September 3}{Neil Calkin}{Erin Doolittle and Jeannie Friedel}

\section{Power Series Inverse}
\underline{Example:}
\[(1+x)(1-x+x^2-x^3 +x^4+...)\]
converges in the ring of formal power series.  So we write 
\[(1+x)^{-1}= 1-x+x^2-x^3 +x^4+...\]
Since we are in a commutative ring (for now) so $f(x)g(x) = g(x)f(x)$. If $f(x)$ has an inverse, $g(x)$ say, that is $f(x)g(x) = 1$ then it is unique.\\

\noindent(Non-commutative version: if $f(x)$ has a right inverse $g(x)$ and a left inverse $h(x)$ then $g(x) = h(x)$.)\\

\begin{proof}
\bea
h(x)f(x) = 1 & & f(x)g(x) = 1\\
&g(x) = \left(h(x)f(x)\right)g(x) = h(x)\left(f(x)g(x)\right) = h(x)&
\eea
\end{proof}

\section{Which power series have an inverse?}
Suppose $f(x)$ has coefficient in a commutative ring, R (e.g. \Z).   When does there exist $g(x)$ power series \underline{over the same ring} so that $f(x)g(x) = 1$?
\bea
f(x) & = & f_0 + f_1x + f_2x^2 + \cdots\\
g(x) & = & g_0 + g_1x + g_2x^2+ \cdots\\
fg & = & (f_0 + f_1x + f_2x^2 + \cdots) (g_0 + g_1x + g_2x^2+ \cdots)\\
& = & f_0g_0 + (f_1g_0 + f_0g_1)x + (f_2g_0 + f_1g_1+f_0g_2)x^2 +\cdots
\eea
\subsection{Method 1}
So, if $fg =1$, we need to simultaneously satisfy
\bea
f_0g_0 = 1 &\Rightarrow & f_0 \text{ must be a unit in $\R$, that is $f^{-1}_0$ exists so in $R = \Z$, this means } f_0 = \pm 1\\
f_1g_0 + f_0g_1 = 0 && \\
f_2g_0 + f_1g_1+ f_0g_2 = 0 && \\
\eea

\begin{tabular}{l c c l c}
Then & $f_1g_0 = -f_0g_1$ & $\Longleftrightarrow$ & $g_1 = -f_0^{-1}f_1g_0$ & \\
& & $\Longrightarrow$ & $f_1g_0 + f_0g_1 =0$.\\
\\
Then & $f_2g_0 + f_1g_1 + f_0g_2 = 0$ & $\Longleftrightarrow$ & $g_2 =  -f_0^{-1}(f_2g_0 + f_1g_1)$\\
\\
& $f_3g_0 + f_2g_1 + f_1g_2 +f_0g_3= 0$ & $\Longleftrightarrow$ & $g_3 =  -f_0^{-1}(f_3g_0 + f_2g_1 + f_1g_2)$
\end{tabular}

So we are able to construct (and actually compute!) $g(x) = f(x) ^{-1}$.
\subsection{Method 2}
\begin{proof}
Alternative proof: If $f_0^{-1}$ exist, $f(x)^{-1}$ exists.\\

\bea
(1-y)^{-1} & = & 1 + y + y^2\\
f(x) & = & f_0(1 + f_0^{-1}f_1x +f_0^{-1}f_2x^2 + \cdots)\\
& = & f_0(1 - x(-f_0^{-1}f_1 - f_0^{-1}f_2x - f_0^{-1}f_3x^2 + \cdots))\\
& = & f_0(1 - xh(x) ) \text{ where } h(x) = -f_0^{-1}f_1 - f_0^{-1}f_2x - f_0^{-1}f_3x^2 + \cdots)\\
f(x)^{-1} & = & (1-xh(x))^{-1}-f_0^{-1}\\
& = & (1 + xh(x) +x^2h(x)^2 + x^3h(x)^3 +\cdots)f_0^{-1}
\eea

which converges since $|xh(x)|_\mu < 1$.
\end{proof}\\

\underline{Example:}
If $f(x) = 1-x-x^{k+1}$,
\[f(x) ^{-1} = \frac{1}{1 -x(1+x)^k} = \sum\limits_{k=0}^{\infty} x^\ell(1+x^k)^\ell\]
\bea
[x^n]f(x)^{-1} & = & \sum\limits_{\ell=0}^{\infty} [x^{n-\ell}](1+x^k)^\ell \;\;\;\;\;\;\;\text{ Need: } n-\ell \ge 0, k|(n-\ell)\\
& = & \sum\limits_{t=0}^{\lfloor\frac{n}{k}\rfloor} [x^{kt}](1+x^k)^{n-kt} \;\;\;\; \text{ Put: } kt = n-\ell, 0\le kt\le n\\
& = & \sum\limits_{t=0}^{\lfloor\frac{n}{k}\rfloor} \binom{n-kt}{t}
\eea
\subsection{Method 3}
Under certain circumstances the following is easy-ish to compute. Set $f(x) = f_0(x)$ and suppose$f(0) = 1$.
\bea
\frac{1}{f_0(x)} & = & \frac{f_0(-x)}{f_0(x)f_0(-x)}
\eea
Since $f_0(x)f_0(-x)$ is even, we can write if as $f_1(x^2)$, where perhaps we can compute $f_1(y)$.
\bea
\frac{1}{f_0(x)} & = & \frac{f_0(-x)}{f_1(x^2)}\\
& =& \frac{f_0(-x)f_1(-x^2)}{f_1(x^2)f_1(-x^2)}\\
& =& f_0(-x)f_1(-x^2)f_2(-x^4)f_3(-x^8)\cdots\\
\text{Since } & &f_0 = 1 + a_1x +a_2x^2 + \cdots\\
\Rightarrow& &f_0(x)f_0(-x) = (1 + a_1x +a_2x^2 + \cdots)(1 + a_1x +a_2x^2 + \cdots)\\
& = & 1 +(2a_2 -a_1^2)x^2 +\cdots)\\
& = & 1 + b_1^2 + b_2x^4 +\cdots\\
\Rightarrow & & f_k(y) = 1 + c_1y + c_2y^2 +\cdots\\
&& f_k(x^{2^k}) = 1 - c_1x^{2^k} + c_2x^{2^{k+1}} +\cdots
\eea
So, $f_k(x^{2^k}) \rightarrow 1$ as $k\rightarrow\infty$.

Note: to compute all coefficients in $\frac{1}{f(x)}$ up to $x^N$ requires the product of $f_k(-x^{2^k})$ up to $k \ge \log_2N$ ($k = \lceil\log_2 N\rceil$) giving a product of $k+1$ terms.
We can do this by using Fourier Transformations.

This is fast precisely when we can compute $f_k(y)$ efficiently.\\


\textbf{
{\color{red}Exercise :  $f(x) = 1 = x^j$.  What are the $f_k$'s? And what does this method give us?}}\\

\subsection{What happens with $f_0 = 1-x-x^2$?}
\bea
f_0(-x) & = & (1+x-x^2)\\
f_0(x)f_0(-x) & = & (1 + x - x^2)(1 -x- x^2) \\
& = & (1 -3x^2 +x^4)\\
f_1(y) & = & 1-3y+y^2\\
f_1(y)f_1(-y) & = & (1-3y+y^2)(1+3y+y^2)\\
& = & (1-9y^2 +2y^2 +y^4)\\
& = & 1-7y^2 +y^4\\
f_2(z) & = & 1-7z+z^4\\
f_k(y) & = & (1-a_ky +y^2)\\
f_k(-y) & = & (1+a_ky+y^2)\\
f_k(y)f_k(-y) & = & 1 -(a_k^2 -2)y^2 +y^4)\\
a_{k+1} & = & a_k^2 - 2
\eea
and obtain a recurrence to obtain $a_k$'s, and hence a factorization of $\frac{1}{1-x-x^2}$.

\end{document}
