%\RequirePackage{atbegshi}
\documentclass[french]{beamer}
\usepackage{etex}

\usepackage[beamer,utf8,fourier]{preambuleTrm}
%\usepackage[french,vlined,boxed]{algorithm2e}
\usepackage{bookmark,multido}
%\usepackage{xlop}


\usepackage{tikz}
\usetikzlibrary{automata,fit,trees,matrix,arrows,decorations.pathmorphing,shapes,arrows,chains,positioning,intersections,backgrounds,calc,through,mindmap}
\newcommand{\myunit}{1.1cm}
\usepackage{tkz-graph}
\usepackage{circuitikz}


\usepackage{caption}
\captionsetup{labelformat=empty,font=footnotesize}


\usepackage{media9}

%\usepackage{multimedia}
% \usepackage{cclicenses}
% \usepackage{cclicence}
\setbeamertemplate{theorems}[numbered]




\usepackage{algo}

\renewcommand{\algocommentfont}{\small\ttfamily\itshape}

\newcommand\nor{\downarrow}
\newcommand\nand{\uparrow}
\newcommand\xor{\oplus}

\newcommand\foncpart{\rightarrow\!\!\!\!\!\!\shortmid}
\newcommand\fonctot{\rightarrow}
\newcommand\injpart{\rightarrowtail\!\!\!\!\!\!\!\shortmid}
\newcommand\injtot{\rightarrowtail}
\newcommand\surjpart{\twoheadrightarrow\!\!\!\!\!\!\!\shortmid}
\newcommand\surjtot{\twoheadrightarrow}
\newcommand\bijpart{\rightarrowtail\!\!\!\!\!\!\!\shortmid\!\!\!\!\twoheadrightarrow}
\newcommand\bijtot{\rightarrowtail\!\!\!\!\!\!\!\!\!\twoheadrightarrow}


\newtheorem{exercice}{Exercice}


\setlength{\columnseprule}{0pt}

%\setlength{\parskip}{0pt}

\graphicspath{{/home/moi/IUT/PolyINFO1}{/home/moi/Lycee/TDmaple/2006_7/}{/home/moi/Figures/Arbres_Graphes/}{/home/moi/Figures/FigSTI/}{/home/moi/Figures/FigMaple/}{/home/moi/Photos/Maths/}{/home/moi/Photos/Tehessin/}{/home/moi/Figures/FigSTI/}{/home/moi/Figures/FigSeconde/}{/home/moi/Lycee/Informatique/XCAS/2008_9/}{/home/moi/Lycee/TDmaple/2008_9/}{/home/moi/IUT/Thierry/Conversions/}{/home/moi/Photos/informathix/}{/home/moi/Lycee/Informatique/PafAlgo/}}




