reserve x,y,P,Q for Integer;
reserve a,b,n for Nat;
reserve V,A for set;
reserve val for Function;
reserve loc for V-valued Function;
reserve d1 for NonatomicND of V,A;
reserve p for SCPartialNominativePredicate of V,A;
reserve d for object;
reserve z for Element of V;
reserve T for TypeSCNominativeData of V,A;
reserve size for non zero Nat;
reserve x0, y0, p0, q0 for Integer;
reserve n0 for Nat;

theorem Th5:
  Lucas(x,y,P,Q,0) = x & Lucas(x,y,P,Q,1) = y &
  for n holds Lucas(x,y,P,Q,n+2) = P*Lucas(x,y,P,Q,n+1)-Q*Lucas(x,y,P,Q,n)
  proof
    set L = Lucas_Sequence(x,y,P,Q);
    thus Lucas(x,y,P,Q,0) = [x,y]`1 by Def3
    .= x;
    thus Lucas(x,y,P,Q,1) = (L.(0+1))`1
    .= ([(L.0)`2, P*(L.0)`2-Q*(L.0)`1])`1 by Def3
    .= [x,y]`2 by Def3
    .= y;
    let n;
A1: (L.(n+1))`1 = [(L.n)`2, P*(L.n)`2-Q*(L.n)`1]`1 by Def3
    .= (L.n)`2;
    n+2 = n+1+1;
    hence Lucas(x,y,P,Q,n+2) = [(L.(n+1))`2, P*(L.(n+1))`2-Q*(L.(n+1))`1]`1
         by Def3
    .= [(L.n)`2, P*(L.n)`2-Q*(L.n)`1]`2 by Def3
    .= P*Lucas(x,y,P,Q,n+1)-Q*Lucas(x,y,P,Q,n) by A1;
  end;
