<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../pmathml.xsl"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN'
  'http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd'
  [<!ENTITY mathml 'http://www.w3.org/1998/Math/MathML'>]>
<!--
Copyright Ken Dyck, 2005.

Use and distribution of this code are permitted under the terms of
the <a
href="http://creativecommons.org/licenses/by-nc-nd/2.0/legalcode"
>by-nc-nd Creative Commons license</a>.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html" />
  <title>Solution to SICP Exercise 1.13</title>
  <style type="text/css">
    body { 
      width: 6in; 
      padding: 1in;
    }   
    h1 {
      font-size: 14pt;
    }
    h2 {
      font-size: 12pt;
      margin-top: 24pt;
    }
    p.eqn {
      text-align: center;
    }
  </style>
</head>

<body>
<h1>SICP Exercise 1.13</h1>

<p>The following is my solution to <a
href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_thm_1.13">Exercise
1.13</a> in <a href="http://mitpress.mit.edu/sicp/">Structure and
Interpretation of Computer Programs</a></p>

<h2>Problem statement</h2>
<p>
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&equals;</mo>
    <mfenced open="{" close="">
      <mtable columnalign="left">
        <mtr>
          <mtd>
            <mn>0</mn>
          </mtd>
          <mtd>
            <mrow>
              <mtext>if </mtext>
              <mi>n</mi>
              <mo>&equals;</mo>
              <mn>0</mn>
            </mrow>
          </mtd>
        </mtr>
        <mtr>
          <mtd>
            <mn>1</mn>
          </mtd>
          <mtd>
            <mrow>
              <mtext>if </mtext>
              <mi>n</mi>
              <mo>&equals;</mo>
              <mn>1</mn>
            </mrow>
          </mtd>
        </mtr>
        <mtr>
          <mtd>
            <mrow>
              <mi mathvariant="italic">Fib</mi>
              <mfenced>
                <mrow>
                  <mi>n</mi>
                  <mo>&minus;</mo>
                  <mn>1</mn>
                </mrow>
              </mfenced>
              <mo>&plus;</mo>
              <mi mathvariant="italic">Fib</mi>
              <mfenced>
                <mrow>
                  <mi>n</mi>
                  <mo>&minus;</mo>
                  <mn>2</mn>
                </mrow>
              </mfenced>
            </mrow>
          </mtd>
          <mtd>
            <mtext>otherwise</mtext>
          </mtd>
        </mtr>
      </mtable>
    </mfenced>
  </mrow>
</math>
</p>

<p>Prove that 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
  </mrow>
</math>

is the closest integer to 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <mrow>
        <msqrt>
          <mn>5</mn>
        </msqrt>
      </mrow>
    </mfrac>
  </mrow>
</math>, 

where 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>&phi;</mi>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <mn>1</mn>
        <mo>&plus;</mo>
        <msqrt>
          <mn>5</mn>
        </msqrt>
      </mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>.

Hint: Let 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>&psi;</mi>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <mn>1</mn>
        <mo>&minus;</mo>
        <msqrt>
          <mn>5</mn>
        </msqrt>
      </mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>.

Use induction and the definition of the Fibonacci numbers (above)
to prove that 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math>.
</p>

<h2>Proof</h2>

<p>Let's restate the problem more formally. For   

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
  </mrow>
</math>

to be the closest integer to 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <mrow>
        <msqrt>
          <mn>5</mn>
        </msqrt>
      </mrow>
    </mfrac>
  </mrow>
</math>,

the distance between the two must be less than or equal to 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <mn>1</mn>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>. In other words, we must prove:
</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mrow>
        <mi mathvariant="italic">Fib</mi>
        <mfenced>
          <mi>n</mi>
        </mfenced>
        <mo>&minus;</mo>
        <mfrac>
          <mrow>
            <msup>
              <mi>&phi;</mi>
              <mi>n</mi>
            </msup>
          </mrow>
          <mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mrow>
        </mfrac>
      </mrow>
    </mfenced>
    <mo>&le;</mo>
    <mfrac>
      <mn>1</mn>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
</p>