\newcommand\caml{\lstset{numbers=none,language=Caml,xleftmargin=10pt,%
keywordstyle =\small\color{orange!40}\usefont{OT1}{cmtt}{b}{n},basicstyle=\small\ttfamily\color{white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{black!90!red},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}



\newcommand\haskell{\lstset{numbers=none, escapeinside={(*@}{@*)},language=haskell,xleftmargin=10pt,%
keywordstyle =\footnotesize\color{blue!40}\usefont{OT1}{cmtt}{b}{n},basicstyle=\footnotesize\ttfamily\color{white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{black!90!blue},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}


\newcommand\prolog{\lstset{numbers=none,language=prolog,xleftmargin=10pt,%
keywordstyle =\color{blue!40}\usefont{OT1}{cmtt}{b}{n},basicstyle=\ttfamily\color{white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{black!90!blue},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}




\setcounter{tocdepth}{1} %\setcounter{page}{0}


\renewcommand\FancyVerbFormatLine[1]{\colorbox{green}{#1}}


\mode<presentation>
{
  \usetheme[secheader]{Madrid}
  % or ...Warsaw

  \setbeamercovered{highly dynamic}
  % or whatever (possibly just delete it)
}
\usepackage{elephantbird}

\newcommand{\triangleup}{\Delta}

\begin{document}


\title[] % (optional, use only with long paper titles)
{Les relations en informatique}

\subtitle{INFO1 - Semaines 39 \& 40}

\author[] % (optional, use only with lots of authors)
{Guillaume CONNAN }
% - Give the names in the same order as the appear in the paper.
% - Use the inst{?} command only if the authors have different
%   affiliation.

\institute{\textsc{IUT} de Nantes - Dpt d'informatique }% (optional, but mostly needed)

\logo{\includegraphics[scale=0.15]{logo_iut}}

%\logo{\includegraphics[scale=0.15]{big_connan}}

\date[] % (optional, should be abbreviation of conference name)
{Dernière mise à jour: \today{} à \now}
% - Either use conference name or its abbreviation.
% - Not really informative to the audience, more for people (including
%   yourself) who are reading the slides online

\subject{ }


\beamerdefaultoverlayspecification{<+->}

% \AtBeginSubsubsection[]
% {
%   \begin{frame}<beamer>
%     \frametitle{Sommaire}
%  {\scriptsize
% \begin{multicols}{2}
%     \tableofcontents[currentsection,currentsubsection]
%        \end{multicols}
% }

%   \end{frame}
% }




% \AtBeginSubsection[]
% {\scriptsize
%   \begin{frame}<beamer>
%     \frametitle{Sommaire}
%  {\tiny
% \begin{multicols}{2}
%     \tableofcontents[currentsection,currentsubsection]
%        \end{multicols}
% }

%   \end{frame}
% }





\AtBeginSection[]
{
  \begin{frame}<beamer>
    \frametitle{Sommaire}
 {\scriptsize
\begin{multicols}{2}
    \tableofcontents[currentsection]
       \end{multicols}
}

  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

\beamerdefaultoverlayspecification{<+->}




\newcommand{\TR}{\mathcal{T}}


\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
 \frametitle{Sommaire}
{\scriptsize
\begin{multicols}{2} 
 \tableofcontents
\end{multicols}
}

 
 \end{frame}


\haskell


\section{Relations binaires}

\subsection{Au CE1}



\begin{frame}
  
%\begin{figure}
\begin{center}
  \includegraphics[width=0.7\linewidth]{CE1-relations}
\end{center}
%\caption{Comment j'ai étudié les relations en CE1...}
\label{ce1}
%\end{figure}


\end{frame}


\subsection{Au CM1}
\begin{frame}
%\begin{figure}
\begin{center}
  \includegraphics[width=0.9\linewidth]{rel_cm1}
\end{center}
%\caption{Comment j'ai étudié les relations en CE1...}
\label{ce1}
%\end{figure}
\end{frame}
\subsection{À l'\textsc{Iut}}


\begin{frame}

  $$
\begin{pmatrix}
1&1&0&0&0\\
1&0&0&0&0\\
0&1&0&0&0\\
0&0&1&0&1\\
0&0&0&0&1\\
0&0&0&0&1\\
\end{pmatrix}
$$
\end{frame}



\begin{frame}[fragile]

  
\begin{center}
             \begin{tabularx}{0.75\textwidth}{Y{0}}
	     \whline
             \textbf{De} & \textbf{Vers}\\
\whline
 C & landau, poupée\\
\hline
N & landau\\
\hline
M & poupée\\
\hline
O& ballon, train\\
\hline
D & train\\
\hline
H& train\\
             \whline
             \end{tabularx}
             \end{center}



\end{frame}





\begin{frame}
$$
E=\bigl\{C,M,N,O,D,H\bigr\}\qquad F=\bigl\{\ell,p,b,f,t\bigr\}
$$

\pause

$$
\GR_\RR=\bigl\{(C,\ell),(C,p),(N,\ell),(M,p),(O,b),(O,t),(D,t),(H,t)\bigr\}
$$

\pause

$$
\GR_\RR=\bigl\{C\mapsto \ell,C\mapsto p,N\mapsto \ell,M\mapsto p,O\mapsto b,O\mapsto t,D\mapsto t,H\mapsto t\bigr\}
$$

\end{frame}



\begin{frame}[fragile]
  \begin{lstlisting}
import qualified Data.Map as Map
import qualified Data.Set as Set

data Rel a b = Rel (Set.Set a, Set.Set b, Map.Map a (Set.Set b)) 

e = Set.fromList ['C','N','M','O','D','H']
f = Set.fromList ['l','p','b','f','t']

g = Map.fromList [('C',Set.fromList ['l','p']),
                  ('N',Set.fromList ['l']), 
                  ('M',Set.fromList ['p']),
                  ('O',Set.fromList ['b','t']),
                  ('D',Set.fromList ['t']),
                  ('H',Set.fromList ['t'])
                 ]
    
r = Rel(e,f,g)
  \end{lstlisting}
\end{frame}

\begin{frame}[fragile]
Après, il n'y a plus qu'à construire une multitude de fonctions:

\begin{lstlisting}
source :: Rel a b -> Set.Set a
source (Rel (s,b,gr)) = s

but :: Rel a b -> Set.Set b
but (Rel (s,b,gr)) = b

graphe :: Rel a b -> Map.Map a (Set.Set b)
graphe (Rel (s,b,gr)) = gr

images_de ::(Ord a) =>  Rel a b -> a -> Set.Set b
images_de rel e1 = (graphe rel) Map.! e1

est_en_relation ::(Ord a, Ord b) => Rel a b -> a -> b -> Bool
est_en_relation rel e1 e2 = Set.member e2 (images_de rel e1)  
\end{lstlisting}
\end{frame}







\begin{frame}

Mettons tout ceci au clair:

  \begin{definition}
Une \textit{relation binaire}  entre deux ensemble E et  F est la donnée
de E, F et d'un
sous-ensemble du produit cartésien $E\times F$.

Une    \textit{relation   $n$-aire}    entre   $n$    ensembles   $E_1$,
$E_2$,...,$E_n$ est la donnée de ces ensembles et d'un sous-ensemble du produit cartésien $E_1\times
E_2\times \cdots E_n$.
\end{definition}
\end{frame}

\begin{frame}
  \begin{definition}
  
L'ensemble des éléments de $E$ qui ont au moins une image par $%
\mathcal{R}$ est l'ensemble de définition ou \textbf{domaine} de dé%
finition de la relation $\mathcal{R}$ que l'on note le plus souvent par $%
\mathcal{D}_{\mathcal{R}}$ ou $\limfunc{dom}(\mathcal{R})$. Remarquons que l'on
a forcément $\limfunc{dom}\left( \mathcal{R}\right) \subseteq E.$%
$$
\limfunc{dom}\left( \mathcal{R}\right) =\left\{ x\mid \exists y \left((x,y)\in \GR_{\RR}\right)\right\}
$$

\end{definition}

\pause



\begin{definition}
  
L'ensemble des éléments de $F$ qui ont au moins un antécé%
dent dans $E$ est appelé l'image de $\mathcal{R}$ ou l'image de $E$ par $%
\mathcal{R}$ ou le \textbf{codomaine} de $\mathcal{R}$. On utilise indiff%
éremment les notations suivantes pour désigner le codomaine de $%
\mathcal{R}$%
noté
$
\limfunc{Im}\mathcal{R}\text{ ou }\limfunc{Im}(\mathcal{R})\text{ ou }\limfunc{Ran}(%
\mathcal{R})\text{ ou }\limfunc{codom}\left( \mathcal{R}\right)
$


$$
\limfunc{Ran}\left( \mathcal{R}\right) =\left\{ y\mid \exists x \left((x,y)\in \GR_{\RR}\right)\right\}
$$
\end{definition}



\end{frame}



\begin{frame} \frametitle{Matrice d'adjacence}
  

 Si les ensembles $E$ et $%
F $ sont définis par:

$$
E =\left\{ x_{1},x_{2},\cdots ,x_{n}\right\} \qquad F =\left\{ y_{1},y_{2},\cdots ,y_{p}\right\}
$$


alors la relation $\mathcal{R}$ est définie par la matrice $R=(r_{i,j})\in \mathfrak{M}_{n,p}$ définie par:
$$
R=\left( 
\begin{array}{cccccc}
r_{1,1} & \cdots & r_{1,j} & \cdots & \cdots & r_{1,p} \\ 
\vdots &  & \vdots &  &  & \vdots \\ 
r_{i,1} &  & r_{i,j} &  &  & r_{i,p} \\ 
\vdots &  & \vdots &  &  & \vdots \\ 
r_{n,1} & \cdots & r_{n,j} & \cdots & \cdots & r_{n,p}%
\end{array}%
\right) \text{ avec }r_{i,j}=\left\{ 
\begin{array}{l}
1\text{ si }x_{i}\mathcal{R}y_{j} \\ 
0\text{ sinon}%
\end{array}%
\right.
$$

\end{frame}



\subsection{Relation transposée}

\begin{frame}

\begin{definition}
La \textbf{relation transposée} de la relation $\mathcal{R}=(E,F,G_{%
\mathcal{R}})$ est la relation notée $\transp{\RR}$ définie par $%
\transp{\RR}=(F,E,G_{\transp{\RR}})$ avec 
$
G_{\transp{\RR}}=\left\{ (y,x)\mid (x,y)\in G_{\mathcal{R}%
}\right\}
$,
c'est-à-dire $y\transp{\RR}x\Leftrightarrow x\mathcal{R}y$.
\end{definition}

\end{frame}


\begin{frame}\frametitle{Exemple}
  Considérons les ensembles  et la relation
suivants:
\begin{itemize}
\item Étudiants$=\bigl\{$Roger, Berthe, Jean-Pierre, Gudrun$\bigr\}$;
\item Chaînes$=\bigl\{$ TF1, Gulli, Zen TV$\bigr\}$;
\item  TV$=\bigl\{$Roger   $\mapsto$  Gulli,  Berthe   $\mapsto$  Gulli,
  Jean-Pierre $\mapsto$ Zen TV, Gudrun $\mapsto$ Gulli$\bigr\}$.
\end{itemize}

\pause

Ainsi       la       relation       $TV       \in       \text{Étudiants}
\longleftrightarrow\text{Chaîne}$       peut       s'interpréter      en
\og ... regarde ...\fg{}.

Que pensez-vous de la relation transposée?
\end{frame}



\subsection{Image, contre image}

\begin{frame}
\begin{definition}
  Si $U$  est une partie  de $E,$ $\mathcal{R}\left( U\right)  $ désigne
  l'ensemble des images des éléments de $U$ par $\mathcal{R}$. 
\end{definition}

\pause

\begin{definition}
Si $V$ est une partie de $F$, la contre image (ou l'image transposée) de 
$V$ par $\mathcal{R}$ est l'image de $V$ par $\transp{\RR}.$ Elle est
donc notée $\transp{\RR}\left( V\right) $.
\end{definition}


\end{frame}


\begin{frame}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

  \begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             ball color= gray!10,
          color = black,                   
minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{be,ga,de} }
\foreach \v/\n in {be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(ga)
\Edge(b)(be)
\Edge(b)(de)
\Edge(d)(ga)
\Edge(e)(de) 


\SetGraphUnit{1.5cm} 
\SO(e){c}
\SO[L=$\alpha$](de){al}


\begin{pgfonlayer}{background} 
\node[draw=blue,fill=blue!20,inner sep=1.5pt,fit=(a) (b) (d) (e) ] {};
\node[color=red,fill=red!20,inner  sep=2pt,fit=(be) (ga) (de)]{};
\node[inner sep=6pt,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
\node[inner sep=6pt,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}

\end{tikzpicture}
\end{center}
\caption{Image et contre-image}
\end{figure}
\end{frame}


\subsection{Égalité de deux relations}


\begin{frame}
  \begin{definition}
Les relations $\mathcal{R}_{1}=(E_{1},F_{1},G_{\mathcal{R}_{1}})$ et $%
\mathcal{R}_{2}=(E_{2},F_{2},G_{\mathcal{R}_{2}})$ sont égales si, et
seulement si, $E_{1}=E_{2}$ \pause \textbf{ET} $F_{1}=F_{2}$ \pause \textbf{ET} $G_{%
\mathcal{R}_{1}}=G_{\mathcal{R}_{2}}.$
\end{definition}
\end{frame}


\subsection{Principales opérations sur les relations}

\begin{frame}
  \begin{definition}
La \textbf{négation} de $\mathcal{R}_{1}$ (on dit aussi le compl%
émentaire de $\mathcal{R}_{1}$) est la relation: 
$$
\overline{\mathcal{R}_{1}}=\left( E,F,\complement_{E\times F}G_{%
\mathcal{R}_{1}}\right)
$$
\end{definition}
\end{frame}

\begin{frame}
  \begin{definition}
On dit que la relation $\mathcal{R}_{1}$ est incluse dans la relation $%
\mathcal{R}_{2}$ ou que la relation $\mathcal{R}_{1}$ est une \textbf{sous
relation} de la relation $\mathcal{R}_{2}$ si, et seulement si, $G_{\mathcal{%
R}_{1}}\subseteq G_{\mathcal{R}_{2}}.$ Cela signifie que 
$$
x\mathcal{R}_{1}y\Rightarrow x\mathcal{R}_{2}y
$$
et on écrit alors $\mathcal{R}_{1}\subseteq \mathcal{R}_{2}$.
\end{definition}

\end{frame}




\begin{frame}\frametitle{Inclusion}
  {\small

\begin{minipage}[t]{0.5\linewidth}
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color= black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
\Edge(a)(ga)
\Edge(c)(ga)
\Edge(d)(ga)
\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_1$}
\end{figure}
\end{minipage}



\pause



\begin{flushright}

\begin{minipage}[t]{0.5\linewidth}\vspace{-7cm}
\hspace{5.5cm} 
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             ball color= gray!10,
                             color = black,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
%\Edge(a)(ga)
\Edge(c)(ga)
%\Edge(d)(ga)
%\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner  sep=2pt,thick,ellipse,fit=(al)(be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_2$ est une sous-relation de $\RR_1$}
\end{figure}

\end{minipage}

\end{flushright}

}
\end{frame}






\begin{frame}\frametitle{Méthode B}
  Voici les notations utilisées en méthode B, $\mathcal{R}$ dé%
signant une relation de $E$ vers $F$. 

\textbf{Obligatoirement }$A\subseteq E$ \textbf{et} $B\subseteq F$.

\begin{itemize}
\item \textit{La relation }$\left( E,F,G_{\mathcal{R}}\cap \left( A\times
F\right) \right) $\textit{\ est notée }$A\vartriangleleft \mathcal{R},$%
\textit{\ c'est une sous relation de }$\mathcal{R}$\textit{\ et les
informaticiens parlent de \og restriction de domaine\fg{}.}

\item \textit{La relation }$(E,F,G_{\mathcal{R}}\cap (E\times B))$\textit{\
est notée }$\mathcal{R}\vartriangleright B,$\textit{\ c'est une sous
relation de }$\mathcal{R}$\textit{et les informaticiens parlent de
\og restriction de codomaine\fg{}.}

\item \textit{La relation }$\left( E,F,G_{\mathcal{R}}\cap \left( A\times
B\right) \right) $\textit{\ est notée }$A\vartriangleleft \mathcal{R}%
\vartriangleright B$\textit{, c'est une sous relation de }$\mathcal{R}\ $%
\textit{et les informaticiens parlent de \og restriction de domaine et de
codomaine\fg{}.}
\end{itemize}
\end{frame}






\begin{frame}
 \begin{definition}
 La \textbf{réunion} de $\mathcal{R}_{1}$ et de $\mathcal{R}%
_{2}$ est la relation $\mathcal{R}_{1}\cup \mathcal{R}_{2}=\left( E,F,G_{%
\mathcal{R}_{1}}\cup G_{\mathcal{R}_{2}}\right) .$

 L'\textbf{intersection} de $\mathcal{R}_{1}$ et de $\mathcal{R}%
_{2}$ est la relation $\mathcal{R}_{1}\cap \mathcal{R}_{2}=\left( E,F,G_{%
\mathcal{R}_{1}}\cap G_{\mathcal{R}_{2}}\right) .$
\end{definition}

\end{frame}




\begin{frame} %\frametitle{Réunion}

  {\small
%\begin{minipage}[t]{0.5\linewidth}
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
\Edge(a)(ga)
%\Edge(c)(ga)
\Edge(d)(ga)
%\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al)(be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_1$}
\end{figure}
%\end{minipage}\hspace{0.5cm}
}
\end{frame}

\begin{frame}

  {\small
%\vspace{-7cm}
%\begin{flushright}
%\begin{minipage}[t]{0.5\linewidth}%\vspace{-0.5cm}
%\hspace{5.5cm} 
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge[color=orange!50!yellow](a)(be)
\Edge[color=orange!50!yellow](a)(de)
\Edge[color=orange!50!yellow](c)(de)
%\Edge(d)(ga)
%\Edge(d)(de)
\Edge[color=orange!50!yellow](d)(ga)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_2$}
\end{figure}
%\end{minipage}
%\end{flushright}
}
\end{frame}






\begin{frame}% \frametitle{Réunion}
 
 {\small 
%\vspace{-0.33cm}

%\begin{minipage}[t]{0.5\linewidth}
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
\Edge(a)(ga)
%\Edge(c)(ga)
\Edge(d)(ga)
%\Edge(d)(de)
\Edge(e)(de)
\Edge[color=gray!80!yellow](a)(be)
\Edge[color=orange!50!yellow](a)(de)
\Edge[color=orange!50!yellow](c)(de)
%\Edge(d)(ga)
%\Edge(d)(de)
\Edge[color=gray!80!yellow](d)(ga)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al)(be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_1\cup\RR_2$}
\end{figure}
%\end{minipage}\hspace{0.5cm}
  }
\end{frame}





\begin{frame}% \frametitle{Intersection}
  
{\small 
%\begin{minipage}[t]{0.5\linewidth}
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
\Edge(a)(ga)
%\Edge(c)(ga)
\Edge(d)(ga)
%\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al)(be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_1$}
\end{figure}
%\end{minipage}\hspace{0.5cm}

}
\end{frame}

\begin{frame}

{\small
% \vspace{-7cm}
% \begin{flushright}
% \begin{minipage}[t]{0.5\linewidth}%\vspace{-0.5cm}
% \hspace{5.5cm} 
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge[color=orange!50!yellow](a)(be)
\Edge[color=orange!50!yellow](a)(de)
\Edge[color=orange!50!yellow](c)(de)
%\Edge(d)(ga)
%\Edge(d)(de)
\Edge[color=orange!50!yellow](d)(ga)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_2$}
\end{figure}
% \end{minipage}
% \end{flushright}
}
\end{frame}









\begin{frame} %\frametitle{Intersection}
 
 {\small 
% \vspace{-0.33cm}

% \begin{minipage}[t]{0.5\linewidth}
\begin{figure}
\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
%\Edge(a)(be)
%\Edge(a)(ga)
%\Edge(c)(ga)
%\Edge(d)(ga)
%\Edge(d)(de)
%\Edge(e)(de)
\Edge[color=gray!80!yellow](a)(be)
%\Edge[color=orange!50!yellow](a)(de)
%\Edge[color=orange!50!yellow](c)(de)
%\Edge(d)(ga)
%\Edge(d)(de)
\Edge[color=gray!80!yellow](d)(ga)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!20,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!20,inner sep=2pt,thick,ellipse,fit=(al)(be) (ga) (de)]{};
%\node[draw=blue,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=red,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\caption{$\RR_1\cap\RR_2$}
\end{figure}
%\end{minipage}\hspace{0.5cm}
  }
\end{frame}






\subsection{Composition de relations}


\begin{frame}
  \begin{definition}
$\mathcal{R}=(E,F,G_{\mathcal{R}})$ et $\mathcal{S}=(U,V,G_{\mathcal{S}})$
sont deux relations. 
La  composée  de  $\RR$  et  $\SR$  est  la  relation  $(E,V,G_{\mathcal{S}\circ
  \mathcal{R}})$ avec 

$$G_{\mathcal{S}\circ \mathcal{R}}=\left\{\left(
x,z\right)  \in  E\times V\mid\exists  y\in  F,\  \left( x,y\right)  \in
G_{\mathcal{R}} \land \left(
y,z\right) \in G_{\mathcal{S}}\right\}$$
\end{definition}
\end{frame}
\begin{frame} \frametitle{Composition}

{\footnotesize
\begin{tabular}[t]{ccc}

\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick}] 
\SetGraphUnit{.65cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 10pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
{\SetVertexNoLabel
\Vertices[empty,x=0,y=0,dir=\SO]{line}{a,b,c,d,e} }
\foreach \v in {a,b,c,d,e}{%
\Vertex[Node]{\v}}   
{\SetVertexNoLabel
\Vertices[empty,x=2,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge[color=yellow](a)(be)
\Edge[color=yellow](a)(ga)
\Edge(c)(ga)
\Edge(d)(ga)
\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
\node[draw=blue,fill=blue!40,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
\node[draw=black,fill=green!30,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F=U}] {};
\end{pgfonlayer}
\end{tikzpicture}

&

\pause

\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick}] 
\SetGraphUnit{.65cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 10pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
{\SetVertexNoLabel
\Vertices[empty,x=2,y=0,dir=\SO]{line}{1,2,3,4,5} }
\foreach \v in {1,2,3,4,5}{%
\Vertex[Node]{\v}}   
{\SetVertexNoLabel
\Vertices[empty,x=0,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge[color=yellow](be)(2)
\Edge[color=yellow](be)(4)
\Edge[color=yellow](ga)(5)
\begin{pgfonlayer}{background}
\node[draw=red,fill=red!40,,inner sep=4pt,thick,ellipse,fit=(1) (2) (3) (4) (5),pin={[pin edge={thick}]V}] {};
\node[draw=black,fill=green!30,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]U=F}] {};
\end{pgfonlayer}
\end{tikzpicture}


&

\pause

\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick}] 
\SetGraphUnit{.65cm}  
\SetUpEdge[lw= 1.5pt,color= black!70]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,
                             color=black,
                             ball color= gray!10,
                             minimum size= 10pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
{\SetVertexNoLabel
\Vertices[empty,x=0,y=0,dir=\SO]{line}{a,b,c,d,e} }
\foreach \v in {a,b,c,d,e}{%
\Vertex[Node]{\v}}   
{\SetVertexNoLabel
\Vertices[empty,x=2,y=0,dir=\SO]{line}{al,be,ga,de,ep} }
\foreach \v/\n in {al/1,be/2,ga/3,de/4,ep/5}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge[color=yellow](a)(be)
\Edge[color=yellow](a)(de)
\Edge[color=yellow](a)(ep)
\Edge(c)(ep)
\Edge(d)(ep)
\begin{pgfonlayer}{background}
\node[draw=blue,fill=blue!40,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
\node[draw=red,fill=red!30,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de) (ep),pin={[pin edge={thick}]V}] {};
\end{pgfonlayer}
\end{tikzpicture}


\end{tabular}
}
\end{frame}






\begin{frame}\frametitle{Cri}
  

\begin{itemize}
\item   Baptême=$\bigl\{$            alouette$\mapsto$Josette,
  alouette$\mapsto$Pépette,                     albatros$\mapsto$Bernard,
  bécasse$\mapsto$Germaine$\bigr\}$;
\item   Cri=$\bigl\{$Josette$\mapsto$turlute,   Josette$\mapsto$grisole,
  Pépette$\mapsto$turlute, Bernard$\mapsto$piaule, Germaine$\mapsto$croule$\bigr\}$
\end{itemize}

\pause


Quelle est la tête de la relation (Baptême $\ ; \ $ Cri) et comment l'interpréter?

\end{frame}



\section{Fonctions}

\begin{frame}
  
\begin{definition}
On dit que \textbf{la relation} $f=(E,F,G_{f})$ est une \textbf{fonction}
 de $E$ vers (ou dans) $F$ si, et
seulement si, tout élément de $E$ a \textbf{au plus} (cela veut dire
: soit zéro ou une) une image dans $F$. 
\end{definition}


\end{frame}



\begin{frame} \frametitle{fonction?}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(a)(be)
\Edge(a)(ga)
\Edge(c)(ga)
\Edge(d)(ga)
\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}







\begin{frame} \frametitle{fonction?}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
%\Edge(a)(be)
\Edge(a)(ga)
\Edge(c)(ga)
%\Edge(d)(ga)
\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}








\begin{frame} \frametitle{fonction?}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d,e}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(b)(al)
\Edge(a)(ga)
\Edge(c)(ga)
%\Edge(d)(ga)
\Edge(d)(de)
\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d) (e)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}




\subsection{Fonctions particulières}


\begin{frame}
  \begin{definition}[Projection canonique]
  
La fonction totale 
$$
\pi_{i}\colon\begin{array}{rll} E_{1}\times E_{2}\times \ldots \times E_{n} &\to &  E_{i} \\ (x_{1},x_{2},\ldots ,x_{n})  & \mapsto &  x_i\end{array}$$

 est appelée
projection canonique de 
$E_{1}\times E_{2}\times \ldots \times E_{n}$ sur $E_{i}$.

Si tous les $E_{i}$ sont égaux au même ensemble $E$, $\pi_{i}$ est
appelée la $i$\eme projection.

\end{definition}

\end{frame}




\begin{frame} \begin{definition}[Fonction identité]
  C'est la fonction totale  définie sur $E$ par 
$$
 \limfunc{Id}_E\colon \begin{array}{rll} E & \to & E\\
   x & \mapsto & x
 \end{array}
$$%
\end{definition}  \end{frame}


\begin{frame} \begin{definition}[Composition réitérée]
  
Si $f$ est une fonction totale de $E$ dans $E,$ on note $f^{k}$ la
composition 
$$
\underset{k\text{ fois}}{\underbrace{f\circ f\circ \cdots \circ f}}
$$%
si $k$ est un entier naturel non nul et, par convention, $f^{0}=id_{E}$. 

\end{definition}  \end{frame}



\begin{frame} \begin{definition}[Fonction caractéristique]
  $$
 \indi{A}\colon \begin{array}{rll} E & \to & \bigl\{0,1\bigr\}\\
   x &  \mapsto & \begin{cases}  1 \text{  si } x\in  A\\ 0 \text{  si }
     x\not \in A \end{cases}
 \end{array}
$$
\end{definition}  \end{frame}




\begin{frame} \begin{definition}[Loi de composition]
  On appelle loi de composition (ou opération) dans $E$ toute fonction de $%
A\times E$ dans $E$.

 Si $A=E$, on dit que la loi est une loi de composition
interne, sinon on parle de loi de composition externe ou loi mixte. 
\end{definition} 



\pause



 Si $f$ est
une  telle loi  de  composition  et $(a,x)\in  A\times  E,$ on  remplace
souvent la \textbf{notation préfixée} $f\left(
(a,x)\right) $ par une \textbf{notation infixée} du style $a\circledcirc x$ ou $a\ast x$ ou $a\boxplus x$ ou $%
a\boxdot x$ ou $a+x$  ou...




\end{frame}



\begin{frame}[fragile]
  
\begin{lstlisting}
Prelude> let biplus = \(a,b) -> a + b + b 
Prelude> :t biplus
biplus :: (Integer, Integer) -> Integer
Prelude> let (++) a b = biplus (a,b)
Prelude> 1 ++ 2
5
Prelude> biplus (1,2)
5
\end{lstlisting}

\end{frame}


\begin{frame} \frametitle{fonction injective}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga,de} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma,de/\delta}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(b)(al)
\Edge(a)(be)
\Edge(c)(ga)
%\Edge(d)(ga)
%\Edge(d)(de)
%\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (c)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) (de)]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}





