\documentclass[a4paper,12pt]{report}
\usepackage{graphicx} % inserting images
\usepackage{hyperref} % PDF links
\usepackage{setspace} % for switching between double/single space in document
\usepackage{fancyhdr} % package for changing Headings style
% setting the margins of page
\usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry}                 
%\usepackage{amsthm,amssymb,amsmath}
\usepackage{amssymb}
%\usepackage{amsmath}
\usepackage{titlesec}
%\usepackage{hyperref}
\usepackage{xepersian}
%\renewcommand{\thefigure}{\arabic{figure}}
% tell tex engine address of folder containing your pictures
\graphicspath{{images/}}
% commands to print the page number in header
\pagestyle{fancy}
\cfoot{}
\lhead{\thepage}

% commands related to XePersian package
\settextfont[Scale=1.1]{XB Zar}
\setdigitfont{XB Zar}
%\setlatintextfont{LinLibertine}
% -------------------------------------
%\input{commands}
%\input{jeld_info}
%\theoremstyle{definition}

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtheorem{definition}{تعریف}[chapter]
%\theoremstyle{theorem}
\newtheorem{theorem}{قضیه}[chapter]
\newtheorem{lemma}{لم}[chapter]
\newtheorem{proposition}{گزاره}[chapter]
\newtheorem{corollary}{نتیجه}[chapter]
\newtheorem{remark}{ملاحظه}[chapter]
%\theoremstyle{definition}
\newtheorem{example}{مثال}[chapter]
\renewcommand*{\baselinestretch}{1.5}
\renewcommand{\bibname}{مراجع}
\makeatletter
\renewcommand*\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \if@RTL\leftskip\else\rightskip\fi \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\if@RTL\rightskip\else\leftskip\fi\@tempdima
      \hskip -\if@RTL\rightskip\else\leftskip\fi
      #1\nobreak\leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
  
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \centerline{\huge\bfseries\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \vskip 40\p@
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
    
    \renewcommand{\@starttoc}[1]{%
  \hboxR to \textwidth{عنوان \hfill صفحه} 
  \begingroup
    \makeatletter
    \@input{\jobname.#1}%
    \if@filesw
      \expandafter\newwrite\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \@nobreakfalse
  \endgroup}
  
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
  \titlespacing{\chapter}{7pc}{7cm}{5cm}[5pc]
  
  % insert each of your chapters with a \inlcude{filename} command as below
%\singlespacing
%\settextfont[Scale=2]{XB Zar}
%\include{chap1b}
\settextfont[Scale=1.1]{XB Zar}
\setdigitfont{XB Zar}
\begin{document}
\pagestyle{empty}
\thispagestyle{empty}
\tableofcontents
%\pagenumbering{arabic}
\pagestyle{fancy}
\include{chap1}
% -----------------------------------------------------------------------

% If do not have appendix then comment following 3 lines
\appendix
%\include{peyvast1}
%\include{peyvast2}
% -------------------------------------------------------



\end{document}