reserve n,n1,n2,k,D for Nat,
        r,r1,r2 for Real,
        x,y for Integer;
reserve p,p1,p2 for Pell's_solution of D;

theorem Th20:
  for D be non square Nat,
      p be positive Pell's_solution of D,
      a,b be Integer, n be Nat st
        n > 0 &
        a + b * sqrt D = (p`1 + p`2 *sqrt D) |^ n
    holds
     [a,b] is positive Pell's_solution of D
  proof
    let D be non square Nat;
    let p be positive Pell's_solution of D;
    let a,b be Integer, n be Nat such that A1: n > 0 and
    A2: a + b * sqrt D = (p`1 + p`2 *sqrt D) |^ n;
    A3: D = (sqrt D)^2 by SQUARE_1:def 2;
    then a^2 - b^2 * D = (a + b * sqrt D) * (a - b * sqrt D)
     .= (p`1 + p`2 *sqrt D) |^ n * (p`1 - p`2 *sqrt D) |^ n by A2,Th6
     .= ((p`1 + p`2 *sqrt D) * (p`1 - p`2 *sqrt D)) |^ n by NEWTON:7
     .= (p`1^2 - p`2^2 * D) |^ n by A3
     .= 1|^n by Def1
     .= 1;
    then reconsider ab=[a,b] as Pell's_solution of D by Lm4;
    p`1 + p`2 *sqrt D >1 by Th18;
    then ab`1 + ab`2 * sqrt D > 1|^n by A2, NEWTON02:40,A1;
    hence thesis by Th18;
  end;
