\documentclass[12pt]{report}
\usepackage{amsthm,amsmath,amssymb}
\usepackage{mathrsfs}
\usepackage{latexsym}
%\usepackage{ntheorem}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage[all]{xy}
\usepackage{setspace}
\usepackage{makeidx}
\makeindex
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usepackage[left=2.5cm,top=4.5cm,bottom=2.3cm,right=3cm,head=1cm,foot=1cm]{geometry}
%\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}
\setlatintextfont{Junicode}
\defpersianfont\traffic{B Traffic}
\defpersianfont\nastaliq{IranNastaliq}
%here comes fancy definitions%%%%%%%%%%%%%%
%\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
%\renewcommand{\chaptermark}[1]{%
      % \markboth{#1}{}}
 \renewcommand{\sectionmark}[1]{% 
         \markright{\thesection\ #1}}      
%\fancyhf{} % delete current header and footer
\fancyhead[RO]{\slshape\leftmark}
\fancyhead[LE]{\slshape\rightmark}
%\fancyhead[LO,RE]{\slshape \thepage}
\renewcommand{\headrulewidth}{0.4pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{theorem}{قضیه}[section]
\newtheorem{lemma}[theorem]{لم}
\newtheorem{proposition}[theorem]{گزاره}
\newtheorem{corollary}[theorem]{نتیجه}
\newtheorem{definition}{تعریف}[section]

%\theoremstyle{definition}
%\newtheorem*{definition}{تعریف}
\newtheorem{remark}{ملاحظه}
\newtheorem{example}{مثال}
\renewcommand\proofname{برهان}
%%Mathematical Operators

\newcommand{\HH}{\mathbb{H}}
\newcommand{\LL}{\mathbb{L}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\ZZ}{\mathbb{Z}}

\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}

\newcommand\calA{{\mathcal A}}
\newcommand\calC{{\mathcal C}}
\newcommand\calI{{\mathcal I}}
\newcommand\calL{{\mathcal L}}
\newcommand\calP{{\mathcal P}}
\newcommand\calR{{\mathcal R}}

\newcommand{\scrB}{\mathscr{B}}
\newcommand{\scrC}{\mathscr{C}}
\newcommand{\scrD}{\mathscr{D}}
\newcommand{\scrE}{\mathscr{E}}
\newcommand{\scrT}{\mathscr{T}}

\newcommand\rmT{\mathrm{T}}
\newcommand\rmD{\mathrm{D}}
\newcommand\rmd{\mathrm{d}}
\newcommand\rmB{\mathrm{B}}

\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\alt}{Alt}
\DeclareMathOperator{\Bd}{Bd}
\DeclareMathOperator{\Int}{Int}
\DeclareMathOperator{\Ext}{Ext}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\curl}{curl}
\DeclareMathOperator{\divergence}{div}
\DeclareMathOperator{\im}{Image}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\diam}{diam}
\DeclareMathOperator{\width}{width}
\DeclareMathOperator{\supp}{Supp}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\cl}{Cl}
%\DeclareMathOperator{\gcd}{gcd}
\def\st{\mathrm{s.t}}

\newcommand{\To}{\longrightarrow}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\numberwithin{figure}{chapter}
\numberwithin{equation}{chapter}
\numberwithin{table}{chapter}
\onehalfspace
\baselineskip=0.75cm
\def\eee{\end{document}}
\begin{document}
%\makeindex
\pagestyle{fancy}
\lhead{\thepage}
\cfoot{}
%--------------------------------------------------------------------------------------------------------------------------%
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
\newpage
\tableofcontents
\thispagestyle{empty}
%\listoffigures
\newpage
\addcontentsline{toc}{chapter}{مقدمه وتاریخچه}
\include{begin2}
\include{ch1}


\end{document}