<p>For now, let's assume the hint in the problem statement is true
(we'll prove it later).</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math>, or 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&minus;</mo>
    <mfrac>
      <msup>
        <mi>&phi;</mi>
        <mi>n</mi>
      </msup>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
    <mo>&equals;</mo>
    <mo>&minus;</mo>
    <mfrac>
      <msup>
        <mi>&psi;</mi>
        <mi>n</mi>
      </msup>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math> 
</p> 

<p>We can substitue this into our problem statement, simplifying it
remarkably:</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mfenced>
        <mrow>
          <mo>&minus;</mo>
          <mfrac>
            <msup>
              <mi>&psi;</mi>
              <mi>n</mi>
            </msup>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mfenced>
    </mfenced>
    <mo>&le;</mo>
    <mfrac>
      <mn>1</mn>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>, or

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mrow>
        <msup>
          <mi>&psi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
    </mfenced>
    <mo>&le;</mo>
    <mfrac>
      <msqrt>
        <mn>5</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
</p>

<p>Now, everybody knows that for 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mi>x</mi>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math> and

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&ge;</mo>
    <mn>0</mn>
  </mrow>
</math>
</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <msup>
        <mi>x</mi>
        <mi>n</mi>
      </msup>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math>
</p>

<p>Therefore, if we can show that 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mi>&psi;</mi>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math>

and

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <msqrt>
        <mn>5</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
    <mo>&gt;</mo>
    <mn>1</mn>
  </mrow>
</math>,

we'll have our proof.</p>

<p>We can see immediately that 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <msqrt>
        <mn>5</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
    <mo>&gt;</mo>
    <mn>1</mn>
  </mrow>
</math>, as 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <msqrt>
        <mn>5</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>

is obviously greater than

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <msqrt>
        <mn>4</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>, 

which is equal to 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
  <mn>1</mn>
  </mrow>
</math>.
</p>

<p>Let's show that

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mi>&psi;</mi>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math>. That is. let's show: 
</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mfrac>
        <mrow>
          <mn>1</mn>
          <mo>&minus;</mo>
          <msqrt>
            <mn>5</mn>
          </msqrt>
        </mrow>
        <mn>2</mn>
      </mfrac>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math>, 

or

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mfrac>
        <mrow>
          <msqrt>
            <mn>5</mn>
          </msqrt>
          <mo>&minus;</mo>
          <mn>1</mn>
        </mrow>
        <mn>2</mn>
      </mfrac>
    </mfenced>
    <mo>&le;</mo>
    <mn>1</mn>
  </mrow>
</math> 
</p>

<p>It is easy to see when we express the value of 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mn>1</mn>
  </mrow>
</math> 

differently, say</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mn>1</mn>
    <mo>&equals;</mo>
    <mfenced open="|" close="|">
      <mfrac>
        <mrow>
          <msqrt>
            <mn>9</mn>
          </msqrt>
          <mo>&minus;</mo>
          <mn>1</mn>
        </mrow>
        <mn>2</mn>
      </mfrac>
    </mfenced>
  </mrow>
</math> 
</p>

<p>It would be even easier to see by punching the expression into a
calculator, but how fun would that be?</p>

<p>Anyways, it should be obvious that</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfenced open="|" close="|">
      <mfrac>
        <mrow>
          <msqrt>
            <mn>5</mn>
          </msqrt>
          <mo>&minus;</mo>
          <mn>1</mn>
        </mrow>
        <mn>2</mn>
      </mfrac>
    </mfenced>
    <mo>&lt;</mo>
    <mfenced open="|" close="|">
      <mfrac>
        <mrow>
          <msqrt>
            <mn>9</mn>
          </msqrt>
          <mo>&minus;</mo>
          <mn>1</mn>
        </mrow>
        <mn>2</mn>
      </mfrac>
    </mfenced>
  </mrow>
</math> 
</p>

<p>So there's our proof. Unfortunately, it rests on an unproven
assumption: the hint that was given in the problem statement. Let's
prove it.</p>

<p>Recall, the hint:</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math>
</p>

<p>We'll approach this proof inductively as the problem statement
recommends. Let's start by establishing some base cases. From the
definition of 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
  </mrow>
</math>,
</p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>0</mn>
  </mrow>
</math>, </p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mn>0</mn>
    </mfenced>
    <mo>&equals;</mo>
    <mn>0</mn>
  </mrow>
</math>
</p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>1</mn>
  </mrow>
</math>, </p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mn>1</mn>
    </mfenced>
    <mo>&equals;</mo>
    <mn>1</mn>
  </mrow>
</math>
</p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>2</mn>
  </mrow>
</math>, </p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mtable columnalign="left">
    <mtr>
      <mtd columnalign="right">
        <mrow>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mn>2</mn>
          </mfenced>
        </mrow>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mn>1</mn>
          </mfenced>
          <mo>&plus;</mo>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mn>0</mn>
          </mfenced>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mn>1</mn>
          <mo>&plus;</mo>
          <mn>0</mn>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mn>1</mn>
        </mrow>
      </mtd>
    </mtr>
  </mtable>
</math>
</p>

<p>Now let's look at the right hand side. </p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>0</mn>
  </mrow>
</math>, </p>


<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mn>0</mn>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mn>0</mn>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <mn>1</mn>
        <mo>&minus;</mo>
        <mn>1</mn>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
    <mo>&equals;</mo>
    <mn>0</mn>
  </mrow>
</math>
</p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>1</mn>
  </mrow>
</math>, </p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mtable columnalign="left">
    <mtr>
      <mtd columnalign="right">
        <mrow>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mn>1</mn>
              </msup>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mn>1</mn>
              </msup>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mn>2</mn>
                </mfrac>
              </mfenced>
              <mo>&minus;</mo>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mn>2</mn>
                </mfrac>
              </mfenced>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <mfrac>
                <mn>1</mn>
                <mn>2</mn>
              </mfrac>
              <mo>&plus;</mo>
              <mfrac>
                <msqrt>
                  <mn>5</mn>
                </msqrt>
                <mn>2</mn>
              </mfrac>
              <mo>&minus;</mo>
              <mfrac>
                <mn>1</mn>
                <mn>2</mn>
              </mfrac>
              <mo>&plus;</mo>
              <mfrac>
                <msqrt>
                  <mn>5</mn>
                </msqrt>
                <mn>2</mn>
              </mfrac>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <msqrt>
              <mn>5</mn>
            </msqrt>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mn>1</mn>
        </mrow>
      </mtd>
    </mtr>
   </mtable>
</math>
</p>

<p>For 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>n</mi>
    <mo>&equals;</mo>
    <mn>2</mn>
  </mrow>
</math>, </p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mtable columnalign="left">
    <mtr>
      <mtd columnalign="right">
        <mrow>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mn>2</mn>
              </msup>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mn>2</mn>
              </msup>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mfenced>
                  <mfrac>
                    <mrow>
                      <mn>1</mn>
                      <mo>&plus;</mo>
                      <msqrt>
                        <mn>5</mn>
                      </msqrt>
                    </mrow>
                    <mn>2</mn>
                  </mfrac>
                </mfenced>
                <mn>2</mn>
              </msup>
              <mo>&minus;</mo>
              <msup>
                <mfenced>
                  <mfrac>
                    <mrow>
                      <mn>1</mn>
                      <mo>&minus;</mo>
                      <msqrt>
                        <mn>5</mn>
                      </msqrt>
                    </mrow>
                    <mn>2</mn>
                  </mfrac>
                </mfenced>
                <mn>2</mn>
              </msup>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&plus;</mo>
                  <mn>2</mn>
                  <msqrt>
                    <mn>5</mn>
                  </msqrt>
                  <mo>&plus;</mo>
                  <mn>2</mn>
                </mrow>
              </mfenced>
              <mo>&minus;</mo>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&minus;</mo>
                  <mn>2</mn>
                  <msqrt>
                    <mn>5</mn>
                  </msqrt>
                  <mo>&plus;</mo>
                  <mn>2</mn>
                </mrow>
              </mfenced>
            </mrow>
            <mrow>
              <mn>4</mn>
              <msqrt>
                <mn>5</mn>
              </msqrt>
            </mrow>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <mn>4</mn>
              <msqrt>
                <mn>5</mn>
              </msqrt>
            </mrow>
            <mrow>
              <mn>4</mn>
              <msqrt>
                <mn>5</mn>
              </msqrt>
            </mrow>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mn>1</mn>
        </mrow>
      </mtd>
    </mtr>
  </mtable>
</math>
</p>

<p>You can see that the for these base cases, the left-hand side
equals the right.</p>

<p>Let's move on to the inductive case. If we assume 

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mi>n</mi>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mi>n</mi>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mi>n</mi>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math> 

and

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mrow>
        <mi>n</mi>
        <mo>&minus;</mo>
        <mn>1</mn>
      </mrow>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mrow>
            <mi>n</mi>
            <mo>&minus;</mo>
            <mn>1</mn>
          </mrow>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mrow>
            <mi>n</mi>
            <mo>&minus;</mo>
            <mn>1</mn>
          </mrow>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math>, 

then we should expect 
</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi mathvariant="italic">Fib</mi>
    <mfenced>
      <mrow>
        <mi>n</mi>
        <mo>&plus;</mo>
        <mn>1</mn>
      </mrow>
    </mfenced>
    <mo>&equals;</mo>
    <mfrac>
      <mrow>
        <msup>
          <mi>&phi;</mi>
          <mrow>
            <mi>n</mi>
            <mo>&plus;</mo>
            <mn>1</mn>
          </mrow>
        </msup>
        <mo>&minus;</mo>
        <msup>
          <mi>&psi;</mi>
          <mrow>
            <mi>n</mi>
            <mo>&plus;</mo>
            <mn>1</mn>
          </mrow>
        </msup>
      </mrow>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mfrac>
  </mrow>
</math>
</p>

<p>Does it?</p>

<p class="eqn">
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mtable columnalign="left">
    <mtr>
      <mtd columnalign="right">
        <mrow>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mrow>
              <mi>n</mi>
              <mo>&plus;</mo>
              <mn>1</mn>
            </mrow>
          </mfenced>
        </mrow>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mi>n</mi>
          </mfenced>
          <mo>&plus;</mo>
          <mi mathvariant="italic">Fib</mi>
          <mfenced>
            <mrow>
              <mi>n</mi>
              <mo>&minus;</mo>
              <mn>1</mn>
            </mrow>
          </mfenced>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
            <mfenced>
              <mfrac>
                <mrow>
                  <msup>
                    <mi>&phi;</mi>
                    <mi>n</mi>
                  </msup>
                  <mo>&minus;</mo>
                  <msup>
                    <mi>&psi;</mi>
                    <mi>n</mi>
                  </msup>
                </mrow>
                <msqrt>
                  <mn>5</mn>
                </msqrt>
              </mfrac>
            </mfenced>
          <mo>&plus;</mo>
            <mfenced>
              <mfrac>
                <mrow>
                  <msup>
                    <mi>&phi;</mi>
                    <mrow>
                      <mi>n</mi>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                  <mo>&minus;</mo>
                  <msup>
                    <mi>&psi;</mi>
                    <mrow>
                      <mi>n</mi>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                </mrow>
                <msqrt>
                  <mn>5</mn>
                </msqrt>
              </mfrac>
            </mfenced>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <mfenced>
                <mrow>
                  <msup>
                    <mi>&phi;</mi>
                    <mi>n</mi>
                  </msup>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&phi;</mi>
                    <mrow>
                      <mi>n</mi>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
              <mo>&minus;</mo>
              <mfenced>
                <mrow>
                  <msup>
                    <mi>&psi;</mi>
                    <mi>n</mi>
                  </msup>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&psi;</mi>
                    <mrow>
                      <mi>n</mi>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mrow>
                  <msup>
                    <mi>&phi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&phi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>2</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mrow>
                  <msup>
                    <mi>&psi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&psi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>2</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mo>&minus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&phi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mo>&minus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&plus;</mo>
                  <msup>
                    <mi>&psi;</mi>
                    <mrow>
                      <mo>&minus;</mo>
                      <mn>1</mn>
                    </mrow>
                  </msup>
                </mrow>
              </mfenced>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&plus;</mo>
                  <mfrac>
                    <mn>2</mn>
                    <mrow>
                      <mn>1</mn>
                      <mo>&plus;</mo>
                      <msqrt>
                        <mn>5</mn>
                      </msqrt>
                    </mrow>
                  </mfrac>
                </mrow>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mrow>
                  <mn>1</mn>
                  <mo>&plus;</mo>
                  <mfrac>
                    <mn>2</mn>
                    <mrow>
                      <mn>1</mn>
                      <mo>&minus;</mo>
                      <msqrt>
                        <mn>5</mn>
                      </msqrt>
                    </mrow>
                  </mfrac>
                </mrow>
              </mfenced>
            </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>3</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mn>2</mn>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>3</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>6</mn>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                    <mo>&plus;</mo>
                    <mn>5</mn>
                  </mrow>
                </mfrac>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>6</mn>
                    <mo>&minus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                    <mo>&plus;</mo>
                    <mn>5</mn>
                  </mrow>
                </mfrac>
              </mfenced>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>6</mn>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>6</mn>
                    <mo>&plus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
               </mfrac>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mfrac>
                  <mrow>
                    <mn>6</mn>
                    <mo>&minus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                  <mrow>
                    <mn>6</mn>
                    <mo>&minus;</mo>
                    <mn>2</mn>
                    <msqrt>
                      <mn>5</mn>
                    </msqrt>
                  </mrow>
                </mfrac>
              </mfenced>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mn>1</mn>
              </mfenced>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mfenced>
                <mn>1</mn>
              </mfenced>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
      </mtd>
      <mtd>
        <mrow>
          <mo>&equals;</mo>
          <mfrac>
            <mrow>
              <msup>
                <mi>&phi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
              <mo>&minus;</mo>
              <msup>
                <mi>&psi;</mi>
                <mrow>
                  <mi>n</mi>
                  <mo>&plus;</mo>
                  <mn>1</mn>
                </mrow>
              </msup>
           </mrow>
            <msqrt>
              <mn>5</mn>
            </msqrt>
          </mfrac>
        </mrow>
      </mtd>
    </mtr>
  </mtable>
</math>
</p>

<p>QED</p>

<!-- vim:set ts=2 sw=2 expandtab: -->
</body>
</html>
