%%Tema para beamer "Imunam", versión 1.0

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage[spanish]{babel} 
\graphicspath{ {images/} }
\usepackage{mathtools}
\usepackage{tikz}


%% Logos de restaurantes:
\newcommand{\logomanekin}{images/logomanekin}

%%Se define el "environment" teorema
%% The "environment" theorem is defined
\newtheorem{Formula}{Formula} 


%%Tema de beamer "Imunam"
%% Theme of beamer "Imunam"
\usetheme[cuernavaca]{Imunam} 
%\usetheme{Imunam} 
%%Si se omite "[cuernavaca]" en éste comando, el logotipo se imprime sin la 
%%leyenda "Unidad Cuernavaca" en la parte inferior.
%% If "[cuernavaca]" is omitted in this command, the logo is printed without the
%% legend "Cuernavaca Unit" in the lower part.

\title{Proof of the Pythagoras theorem.}
\author{Enrique Andrade Gonzalez %Nombre del autor % Author's name
	      \texttt{e.andrade@udc.es}} %email
	      
\date{Computer tools in mathematican's work} %subject

%\institute{Instituto de Matemáticas, unidad Cuernavaca} 
%%Instituto del ponenete, dado que el texto "Intituto de matemáticas" aparece
%%en el logo, parece redundante incluirlo además con éste comando.

\begin{document}

\begin{frame}

  \titlepage %Necesario para generar la portada
  
\end{frame}

%%La siguiente diapositiva es opcional, si se quiere la tabla de contenidos
%%Se sebe compilar dos veces el documento para que funcione
%--------------------------------------------------------------------------
\begin{frame}
\tableofcontents %Imprime la tabla de contenido
\end{frame}
%--------------------------------------------------------------------------

\section{Introduction} %%Título de la sección (Opcional)
\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{objective} %%Subtítulo de la diapositiva (opcional)
  In this presentation we try to show a proof of the Pythagorean theorem.
  There are many demonstrations, but this one is one of the simplest.
\end{frame}

\section{Proof of the Pythagorean theorem} %%Otra sección
\begin{frame}
    \frametitle{Concept}
    Suppose we have a square of side \textbf{r} and on each of its sides we place a right triangle of legs \textbf{x} and \textbf{y}. As in this situation the hypotenuse of each of the triangles is \textbf{r} we want to prove that:
    \\\
    \begin{Formula} %%Uso del "environment" definido al inicio del documento.
        \[x^{2}+y^{2}=r^{2}\]
    \end{Formula}
    

\end{frame}

\begin{frame}
    \frametitle{The figure}
    The figure that is obtained is the following:
    \begin{center}
    \begin{tikzpicture}[scale=0.8]
    %\begin{tikzpicture}
        %\draw (0,0) circle (1cm);    
        \draw [fill=green] (-2,-2) rectangle (2,2); 
        \draw [fill=red] (-2,0) -- (0,2) -- (2,0) -- (0,-2) -- cycle;
        % r
        \draw [dotted]
        (0.75,1) node[black] {r}
        (0.75,-1) node[black] {r}
        (-0.75,1) node[black] {r}
        (-0.75,-1) node[black] {r};
        
        % x y
        \draw [dotted]
        (1,-2.2) node[black] {y}
        (1,2.2) node[black] {x}
        (-1,2.2) node[black] {y}
        (-1,-2.2) node[black] {x}
        
        (2.2,1) node[black] {y}
        (2.2,-1) node[black] {x}
        (-2.2,1) node[black] {x}
        (-2.2,-1) node[black] {y};
        
    \end{tikzpicture}
    \[x^{2}+y^{2}=r^{2}\]
    \end{center}
\end{frame}


%\section{Restaurants} %%Otra sección
\begin{frame}
    \frametitle{Conclusions}
    \begin{itemize}
        \item Each side of the \textbf{green square} is the sum of \textbf{x} and \textbf{y}. Therefore, the area of the square is: \[(x+y)^{2}\]
        \item For the same reason, the area of the \textbf{red square} is: \[r^{2}\]
        \item The area of each of the \textbf{green triangles} (y, x and r) is:\[\frac{x+y}{2}\]

    \end{itemize}
\end{frame}


\section{Demonstration} %%Otra sección
\begin{frame}
    \frametitle{Demonstration}
    
    \begin{itemize}
        \item The green square is formed by the red square and the four green triangles, so the sum of all the areas is: \[(x+y)^{2}=r^{2} + 4 (\frac{x+y}{2})\]
        \item We develop the left part of equality: \[(x+y)^{2}=x^{2} + 2xy + y^{2}\]
        \item We substitute in the first formula: \[x^{2} + 2xy + y^{2} = r^{2} + 2xy\]
        \item \textbf{2xy} is eliminated on both sides of the equality, and we obtain the desired result: \[x^{2} + y^{2} = r^{2}\]
    \end{itemize}


\end{frame}

\end{document}