reserve n,n1,n2,k,D for Nat,
        r,r1,r2 for Real,
        x,y for Integer;

theorem Th6:
  for D be non square Nat
    for a,b,c,d be Integer, n be Nat st
      a + b * sqrt D = (c + d *sqrt D) |^ n
    holds
      a - b * sqrt D = (c - d *sqrt D) |^ n
  proof
    let D be non square Nat;
    set S=sqrt D;
    defpred P[Nat] means
    for a,b,c,d be Integer st
    a +b * S = (c+d *S) |^ $1 holds
    a - b * S = (c - d *S) |^ $1;
    A1: P[0]
    proof
      let a,b,c,d be Integer such that A2:
      a +b * S = (c+d *S) |^ 0;
      (c+d *S) |^ 0 = 1 +0*S = (c-d *S) |^ 0 by NEWTON:4;
      then a = 1 & b=0 by Th3,A2;
      hence thesis by NEWTON:4;
    end;
    A3: P[n] implies P[n+1]
    proof
      assume A4:P[n];
      let a,b,c,d be Integer such that
      A5: a +b * S = (c+d *S) |^ (n+1);
      set cPd= c+d * S,cMd= c-d *sqrt (D);
      consider a1,b1 be Integer such that
      A6: a1 +b1 * S = cPd |^ n by Th5;
      A7: D = S^2 by SQUARE_1:def 2;
      a +b * S = cPd * (a1 +b1 * S) by A5,A6,NEWTON:6
      .= c * a1 + d*b1 * D + S * (c*b1+d*a1) by A7;
      then a = c*a1 +d*b1*D & b = c*b1+d*a1 by Th3;
      hence a - b * S = cMd * (a1 -b1 * S) by A7
      .= cMd * cMd |^ n by A4,A6
      .= cMd |^(n+1) by NEWTON:6;
    end;
    P[n] from NAT_1:sch 2(A1,A3);
    hence thesis;
  end;
