\usepackage{fullpage}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{hyperref}
\usepackage[square]{natbib}
\usepackage[labelfont=bf,textfont=sl,tableposition=top,small]{caption}
\usepackage{fancyhdr}
\usepackage{makeidx}

\theoremstyle{plain}% default
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem*{cor}{Corollary}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[chapter]
\newtheorem{conj}{Conjecture}[chapter]
\newtheorem{exmp}{Example}[chapter]
\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}

\renewcommand{\floatpagefraction}{0.95}
\renewcommand{\textfraction}{0.05}

\def\appendixname{Appendix}

%% Chapter heading layout
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  \reset@font
  \vspace*{5\p@}%
  {\parindent \z@ 
    \begin{flushleft}
      \reset@font \scshape \bfseries \Huge \thechapter \par
    \end{flushleft}
    \hrule
    \begin{flushleft}
      \reset@font \LARGE \bfseries \strut #1\strut \par
    \end{flushleft}
    \vskip 50\p@
  }}
\def\@makeschapterhead#1{%
  \reset@font
  \vspace*{5\p@}%
  {\parindent \z@ 
    \begin{flushleft}
      \reset@font \scshape \bfseries \Huge \vphantom{\thechapter} \par
    \end{flushleft}
    \hrule
    \begin{flushleft}
      \reset@font \LARGE \bfseries \strut #1\strut \par
    \end{flushleft}
    \vskip 50\p@
  }}

%% Fancyhdr settings
\fancyfoot{}
\headsep = 12pt
\fancyhead[LE,RO]{\small \thepage}
\fancyhead[RE]{\small \it \leftmark}
\fancyhead[LO]{\small \it \rightmark}
\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[LE,RO]{\small \thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
}

\renewcommand{\headrulewidth}{0pt}
\makeindex

\hypersetup{colorlinks = true,linkcolor = blue,anchorcolor = green,
  citecolor = blue,filecolor = red,pagecolor = red, urlcolor=blue,
  breaklinks=true,plainpages=false}