reserve a,b,n for Element of NAT;

theorem Th49:
  for a,b,n being Element of NAT holds GenFib(a,b,n+1) = a*Fib(n) + b*Fib(n+1)
proof
  let a,b,n be Element of NAT;
  defpred P[Nat] means GenFib(a,b,$1+1)=a*Fib($1)+b*Fib($1+1);
A1: Fib(2)=Fib(0+2) .=0+1 by FIB_NUM2:24,PRE_FF:1;
  GenFib(a,b,2)=GenFib(a,b,0+2) .=GenFib(a,b,0)+GenFib(a,b,0+1) by Th34
    .=a+GenFib(a,b,1) by Th32
    .=a+b by Th32;
  then
A2: P[1] by A1,PRE_FF:1;
A3: for k being Nat st P[k] & P[k+1] holds P[k+2]
  proof
    let k be Nat;
    assume that
A4: P[k] and
A5: P[k+1];
    GenFib(a,b,(k+2)+1)=GenFib(a,b,(k+1)+2)
      .=a*Fib(k)+b*Fib(k+1)+GenFib(a,b,(k+1)+1) by A4,Th34
      .=a*(Fib(k)+Fib(k+1))+b*(Fib(k+1)+Fib((k+1)+1)) by A5
      .=a*Fib(k+2)+b*(Fib(k+1)+Fib((k+1)+1)) by FIB_NUM2:24
      .=a*Fib(k+2)+b*Fib((k+1)+2) by FIB_NUM2:24
      .=a*Fib(k+2)+b*Fib((k+2)+1);
    hence thesis;
  end;
A6: P[0] by Th32,PRE_FF:1;
  for k being Nat holds P[k] from FIB_NUM:sch 1 (A6, A2, A3);
  hence thesis;
end;
