reserve i,i1,i2,i3,i4,i5,j,r,a,b,x,y for Integer,
  d,e,k,n for Nat,
  fp,fk for FinSequence of INT,
  f,f1,f2 for FinSequence of REAL,
  p for Prime;
reserve fr for FinSequence of REAL;
reserve fr,f for FinSequence of INT;
reserve b,m for Nat;
reserve b for Integer;

theorem
  p>2 & a gcd p =1 & a,b are_congruent_mod p implies Lege (a,p) = Lege (b,p)
proof
  assume that
A1: p>2 and
A2: a gcd p = 1 and
A3: a,b are_congruent_mod p;
  Lege (a,p),a|^((p-'1) div 2) are_congruent_mod p by A1,A2,Th28; then
A4: Lege (a,p) mod p = a|^((p-'1) div 2) mod p by NAT_D:64;
  b gcd p = 1 by A2,A3,WSIERP_1:43;
  then Lege (b,p),b|^((p-'1) div 2) are_congruent_mod p by A1,Th28;
  then
A5: Lege (b,p) mod p = b|^((p-'1) div 2) mod p by NAT_D:64;
  a mod p = b mod p by A3,NAT_D:64;
  then Lege (a,p) mod p = Lege (b,p) mod p by A4,A5,Th13;
  then Lege (a,p),Lege (b,p) are_congruent_mod p by NAT_D:64;
  then
A6: p divides (Lege (a,p) - Lege (b,p));
  per cases by Th25;
  suppose
A7: Lege (a,p) = 1;
A8: now assume Lege (b,p) = 0; then
      p = 1 by A6,A7,WSIERP_1:15;
      hence contradiction by A1;
    end;
    Lege (b,p) <> -1 by A7,A1,A6,NAT_D:7;
    hence thesis by A7,A8,Th25;
  end;
  suppose
A9: Lege (a,p) = 0;
A10: now assume Lege (b,p) = 1; then
      p = 1 by WSIERP_1:15,A6,A9,INT_2:10;
      hence contradiction by A1;
    end;
    now assume Lege (b,p) = -1; then
      p = 1 by A6,A9,WSIERP_1:15;
      hence contradiction by A1;
    end;
    hence thesis by A9,Th25,A10;
  end;
  suppose
A11: Lege (a,p) = -1;
A12: now
      assume Lege (b,p) = 1;
      then p divides -2 by A6,A11;
      then p divides 2 by INT_2:10;
      hence contradiction by A1,NAT_D:7;
    end;
    now assume Lege (b,p) = 0; then
      p = 1 by WSIERP_1:15,A6,A11,INT_2:10;
      hence contradiction by A1;
    end;
    hence thesis by A11,Th25,A12;
  end;
end;
