\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Mamouni My Ismail}

%%%%%%%%Nouvelles Commandes%%%%%%%%%%%
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\vers}{\longrightarrow}
\newcommand{\impliq}{\Longrightarrow}

\newcommand{\texte}{Texte qui se répète}


\newcommand{\app}[5]{\begin{array}[t]{lrll}
                    #1:&#2&\longrightarrow & #3 \\
                    &#4&\longmapsto & #5
            \end{array}}
\newcommand{\norme}[1]{\Vert #1\Vert}
\newcommand{\implique}[2]{#1 \impliq #2}
\newcommand{\somme}[4]{\sum_{#1=#2}^{#3}#4_#1}

%%%%%%%%%%En tetes%%%%%%%%%%%%%%%%
\usepackage{fancybox}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{\thepage}
\cfoot{gfgfg}
\lhead{Droite en Haut}


%%%%%%%%%Nouveaux environnement%%%%%%%%%%%%%%
\newtheorem{thm}{Théorème}
\newtheorem{lem}{Lemma}[section]
\newtheorem{defi}{Definition}[subsection]


\begin{document}
\tableofcontents

\newpage
\section{Section 1}
\subsection{Sous Section 1}
\begin{defi}
hghggh
\end{defi} 

\begin{defi}
hghggh
\end{defi} 
\begin{thm}
hghghgh
\end{thm}

\begin{thm}
aaaaa
\end{thm}
\begin{lem}
hghghgh
\end{lem}

\begin{lem}
hghghgh
\end{lem}

\subsection{Sous Sectio}
\begin{defi}
hghggh
\end{defi}
\section{Section 2}
\begin{lem}
hghghgh
\end{lem}

ffff
Soit $x\in\R A\vers B, P\impliq B$  \texte  \texte \texte 

$\text{ Soit }x \in \R$

$\norme{x}$

$\implique{A}{C}$

$\somme{j}{0}{n+1}{y}$

$\app{f}{A}{B}{x}{f(x)}$

\begin{thm}
hghghgh
\end{thm}

\begin{thm}
aaaaa
\end{thm}
\end{document}