
theorem Th24:
  for n being Nat st n >= 2 holds
    Fib (n+1) = [\ (Fib n + sqrt 5 * Fib n + 1) / 2 /]
  proof
    let n be Nat;
    assume A1: n >= 2;
A2: sqrt 5 > 0 by SQUARE_1:25;
    set tn = tau to_power n;
    set tb = tau_bar;  set s5 = sqrt 5;
    set tbn = tb to_power n;
    per cases;
    suppose A3: n is even; then
A4:   tbn > 0 by Th6;
A5:   (Fib n + sqrt 5 * Fib n + 1) / 2 >= Fib (n+1)
      proof
        tbn <= 1/2 by Th8,A1; then
        2 * tbn <= 2 * (1/2) by XREAL_1:64; then
        (2 * tbn) / tbn <= 1 / tbn by A4,XREAL_1:72; then
        2 <= 1 / tbn by A4,XCMPLX_1:89; then
        2 * s5 <= (1 / tbn) * s5 by A2,XREAL_1:64; then
        s5 + s5 <= (1 * s5) / tbn by XCMPLX_1:74; then
        s5 + s5 - s5 <= (1*s5)/tbn - s5 by XREAL_1:9; then
        - s5 >= -(s5/tbn - s5) by XREAL_1:24; then
        - s5 + 1 >= - s5 / tbn + s5 + 1 by XREAL_1:6; then
        tau_bar >= ((s5+1)-s5/tbn)/2 by FIB_NUM:def 2,XREAL_1:72; then
        tau_bar * tbn >= (tau - (s5 / tbn) / 2) * tbn
        by A4,FIB_NUM:def 1,XREAL_1:64; then
        tb * tbn >= (tau - (sqrt 5 / 2) / tbn) * tbn by XCMPLX_1:48; then
        tb * tbn >= tau * tbn - ((s5 / 2) / tbn) * tbn; then
        tb * tbn >= tau * tbn - (s5 / 2) by A4,XCMPLX_1:87; then
        tb to_power 1 * tbn >= tau * tbn - (s5/2); then
        tb to_power (n+1) >= tau * tbn - (s5/2) by Th2; then
        - tb to_power (n+1) <= -(tau*tbn - (s5/2)) by XREAL_1:24; then
        - tb to_power (n+1) + tau to_power (n+1) <=
        - tau * tbn + (sqrt 5/2) + tau to_power (n+1) by XREAL_1:6; then
        -tb to_power (n+1) + tau to_power (n+1) <=
        tau to_power (n+1) - tau * tbn + (s5/2); then
        - tb to_power (n+1) + tau to_power (n+1) <=
        tn*tau to_power 1-tau * tbn+(s5/2) by Th2; then
        - tb to_power (n+1) + tau to_power (n+1) <=
        tn * tau - tau * tbn + (s5/2); then
        (tau to_power (n+1)-tau_bar to_power (n+1))/sqrt 5 <=
        (tau*(tn - tbn) + (s5/2))/s5 by A2,XREAL_1:72; then
        Fib (n+1) <= (tau * (tn - tbn) + (s5/2)) / s5 by FIB_NUM:7; then
        Fib (n+1) <= (tau * (tn - tbn))/s5 + (s5/2)/s5 by XCMPLX_1:62; then
        Fib (n+1) <= tau * ((tn - tbn)/s5) + (s5/2)/s5 by XCMPLX_1:74; then
        Fib (n+1) <= tau * Fib n + (s5 / 2) / sqrt 5 by FIB_NUM:7; then
        Fib (n+1) <= tau * Fib n + (s5 / s5) / 2 by XCMPLX_1:48; then
        Fib (n+1) <= tau * Fib n + 1 / 2 by A2,XCMPLX_1:60;
        hence thesis by FIB_NUM:def 1;
      end;
      (Fib n + s5 * Fib n + 1) / 2 - 1 < Fib (n+1)
      proof
        Fib (n+1) = [\ tau * Fib n + 1 /] by A1,A3,Th22; then
A6:     tau * Fib n + 1 - 1 < Fib (n+1) by INT_1:def 6;
        (Fib n+s5*Fib n+1) <= (Fib n+s5 * Fib n + 2) by XREAL_1:6; then
        (Fib n+s5*Fib n+1)/2 <= (Fib n+s5*Fib n+2)/2 by XREAL_1:72;then
        (Fib n+s5 * Fib n + 1)/2-1 <= tau * Fib n + 1 - 1
        by FIB_NUM:def 1,XREAL_1:9;
        hence thesis by A6,XXREAL_0:2;
      end;
      hence thesis by A5,INT_1:def 6;
    end;
    suppose A7: n is odd;