\begin{frame} \frametitle{fonction surjective}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c,d}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(b)(al)
\Edge(a)(be)
\Edge(c)(ga)
\Edge(d)(ga)
%\Edge(d)(de)
%\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (d)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) ]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}





\begin{frame} \frametitle{fonction bijective}

\begin{center}
\begin{tikzpicture}[ every fit/.style={ellipse,draw,thick},] 
\SetGraphUnit{0.75cm}  
\SetUpEdge[lw= 1.5pt,color= black!50]
\GraphInit[vstyle=Normal] 

\tikzset{VertexStyle/.style= {shape= circle,
                             shading= ball,color=black,
                             ball color= gray!10,
                             minimum size= 15pt,
                             draw}}
\tikzstyle{EdgeStyle}=[->]
\Vertices[dir=\SO]{line}{a,b,c}
{\SetVertexNoLabel
\Vertices[empty,x=3,y=0,dir=\SO]{line}{al,be,ga} }
\foreach \v/\n in {al/\alpha,be/\beta,ga/\gamma}{%
\Vertex[Node,L=$\n$]{\v}}   
\Edge(b)(al)
\Edge(a)(be)
\Edge(c)(ga)
%\Edge(d)(ga)
%\Edge(d)(de)
%\Edge(e)(de)
\begin{pgfonlayer}{background}
 \node[draw=blue,fill=blue!40,inner sep=1.5pt,thick,ellipse,fit=(a) (b) (c)] {};
 \node[draw=red,fill=red!40,inner sep=2pt,thick,ellipse,fit=(al) (be) (ga) ]{};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(a) (b) (c) (d) (e),pin={[pin edge={thick}]E}] {};
%\node[draw=black,inner sep=4pt,thick,ellipse,fit=(al) (be) (ga) (de),pin={[pin edge={thick}]F}] {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
  
\end{frame}


\begin{frame}\frametitle{Méthode B}
  En méthode B on note:
\begin{itemize}
\item ${D\foncpart\ \ C}$: fonctions partielles de D vers C;
\item ${D\fonctot C}$: fonctions totales de D vers C;
\item ${D\injpart\ \ C}$: injections partielles de D vers C;
\item ${D\injtot C}$: injections totales de D vers C;
\item ${D\surjpart\ \ C}$: surjections partielles de D vers C;
\item ${D\surjtot C}$: surjections totales de D vers C;
\item ${D\bijpart C}$: bijections partielles de D sur C;
\item ${D\bijtot C}$: bijections totales de D sur C.
\end{itemize}
\end{frame}


\section{Relations binaires sur un ensemble}



\begin{frame}
  

%\begin{figure}
\begin{center}
  \includegraphics[width=\linewidth]{CE1-rel-ens}
\end{center}
%\end{figure}


\end{frame}

\end{document}
%%% Local Variables: 
%%% TeX-master: t
%%% End: 
