% This is a demonstration file distributed with the
% Lecturer package (see lecturer-doc.pdf).
%
% You can recompile the file with a basic TeX implementation,
% using pdfTeX or LuaTeX with the plain format.
% 
% The reusable part ends somewhere around line 150.
%
% Author: Paul Isambert.
% Date: July 2010.

\input lecturer

%\showgrid{1cm}

\setparameter job:
  fullscreen = true
  font       = \mainfont

\setparameter slide:
  width height = 12cm
  top          = 0cm
  bottom       = 3cm
  left         = 5cm
  right        = 1.6cm
  topskip      = 0pt
  background   = black % For the lines between squares.
  foreground   = white
  vpos         = center
  hpos         = ff

\setarea{area1 area2 matharea}
  width = 3cm

\setarea{area1 area2}
  height     = 4.3cm
  background = white

\setarea{area2}
  vshift     = 4.7cm

\setarea{matharea footnotearea}
  height       = 2.6cm
  vshift*      = 0pt
  topskip      = .1cm
  baselineskip = .333cm
  vpos         = center

\setarea{matharea}
  background = blue
  foreground = white
  hpos       = rr

% Below the slide's text.
\setarea{mainarea}
  hshift     = 3.4cm
  hshift*    = 0pt
  height     = 9cm
  background = red

\setarea{footnotearea}
  hshift       = 3.4cm
  hshift*      = 1.8cm
  left right   = .3cm
  background   = white
  font         = \footnotefont
  hpos         = ff

\setarea{area6 area7}
  width   = 1.4cm
  hshift* = 0pt
  height  = 1.1cm

\setarea{area6}
  vshift     = 9.4cm
  background = white

\setarea{area7}
  vshift*    = 0pt
  background = yellow



\setparameter step:
  vskip = \baselineskip

\setstep\emptystep
  vskip = 0pt

% Used for the maths.
\def\mathstep#1 #2 #3{\emptystep[on=#1,off=#2]\position{matharea}[0pt,0pt]{$#3$}\ignorespaces}
\def\Mathstep#1 #2{\emptystep[off=#1,visible=true]\position{matharea}[0pt,0pt]{$#2$}\ignorespaces}

% The footnote. Since the same name is given
% to each footnote step, there must be at most
% one per slide. Otherwise, a name should be given
% manually (or automatically with a number in the name,
% and a counter to increment it on every footnote call).
\def\footnote#1{%
  \showorhide{toggle=footnote}{\super{\usecolor{blue}{*}}}
  \emptystep[footnote,on=]
    \position{footnotearea}{\quitvmode\llap{* }#1}%
  }

% On the last equation.
\newsymbol\cross[1.7em]{%
  pen 0.1,
  move 0 -.5, .5 .9, stroke,
  move 0 .9, .5 -.5, stroke,
  }
% Font for text.
\font\mainfont=cmss10
\font\supmainfont=cmss10 at 7.5pt
% Simple superscript (I'm not very good with
% math font family... I'm no mathematician after all).
\def\super#1{\raise.3em\hbox{\supmainfont#1}}
\font\footnotefont=cmss8 at 7pt
\mainfont
\frenchspacing

% Font for maths.
\font\mathfont=cmss12 at 16pt
\font\scriptmathfont=cmss12 at 10pt
\font\scriptscriptmathfont=cmss12 at 8pt
\textfont0=\mathfont
\scriptfont0=\scriptmathfont
\scriptscriptfont0=\scriptscriptmathfont
\font\mathfont=cmss12 at 16pt
\font\scriptmathfont=cmss12 at 12pt
\font\scriptscriptmathfont=cmss12 at 8pt
\textfont1=\mathfont
\scriptfont1=\scriptmathfont
\scriptscriptfont1=\scriptscriptmathfont
\font\Tensy=cmsy10 at 18pt
\font\scriptTensy=cmsy10 at 10pt
\font\scriptscriptTensy=cmsy10 at 8pt
\textfont2=\Tensy
\scriptfont2=\scriptTensy
\scriptscriptfont2=\scriptscriptTensy
\font\Tenex=cmex10 at 18pt
\font\scriptTenex=cmex10 at 12pt
\font\scriptscriptTenex=cmex10 at 8pt
\textfont3=\Tenex
\scriptfont3=\scriptTenex
\scriptscriptfont3=\scriptscriptTenex



% \endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
% UNCOMMENT THE PREVIOUS LINE TO USE THIS FILE AS A TEMPLATE, %
% OR REMOVE EVERYTHING BELOW.                                 %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




\slide[A simple assumption]

\mathstep A B {{a\over b}=\sqrt2}
\mathstep B C {({a\over b})^2=2}
\mathstep C D {{a^2\over b^2}=2}
\mathstep D {} {a^2=2b^2}

\step Some say the square root of 2 isn't rational.
\step Suppose it were.

\step[A] Then we could write it as this, where a and b are
integers without a common factor.%
\footnote{%
  Suppose c/d is a rational number. If c and d have no common
  factor, then a=b and b=d. If they have a common factor,
  divide both by their greatest common divisor. The result
  is a/b, with no common factor.}

\step[B] But then we can also write this.
\step[C] And this.
\step[D] And finally this.
\step Which means that a\super2 is even.

\endslide



\slide[Its consequences]

\Mathstep A {a^2=2b^2}
\mathstep A B {(2k)^2=2b^2}
\mathstep B C {4k^2=2b^2}
\mathstep C D {2k^2=b^2}

\step[visible=true] So what?
\step So a is even. Because only even numbers produce even squares.%
\footnote{%
  An even number, by definition, is expressible
  in the form 2k, where k is any integer.
  On the other hand, an odd number is expressible
  by 2k+1. Thus the square of an odd number is
  (2k+1)\super2, i.e. 4k\super2+4k+1, i.e.
  2x2(k\super2+k)+1, which is of the form 2k+1,
  with 2(k\super2+k) as k.
  Hence, an odd number produces an odd square,
  and thus if a square is even its root is even too.}

\step[A] Being even means being expressible in the form 2k, where k is
any integer.
\step[B] And (2k)\super2 square gives 4k\super2.

\step[C] Let's simplify.
\step Thus b\super2 is even.
\step And b is too.

\endslide



\slide[The problem]

\Mathstep A {{a\over b}=\sqrt2}
\mathstep A {} {\rlap\cross{a\over b}=\sqrt2}

\step[visible=true] And but so we said a and b have no common factor.

\step If both are even they do have a common factor: 2.
\step Which is absurd.

\step Thus, our basic assumption is false.
\step[A] There are no such a and b.

\step The square root of 2 is irrational.

\endslide

\bye