A8:   (Fib n + sqrt 5 * Fib n + 1) / 2 >= Fib (n+1)
      proof
        Fib (n+1) = [/ tau * Fib n - 1 \] by A1,A7,Th23; then
A9:     tau * Fib n - 1 + 1 > Fib (n+1) by INT_1:def 7;
        1 + (Fib n+sqrt 5*Fib n) > 0 + (Fib n+sqrt 5*Fib n) by XREAL_1:6; then
        (Fib n+sqrt 5 * Fib n + 1)/2 > (Fib n+sqrt 5 * Fib n)/2 by XREAL_1:74;
        hence thesis by A9,FIB_NUM:def 1,XXREAL_0:2;
      end;
      (Fib n + (sqrt 5) * Fib n + 1) / 2 - 1 < Fib (n+1)
      proof
        n > 1 by A1,XXREAL_0:2; then
        (2 * sqrt 5) * tbn > (2 * sqrt 5) * (-1/2) by A2,Th14,XREAL_1:68; then
        - (2 * sqrt 5) * tbn < - (2 * sqrt 5) * (-1/2) by XREAL_1:24; then
        1*tn +sqrt 5*tn - 2*tau*tn + 2*tb*tbn - sqrt 5*tbn - 1*tbn + 2*tau*tn <
        sqrt 5 + 2 * tau * tn by FIB_NUM:def 1,def 2,XREAL_1:6; then
        tn + sqrt 5 * tn + 2 * tb * tbn - sqrt 5 * tbn - tbn - 2 * tb * tbn <
        sqrt 5 + 2 * tau * tn - 2 * tb * tbn by XREAL_1:9; then
        ((1+sqrt 5) * (tn-tbn)) /sqrt 5 < (sqrt 5 + 2*tau*tn - 2*tb*tbn)/sqrt 5
        by A2,XREAL_1:74; then
        (1 + sqrt 5) * ((tn - tbn) / sqrt 5) <
        (sqrt 5 + 2 * (tau * tn) - 2 * tb * tbn) / sqrt 5 by XCMPLX_1:74; then
        (1 + sqrt 5) * Fib n < (sqrt 5 + 2 * (tau*tn) - 2 * tb * tbn) / sqrt 5
        by FIB_NUM:7; then
        (1 + sqrt 5) * Fib n <
        (sqrt 5 + 2 * (tau to_power 1*tn) - 2*tb*tbn) /sqrt 5; then
        (1 + sqrt 5) * Fib n <
        (sqrt 5 + 2*tau to_power (n+1) - 2*(tb*tbn))/sqrt 5 by Th2; then
        (1+sqrt 5) * Fib n < (sqrt 5 + 2 * tau to_power (n+1) -
        2 * (tb to_power 1 * tbn)) / sqrt 5; then
        (1 + sqrt 5) * Fib n < (sqrt 5 + 2 * tau to_power (n+1) -
        2 * tb to_power (n+1)) / sqrt 5 by Th2; then
        (1 + sqrt 5) * Fib n <
        (sqrt 5 + 2 * (tau to_power (n+1) - tb to_power (n+1))) / sqrt 5; then
        (1+sqrt 5) * Fib n < sqrt 5 / sqrt 5 + (2 * (tau to_power (n+1) -
        tb to_power (n+1))) / sqrt 5 by XCMPLX_1:62; then
        (1 + sqrt 5) * Fib n < sqrt 5 / sqrt 5 + 2 * ((tau to_power (n+1) -
        tb to_power (n+1)) / sqrt 5) by XCMPLX_1:74; then
        (1+sqrt 5) * Fib n < sqrt 5 / sqrt 5 + 2 * Fib (n+1) by FIB_NUM:7; then
        (1 + sqrt 5) * Fib n < 1 + 2 * Fib (n+1) by A2,XCMPLX_1:60; then
        ((1 +sqrt 5) * Fib n) / 2 < (1 + 2 * Fib (n+1)) / 2 by XREAL_1:74; then
        ((1+sqrt 5) * Fib n) / 2 -1/2 < 1/2 + Fib (n+1) - 1/2 by XREAL_1:9;
        hence thesis;
      end;
      hence thesis by A8,INT_1:def 6;
    end;
  end;
